akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define PI (acos(-1))
const long long INF = 1LL << 60;

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;
}

#define rep(i, e) for(int i = 0; i < e; i++)
#define repp(i, s, e) for(int i = s; i < e; i++)
#define MAX_N 100
#define Card_Max 36
#define p(a) printf("%d\n", a);
#define ll long long
#define ull unsigned long long
#define MAX 1e9
#define NIL -1
typedef pair<ll, ll> P;

const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

int main() {
    int N;
    int h[100005] = {};
    long long dp[100010] = {};

    rep(i, 100005) dp[i] = INF;
    dp[0] = 0;

    cin >> N;
    rep(i, N) cin >> h[i];
    rep(i, N) {
        chmin(dp[i + 1], dp[i] + abs(h[i + 1] - h[i]));
        chmin(dp[i + 2], dp[i] + abs(h[i + 2] - h[i]));
    }

    cout << dp[N - 1] << endl;
}

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

int main()
{
    int n;
    cin >> n;
    vector<int> a(n - 1);
    for(auto& i : a) cin >> i;

    sort(a.begin(), a.end());
    for (int i = 1, k = i; i <= n; i++)
    {
        int ans = 0;
        for(; k <= n; k++, ans++)
        {
            if(a[k - 1] != i) break;
        }
        cout << ans << endl;
    }
}

Measured memory_bytes: 4052
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define rep(i,N) for(int i=0;i<(int)N;i++)
#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
static inline void PUT(char c)
{
  static char buf[1<<15],*ptr=buf;
  if(ptr==buf+strlen(buf)||c==0){fwrite(buf,1,ptr-buf,stdout),ptr=buf;}*ptr++=c;
}
static inline int IN(void)
{
  int x=0,f=0,c=getchar();while(c<48||c>57){f^=c==45,c=getchar();}
  while(c>47&&c<58){x=x*10+c-48,c=getchar();}return f?-x:x;
}
static inline void OUT(int a)
{
  if(a<0)PUT('-'),a=-a;
  int d[40],i=0;do{d[i++]=a%10;}while(a/=10);
  while(i--){PUT(d[i]+48);}PUT('\n');
}
int N=0;
static inline void Add(int *fwt,int i,int v){while(i<N){fwt[i]+=v;i|=i+1;}}
static inline int Sum(int *fwt,int i){int v=0;while(i>=0){v+=fwt[i];i=(i&(i+1))-1;}return v;}
int main()
{
  N=IN();int Q=IN(),after[500001],dat[500000],fenwick[500000]={0},id[500001],left[500001],pos[500001]={0},result[500001];
  rep(i,N){dat[i]=IN();}
  rep(i,Q){left[i+1]=IN()-1;int r=IN()-1;after[i+1]=id[r];id[r]=i+1;}
  for(int r=0;r<N;r++)
  {
    if(pos[dat[r]]){Add(fenwick,pos[dat[r]]-1,-1);}
    Add(fenwick,r,1);
    for(int i=id[r];i;i=after[i]){result[i]=Sum(fenwick,r)-Sum(fenwick,left[i]-1);}
    pos[dat[r]]=r+1;
  }
  rep(i,Q){OUT(result[i+1]);}
}

Measured memory_bytes: 17296
#include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
#include <functional>
#include <cmath>
#include <set>
#include <queue>
#include <vector>
#include <climits>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
using namespace std;

