akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<stdio.h>
using namespace std;
char t[1001];
int size,n,tmp,cnt,a,b,c,x,y,z,flg;
int endofinput(){
  if(t[12]!='\n')return 0;
  if(t[0]!='E')return 0;
  if(t[1]!='N')return 0;
  if(t[2]!='D')return 0;
  if(t[3]!=' ')return 0;
  if(t[4]!='O')return 0;
  if(t[5]!='F')return 0;
  if(t[6]!=' ')return 0;  if(t[9]!='P')return 0;
  if(t[7]!='I')return 0;  if(t[10]!='U')return 0;
  if(t[8]!='N')return 0;  if(t[11]!='T')return 0;
  return 1;
}
int main(){
  while(1){
    size=0;
    while(1){
      scanf("%c",&t[size]);
      size++;
      if(t[size-1]=='\n')break;
    }
    if(endofinput())break;
    cnt=0;
    flg=0;
    if(t[0]!=' ')cnt=1;
    for(int i=1;i<size-1;i++){
      if(t[i]==' '){
	cout<<cnt;
	cnt=0;
	flg=1;
      }else{
	cnt++;
	flg=0;
      }
    }
    cout<<cnt<<endl;
  }

  return 0;
}

Measured memory_bytes: 1152
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC optimize("no-stack-protector")
#pragma GCC optimize("fast-math")
#pragma GCC optimize("trapv")
#pragma GCC target("sse4")

#include <bits/stdc++.h>

using namespace std;

#define deb(x) cout << #x << " is " << x << "\n"
#define int long long
#define mod 1000000007
#define PI acos(-1)

void solve() {
    string s;
    cin >> s;
    if (s.back() == 's') {
        cout << s << "es";
    } else {
        cout << s << "s";
    }
}

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
// #ifndef ONLINE_JUDGE
//     freopen("input.txt", "r", stdin);
//     freopen("output.txt", "w", stdout);
// #endif
    int tc = 1;
    // cin >> tc;
    while (tc--) {
        solve();
    }
    return 0;
}


Measured memory_bytes: 3644
function Main(input) {
    var D = input.split("\n")[0] - 0;
    var str;
    switch (D) {
    case 25: 
        str = 'Christmas';
        break;
    case 24:
        str = 'Christmas Eve';
        break;
    case 23:
        str = 'Christmas Eve Eve';
        break;
    case 22:
        str = 'Christmas Eve Eve Eve';
    default:
    }

    console.log(str);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 7372
package main

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

func main() {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)

	var valsN, valsX []int64
	var n, x int64
	for {
		n = nextInt(sc)
		x = nextInt(sc)
		if n == 0 && x == 0 {
			break
		}
		valsN = append(valsN, n)
		valsX = append(valsX, x)
	}

	m := make([]map[int64]int64, 98)
	for a := int64(3); a <= 100; a++ {
		m[a-3] = make(map[int64]int64)
		if a-4 >= 0 {
			for i := int64(0); i <= 300; i++ {
				cnt, ok := m[a-4][i]
				if ok {
					m[a-3][i] = cnt
				} else {
					m[a-3][i] = 0
				}
			}
		}
		for b := int64(1); b <= a-2; b++ {
			for c := b + 1; c < a; c++ {
				d := a + b + c
				cnt, ok := m[a-3][d]
				if ok {
					m[a-3][d] = cnt + 1
				} else {
					m[a-3][d] = 1
				}
			}
		}
	}

	for i := range valsN {
		v, ok := m[valsN[i]-3][valsX[i]]
		if ok {
			fmt.Println(v)
		} else {
			fmt.Println(0)
		}
	}
}

func nextString(sc *bufio.Scanner) string {
	sc.Scan()
	return sc.Text()
}

func nextInt(sc *bufio.Scanner) int64 {
	i, err := strconv.ParseInt(nextString(sc), 10, 64)
	if err != nil {
		panic(err)
	}
	return i
}



Measured memory_bytes: 3312
#pragma region template
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
const long long MOD = 1e9+7, MAX = 1e18, larg = 1e5, INF = -1e9;
long long A,B,C,D,E,F,G,H,I,J,K,L,N,M,O,P,Q,R,S,T,U,V,W,x,y,z;
long long max_value = INF, max_index = -1;
long long min_value = MAX, min_index = -1;
typedef long long ll;
typedef pair<ll, ll> Pa;

template <std::int_fast64_t Modulus> class modint {
  using u64 = std::int_fast64_t;
public:
  u64 a;
  constexpr modint(const u64 x = 0) noexcept : a(x % Modulus) {}
  constexpr u64 &value() noexcept { return a; }
  constexpr const u64 &value() const noexcept { return a; }
  constexpr modint operator+(const modint rhs) const noexcept {
    return modint(*this) += rhs;
  }
  constexpr modint operator-(const modint rhs) const noexcept {
    return modint(*this) -= rhs;
  }
  constexpr modint operator*(const modint rhs) const noexcept {
    return modint(*this) *= rhs;
  }
  constexpr modint operator/(const modint rhs) const noexcept {
    return modint(*this) /= rhs;
  }
  constexpr modint &operator+=(const modint rhs) noexcept {
    a += rhs.a;
    if (a >= Modulus) {
      a -= Modulus;
    }
    return *this;
  }
  constexpr modint &operator-=(const modint rhs) noexcept {
    if (a < rhs.a) {
      a += Modulus;
    }
    a -= rhs.a;
    return *this;
  }
  constexpr modint &operator*=(const modint rhs) noexcept {
    a = a * rhs.a % Modulus;
    return *this;
  }
  constexpr modint &operator/=(modint rhs) noexcept {
    u64 exp = Modulus - 2;
    while (exp) {
      if (exp % 2) {
        *this *= rhs;
      }
      rhs *= rhs;
      exp /= 2;
    }
    return *this;
  }
};
typedef modint<MOD> m;
#pragma endregion