int main()
{
	int N;
	cin >> N;
	vector<double> v(N);
	for (auto i = 0; i < N; ++i)
	{
		cin >> v[i];
	}

	sort(v.begin(), v.end());

	auto result = v[0];
	for (auto i = 0; i < N; ++i)
	{
		result = (result + v[i]) / 2;
	}

	cout << fixed << setprecision(10) << result << endl;

	return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
using namespace std;
#define MP make_pair
int main(){
	int n;
	for(;;){
		scanf("%d\n",&n);
		if(n==0) break;
		pair<pair<int,int>,pair<int,char> > ar[10];
		char c;
		int r;
		for(int i=0;i<n;i++){
			scanf("%c",&c);
			int win=0,lose=0;
			for(int j=0;j<n-1;j++){
				scanf(" %d",&r);
				if(r==0) win++;
				if(r==1) lose++;
			}
			ar[i]=MP(MP(-win,lose),MP(i,c));
			scanf("\n");
		}
		sort(ar,ar+n);
		for(int i=0;i<n;i++){
			printf("%c\n",ar[i].second.second);
		}
	}
}

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


#define FOR(i, start, end) for(uint64_t i=start; i<end; i++)
#define REP(i, n) FOR(i, 0, n)

// 最大公約数gcd
// 最小公倍数lcm=m*n/gcd
uint64_t gcd(uint64_t m, uint64_t n) {
  uint64_t temp;
  while (m % n != 0){
    temp = n;
    n = m % n;
    m = temp;
  }
  return n;
}

uint64_t lcm(uint64_t m, uint64_t n) {
  return (m*n)/gcd(m,n);
}

// vector<vector<uint64_t> > v(n+1, vector<uint64_t>(n+1, 0))
// v[n][k]に組み合わせ数が入る。
void comb(vector<vector <uint64_t> > &v){
  for(uint64_t i = 0;i <v.size(); i++){
    v[i][0]=1;
    v[i][i]=1;
  }
  for(uint64_t k = 1;k <v.size();k++){
    for(uint64_t j = 1;j<k;j++){
      v[k][j]=(v[k-1][j-1]+v[k-1][j]);
    }
  }
}

// 掛け算オーバーフロー判定
bool is_product_overflow(uint64_t a, uint64_t b) {

	uint64_t prod = a * b;
	
	return (prod / b != a);
}

//素因数分解
void primeFactorization(uint64_t a, list<uint64_t> &factors){ //素因数分解を出力するプログラム
  long i,sq;
  if(a%2==0){ //偶数の場合
    factors.push_back(2);
    primeFactorization(a/2,factors); //2で割った値で再帰
    return;
  }
  sq = sqrt(a);
  for(i=3;i<=sq;i+=2){ //3以上√a以下の奇数の場合
	if(a%i==0){
	  factors.push_back(i);
      primeFactorization(a/i,factors); //割れた値で再帰
      return;
	}
  }
  //偶数でも3以上√a以下の奇数の場合でも割り切れない場合
  if(a!=1){ //aが1でないなら、a自身は素数
    factors.push_back(a);
  }
}

// フェルマーの小定理
// mod. m での a の逆元 a^{-1} を計算する
// (a/b)%m = a*movinv(b,m)%m  
int64_t modinv(int64_t a, int64_t m) {
    int64_t b = m, u = 1, v = 0;
    while (b) {
        int64_t t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

// 円周率
// M_PI

// #include <iomanip> // setprecisionを使用するのに必要
// cout << std::fixed << std::setprecision(15) << y << endl;

// 昇順
// priority_queue<int, vector<int>, greater<int> > queue;

signed main() {
  int64_t n,m;
  cin >> n >> m;
  
  int count = 0;
  if(m>=2){
    count += m*(m-1)/2;
  }
  if(n>=2){
    count += n*(n-1)/2;
  }
  
  cout << count << endl;
 
  return 0;
}




Measured memory_bytes: 3668
import java.util.*;
import java.util.stream.Collectors;

class Main {
    public static void main(String args[]) {
        Scanner sc = new Scanner(System.in);
      
        int n = sc.nextInt();
        double result = 1;
        double pow = Math.pow(10, 9) + 7;
        for (int i = 1; i <= n; i++) {
            result = (result * i) % pow;
        }

        System.out.println((long) (result % pow));
    }
}

Measured memory_bytes: 23764
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
class Simple {
    int N;
    int[] l, r;
    void Solve() {
        //input
        N = io.Int;
        l = new int[N];
        r = new int[N];
        for(int i = 0; i < N; ++i) {
            l[i] = io.Int;
            r[i] = io.Int;
        }
        //cal
        var ans = 0;
        for(int i = 0; i < N; ++i) 
            ans += r[i] - l[i] + 1;
        //ret
        Console.WriteLine(ans);
    }
    SimpleIO io = new SimpleIO();
    public static void Main(string[] args) { new Simple().Stream(); }
    void Stream() {
        Solve();
        io.writeFlush();
    }
}
class SimpleIO {
    SimpleIO(bool isAutoFlush = false) { this.isAutoFlush = isAutoFlush; }
    string[] nextBuffer;
    int BufferCnt;
    char[] cs = new char[] { ' ' };
    public bool isAutoFlush;
    StreamWriter sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
    public SimpleIO() {
        nextBuffer = new string[0];
        BufferCnt = 0;
        if(!isAutoFlush)
            Console.SetOut(sw);
    }
    public string Next() {
        if (BufferCnt < nextBuffer.Length)
            return nextBuffer[BufferCnt++];

        string st = Console.ReadLine();
        while (st == "")
            st = Console.ReadLine();
        nextBuffer = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        BufferCnt = 0;
        return nextBuffer[BufferCnt++];
    }
    public string String => Next();
    public char Char => char.Parse(String);
    public int Int => int.Parse(String);
    public long Long => long.Parse(String);
    public double Double => double.Parse(String);
    public void writeFlush() { Console.Out.Flush(); }
}


Measured memory_bytes: 11092
#include<bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < n; i++)
#define vi vector<int>
#define all(x) (x).begin(),(x).end()
#define INF (1<<30)-1
using ll = long long;
using namespace std;
template<class T>bool chmax(T &a, const T &b){ if(a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b){ if(b<a) { a=b; return 1; } return 0; }

int main(){
  int n,m,k; cin >> n >> m >> k;
  bool ok = false;
  for(int i = 0; i <= n; i++){
    for(int j = 0; j <= m; j++){
      if(k == n*j + m*i - i*j*2) ok = true;
    }
  }
  if(ok) cout << "Yes";
  else cout << "No";
  cout << "\n";
  return 0;
}


Measured memory_bytes: 3600
#include <bits/stdc++.h>
#include <fstream>
#define inputtxt() std::ifstream in("input.txt"); std::cin.rdbuf(in.rdbuf())
using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(obj) (obj).begin(), (obj).end()


struct edge{
    int to, cost;
    edge(int t, int c) { to = t; cost = c;}
};
struct vertex{
    int number, cost;
    vertex(int n, int c) { number = n; cost = c;}
    bool operator> (const vertex &a) const{
        return cost > a.cost;
    }
};
vector<vector<edge>> graph;
const int INF = INT_MAX;
vector<int> dist;
vector<int> prv;

//If a graph has a closed path, it returns true.
bool bellmanford(int n, int start){
    dist = vector<int>(n,INF);
    prv  = vector<int>(n,-1);
    dist[start] = 0;
    for(int i=0; i<n+1; i++){
        for(int v=0; v<n; v++){
            for(edge e : graph[v]){
                if(dist[v]==INF || dist[v] + e.cost >= dist[e.to]) continue;
                dist[e.to] = dist[v] + e.cost;
                prv[e.to] = v;
                if(i == n) return true;
            }
        }
    }
    return false;
}

int main() {
    int V, E, r;
    cin >> V >> E >> r;
    graph = vector<vector<edge>>(V);
    rep(i,E){
        int s, t, d;
        cin >> s >> t >> d;
        graph[s].push_back(edge(t,d));
    }
    if(bellmanford(V, r)){
        cout << "NEGATIVE CYCLE" << endl;
        return 0;
    }
    rep(i,V){
        if(dist[i]!=INF){
            cout << dist[i] << endl;
        }else{
            cout << "INF" << endl;
        }
    }
    return 0;
}


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


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

    for (int i = 0; i < 2000; ++i) {
        int c = i * 0.08;
        int d = i * 0.1;

        if (a == c && b == d) {
            cout << i << endl;
            return 0;
        }
    }
    cout << -1 << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = Integer.parseInt(sc.next());
        String S = sc.next();
        String T = sc.next();

        StringBuilder sb = new StringBuilder();
        for(int i = 0; i < N; ++i) {
            sb.append(S.charAt(i));
            sb.append(T.charAt(i));
        }
        System.out.println(sb.toString());
    }
}


Measured memory_bytes: 25044
#include <bits/stdc++.h>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
using ll = long long;
using P = pair<ll, ll>;
const long double PI = acos(-1.0L);
ll GCD(ll a, ll b) { return b?GCD(b, a%b):a; }
ll LCM(ll a, ll b) { return a/GCD(a, b)*b; }

int n, p;

int main() {
    while(1) {
        cin >> n >> p;
        if(n == 0 && p == 0) break;
        vector<int> stone(n, 0);
        int now = 0;
        int wan = p;
        while(1) {
            if(wan == 0) {
                wan = stone[now%n];
                stone[now%n] = 0;
            }else {
                stone[now%n]++;
                wan--;
                if(wan == 0) {
                    bool flg = true;
                    for(int i = 0; i < n; ++i) {
                        if(i == now%n) continue;
                        if(stone[i] != 0) {
                            flg = false;
                            break;
                        }
                    }
                    if(flg) {
                        cout << now%n << endl;
                        break;
                    }
                }
            }
            now++;
        }
    }
}


Measured memory_bytes: 3016
#![allow(unused_imports)]
// use itertools::Itertools;
use proconio::{input, marker::*};

fn main() {
    input! {
        mut sa: Chars,
        mut sb: Chars,
        mut sc: Chars
    };
    let mut c = 'a';
    loop {
        let turn = match c {
            'a' => &mut sa,
            'b' => &mut sb,
            'c' => &mut sc,
            _ => unreachable!(),
        };
        if turn.is_empty() {
            println!("{}", c.to_uppercase());
            return;
        }
        c = turn.remove(0);
    }
}


Measured memory_bytes: 2212
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

const ll mod = 1000000007;

int main() {
    int N, K, R, S, P, ans;
    cin >> N >> K >> R >> S >> P;
    string T;
    cin >> T;
    map<char, int> points = {{'r', P}, {'s', R}, {'p', S}};

    ans = 0;
    rep(i, K){
        char prev = 'n';
        bool hasToMinusNext = true;
        for(int j = i; j < N; j = j + K){
            char now;
            now = T[j];
            if(now == prev && hasToMinusNext){
                hasToMinusNext = false;
            } else {
                ans += points[now];
                hasToMinusNext = true;
            }
            prev = now;
        }
    }
    cout << ans << endl;
    
    return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef vector<pair<ll, ll>> pll;
 
#define mod 1000000007
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define popcount(x) __builtin_popcountll(x)
 
const long double PI = acos(-1);
 
ll gcd(ll a,ll b){return b ? gcd(b,a%b) : a;}
ll lcm(ll a,ll b){return a / gcd(a,b) * b;}
ll stringcount(string s, char c){return count(s.cbegin(), s.cend(), c);}
bool isInteger(double x){return floor(x) == x;}


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

  string s, t;
  cin >> s >> t;
  reverse(all(t));
  if(s == t) cout << "YES" << endl;
  else cout << "NO" << endl;
  return 0;
}

Measured memory_bytes: 256
import java.util.*

fun main() {
    val pw = java.io.PrintWriter(System.out)
    Problem.solve(Scanner(System.`in`), pw)
    pw.flush()
}

object Problem {
    fun solve(sc: Scanner, pw: java.io.PrintWriter) {
        val S = sc.next()
        val T = sc.next()
        var min = T.length
        for (i in 0..S.length - T.length) {
            var n = 0
            for (j in T.indices) {
                if (S[i + j] != T[j]) n++
            }
            if (min > n) min = n
        }
        pw.println(min)
    }
}


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

bool cnt[100];

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

    int n, m;
    cin>>n>>m;

    for (int i=0; i<n; i++) {
        string s;
        cin>>s;

        for (int j=0; j<m; j++)
            if (s[j] == '#') {
                if (cnt[i+j]) {
                    cout<<"Impossible"<<endl;
                    return 0;
                }
                cnt[i+j] = 1;
            }
    }
    cout<<"Possible"<<endl;
}


Measured memory_bytes: 3564
#include<stdio.h>

int bubble(int A[],int N){
  int sw = 0;
  int i,j,temp;

  for(i=0;i<(N-1);i++){
    for(j=(N-1);j>i;j--){
      if(A[j]<A[j-1]){
	temp=A[j-1];
	A[j-1]=A[j];
	A[j]=temp;
	sw++;
      }
    }
  }
  return sw;
}

int main(){
  int A[100],N,i,sw;

  scanf("%d",&N);
  for(i=0;i<N;i++) scanf("%d",&A[i]);

  sw = bubble(A,N);

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

  return 0;
}

Measured memory_bytes: 604
#include<bits/stdc++.h>
#include<iostream>
#include<stdio.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); ++i)
typedef long long ll;
#define MAX 500000
#define SENTINEL 2000000000
  
int cnt;
int L[MAX/2+2],R[MAX/2+2];

void merge(int A[], int n, int left, int mid,int right){
  int n1 = mid - left;
  int n2 = right - mid;
  rep(i,n1) L[i] = A[left+i];
  rep(i,n2) R[i] = A[mid+i];
  L[n1] = R[n2] = SENTINEL;
  int i = 0,j = 0;
  for(int k=left;k<right;k++){
    cnt++;
    if( L[i]<=R[j] ){
      A[k] = L[i++];
    }else{
      A[k] = R[j++];
    }
  }
}

void mergeSort(int A[],int n,int left,int right){
  if(left+1<right){
    int mid  = (left + right)/2;
    mergeSort(A,n,left,mid);
    mergeSort(A,n,mid,right);
    merge(A,n,left,mid,right);
  }
}
  

int main(){
  int A[MAX], n;
  cnt = 0;
  cin >> n;
  rep(i,n) cin >> A[i];
  
  mergeSort(A,n,0,n);
  
  rep(i,n){
    if(i) cout <<" ";
    cout << A[i];
  }
  cout << endl;
  
  cout << cnt << endl;
  
  return 0;
}
                                        
  
  
  
     





Measured memory_bytes: 6868
#include <stdio.h>

int main(void)
{
	int isbingo[] = {0111, 0222, 0444, 0007, 0070, 0700, 0124, 0421};
	char str[16];
	int os, xs;
	int i;

	while (~scanf("%s", str)){
		int w = 0;
		os = xs = 0;
		for (i = 0; i < 9; i++){
			if (str[i] == 'o') os |= 1 << i;
			if (str[i] == 'x') xs |= 1 << i;
		}
		for (i = 0; i < 8; i++){
			if ((os & isbingo[i]) == isbingo[i]) w = 1;
			if ((xs & isbingo[i]) == isbingo[i]) w = 2;
		}
		printf("%c\n", "dox"[w]);
	}
	return (0);
}

Measured memory_bytes: 540
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  for(int i=0;i<(n);++i)
#define REPr(i,n) for(int i=(n)-1;i>=0; --i)
#define FORq(i, m, n) for(int i = (m);i <= (n);++i)
#define rFORq(i, m , n) for(int i = (n);i >=(m);--i)
#define SCD(n) scanf("%d",&n)
#define SCD2(m,n) scanf("%d%d",&m,&n)
#define SCD3(m,n,k) scanf("%d%d%d",&m,&n,&k)
#define SCLLD(n) scanf("%lld",&n)
#define SCLLD2(m,n) scanf("%lld%lld",&m,&n)
#define SCLLD3(m,n,k) scanf("%lld%lld%lld",&m,&n,&k)
#define PB push_back
#define MP make_pair
#define ARSCD(A,N) REP(i,N){SCD(A[i]);}
#define ARSCD1(A,N) FORq(i,1,N){SCD(A[i]);}
#define VSCD(v,N) REP(i,N){int x; SCD(x); v.PB(x);}
#define VSCLLD(v,N) REP(i,N){long long x; SCLLD(x); v.PB(x);}
#define PRINTD(n) printf("%d\n",n)
#define PRINTLLD(n) printf("%lld\n",n)
#define DEBUG printf("%s\n","debug")
#define fst first
#define snd second
#define SIN(x,S) (S.count(x) != 0)
using namespace std;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector < VI > VVI;
typedef vector<long long> VL;
typedef long long ll;
typedef long long integer;
////////////////////////////////////////////////////////////////////
int main(){
    int N; SCD(N);
    vector<string> str[12];
    str[1].PB("3");
    str[1].PB("5");
    str[1].PB("7");
    FORq(i,2,10){
        REP(j,str[i-1].size()){
            string prev = str[i-1][j];
            //cout << prev << "\n";
            str[i].PB(prev + "3");
            str[i].PB(prev + "5");
            str[i].PB(prev + "7");
            
        }
    }

    //DEBUG;
    int ans = 0;

    FORq(i,1,9){
        REP(j,str[i].size()){
            bool chk3 = false;
            bool chk5 = false;
            bool chk7 = false;

            REP(k,i){
                if (str[i][j][k] == '3') chk3 = true;
                if (str[i][j][k] == '5') chk5 = true;
                if (str[i][j][k] == '7') chk7 = true;
            }
            if (!((chk3) and (chk5) and (chk7))) continue;
            //cout << str[i][j] << "\n";
            int num = stoi(str[i][j]);
            if (num <= N) ans++;
        }
    }

    PRINTD(ans);
}

Measured memory_bytes: 5368
<?php
  
list($n, $k) = explode(' ', trim(fgets(STDIN)));
list($r, $s, $p) = explode(' ', trim(fgets(STDIN)));
$t = trim(fgets(STDIN));

$m = "abc";
$c = 0;
for($i=0; $i<$n; $i++){
    
  if($i>=$k) $m = $t[$i-$k];
  
  if ($m ==$t[$i]){
    $t[$i] = "abc";
  } else if ($t[$i] == 'r'){
    $c += $p;
  } else if ($t[$i] == 's'){
    $c += $r;
  } else if ($t[$i] == 'p'){
    $c += $s;
  }
  
}

echo $c;

?>

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

#define ll              long long
#define Ull             unsigned long long
#define pb              push_back
#define INF             2e16
#define PI              acos(-1.0)
#define mk              make_pair
#define pii             pair<int,int>
#define pll             pair<ll,ll>
#define min3(a,b,c)     min(a,min(b,c))
#define max3(a,b,c)     max(a,max(b,c))
#define min4(a,b,c,d)   min(a,min(b,min(c,d)))
#define max4(a,b,c,d)   max(a,max(b,max(c,d)))
#define SQR(a)          ((a)*(a))
#define MEM(a,x)        memset(a,x,sizeof(a))
#define ABS(x)          ((x)<0?-(x):(x))

#define SORT(v)         sort(v.begin(),v.end())
#define REV(v)          reverse(v.begin(),v.end())
#define FastRead        ios_base::sync_with_stdio(0);cin.tie(nullptr);

const int N = 2;
const ll MOD = 1e9 + 7;


/*bool comp(const pii &p1, const pii &p2)
{

}*/


void Solve()
{

	ll n;
	cin >> n;
	ll dig = n % 10;
	if (dig == 2 || dig == 5 || dig == 7 || dig == 9 || dig == 4 )
		cout << "hon" << "\n";

	else if (dig == 0 || dig == 1 || dig == 6 || dig == 8)
		cout << "pon" << "\n";

	else
		cout << "bon" << "\n";

}


int main()
{

	FastRead;
	int T = 1;
	//cin>>T;
	while (T--)
	{
		Solve();
	}

	return 0;
}


Measured memory_bytes: 3636
import std.stdio;
import std.conv, std.array, std.algorithm, std.string;
import std.math, std.random, std.range, std.datetime;
import std.bigint;
import std.container;
string read(){ static string[] ss; while(!ss.length) ss = readln.chomp.split; string res = ss[0]; ss.popFront; return res; }

const ulong MOD = 1_000_000_007;

void main(){
	long n = read.to!long;
	long m = read.to!long;
	
	ulong ans;
	
	if(n < m - 1 || n > m + 1) ans = 0;
	else if(n == m) ans = 2 * f(n) * f(n) % MOD;
	else ans = f(m) * f(n) % MOD;
	
	ans.writeln;
		
	}

ulong f(long n){
	ulong res = 1;
	for(long i = 1; i <= n; i ++){
		res *= i;
		res %= MOD;
		}
	return res;
	}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct Node{
    int key;
    struct Node *right,*left,*parent;
};

struct Node *root,*NIL;

void insert(int k){
    struct Node *y=NIL;
    struct Node *x=root;
    struct Node *z;

    z=(struct Node *)malloc(sizeof(struct Node));
    z->key=k;
    z->left=NIL;
    z->right=NIL;

    while(x != NIL){
        y=x;
        if(z->key < x->key){
            x=x->left;
        }
        else
            x=x->right;
    }
    z->parent=y;
    if(y==NIL)
        root=z;
    else{
        if(z->key < y->key)
            y->left=z;
        else
            y->right=z;
    }
}

void inorder(struct Node *u){
    if(u==NIL)
        return;
    inorder(u->left);
    printf(" %d",u->key);
    inorder(u->right);
}
void preorder(struct Node *u){
    if(u==NIL)
        return;
    printf(" %d",u->key);
    preorder(u->left);
    preorder(u->right);
}
int main(void){
    int n,i,x;
    char line[7];
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%s",line);
        if(!strcmp(line,"insert")){
            scanf("%d",&x);
            insert(x);
        }
        else if(!strcmp(line,"print")){
            inorder(root);
            puts("");
            preorder(root);
            puts("");
        }
    }
    return 0;
}

Measured memory_bytes: 24048
#include <iostream>
#include <cstdio>

using namespace std;

int main()
{
  int n;
  while (scanf("%d ", &n) == 1) {
    if (n == 0) {
      break;
    }
    int a[12] ,b[12];
    for (int i = 0; i < 12; i++) {
      scanf("%d %d ", a + i, b + i);
    }
    for (int i = 1; i <= 12; i++) {
      int _a, _b;
      _a = a[i - 1], _b = b[i - 1];
	n -= (_a - _b);
	//printf("n = %d\n", n);
      if (n <= 0) {
	cout << i << endl;
	goto next;
      }
    }
    cout << "NA" << endl;
  next:;
  }
  return 0;
}

Measured memory_bytes: 0
//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;

#define endl "\n"
#define all(c) (c).begin(),(c).end()

// target 4096

signed main() {
	// freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout);
	std::ios::sync_with_stdio(false);
	cin.tie(0);

	int n;
	cin >> n;
	ll res = 0;
	for (int i = 1; i < n; i++) {
		for (int j = 1; j*j <= i; j++)
			if (j*j == i)
				res++;
			else if (i % j == 0)
				res += 2;
	}
	cout << res << endl;
}
/* --- PSolving ---
 * Simplifying (getting rid of variables, conditions, code logic, etc.)
 * Reframing
 * Solving a subtask (subgoal, aux. problem, removing a condition or fixing a parameter, etc.)
 * Inducing
 * Divide and conquer
 * Working backwards
 * Visual intuition
 */