int main() {
  cin >> H >> W >> N;
  cout << (N-1)/max(H, W)+1;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define DEBUG(x) cerr << #x << ": " << (x) << endl;

int main() {
  int n;
  cin >> n;
  printf("%f\n", acos(-1) * n * 2); 
}

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

class Program
{
	static void Main(string[] args)
	{
        long[] input = Console.ReadLine().Split(' ').Select(e => long.Parse(e)).ToArray();
        long x = input[0];
        long y = input[1];

        Console.WriteLine((Math.Abs(x - y) > 1) ? "Alice" : "Brown");
	}
}

Measured memory_bytes: 13396
#include <iostream>
#include <algorithm>
using namespace std;
bool descending(int a, int b){
    if(a > b){
        return true;
    }
    else {
        return false;
    }
}
int main(){
    int n, h, a[100005], b[100005], maxa=0, c=0, x=0;;
    cin >> n >> h;
    for(int i=0; i<n; i++){
        cin >> a[i] >> b[i];
        if(maxa<a[i]){
            maxa=a[i];
        }
    }
    sort(b, b+n, descending);
    while(h>0){
        if(b[c]>=maxa && c<n){
            h-=b[c];
            c++;
            x++;
        }
        else{
            h-=maxa;
            x++;
        }
    }
    cout << x << endl;
    return 0;
}

Measured memory_bytes: 4376
import java.util.ArrayList;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;

public class Main {

	public static final int BIG_NUM = 2000000000;
	public static final int MOD = 1000000007;
	public static final long HUGE_NUM = 99999999999999999L;
	public static final double EPS = 0.000000001;

	@SuppressWarnings("unchecked")
	public static void main(String[] args) {

		//BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		Scanner scanner = new Scanner(System.in);

		int V = scanner.nextInt();
		int E = scanner.nextInt();

		int POW[] = new int[V+1];
		POW[0] = 1;
		for(int i = 1; i <= V; i++){

			POW[i] = POW[i-1]*2;
		}

		ArrayList<Edge> G[] = new ArrayList[V];
		for(int i = 0; i < V; i++){

			G[i] = new ArrayList<Edge>();
		}

		for(int loop = 0; loop < E; loop++){

			int from = scanner.nextInt();
			int to = scanner.nextInt();
			int weight = scanner.nextInt();

			G[from].add(new Edge(to,weight));
		}

		int dp[][] = new int[POW[V]][V];

		for(int state = 0; state < POW[V]; state++){
			for(int last_node = 0; last_node < V; last_node++){
				dp[state][last_node] = BIG_NUM;
			}
		}

		//頂点0スタート0戻り
		int base = 0;

		dp[POW[0]][0] = 0;

		for(int state = 1; state < POW[V]-1; state++){
			for(int last_node = 0; last_node < V; last_node++){
				if(dp[state][last_node] == BIG_NUM)continue;

				for(int i = 0; i < G[last_node].size(); i++){

					int next_node = G[last_node].get(i).to;
					if((state & POW[next_node]) != 0)continue;

					int next_state = state+POW[next_node];

					dp[next_state][next_node] = Math.min(dp[next_state][next_node], dp[state][last_node]+G[last_node].get(i).weight);
				}
			}
		}

		int ans = BIG_NUM;
		for(int last_node = 1; last_node < V; last_node++){
			for(int i = 0; i < G[last_node].size(); i++){
				if(G[last_node].get(i).to != base)continue;

				ans = Math.min(ans,dp[POW[V]-1][last_node]+G[last_node].get(i).weight);
			}
		}

		if(ans == BIG_NUM){

			System.out.println("-1");

		}else{

			System.out.println(ans);
		}
	}
}

class Edge{
	Edge(int arg_to,int arg_weight){
		to = arg_to;
		weight = arg_weight;
	}
	int to,weight;
}

class UTIL{

	//最大公約数
	public static long gcd(long x,long y){

		x = Math.abs(x);
		y = Math.abs(y);

		if(x < y){

			long tmp = y;
			y = x;
			x = tmp;
		}

		if(y == 0){

			return x;
		}else{

			return gcd(y,x%y);
		}
	}

	//最小公倍数
	public static long lcm(long x,long y){

		return (x*y)/gcd(x,y);
	}

	//String→intへ変換
    public static int getNUM(String tmp_str){

        return Integer.parseInt(tmp_str);
    }

    //文字が半角数字か判定する関数
    public static boolean isNumber(String tmp_str){

        if(tmp_str == null || tmp_str.length() == 0){

            return false;
        }

        Pattern pattern = Pattern.compile("\\A[0-9]+\\z");
        Matcher matcher = pattern.matcher(tmp_str);
        return matcher.matches();
    }
}


Measured memory_bytes: 33116
#include<stdio.h>

int main(int argc, char *argv[]){

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

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

  int out = -1;
  int index = a[0];

  int loop_chk[n];
  for(int i=0; i<(sizeof(loop_chk)/sizeof(loop_chk[0])); i++){
    loop_chk[i] = 0;
  }

  for(int i=1; i<n; i++){
    //printf("i=%d, index=%d\n", i, index);
    if(index == 2){
      out = i;
      break;
    }
    if(loop_chk[index] == 1){
      break;
    }else{
      loop_chk[index] = 1;
    }
    index = a[index - 1];
  }

  printf("%d\n", out);

  return 0;
}


Measured memory_bytes: 896
#include<iostream>
#include<vector>
#include<algorithm>
#include<cctype>
#include<utility>
#include<string>
#include<cmath>
#include<map>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;
typedef long long int ll;

int main(){

    int H,W;
    cin >> H >> W;
    int map[H][W];

    REP(i,H){
        REP(j,W){
            cin >> map[i][j]; 
            /*if(map[i][j] == 0){
                count--;
            }*/
        }
        
        
    }
    vector<int> y1,x1,y2,x2;
    

    REP(i,H){
        REP(j,W-1){
            if(map[i][j] % 2 == 1){
                map[i][j]--;
                map[i][j+1]++;
                y1.push_back(i);
                x1.push_back(j);
                y2.push_back(i);
                x2.push_back(j+1);

            }   
        }
    }
    

    REP(i,H-1){
        if(map[i][W-1] % 2 == 0 || map[i][W-1] == 0){

        }else{
            map[i][W-1]--;
            map[i+1][W-1]++;
            y1.push_back(i);
            x1.push_back(W-1);
            y2.push_back(i+1);
            x2.push_back(W-1);
        }
    }

    cout << y1.size() << endl;
    REP(i,y1.size()){
        cout << y1[i]+1 << " " << x1[i]+1 << " " << y2[i]+1 << " " << x2[i]+1 << endl;
    }

  


   
    return 0;
}

Measured memory_bytes: 5220
#include <iostream>
#include <vector>

using namespace std;

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

  std::vector<vector<int> > nominated_nums;
  int a = x % 100;
  for(int i=0; i*1<=100; i++){
    for(int j=0; j*2<=100; j++){
      for(int k=0; k*3<=100; k++){
        for(int l=0; l*4<=100; l++){
          for(int n=0; n*5<=100; n++){
            if( a == i*1 + j*2 + k*3 + l*4 + n*5 ){
              vector<int> nums;
              nums.push_back(i);
              nums.push_back(j);
              nums.push_back(k);
              nums.push_back(l);
              nums.push_back(n);
              nominated_nums.push_back(nums);
            }
          }
        }
      }
    }
  }

  for(int i=0; i<nominated_nums.size(); i++){
    int money = 0;
    money += nominated_nums[i][0] * 101;
    money += nominated_nums[i][1] * 102;
    money += nominated_nums[i][2] * 103;
    money += nominated_nums[i][3] * 104;
    money += nominated_nums[i][4] * 105;
    if( x >= money ){
      std::cout << "1" << '\n';
      return 0;
    }
  }
  std::cout << "0" << '\n';


  return 0;
}