Measured memory_bytes: 3636
#include<bits/stdc++.h>
#include<iomanip>
using namespace std;
typedef long long ll;
typedef long  l;
typedef pair<int,int> P;
#define rep(i,n) for(int i=0;i<n;i++)
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
const double PI=3.141592653589;
const int INF=1000000007;
const ll LMAX=1000000000000001;
ll gcd(ll a,ll b){if(a<b)swap(a,b);ll c=a%b;while(c!=0){a=b;b=c;c=a%b;}return b;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}
int dx[]={-1,0,1,0};
int dy[]={0,1,0,-1};


int main(){
  int n; cin>>n;
  vector<ll> x(n);
  rep(i,n) cin>>x[i];
  ll ans=LMAX;
  for(int i=1;i<101;i++){
    ll sum=0;
    rep(j,n){
      sum+=(x[j]-i)*(x[j]-i);
    }
    ans=min(ans,sum);
  }
  cout<<ans<<endl;

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define rrep(i,n) for (int i = n-1; i >= 0; i--)
#define rep2(i,s,n) for (int i = s; i < n; ++i)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define tmax(a,b,c) max(a,max(b,c))
#define tmin(a,b,c) min(a,min(b,c))
#define pb push_back
#define eb emplace_back
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vs vector<string>
#define vc vector<char>
#define vb vector<bool>
#define vp vector<P>
using namespace std;
using ll = long long;
using P = pair<int,int>;
using LP = pair<ll,ll>;
template<class T> istream& operator>>(istream& is,vector<T>& v) { for(T& t:v){is>>t;} return is; }
template<class T> ostream& operator<<(ostream& os,const vector<T>& v) { for(T t:v){os<<t<<" ";} os<<"\n"; return os; }
void Yes(bool b) { cout << (b ? "Yes" : "No") << endl; }
void YES(bool b) { cout << (b ? "YES" : "NO") << endl; }
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;}
const int inf = 1001001001;
const ll linf = 1001001001001001001;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
    int n;
    cin >> n;
    vl a(n),b(n);
    rep(i,n) cin >> a[i] >> b[i];
    ll sum = 0;
    rrep(i,n) {
        a[i] += sum;
        ll na = (a[i]+b[i]-1)/b[i]*b[i];
        sum += na-a[i];
    }
    cout << sum << endl;
}


Measured memory_bytes: 1792
import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        double ans = (a + b) / 2.0;
        System.out.println((int)Math.ceil(ans));
    }

    public static void printArray(int[] array){
        for(int i=0; i<array.length; i++){
            if(i == array.length){
                System.out.println(array[i]);
            } else {
                System.out.print(String.format("%d ", array[i]));
            }
        }
    }
}


Measured memory_bytes: 22868
#include <bits/stdc++.h>
#define rep(i, a) for (int i = (int)0; i < (int)a; ++i)
#define rrep(i, a) for (int i = (int)a - 1; i >= 0; --i)
#define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define RREP(i, a, b) for (int i = (int)a - 1; i >= b; --i)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define popcount __builtin_popcount
using ll = long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 60;


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;
}

ll gcd(ll n, ll m)
{
	ll tmp;
	while (m != 0)
	{
		tmp = n % m;
		n = m;
		m = tmp;
	}
	return n;
}

ll lcm(ll n, ll m)
{
	return abs(n) / gcd(n, m) * abs(m); //gl=xy
}

using namespace std;

void solve(){
	string s,t;
	cin>>s>>t;
	int n=s.size(),m=t.size();
	int ans=n;
	rep(i,n){
		if(i+m>n)break;
		int cnt=0;
		rep(j,m){
			if(t[j]!=s[i+j])++cnt;
		}
		chmin(ans,cnt);
	}
	cout<<ans;
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout << fixed << setprecision(15);
	solve();
	return 0;
}