Measured memory_bytes: 2872
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
using bint = boost::multiprecision::cpp_int;
using ll = long long;
using pint = pair<int, int>;
using pll = pair<ll, ll>;
#define rep(i,n) for (int i = 0; i < (n); i++)
#define repSE(i,s,n) for (int i = (s); i < (n); i++)
#define rrepSE(i,s,e) for (int i = (s); i > (e); i--)
#define ssort(v) sort(v.begin(), v.end())
#define gsort(v) sort(v.rbegin(), v.rend())
template<typename T> istream &operator>>(istream &is, vector<T> &vec){ for (auto &v : vec) is >> v; return is; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &vec){ os << "["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const deque<T> &vec){ os << "deq["; for (auto v : vec) os << v << ","; os << "]"; return os; }
template<typename T> ostream &operator<<(ostream &os, const set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const unordered_set<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const multiset<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T> ostream &operator<<(ostream &os, const unordered_multiset<T> &vec){ os << "{"; for (auto v : vec) os << v << ","; os << "}"; return os; }
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &pa){ os << "(" << pa.first << "," << pa.second << ")"; return os; }
template<typename TK, typename TV> ostream &operator<<(ostream &os, const map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << "=>" << v.second << ","; os << "}"; return os; }
template<typename TK, typename TV> ostream &operator<<(ostream &os, const unordered_map<TK, TV> &mp){ os << "{"; for (auto v : mp) os << v.first << "=>" << v.second << ","; os << "}"; return os; }
template<typename T> bool chmax(T &m, const T q) { if (m < q) {m = q; return true;} else return false; }
template<typename T> bool chmin(T &m, const T q) { if (q < m) {m = q; return true;} else return false; }
#define DEBUG_PRINT(var) std::cout << #var << " = " << var << "\n";