Measured memory_bytes: 3660
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        final Scanner scanner = new Scanner(System.in);
        final char[] chars = scanner.next().toCharArray();
        if (chars[2] == chars[3] && chars[4] == chars[5]) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}


Measured memory_bytes: 21844
#include<stdio.h>


unsigned long  check(unsigned long A){
	if(A%4==0) return A;
	else if(A%4==1) return 1;
	else if(A%4==2) return A^1;
	else if(A%4==3) return 0;
	return 0;
}

int main(){
	unsigned long A,B;
	scanf("%lu %lu",&A, &B);
	if(A < 1){
		printf("%lu\n",check(B));
		return 0;
	}
	printf("%lu\n",check(A-1)^check(B));
	return 0;
}





Measured memory_bytes: 128
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<queue>
#include<string>
#include<cstring>
#include<algorithm>
#include<set>
#include<map>

#define REP(i,n) for(int i=0;i<(n);i++)
#define EPS (1e-7)
#define INF (3e9)

using namespace std;
typedef long long int ll;

string s;
int main(void){
    cin >> s;
    if(s=="Sunny") cout << "Cloudy" << endl;
    if(s=="Cloudy") cout << "Rainy" << endl;
    if(s=="Rainy") cout << "Sunny" << endl;

    return 0;
}



Measured memory_bytes: 256
/*dismint|jjc*/
#include <bits/stdc++.h>
using namespace std;
#define forl(V, S, E) for(int V = S; V < E; V++)
#define ford(V, S, E) for(int V = S; V >= E; V--)
#define fore(E, X) for(auto &E:X)
#define println(X) cout << X << endl
#define printe(X) for(auto &E:X) cout << E << " "; cout << endl
typedef unordered_map<int, unordered_set<int>> graph;
typedef long long ll;

const ll mod = 1e9+7;
ll factorial[200000];
graph G;

map<int, int> parent, subtree;
void est(int root) {
	stack<pair<int, int>> S; S.push(make_pair(root, 0));
	unordered_set<int> VST;
	while(!S.empty()) {
		pair<int, int> VP = S.top(); S.pop(); int V = VP.first;
		if(VST.count(V) > 0) {
			subtree[parent[V]] += ++subtree[V];
			continue;
		}
		VST.insert(V); S.push(VP);
		fore(NB, G[V]) {
			if(VST.count(NB) > 0) continue;
			parent[NB] = V;
			S.push(make_pair(NB, V));
		}
	}
}

int main() {
	ios_base::sync_with_stdio(false); cin.tie(NULL);
	ll n, k; cin >> n >> k;
	forl(i, 0, n-1) { int a, b; cin >> a >> b; G[a].insert(b); G[b].insert(a); }
	est(1); factorial[0] = 1; forl(i, 1, 200000) factorial[i] = (factorial[i-1]*i)%mod;
	ll ans = k;
	forl(i, 1, n+1) {
		ll op = k, nm = (int)G[i].size()-1;
		if(i == 1) { op--; nm++; }
		else op -= 2;
		while(nm--) {
			ans = (ans*(op--))%mod;
		}
	}
	println(ans);
}


Measured memory_bytes: 34120
#include <iostream>
#include<algorithm>
#include<set>
#include<queue>
#include<bitset>
#define rep(i,j,n) for(int i=j;i<n;i++)
using namespace std;
#define int long long
struct edge{long long to,cost;};
typedef pair<int,int>P;
#define inf 1000000007
string alph("abcdefghijklmnopqrstuvwxyz");
signed main(){
    int n,m;cin>>n>>m;
    if(n%m==0){
       cout<<-1<<endl;
        return 0;
    }
    else rep(i,1,m){
        int h=n*1;
        if(h%m!=0){
            cout<<h<<endl;
            return 0;
        }
    }
    return 0;
}


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

using ll = long long;

using namespace std;

#define amin(a, b) a = min(a, b)

int main() {
    int n, q;
    cin >> n >> q;
    set<int> bot_idx, left_idx;
    bot_idx.insert(n), left_idx.insert(n);
    vector<int> bot_lim(n+1, n), left_lim(n+1, n);
    ll ans = ll(n-2) * (n-2);
    for (int i=0, t, x; i<q; i++) {
        cin >> t >> x;
        if (t == 1) {
            int a = *bot_idx.lower_bound(x);
            int cnt = bot_lim[a] - 1;
            ans -= cnt - 1;
            left_idx.insert(cnt);
            amin(left_lim[cnt], x);
            // cerr << t << ' ' << cnt << ' ' << a << '\n';
        } else {
            int a = *left_idx.lower_bound(x);
            int cnt = left_lim[a] - 1;
            ans -= cnt - 1;
            bot_idx.insert(cnt);
            amin(bot_lim[cnt], x);
            // cerr << t << ' ' << cnt << ' ' << a << '\n';
        }
    }
    cout << ans << '\n';
    return 0;
}

Measured memory_bytes: 8744
#include <cstdio>
#include <cstdlib>
#include <cstring>
#define REP(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) REP(i, 0, (n))
bool osenbei[10][10000];
int main()
{
    int r, c;
    while (scanf("%d%d",&r,&c),r|c) {
        int t;
        rep(i, r) rep(j, c) { scanf("%d", &t); osenbei[i][j] = t; }

        int res = 0;
        rep(i, (1<<r)) {
            rep(j, r) if ((i >> j) & 1)
                rep(k, c) osenbei[j][k] = !osenbei[j][k];

            int tmp = 0;
            rep(l, r) rep(j, c) tmp += !osenbei[l][j];

            rep(j, c) {
                int cnt = 0;
                rep(l, r) cnt += osenbei[l][j];
                if (r - cnt < cnt) tmp += 2 * cnt - r;
            }
            if (res < tmp) res = tmp;

            rep(j, r) if ((i >> j) & 1)
                rep(k, c) osenbei[j][k] = !osenbei[j][k];
        }
        printf("%d\n", res);
    }
    return 0;
}

Measured memory_bytes: 860
using System;
using System.Collections.Generic;
using System.Text;

namespace AtTest._400Problems_remain_
{
    class CF2017C_C
    {
        static void Main(string[] args)
        {
            Method(args);
            Console.ReadLine();
        }

        static void Method(string[] args)
        {
            string s = Read();
            string canS = s.Replace("x", "");
            for (int i = 0; i < canS.Length; i++)
            {
                if (canS[i] != canS[canS.Length - 1 - i])
                {
                    Console.WriteLine(-1);
                    return;
                }
            }
            int[] xCnts = new int[canS.Length + 1];
            int now = 0;
            for(int i =0; i < s.Length; i++)
            {
                if (s[i] == 'x') xCnts[now]++;
                else now++;
            }
            int res = 0;
            for (int i = 0; i < xCnts.Length / 2; i++)
            {
                res += Math.Abs(xCnts[i] - xCnts[xCnts.Length - 1 - i]);
            }
            Console.WriteLine(res);
        }

        private static string Read() { return Console.ReadLine(); }
        private static int ReadInt() { return int.Parse(Read()); }
        private static long ReadLong() { return long.Parse(Read()); }
        private static double ReadDouble() { return double.Parse(Read()); }
        private static int[] ReadInts() { return Array.ConvertAll(Read().Split(), int.Parse); }
        private static long[] ReadLongs() { return Array.ConvertAll(Read().Split(), long.Parse); }
        private static double[] ReadDoubles() { return Array.ConvertAll(Read().Split(), double.Parse); }
    }
}


Measured memory_bytes: 15224
#include "iostream"
using namespace std;

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

	for(i = n-1; i > 0;i--){
		cout << a[i] << " ";
	}
	cout << a[0];

	cout << endl;
	return 0;
}


Measured memory_bytes: 3080
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int N,con=0;
    cin>>N;
    string S;
    cin>>S;
    
    for(int i=0;i<N-1;i++){
        if(S[i]==S[i+1]){
            con++;
        }
    }
    cout<<N-con;
    
}


Measured memory_bytes: 512
#include <iostream>
#include <fstream>
#include <vector>
#include <set>
#include <algorithm>
#include <queue>
#include <map>
#include <unordered_map>
#include <random>
#include <cstdio>
#include <cstring>
#include <cmath>

using namespace std;
using ll = long long;

ll N;
vector<pair<ll, ll>> xy;

void input() {
    cin >> N;
    xy.resize(N);
    for (ll i = 0; i < N; i++) {
        ll x, y;
        cin >> x >> y;
        xy[i] = {x, y};
    }
}

void solve() {
    vector<ll> parities;
    set<ll> pset;
    for (auto pair : xy) {
        auto p = abs(pair.first + pair.second) % 2;
        parities.push_back(p);
        pset.insert(p);
    }
    if (pset.size() != 1) {
        cout << -1 << endl;
        return;
    }
    const ll MAXU = 31;
    vector<ll> arms;
    if (pset.find(0) != pset.end()) {
        arms.push_back(1);
    }
    for (ll i = 0; i <= MAXU; i++) {
        arms.push_back(1ull << i);
    }
    
    auto M = arms.size() - (parities[0] == 0 ? 1 : 0);
    cout << arms.size() << endl;
    for (auto arm : arms) {
        cout << arm << ' ';
    }
    cout << endl;
    
    for (ll i = 0; i < N; i++) {
        string dirs;
        string dir_type = "LDUR";
        auto x = xy[i].first, y = xy[i].second;
        if (parities[i] == 0) {
            x--;
            dirs.push_back('R');
        }
        auto u = ((x + y) >> 1) + (1ull << MAXU);
        auto v = ((x - y) >> 1) + (1ull << MAXU);
        for (ll r = 0; r < M; r++) {
            dirs.push_back(dir_type[(u>>r & 1)*2 + (v>>r & 1)]);
        }
        
        cout << dirs << endl;
    }
}


int main() {
    input();
//    cout << solve() << endl;
    solve();
    
    return 0;
}



Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, a, b) for (int i = a; i < b; i++)
#define all(v) v.begin(), v.end()
const int MOD = 1e9 + 7;
const int INF = 1e9;
//'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122