int main()
{
    ll n, a, b;
    cin >> n >> a >> b;
    vector<ll> x(n);
    rep(i,n) cin >> x[i];
    ll ans = 0; ll prev = x[0];
    repSE(i,1,n) {
        ans += min((x[i] - prev) * a, b);
        prev = x[i];
    }
    cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 1024
import java.util.Scanner;

public class Main {
    public static void main(String args[]) {
        try (Scanner in = new Scanner(System.in)) {
            int N = in.nextInt();
            int M = in.nextInt();

            int max = 0;
            int l = M / N;
            for (int n = l; n >= 1; n--) {
                if ((M - N * n) % n == 0) {
                    max = n;
                    break;
                }
            }

            System.out.println(max);
        }
    }
}


Measured memory_bytes: 24148
#include<bits/stdc++.h>
using namespace std;
int main()
{
  string s;
  cin>>s;
  int l=s.length();
 // cout<<l<<endl;
  int c=0;
  for(int i=0;i<l;i++)
  {
      if(s[i]=='o')
      {
          c++;
      }
  }
  int r=15-l;
  //cout<<c;
  if(r+c>=8)
  {
      cout<<"YES";
  }
  else
  cout<<"NO";
}

Measured memory_bytes: 256
/* ---------- STL Libraries ---------- */

// IO library
#include <cstdio>
#include <fstream>
#include <iomanip>
#include <ios>
#include <iostream>

// algorithm library
#include <algorithm>
#include <cmath>
#include <numeric>
#include <random>

// container library
#include <array>
#include <bitset>
#include <deque>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <tuple>
#include <vector>

/* ---------- Namespace ---------- */

using namespace std;

/* ---------- Type Abbreviation ---------- */

template <typename T>
using V = vector<T>;
template <typename T, typename U>
using P = pair<T, U>;
template <typename T>
using PQ = priority_queue<T>;
template <typename T>
using GPQ = priority_queue<T, vector<T>, greater<T>>;

using ll = long long;

#define fst first
#define snd second

/* ---------- conversion ---------- */

#define INT(c) static_cast<int>(c)
#define CHAR(n) static_cast<char>(n)
#define LL(n) static_cast<ll>(n)
#define DOUBLE(n) static_cast<double>(n)

/* ---------- container ---------- */

#define ALL(v) (v).begin(), (v).end()
#define SIZE(v) (LL((v).size()))

#define FIND(v, k) (v).find(k) != (v).end()
#define VFIND(v, k) find(ALL(v), k) != (v).end()

#define gsort(b, e) sort(b, e, greater<decltype(*b)>())
#define SORT(v) sort((v).begin(), (v).end())
#define GSORT(v) sort((v).begin(), (v).end(), greater<decltype((v).front())>())

/* ----------- debug ---------- */

template <class T>
ostream& operator<<(ostream& os, vector<T> v) {
    os << "[";
    for (auto vv : v)
        os << vv << ",";
    return os << "]";
}

template <class T>
ostream& operator<<(ostream& os, set<T> v) {
    os << "[";
    for (auto vv : v)
        os << vv << ",";
    return os << "]";
}

template <class L, class R>
ostream& operator<<(ostream& os, pair<L, R> p) {
    return os << "(" << p.fst << "," << p.snd << ")";
}

/* ---------- Constants ---------- */

// const ll MOD = 1e9 + 7;
// const int INF = 1 << 25;
// const ll INF = 1LL << 50;
// const double PI = acos(-1);
// const double EPS = 1e-10;
// const ll dx[4] = {0, -1, 1, 0};
// const ll dy[4] = {-1, 0, 0, 1};
// mt19937 mt(LL(time(0)));

/* ---------- Short Functions ---------- */

template <typename T>
T sq(T a) {
    return a * a;
}

template <typename T>
T gcd(T a, T b) {
    if (a > b) return gcd(b, a);
    return a == 0 ? b : gcd(b % a, a);
}

template <typename T, typename U>
T mypow(T b, U n) {
    if (n == 0) return 1;
    if (n == 1) return b /* % MOD */;
    if (n % 2 == 0) {
        return mypow(b * b /* % MOD */, n / 2);
    } else {
        return mypow(b, n - 1) * b /* % MOD */;
    }
}

ll pcnt(ll b) {
    return __builtin_popcountll(b);
}

/* v-v-v-v-v-v-v-v-v Main Part v-v-v-v-v-v-v-v-v */

int main() {
    int N;
    cin >> N;
    for (int i = N; i < 1000; ++i) {
        if (i / 100 == (i / 10) % 10 && i / 100 == i % 10) {
            cout << i << endl;
            break;
        }
    }
    return 0;
}


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

int main(void)
{
	int q, com, x;
	multiset<int> S;
    cin >> q;
    rep(i, q)
    {
        cin >> com >> x;
        if (com == 0)
        {
            S.insert(x);
            cout << S.size() << endl;
        }
        else if (com == 1)
        {
            cout << S.count(x) << endl;
        }
        else if (com == 2)
        {
            S.erase(x);
        }
        else
        {
            int y;
            cin >> y;
            set<int>::iterator st, en, itr;
            st = S.lower_bound(x);
            en = S.upper_bound(y);
            for(itr = st; itr != en; ++itr) {
                cout << *itr << endl;
            }
        }
    }
}


Measured memory_bytes: 12352
#include <iostream>
#include <map>
#include <vector>
#include <cmath>
#include <string>
#include <cstring>
#include <algorithm>
#include <climits>
#include <stack>
#include <queue>
#include <set>
#include <cctype>
#include <bitset>
#include <type_traits>

#include <list>
using namespace std;

#define REP(i, n) for (int i = 0; i < (n); ++i)
#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define YES(j) cout << (j ? "YES" : "NO") << endl;
#define Yes(j) std::cout << (j ? "Yes" : "No") << endl;
#define yes(j) std::cout << (j ? "yes" : "no") << endl;
void printarray(int *a, int n)
{
    REP(i, n)
    {
        if (i > 0)
            cout << " ";
        cout << a[i];
    }
    cout << endl;
}

void insertionSort(int *a, int n)
{
    printarray(a, n);
    rep(i, 1, n)
    {
        int v = a[i];
        int j = i - 1;
        while (j >= 0 && a[j] > v)
        {
            a[j + 1] = a[j];
            j--;
        }
        a[j + 1] = v;
        printarray(a, n);
    }
}
int main(void)
{
    int n;
    cin >> n;
    int a[101];
    REP(i, n)
    {
        cin >> a[i];
    }
    insertionSort(a, n);
}


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

int main() {
  int n; cin >> n;
  vector<int> h(n);
  for(int i=0; i<n; i++) cin >> h[i];
 
  int x = h[0];
  int ans=1;
  for(int i=1;i<n;++i) {
    if (max(x,h[i]) == h[i]) {
      ans++;
      x = h[i];
    }
  }
  
  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 256
abc = input().split()
d = abc[0]
e = abc[1]
f = abc[2]
g = d + e + f
g = int(g)
a = 575
b = 557
c = 755

if g == a:
    print("YES")
elif g == b:
    print("YES")
elif g == c:
    print("YES")
else:
    print("NO")


Measured memory_bytes: 3060
N=int(input())
S=[input() for i in range(N)]

D={}
for i in range(N):
    try:
        if D[S[i]]>=1:
            D[S[i]]+=1
    except:
        D[S[i]]=1
E=sorted(D.items(),key=lambda x:x[1])
m=E[-1][1]
ans=[]
for i in E:
    if i[1]==m:
        ans.append(i[0])
for i in sorted(ans):
    print(i)


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

using namespace std;

typedef long long ll;

char g[55][55];
int r, c;
int dp[55][55];

bool update() {
	bool change = false;
	for(int i = 0; i < r; i++) {
		for(int j = 0; j < c; j++) {
			if(g[i][j] == '#') continue;
			if(i > 0 && dp[i-1][j] + 1 < dp[i][j]) {
				change = true;
				dp[i][j] = 1 + dp[i-1][j];
			}
			if(i < r-1 && dp[i+1][j] + 1 < dp[i][j]) {
				change = true;
				dp[i][j] = 1 + dp[i+1][j];
			}
			if(j > 0 && dp[i][j-1] + 1 < dp[i][j]) {
				change = true;
				dp[i][j] = 1 + dp[i][j-1];
			}
			if(j < c-1 && dp[i][j+1] + 1 < dp[i][j]) {
				change = true;
				dp[i][j] = 1 + dp[i][j+1];
			}
		}
	}
	return change;
}

int main() {
	scanf("%d%d\n", &r, &c);
	for(int i = 0; i < r; i++) {
		scanf("%s", g[i]);
		for(int j = 0; j < c; j++) {
			dp[i][j] = 1 << 25;
		}
	}
	dp[0][0] = 0;
	while(update());
	if(dp[r-1][c-1] == 1 << 25) {
		printf("-1\n");
		return 0;
	}
	int ret = -dp[r-1][c-1]-1;
	for(int i = 0; i < r; i++) for(int j = 0; j < c; j++) if(g[i][j] == '.') ret++;
	printf("%d\n", ret);
}

Measured memory_bytes: 384
//https://atcoder.jp/contests/abc129/tasks/abc129_a
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
#define ALL(n) begin(n),end(n)
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
const long long INF = numeric_limits<long long>::max();
int main()
{
    vector<int> v(3);
    for(auto &x : v){
        cin >> x;
    }
    sort( ALL(v) );
    cout << v[0] + v [1] << endl;
    return 0;
}

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

int main(){
   long long a,b,k;
   cin >> a >> b>> k;
   long long remain = a-k;
   if(remain >= 0){
      cout << remain << " " << b;
      return 0;
   }else{
      long long  remain_b = b - abs(remain);
      a=0;
      if(remain_b >= 0){
         cout << a << " " << remain_b << endl;
         return 0;
      }else{
         b=0;
      }
   }

   cout << a << " " << b <<endl;
   return 0;
}

Measured memory_bytes: 256
#AGC018A

from fractions import gcd
n,k=map(int,raw_input().split())
a=map(int,raw_input().split())
g=a[0]
for i in xrange(n):
 g=gcd(g,a[i])
if k<=max(a) and k%g==0:
 print 'POSSIBLE'
else:
 print 'IMPOSSIBLE'


Measured memory_bytes: 12604
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
#define rep(i,m,n) for(int i=(int)(m);i<(int)(n);++i)
#define rREP(i,m,n) for(int (i)=(n)-1; (i)>=(m);--(i))
#define all(x) (x).begin(),(x).end()
#define out(y,x,h,w) (y)<0||(x)<0||(y)>=(h)||(x)>=(w)
constexpr int INF = 1000000001;
constexpr ll mod = 1000000007;
constexpr double PI = 3.1415926535897932;

template<class T>inline bool chmin(T& a, T b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
}
template<class T>inline bool chmax(T& a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}
inline void init() {
	cin.tie(nullptr); cout.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

vector<ll>num;
void dfs(ll x, int digit = 1) {
	num.push_back(x);
	if (digit>=10)return;
	int u = x % 10;
	x *= 10;
	dfs(x + u, digit + 1);
	if (u == 0) {
		dfs(x + 1, digit + 1);
	}
	else if (u == 9) {
		dfs(x + 8, digit + 1);
	}
	else {
		dfs(x + u + 1, digit + 1);
		dfs(x + u - 1, digit + 1);
	}
	return;
}

int main() {
	init();

	int K; cin >> K;
	rep(i, 1, 10) {
		dfs(i);
	}
	sort(all(num));
	cout << num[K - 1] << "\n";

	return 0;
}

Measured memory_bytes: 2420
function Main(input){
  const abcde = input.split("\n").map(n=>parseInt(n));
  const len = abcde.length;
 
  var total_time = 0;
 
  var last_cal_num = 10;
  var last_cal_num_index = 0;
 
  // 最後に注文するものを割り出す
  for(var i = 0; i < 5; i++){
    var j = abcde[i] % 10
    if(0 < j && j < last_cal_num){
      last_cal_num = j;
      last_cal_num_index = i;
    }
  }
   
  // 最後に注文するもの以外の時間を足す
  for(var i = 0; i < 5; i++){
    if(i !== last_cal_num_index){
      var j = abcde[i];
      var k = j % 10;
      j = k ? j + (10-k) : j; // k=0の時はそのままの値を入れる
      total_time += j;
    }
  }
   
  // 最後の注文の時間を足す
  total_time += abcde[last_cal_num_index];
  console.log(String(total_time).trim());
   
}
 
Main(require("fs").readFileSync("/dev/stdin","utf-8"));

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

using namespace std;

int main() {
	int n;
	cin >> n;
	int arr[n];
	for (int i=0; i<n; i++)
		cin >> arr[i];
	sort(arr, arr+n);
	cout << arr[n-1] - arr[0] <<  endl;
}

Measured memory_bytes: 384
n = int(input())
if n % 2 == 0:
    print("{0} {1} {2}".format(n,n,int(n/2)))
else:
    key = 0
    for i in range(n//4+1,3501):
        if key == 1:
            break
        for j in range(n//4+1,3501):
            if (i+j)*n < 4*i*j:
                if (n*i*j)/(4*i*j-n*i-n*j) == int((n*i*j)/(4*i*j-n*i-n*j)):
                    key = 1
                    print("{0} {1} {2}".format(i,j,int((n*i*j)/(4*i*j-n*i-n*j))))
                    break
            elif (i+j)*n == 4*i*j:
                key = 1
                print("{0} {1} {2}".format(i,2*j,2*j))
                break

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

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	cout<<setprecision(32);

	int n; ll m;
	cin>>n>>m;
	set<int> st;
	ll lcm = 1;
	for(int i = 0; i < n; i++){
		ll x; cin>>x;
		int cnt = 0;
		while(x%2 == 0){
			x >>= 1;
			cnt++;
		}
		cnt--;
		st.insert(1<<cnt);
		lcm = lcm*(x/__gcd(x, lcm));
		if(lcm > m){
			cout<<0<<endl;
			exit(0);
		}
	}
	if(st.size() != 1){
		cout<<0<<endl;
		exit(0);
	}
	m /= (*st.begin());
	ll mul = m/lcm;
	cout<<(mul + 1)/2<<endl;

	return 0;
}

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

int main(void){
    ll N,W;
    cin>>N>>W;
    vector<pair<ll,ll>> P;
    for (int i=0;i<N;i++) {
        ll w,v;
        cin>>w>>v;
        P.push_back(make_pair(w,v));
    }
    sort(P.begin(),P.end());
    ll wmin = P[0].first;
    vector<vector<ll>> X(4);
    for (auto p:P) {
        X[p.first-wmin].push_back(p.second);
    }

    vector<vector<ll>> sum(4,vector<ll>(101,0)); //先頭からn個までの和

    for (int i=0;i<4;i++){
        sort(X[i].begin(),X[i].end(),greater<ll>());
        for (int j=1;j<=X[i].size();j++) {
            sum[i][j] += sum[i][j-1] + X[i][j-1];
        }
    }

    ll ans = -1;

    for (int i=0;i<=X[0].size();i++) {
        for (int j=0;j<=X[1].size();j++) {
            for (int k=0;k<=X[2].size();k++) {
                for (int l=0;l<=X[3].size();l++) {
                    ll vsum;
                    ll weight = wmin*i + (wmin+1)*j + (wmin+2)*k + (wmin+3)*l;
                    if (weight <= W) {
                        vsum = sum[0][i] + sum[1][j] + sum[2][k] + sum[3][l];
                        ans = max(vsum,ans); 
                    }
                }
            }
        }
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
def min(a,b) a<b ? a:b end
MOD=2019
L,R=gets.split.map(&:to_i)

if R-L>=2019
  puts 0
else
  ans = 2018
  (L..R-1).each do |i|
    (i+1..R).each do |j|
      ans = min(ans, ((i%MOD)*(j%MOD)) % MOD)
      if ans == 0
        puts ans
        exit
      end
    end
  end
  puts ans
end


Measured memory_bytes: 1788
#include<bits/stdc++.h>
using namespace std;
#define rep(i,j,n) for(int i=(int)(j);i<(int)(n);i++)
#define REP(i,j,n) for(int i=(int)(j);i<=(int)(n);i++)
#define MOD 1000000007
#define int long long
#define ALL(a) (a).begin(),(a).end()
#define vi vector<int>
#define vii vector<vi>
#define pii pair<int,int>
#define priq priority_queue<int>
#define disup(A,key) distance(A.begin(),upper_bound(ALL(A),(int)(key)))
#define dislow(A,key) distance(A.begin(),lower_bound(ALL(A),(int)(key)))
signed main(){
  int N;
  cin>>N;
  vi A(N);
  rep(i,0,N)
    cin>>A[i];
  sort(ALL(A));
  cout<<A[N-1]-A[0];
  }


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fst first
#define snd second
#define fore(i,a,b) for(int i=a,ThxDem=b;i<ThxDem;++i)
#define pb push_back
#define ALL(s) s.begin(),s.end()
#define FIN ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define SZ(s) int(s.size())
using namespace std;
typedef long long ll;
typedef pair<int,int> ii;

int main(){FIN;
	int x,y; cin>>x>>y;
	if(x>y)cout<<"safe\n";
	else cout<<"unsafe\n";
}

Measured memory_bytes: 3612
#include<stdio.h>
#include<stdlib.h>
int main()
{
	int n,m,i,t,r;
	int x[100000]={0};
	scanf("%d%d",&n,&m);
	for(i=1;i<n;++i)scanf("%d",&t),x[i]=t+x[i-1];
	for(i=r=0;m--;)
	{
		scanf("%d",&t);
		r=(r+abs(x[i]-x[i+t]))%100000;
		i+=t;
	}
	printf("%d\n",r);
	return 0;
}

Measured memory_bytes: 1112
using System;
using System.Linq;
class Program
{
    static void Main(string[] args)
    {
        // スペース区切りの整数の入力
        string[] input = Console.ReadLine().Split(' ');
        int a = int.Parse(input[0]);
        int b = int.Parse(input[1]);
        int c = int.Parse(input[2]);
        var output = from p in input orderby p select p;
        //出力
        Console.WriteLine(string.Join(" ",output));

    }
}


Measured memory_bytes: 21200
#include <stdio.h>

#define MAX 10000
#define NIL -1

struct Node {int p, l, r;};
struct Node T[MAX];
int n;

void preParse(int u) {
  if(u == NIL) return;
  printf(" %d",u);
  preParse(T[u].l);
  preParse(T[u].r);
}

void inParse(int u) {
  if(u == NIL) return;
  inParse(T[u].l);
  printf(" %d",u);
  inParse(T[u].r);
}
void postParse(int u) {
  if(u == NIL) return;
  postParse(T[u].l);
  postParse(T[u].r);
  printf(" %d",u);
}

int main(void) {
  int i, v, l, r, root;
  scanf("%d",&n);
  for(i=0; i<n; i++) {
    T[i].p = NIL;
  }
  
  for(i=0; i<n; i++) {
    scanf("%d %d %d",&v,&l,&r);
    T[v].l = l;
    T[v].r = r;
    if(l != NIL) T[l].p = v;
    if(r != NIL) T[r].p = v;
  }
  
  for(i=0;i<n;i++) if(T[i].p == NIL) root = i;
  
  printf("Preorder\n");
  preParse(root);
  printf("\n");

  printf("Inorder\n");
  inParse(root);
  printf("\n");

  printf("Postorder\n");
  postParse(root);
  printf("\n");

  return 0;
}



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

using ll = long long; 

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

  int N;
  if (a < b) {
    //N = stoi(b);
    N = b;
    for (int i=0; i<N; i++){
      cout << a;
      if (i==N-1){
        cout << endl;
      }
    }
  }
  else {
    //N = stoi(a);     
     N = a;
     for (int i=0; i<N; i++){
      cout << b;
      if (i==N-1){
        cout << endl;
      }
    }
  }

  return 0;
}

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

typedef pair<int,int> P;

int n,m;
int a[11000],b[11000],w[11000];
bool use[110];
vector<P> g[110];

int dfs(int x,int low,int up){
  if(use[x])return 0;
  use[x] = true;

  int res = 0;
  for(int i=0;i<g[x].size();i++){
    if(g[x][i].first>=low && g[x][i].first<=up)
      res += dfs(g[x][i].second,low,up);
  }
  return res+1;
}

int main(){
  while(cin >> n >>m,n||m){
    for(int i=0;i<n;i++)g[i].clear();
    for(int i=0;i<m;i++){
      cin >> a[i] >> b[i] >> w[i];
      a[i]--; b[i]--;
      g[a[i]].push_back(P(w[i],b[i]));
      g[b[i]].push_back(P(w[i],a[i]));
    }

    int l=-1,r = 10001;
    for(int i=0;i<m;i++){
      while(r-l>1){
	int mid = (l+r)/2;
	for(int j=0;j<n;j++)use[j] = false;
	int tmp = dfs(a[i],w[i]-mid,w[i]);
	if(tmp == n)r = mid;
	else l = mid;
      }
      l = -1;
    }
    if(r == 10001)cout << -1 << endl;
    else cout << r << endl;
  }
}
      

Measured memory_bytes: 1376
#include <cstdio>
#include <cmath>
#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <algorithm>
#include <queue>
using namespace std;
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define REP(i,n) for(ll i=0;i<n;i++)
#define REPR(i,n) for(ll i=n-1;i>=0;i--)

typedef long long ll;
#define INF 1e18
#define MOD ((ll)1e9+7)

int main(){
	ll n; cin>>n;
	ll k; cin>>k;
	ll ans=0;
	FOR(i,k,n+2){
		ans+=(i*(n-i+1)+1)%MOD;
		ans%=MOD;
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
int a[11][1001],ans,h,w,k;
bool ok[11];
int culc(int hc){
	int cur=0,ind=1,d=hc;
	while(d>0){
		if(d&1) ok[ind]=true;
		ind++;
		d=d>>1;
	}
	ind=0;
	for(int i=1;i<=h-1;i++) if(ok[i]) ind++;
	ok[h]=true;
	ok[0]=true;
	while(cur<w){
		bool st=true;
		for(int inc=1;inc+cur<=w;inc++){		
			for(int i=0;i<h&&st;i++){
				if(ok[i]){
					for(int j=i+1;j<=h&&st;j++){
						if(ok[j]){
							if(a[j][cur+inc]+a[i][cur]-a[i][cur+inc]-a[j][cur]>k) st=false;							
							break;
						}
					}		
				}	
			}
			if(st&&inc+cur==w) return ind;
			if(!st){
				if(inc==1) return h*w;
				ind++;
				cur=cur+inc-1;
				st=true;
				break;
			}	
		}
	}
	return ind;
}		
int main(){	
	cin>>h>>w>>k;
	ans=h*w;
	for(int i=0;i<h;i++){
		string s;
		cin>>s;
		for(int j=0;j<w;j++){
			if(s[j]=='1') a[i+1][j+1]=1;
			else a[i+1][j+1]=0;
		}
	}
	for(int i=0;i<=h;i++) a[i][0]=0;
	for(int j=0;j<=w;j++) a[0][j]=0;
	for(int i=1;i<=h;i++) for(int j=1;j<=w;j++) a[i][j]=a[i][j]+a[i][j-1];
	for(int i=2;i<=h;i++) for(int j=1;j<=w;j++) a[i][j]=a[i][j]+a[i-1][j];
	for(int i=0;i<(1<<(h-1));i++){
		for(int j=0;j<=h;j++) ok[j]=false;
		ans=min(ans,culc(i));
	}
	cout<<ans<<endl;
  	return 0;
}


Measured memory_bytes: 256
N, M = map(int, input().split())
net = [[] for _ in range(N)]
for _ in range(M):
    a, b = map(int, input().split())
    net[a-1].append(b-1)
    net[b-1].append(a-1)

for i in range(N):
    print(len(net[i]))


Measured memory_bytes: 2940
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define each(a,x) for(auto a : (x))
#define all(a) (a).begin(),(a).end()
#define chmin(a,b) ((a) = min((a),(b)))
#define chmax(a,b) ((a) = max((a),(b)))
#define in_range(x,l,r) ((l)<=(x) && (x)<(r))
#define printvec(a) rep(i,a) cout << a[i] << " \n"[i+1==(a).size()];
#define fs first
#define sc second
#define em emplace
#define eb emplace_back
#define sz size()
#define MP make_pair
using namespace std;
typedef long long ll;
typedef double D;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<string> vs;

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

int main(){
  int H, W, h, w;
  cin >> H >> W >> h >> w;

  if (H%h==0 and W%w==0) {
    cout << "No" << endl;
    return 0;
  }

  cout << "Yes" << endl;
  int area = h*w;
  int p = INF/(area-1);
  int m = p*(area-1) + 1; m *= -1;
  rep(i,H){
    rep(j,W) {
    if (i%h == h-1 and j%w == w-1) {
      cout << m;
    } else {
      cout << p;
    }
    if (j==W-1) cout << endl;
    else cout << " ";
    }
  }
}


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

#define coutv(v) for (int i = 0; i < (v).size(); ++i) cout << v[i] << ' '; cout << endl;
#define coutvv(v) for (int i = 0; i < (v).size(); ++i) {for (int j = 0; j < (v[i]).size(); ++j) cout << v[i][j] << ' '; cout << endl;}
#define debugv(v) {for (int i = 0; i < (v).size(); ++i) cerr << v[i] << ' '; cerr << endl;}
#define debugvv(v) {for (int i = 0; i < (v).size(); ++i) {for (int j = 0; j < (v[i]).size(); ++j) cerr << v[i][j] << ' '; cerr << endl;}}
#define stringtovector(s, v) {for (int i = 0; i < (s).size(); ++i) v.push_back(s[i]);
#define TC int TESTCASE; cin >> TESTCASE; while (TESTCASE--)
typedef long long ll;
const int mod = 1000000007;



int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    int cnt = 0;
    for (int i = 0; i < n; i++) {
        for (int j = i; j < n; j++) {
            for (int k = j; k < n; k++) {
                if (i != j && j != k && i != k && a[i] != a[j] && a[j] != a[k] && a[i] != a[k]) {
                    int b,c,d;
                    b = min({a[i], a[j], a[k]});
                    c = max({a[i], a[j], a[k]});
                    d = a[i] + a[j] + a[k] - b - c;
                    if (c < b + d) {
                        cnt += 1;
                    }
                }
            }
        }
    }
    cout << cnt;
}


Measured memory_bytes: 3600
D, N = map(int, input().split())
if  D == 0:
    if N == 100:
        print(101)
    else:
        print(N)

if D == 1:
    if N == 100:
        print(101*100)
    else:
        print(N*100)

if D == 2:
    if N == 100:
        print(101*100**2)
    else:
        print(N*100**2)





Measured memory_bytes: 9148
n = int(input())
act = []

for i in range(n):
    act.append(list(map(int, input().split())))
    
dp = [[0]*n for i in range(3)]
dp[0][0] = act[0][0]
dp[1][0] = act[0][1]
dp[2][0] = act[0][2]

for i in range(1, n):
    dp[0][i] += act[i][0] + max(dp[1][i-1], dp[2][i-1])
    dp[1][i] += act[i][1] + max(dp[0][i-1], dp[2][i-1])
    dp[2][i] += act[i][2] + max(dp[1][i-1], dp[0][i-1])
    
print(max(dp[0][-1], dp[1][-1], dp[2][-1]))

Measured memory_bytes: 66008
from sys import stdin


def main():
    N = int(stdin.readline().rstrip())
    Xi = [(i, int(x)) for i, x in enumerate(stdin.readline().rstrip().split())]
    Xi = sorted(Xi, key=lambda x: x[1], reverse=True)
    result = list(range(N))
    index = N // 2 - 1
    for i in range(N):
        idx = index
        if i <= index:
            idx += 1
        result[Xi[i][0]] = Xi[idx][1]

    for x in result:
        print(x)


if __name__ == '__main__':
    main()


Measured memory_bytes: 45460
n = int(input())
# vals = [int(input()) for _ in range(n)]

profit = -1e10 # 利益
min_val = int(input())

for i in range(1, n):
    val = int(input())
    diff = val - min_val
    if (diff > profit):
        profit = diff
    if (val < min_val):
        min_val = val

print(profit)


Measured memory_bytes: 5628
#include<iostream>
#include<algorithm>
#include<functional>
using namespace std;
int main()
{
	while(1){
		long n,p[65000],j[65000],max=0,sum=0;
		cin >> n;
		if(n==0)break;
		for(int i=0;i<n;++i){
			cin >> p[i];
		}
		for(int i=0;i<n-1;++i){
			cin >> j[i];
		}
		for(int i=0;i<n;++i){
			sum+=p[i];
		}
		max=sum*n;
		sort(j,j+n-1,greater<int>());
		for(int i=1;i<n;++i){
			sum+=j[i-1];
			if(max<sum*(n-i))max=sum*(n-i);
		}
		cout << max << endl;
	}
	return 0;
}

Measured memory_bytes: 2196
#include <bits/stdc++.h>
using namespace std;
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;
}

int main() {
  int n;
  cin >> n;
  vector<int> h(n);
  vector<long> dp(n);
  for (int i = 0; i < n; i++) cin >> h[i];
  for (int i = 0; i < n; i++) dp[i] = 2000000000;
  dp[0] = 0;
  for (int i = 1; i < n; i++) {
    chmin(dp[i], dp[i - 1] + abs(h[i] - h[i - 1]));
    if (i > 1) chmin(dp[i], dp[i - 2] + abs(h[i] - h[i - 2]));
  }
  cout << dp[n - 1] << endl;
}

Measured memory_bytes: 1408
#include <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <cstdlib>
#include <list>
#include <numeric>
#include <map>	
#include <cmath>
#include <string>
#define rep(i,n) for(int i=0;i<n;i++)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define Cout(s) cout<<s<<endl
using namespace std;
typedef long long ll;
string Yes(bool b) { if (b) { return "Yes"; } else { return "No"; } }
string YES(bool b) { if (b) { return "YES"; } else { return "NO"; } }
//================================================

int a = 0, b = 0, c, d, n, k = 0, ans = 0;
string s, t;

int main()
{
	int r, D;ll  x; cin >> r >> D >> x;

	rep(i,10)
	{
		x = r * x - D;
		cout << x << endl;
	}

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#include "string"
#define endl '\n'
#define PI pair<int,int>
#define ff first
#define ss second
#define int long long 
#define boost ios_base::sync_with_stdio(false);cin.tie(nullptr)


int32_t main() { 
    boost;
    
    int n,m;
    cin>>n>>m;
    int a[n];
    int tot = 0;
    for(int i=0;i<n;i++){
        cin>>a[i];
        tot+=a[i];
    }
    sort(a,a+n,greater<int>());
    if(a[m-1]*4*m>=tot)
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;   	
}           

Measured memory_bytes: 256
# -*- coding: utf-8 -*-

N = int(input())

AC = 0
WA = 0
TLE = 0
RE = 0

for i in range(N):
    tmp = str(input())
    if tmp == 'AC':
        AC += 1
    elif tmp == 'WA':
        WA += 1
    elif tmp == 'TLE':
        TLE += 1
    elif tmp == 'RE':
        RE += 1

print('AC x', AC)
print('WA x', WA)
print('TLE x', TLE)
print('RE x', RE)

Measured memory_bytes: 9204
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>


using namespace std;
using namespace __gnu_pbds;

#define int long long int
#define pb push_back
#define M 10000000007
#define ff first
#define ss second
#define deb(x) cout< #x< " "< x< endl;
#define fo(i,n) for(int i=0;i<n;i++)
#define ffo(i,k,n) for(int i=k;i<=n;i++)
#define ffORR(a,b,c) for(int a= b;a>=c;a--)
#define fa(defr) for(auto x:defr)
#define sz size()
// #define mp make_pair
#define mxm3(a,b,c) max(a, max(b,c))
#define mi3(a,b,c) min(a, min(b,c))
#define mxn 1000005
#define PII pair<int,int>
#define all(v) v.begin(), v.end()
#define endl "\n"
#define fast ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);


// typedef rightee<pair<int, int>,
//         nuint_type,
//         less<pair<int, int>>,
//         rb_rightee_tag,
//         rightee_order_statistics_node_update> oset;

//126271
// 107897



int lcm(int a, int b) {
	int x = (a * b);
	return x / __gcd(a, b);
}

int ceil(int a, int b) {
	if (a % b != 0) return a / b + 1;
	return a / b;
}


int power(int x, int y, int p)
{
	int res = 1LL;
	x = x % p;
	while (y > 0)
	{
		if (y & 1)
			res = (res * x) % p;
		y = y >> 1;
		x = (x * x) % p;
	}
	return res;
}

int pow1(int n) {
	int ans = power(2, n, M);
	ans = (ans - 1 + M) % M;
	return ans % M;
}


int32_t main() {

	// fast;
	int t;
	// cin >> t;
	t = 1;
	while (t--) {
		int n; cin >> n;
		vector<int>arr(n);
		vector<int>brr(n);
		vector<int>crr(n);
		vector<vector<int>>dp(3, vector<int>(n,0));
		for (int i = 0; i < n; i++) {
			cin >> arr[i] >> brr[i] >> crr[i];
		}
		dp[0][0] = arr[0];
		dp[1][0] = brr[0];
		dp[2][0] = crr[0];

		for(int i = 1;i<n;i++){
			dp[0][i] = arr[i] + max(dp[1][i-1] , dp[2][i-1]);
			dp[1][i] = brr[i] + max(dp[0][i-1] , dp[2][i-1]);
			dp[2][i] = crr[i] + max(dp[1][i-1] , dp[0][i-1]);
		}
		cout << max({dp[0][n-1], dp[1][n-1], dp[2][n-1]}) << endl;
	}

}

Measured memory_bytes: 5760
import java.util.*;
public class Main{
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    int N=sc.nextInt();
    long A[] = new long[N+1];
    long B[] = new long[N+1];
    long C[] = new long[N+1];
    long D[] = new long[N+1];
    for(int i=0;i<N+1;i++){
      A[i] =sc.nextLong();}
    B[0]=sc.nextLong();
    C[0]=Math.max(B[0]-A[0],0);
    if(C[0]==0){D[0]=B[0];}
    else{D[0]=A[0];}
    for(int j=1;j<N+1;j++){
     if(j==N){B[j]=0;}
      else{B[j] =sc.nextLong();}
      if(C[j-1]<A[j]){
      C[j]=Math.max(B[j]-A[j]+C[j-1],0);}
      else{C[j]=B[j];}
      if(C[j]==0){if((j==N)&&(A[j]<C[j-1])){D[j]=D[j-1]+A[j];}else{
        D[j]=D[j-1]+C[j-1]+B[j];}}
      else{D[j]=D[j-1]+A[j];}}
    System.out.println(D[N]);
  }
}


Measured memory_bytes: 93624
#include <cassert>

#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
//#include <boost/foreach.hpp>
//#include <boost/range/algorithm.hpp>
#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define ll long long
#define Sort(v) sort(all(v))
#define INF 1000000000
#define END return 0
#define pb push_back
#define se second
#define fi first
#define pb push_back
#define all(v) (v).begin() , (v).end()
#define MP make_pair
#define MOD 1000000007LL
using namespace std;
int day[12]={31,28,31,30,31,30,31,31,30,31,30,31};

int main (){
    ll x,y;cin>>x>>y;
    int ans=0;
    while(x<=y){
        ans++;
        x*=2;
        
    }
    
cout<<ans<<endl;
}

/*

*/


Measured memory_bytes: 256