int main() {
    int n, d;
    cin >> n >> d;
    int x[n][d];
    rep(i, 0, n) {
        rep(j, 0, d) {
            cin >> x[i][j];
        }
    }

    int ans = 0;
    rep(i, 0, n - 1) {
        rep(j, i + 1, n) {
            int sum = 0;
            rep(k, 0, d) {
                sum += (x[i][k] - x[j][k]) * (x[i][k] - x[j][k]);
            }
            rep(l, 0, 200) {
                if (l * l == sum) {
                    ans++;
                    break;
                }
            }
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for(ll i = 0; i < (ll)n; i++)
#define FOR(i, a, b) for(ll i = (a); i < (ll)b; i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define INF (1ll << 60)
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
using vl = vector<ll>;
using vvl = vector<vl>;
typedef double db;
typedef string str;
typedef pair<ll, ll> p;
constexpr int MOD = 1000000007;
using ll = long long;
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;
}

void print(const std::vector<int> &v) {
    std::for_each(v.begin(), v.end(), [](int x) { std::cout << x << " "; });
    std::cout << std::endl;
}

int main() {
    int N;
    cin >> N;
    vector<string> s(N);
    vector<long long> t(N);
    string X;
    REP(i, N) { cin >> s[i] >> t[i]; }
    cin >> X;
    ll res = 0;
    bool flag = false;

    REP(i, N) {
        if(s[i] == X) {
            flag = true;
            continue;
        }
        if(flag) {
            res += t[i];
        }
    }
    cout << res << endl;
    return 0;
}

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

int main(void){
    int a[3],i,j,w;
    
    for(i=0; i<3; i++)
        scanf("%d",&a[i]);

    for(i=0; i<3; i++){
        for(j=2; j>0; j--){
            if(a[j-1]<a[j]){
                w=a[j];
                a[j]=a[j-1];
                a[j-1]=w;
            }
        }
    }
    printf("%d\n",abs(a[1]-a[0])+abs(a[2]-a[1]));
        
    return 0;
}


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

using namespace std;

#define ll long long int

int main (){

    int a,b,x,y,z,d,res;

    cin>>a>>b;

    x=a+b;
    y=a-b;
    z=max(x,y);
    d=a*b;
    res=max(z,d);

    cout<<res<<endl;

    return 0;

}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
using namespace::std;
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/numeric/interval.hpp>
#include <boost/numeric/interval/io.hpp>
#include <boost/intrusive/rbtree.hpp>
#include <boost/geometry.hpp>
#include <boost/geometry/geometries/linestring.hpp>
#include <boost/geometry/geometries/polygon.hpp>
#include <boost/geometry/geometries/point_xy.hpp>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/tag_and_trait.hpp>
using namespace __gnu_pbds;
using namespace::std;
namespace mp = boost::multiprecision;
typedef mp::number<mp::cpp_dec_float<0>> cfloat;
typedef mp::cpp_int cint;
typedef long long lint;
typedef long long ll;
typedef long double ldouble;
typedef vector<lint> vec;
typedef vector<vector<lint>> mat;
typedef vector<vector<vector<lint>>> mat3;
typedef vector<double> dvec;
typedef vector<vector<double>> dmat;
typedef vector<vector<vector<double>>> dmat3;
typedef vector<string> svec;
typedef vector<vector<string>> smat;
typedef vector<vector<vector<string>>> smat3;
typedef vector<pair<lint,lint>> pvec;
typedef vector<vector<pair<lint,lint>>> pmat;
typedef vector<vector<vector<pair<lint,lint>>>> pmat3;
#define rep(i, n) for(lint i = 0; i < (lint)(n); i++)
#define irep(i) for(lint i = 0;; i++)
#define irep1(i) for(lint i = 1;; i++)
#define irep2(i) for(lint i = 2;; i++)
#define rrep(i, n) for(lint i = (lint)(n-1); i >-1; i--)
#define rrepi(i,a,b) for(lint i = (lint)(b-1); i >a-1; i--)
#define repi(i,a,b) for(lint i=lint(a);i<lint(b);i++)
#define rep2(i,a,b,c) for(lint i=lint(a);i>lint(b);i+=c)
#define all(x) (x).begin(),(x).end()
#define PI 3.141592653589793
#define dist(x1,y1,x2,y2) (pow(pow(x2-x1,2)+pow(y2-y1,2),0.5))
#define output(v) do{bool f=0;for(auto i:v){cout<<(f?" ":"");if(i>INF/2)cout<<"INF";else cout<<i;f=1;}cout<<"\n";}while(0)
#define output2(v) for(auto j:v)output(j);
#define input(a,n) lint n;cin>>n;vector<lint>a(n);rep(i,n)cin>>a[i];
#define SUM(v) accumulate(all(v),0LL)
#define INF (1LL<<60)
#define IINF (1<<30)
#define EPS (1e-10)
#define LINF 9223372036854775807
#define MOD 1000000007
#define endl "\n"
template<typename T=lint>T in(){return *istream_iterator<T>(cin);}
inline lint gcd(lint a,lint b){return b?gcd(b,a%b):a;}
inline lint lcm(lint a,lint b){return a*b/gcd(a,b);}
inline bool chmin(auto& s,const auto& t){bool res=s>t;s=min(s,t);return res;}
inline bool chmax(auto& s,const auto& t){bool res=s<t;s=max(s,t);return res;}
vector<lint> dx={-1,1,0,0,1,1,-1,-1};
vector<lint> dy={0,0,-1,1,1,-1,1,-1};

int main(){
    lint n;
    cin>>n;
    cout<<(lint)pow(n,3);
}

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

using namespace std;

int main() {
    int N, K, Q;
    cin >> N >> K >> Q;
    vector<int> v(N, K - Q);
    int A;
    for (int i = 0; i < Q; i ++) {
        cin >> A;
        v.at(A - 1)++;
    }
    for (int i = 0; i < N; i++) {
        if (v.at(i) > 0) {
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    }
}


Measured memory_bytes: 1024
import java.util.*;
class Main{
    public static void main(String[] args){
	Scanner stdIn = new Scanner(System.in);
        int A = stdIn.nextInt();
	int B = stdIn.nextInt();
	int T = stdIn.nextInt();
	//double t=T+0.5;
	int s =T/A;
	System.out.println(s*B);
    }
}


Measured memory_bytes: 21972
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())

menu = [a,b,c,d,e]
mlt = [0]*5
mod = [0]*5
for i in range(5):
    mlt[i] = menu[i] // 10
    mod[i] = menu[i] % 10
    if mod[i] == 0:
        mod[i] = 10

ans = 0
t = 0
for i in range(5):
    if mod[i] == min(mod) and t == 0:
        t = 1
        ans += menu[i]
    elif mod[i] == 10:
        ans += mlt[i]*10
    else:
        ans += (mlt[i]+1)*10


print(ans)

Measured memory_bytes: 3064
#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<queue>
#include<deque>
#include<random>
#include<map>

using namespace std;
typedef long long int ll;
 
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define rep_r(i,n) for(int i=((int)(n)-1);i>=0;--i)
#define FOR(i,m,n) for(int i=((int)(m));i<(int)(n);++i)
#define FOR_R(i,m,n) for(int i=((int)(m)-1);i>=(int)(n);--i)
#define all(x) (x).begin(), (x).end()
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define vp vector<pii>
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define INF 1e9
#define LLINF 1e18
#define PI (acos(-1))
#define MOD 1e9+7
 
int main(){
	int n;
	cin >> n;
	vi v(n);
	rep(i ,n) cin >> v[i];
	sort(all(v));
	
	int ans = 0;
	rep(i ,n - 2){
		int a = v[i];
		
		for(int j = i + 1;j < n - 1; j++){
			int b = v[j];
			
			for(int k = j + 1; k < n; k++){
				int c = v[k];
				
				if(c < a + b)
					ans++;
				else
					break;
			}
		}
	}
	
	cout << ans << endl;
	
	return 0;
}
					
	
	
	

Measured memory_bytes: 256