akhauriyash/Code-Regression huggingface dataset:
// https://atcoder.jp/contests/abc174/tasks/abc174_a

#include "algorithm"
#include "bitset"
#include "cmath"
#include "functional"
#include "iomanip"
#include "iostream"
#include "map"
#include "numeric"
#include "queue"
#include "set"
#include "string"
#include "vector"
#define rep(i, to) for (ll i = 0; i < (to); ++i)
#define rep1(i, to) for (ll i = 1; i <= (to); ++i)
#define repf(i, from, to) for (ll i = from; i < (to); ++i)
#define repr(i, from) for (ll i = from - 1; i >= 0; --i)
#define all(vec) vec.begin(), vec.end()
#define unless(cond) if (!(cond))
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef long double ld;
template <typename T>
using V = vector<T>;
using VL = V<ll>;
using VVL = V<VL>;
template <typename T, typename U>
using P = pair<T, U>;
using PL = P<ll, ll>;
using VPL = V<PL>;

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

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

template <typename T>
inline ll len(V<T> arr) {
  return arr.size();
}

struct exit_exception : public std::exception {
  const char* what() const throw() { return "Exited"; }
};

template <typename T>
void drop(T res) {
  cout << res << endl;
  throw exit_exception();
}

const ll INF = 1e18;

void solve();

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

  try {
    solve();
  } catch (exit_exception& e) {
  }

  return 0;
}
#endif

void solve() {
  ll X;
  cin >> X;

  if (X >= 30) drop("Yes");
  drop("No");
}


Measured memory_bytes: 3668
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<string>
#include<iostream>
#include<sstream>
#include<set>
#include<map>
#include<queue>
#include<bitset>
#include<vector>
#include<limits.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define RI(X) scanf("%d", &(X))
#define RII(X, Y) scanf("%d%d", &(X), &(Y))
#define RIII(X, Y, Z) scanf("%d%d%d", &(X), &(Y), &(Z))
#define DRI(X) int (X); scanf("%d", &X)
#define DRII(X, Y) int X, Y; scanf("%d%d", &X, &Y)
#define DRIII(X, Y, Z) int X, Y, Z; scanf("%d%d%d", &X, &Y, &Z)
#define RS(X) scanf("%s", (X))
#define CASET int ___T; scanf("%d", &___T); for(int cs=1;cs<=___T;cs++)
#define MP make_pair
#define PB push_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define PII pair<int,int>
#define VI vector<int>
#define VL vector<long long>
#define VPII vector<pair<int,int>>
#define PLL pair<long long,long long>
#define VPLL vector<pair<long long,long long>>
#define F first
#define S second
typedef long long LL;
using namespace std;
const int MOD = 1e9+7;
const int SIZE = 1e5+10;
bool dp[SIZE][50];
PII bfs[SIZE*45];
int main(){
    DRI(K);
    int rr=0;
    REPP(i,1,10){
        bfs[rr++]=MP(i%K,i);
    }
    REP(i,rr){
        int r,s;
        tie(r,s)=bfs[i];
        REP(j,10){
            if(s+j>45)continue;
            int nxt_r=(r*10+j)%K;
            if(!dp[nxt_r][s+j]){
                dp[nxt_r][s+j]=1;
                bfs[rr++]=MP(nxt_r,s+j);
            }
        }
    }
    int an=0;
    while(!dp[0][an])an++;
    printf("%d\n",an);
    return 0;
}


Measured memory_bytes: 40320
#include <iostream>
using namespace std;
long long solve(long long x, long long n){
    if (x == 0)
        return 0;
    if (x <= n / 2)
        return n + solve(n - 2 * x, n - x);
    else{
        long long cnt = x / (n - x);
        return 2 * cnt * (n - x) + solve(x - cnt * (n - x), n - cnt * (n - x));
    }
}
int main(){
    long long n, x;
    cin >> n >> x;
    cout << x + solve(x, n) << endl;
}


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

typedef long long ll;
#define REP(i,n) for(int i=0,_n=(int)(n);i<_n;++i)
#define ALL(v) (v).begin(),(v).end()
#define CLR(t,v) memset(t,(v),sizeof(t))
template<class T1,class T2>ostream& operator<<(ostream& os,const pair<T1,T2>&a){return os<<"("<<a.first<<","<<a.second<< ")";}
template<class T>void pv(T a,T b){for(T i=a;i!=b;++i)cout<<(*i)<<" ";cout<<endl;}
template<class T>void chmin(T&a,const T&b){if(a>b)a=b;}
template<class T>void chmax(T&a,const T&b){if(a<b)a=b;}


int nextInt() { int x; scanf("%d", &x); return x;}

int main2() {
  int A = nextInt();
  int B = nextInt();
  int C = nextInt();
  int D = nextInt();
  int E = nextInt();
  int F = nextInt();

  int ans1 = A*100;
  int ans2 = 0;
  for (int a = 0; a*A*100 <= F; a++) {
    for (int b = 0; a*A*100 + b*B*100 <= F;b++) {
      int water = a*A*100 + b*B*100;
      if (water == 0) continue;
      for (int c = 0; water + c*C <= F; c++) {
        for (int d = 0; water + c*C + d*D <= F; d++) {
          int suger = c*C + d*D;
          int suger_and_water = suger + water;
          if ( E * suger_and_water >= suger * (100+E) ) {
            if (ans2 * suger_and_water < suger * ans1 ) {
              ans1 = suger_and_water;
              ans2 = suger;
            }
          }
        }
      }
    }
  }
  cout << ans1 << " " << ans2 << endl;
  return 0;
}

int main() {
  for (;!cin.eof();cin>>ws)
    main2();
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#define rep(i,n) for(long long i=0;i<n;i++)

using namespace std;
using ll = long long;

int main(void)
{
    int a,b,c;
    cin >> a >> b >> c;
    if(a==b)
    {
        if(a!=c) cout << "Yes" << endl;
        else cout << "No" << endl;
    }else{
        if(a==c || b==c) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")




n,a,b = map(int, input().split())
M = 10**9+7
N = 2*10**5+3 # 必要なテーブルサイズ

def cmb(n, r, M):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return (g1[n] * g2[r] * g2[n-r]) % M

g1 = [None] * (N+1) # 元テーブル
g2 = [None] * (N+1) #逆元テーブル
inverse = [None] * (N+1) #逆元テーブル計算用テーブル
g1[0] = g1[1] = g2[0] = g2[1] = 1
inverse[0], inverse[1] = [0, 1] 

for i in range( 2, N + 1 ):
    g1[i] = ( g1[i-1] * i ) % M 
    inverse[i] = ( -inverse[M % i] * (M//i) ) % M # ai+b==0 mod M <=> i==-b*a^(-1) <=> i^(-1)==-b^(-1)*aより
    g2[i] = (g2[i-1] * inverse[i]) % M 

def cmb2(n,r,M):
    res = 1
    for i in range(r):
        res *= (n-i)
        res %= M
#     print(res)
    res *= g2[r]
    res %= M
    return res
    
ans = pow(2, n, M) - cmb2(n,a,M) - cmb2(n,b,M) - 1
print(ans%M)

Measured memory_bytes: 85328
void main() {
	writeln(ri^^3);
}

// ===================================

import std.stdio;
import std.string;
import std.functional;
import std.conv;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}


Measured memory_bytes: 2484
#include <iostream>
#include <algorithm>
#include <math.h>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <utility>
#include <iomanip>  // std::setprecision()
using namespace std;
using ll = long long;
#define rep(i,a,b) for(ll i=(a); i<(b); i++)
#define YES cout << "YES" << endl;
#define NO cout << "NO" << endl;
#define yes cout << "Yes" << endl;
#define no cout << "No" << endl;
#define pai 3.14159265358979323846
ll gcd(ll a, ll b){if (a%b == 0)  return(b);else  return(gcd(b, a%b));}
ll lcm(ll a, ll b){return a * b / gcd(a, b);}
/* map<string,int> */
/* 大文字を小文字に変換 tolower*/
/* 小文字を大文字に変換 toupper*/
/* 辞書順 next_permutation(a.begin(),a.end()) */
 
int main() {
   int n;
   cin >> n; 
   vector <char> a(n);
   int rc = 0,wc = 0;
   rep(i,0,n) {
       cin >> a[i];
       if (a[i] == 'R') rc++;
       if (a[i] == 'W') wc++;
   }
   if (rc ==0 || wc== 0) {
       cout << 0 <<endl;
       return 0;
   }
   int count =0;
   for (int i =0; i < rc; i++) {
       if(a[i] == 'W') {
           count++;
       }
   }
   cout << count << endl;

}

Measured memory_bytes: 3228
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <math.h>

// ===============================================================
//using系

using namespace std;
using ll = long long;
using vl = vector<long long>;
using vvl = vector<vector<long long>>;
using vvi = vector<vector<int>>;
using Graph = vvi;
using vs = vector<string>;
using vc = vector<char>;
using vcc = vector<vector<char>>;
using vm = vector<short>;
using vmm = vector<vector<short>>;
using pii = pair<int, int>;
using psi = pair<string, int>;
using ld = long double;
using ull = unsigned long long;
using ui = unsigned int;
using qul = queue<ll>;
using pql = priority_queue<ll>;
using kaage = priority_queue<int, vector<int>, greater<int>>;
int dx[] = { 1,0,-1,0 };
int dy[] = { 0,1,0,-1 };
constexpr ll mod = 1e9 + 7;

// ========================================================================
//define系

#define int long long
#define rep(i, n) for(ll i = 0; i < n; i++)
#define REP(i, n) for(ll i = 1; i <= n; i++)

// ========================================================================


ll gcd(ll a, ll b)
{
	if (a % b == 0)
	{
		return(b);
	}
	else
	{
		return(gcd(b, a % b));
	}
}
//最大公約数
ll lcm(ll a, ll b)
{
	return a * b / gcd(a, b);
}
//最小公倍数
ll box(double a)
{
	ll b = a;
	return b;
}
//切り捨て
ll fff(double a)
{
	ll b = a + 0.5;
	return b;
}
//四捨五入
ll mch(ll n) {
	if (n == 1) return 1;
	else return n * mch(n - 1);
}
//1から整数nまでの階乗を出す(INFで割っていない)
bool prime(ll a)//素数判定、primeならtrue,違うならfalse
{
	if (a < 2) return false;
	else if (a == 2) return true;
	else if (a % 2 == 0) return false;
	double m = sqrt(a);
	for (int i = 3; i <= m; i += 2)
	{
		if (a % i == 0)
		{
			return false;
		}
	}

	// 素数である
	return true;
}
//素数判定
ll modpow(ll a, ll n, ll mod) {
	ll hi = 1;
	while (n > 0) {
		if (n & 1) hi = hi * a % mod;
		a = a * a % mod;
		n >>= 1;
	}
	return hi;
}
//いろいろやります（ただの前座）
ll mg(ll a, ll mod) {
	return modpow(a, mod - 2, mod);
}
//割り算の10^9+7等対策で逆元を出します 


// ========================================================================


//ある程度のテンプレ
//これとBFS、あとその時その時で使うものはここに書く


// ========================================================================


signed /*int*/ main() {
	ll a, b, c, d; cin >> a >> b >> c >> d;
	for (int i = 0; i < 1000; i++) {
		c -= b;
		if (c <= 0) {
			cout << "Yes" << endl;
			break;
		}
		a -= d;
		if (a <= 0) {
			cout << "No" << endl;
			break;
		}
	}

	return 0;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep1(i, n) for(int i = 1; i < n+1; i++)
#define sort(A) sort(A.begin(),A.end())
#define reverse(A) reverse(A.begin(),A.end());
#define vecmin(A) *min_element(A.begin(),A.end());
#define vecmax(A) *max_element(A.begin(),A.end());
typedef long long ll;

ll sum(ll n){
  return n*(n+1)/2;
}

ll f(ll n,ll k){
  ll left = sum(n)-sum(n-k);
  ll right = sum(k-1);
  return left - right + 1;
}

int main(){
  ll n,k;
  cin >> n >> k;
  ll ans = 0;
  for(ll i=k;i<=n+1;i++){
    ans += f(n,i);
    ans %= 1000000007;
  }
  cout << ans << endl;
}


Measured memory_bytes: 3636
#include <iostream>
#include <string>
#include <vector>
#include <climits>
#include <set>
#include <algorithm>
#include <unordered_map>
#include <queue>
#include <iomanip>
#include <map>
#include <utility>
#include <numeric>

#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define P pair<int, int>
#define debug(x) cout << #x << ": " << x << ", "
#define debugln(x) cout << #x << ": " << x << '\n'

using namespace std;
using ll = long long;

const int mod = 1e9+7;

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  ll X, Y;
  cin >> X >> Y;

  string ans;
  if (abs(X-Y) >= 2) {
    ans = "Alice";
  } else {
    ans = "Brown";
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
#include <vector>

int a[4],b[4];
int main(){
  float f;
  std::vector<float>v;
  for(;~scanf("%f",&f);)v.push_back(f);
  std::sort(v.begin(),v.end());
  printf("%.2f\n",v[v.size()-1]-v[0]);
}

Measured memory_bytes: 1096
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<(b);++i)
#define erep(i,a,b) for(int i=a;i<=(int)(b);++i)
#define per(i,a,b) for(int i=(b);i>(a);--i)
#define eper(i,a,b) for(int i=((int)(a));i>=b;--i)
#define pb push_back
#define mp make_pair
#define INF 2000000000
#define MOD 1000000007
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int dy[]={0, 0, 1, -1};
int dx[]={1, -1, 0, 0};
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a/gcd(a, b)*b;}

int N, C, imos[200002], sum[200002];
int main() {
 ios::sync_with_stdio ( false );
 cin.tie ( 0 );
    cin >> N >> C;
    vector<int> s(N), t(N), c(N);
    rep(i, 0, N) cin >> s[i] >> t[i] >> c[i];
    rep(i, 1, C+1) {
        rep(j , 0, 200002) imos[j] = 0;
        rep(j , 0, N) {
            if (c[j] == i) {
                imos[2*s[j]-1]++;
                imos[2*t[j]]--;
            }
        }
        rep(k, 1, 200002) 
            imos[k] += imos[k-1];
        rep(k, 0, 200002)
            if (imos[k] > 0)
                sum[k]++;
    }
    int ans = 0;
    rep(i, 0, 200002) {
        if (ans < sum[i]) ans = sum[i];
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3072
import java.util.Scanner;

public class Main {

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

		String month = scan.next();

		if(month.equals("SUN"))		System.out.println("7");
		else if(month.equals("MON"))		System.out.println("6");
		else if(month.equals("TUE"))		System.out.println("5");
		else if(month.equals("WED"))		System.out.println("4");
		else if(month.equals("THU"))		System.out.println("3");
		else if(month.equals("FRI"))		System.out.println("2");
		else if(month.equals("SAT"))		System.out.println("1");

	}

}


Measured memory_bytes: 21588
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <numeric>
#include <set>
#include <list>
#include <bitset>
#include <cstdlib>
#include <map>
using ll = long long int;
using namespace std;

int main()
{
    ll A, B, C, ans = 0;
    cin >> A >> B >> C;
    if (C <= (A + B))
    {
        ans = B + C;
    }
    else
    {
        ans = A + B * 2 + 1;
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
use std::io::{stdin, Read};

macro_rules! parse {
    ($it: ident ) => {};
    ($it: ident, ) => {};
    ($it: ident, $var:ident : $t:tt $($r:tt)*) => {
        let $var = parse_val!($it, $t);
        parse!($it $($r)*);
    };
    ($it: ident, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = parse_val!($it, $t);
        parse!($it $($r)*);
    };
}

macro_rules! parse_val {
    ($it: ident, [$t:tt; $len:expr]) => {
        (0..$len).map(|_| parse_val!($it, $t)).collect::<Vec<_>>();
    };
    ($it: ident, ($($t: ty),*)) => {
        ($(parse_val!($it, $t)),*)
    };
    ($it: ident, $t: ty) => {
        $it.next().unwrap().parse::<$t>().unwrap()
    };
}

fn solve(s: &str) {
    let mut it = s.split_whitespace();
    parse!(it, s: usize, w: usize);
    if s <= w {
        println!("unsafe");
    } else {
        println!("safe");
    }
}

fn main() {
    let mut s = String::new();
    stdin().read_to_string(&mut s).unwrap();
    solve(&s);
}

#[cfg(test)]
mod tests {
    use super::*;
    #[test]
    fn test_input() {
        let s = "
        ";
        solve(s);
    }
}


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

int main(){
    long N;
    cin >> N;
    deque<long> A(N);
    for(auto& i : A)cin >> i;
    sort(rbegin(A), rend(A));
    long a(accumulate(begin(A), end(A), 0L));
    for(int i = 0; i < N; ++i){
        a -= A[i];
        if(A[i] > 2 * a)return 0 & printf("%ld\n", i + 1);
    }
    return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
int a[10];
bool first=false;
int main()
{
    int n;
    cin>>n;
    for(int i=0;i<n;i++)
    {
        a[i]=i+1;
    }
    do
    {
        first=false;
        for(int i=0;i<n;i++)
        {
            if(first==false)
            {
                cout<<a[i];
                first=true;
            }else
            {
                cout<<" "<<a[i];
            }
        }
        puts("");
    }while(next_permutation(a,a+n));
    return 0;
}



Measured memory_bytes: 3092
#include<bits/stdc++.h>
#define randome_generate srand(std::chrono::high_resolution_clock::now().time_since_epoch().count())
using namespace std;
int n;
char mb3[4][4]={
	{".aa"},
	{"a.."},
	{"a.."}
};
char mb4[5][5]={
	{"aabc"},
	{"ccbc"},
	{"badd"},
	{"bacc"}
};
char mb5[6][6]={
	{"aabba"},
	{".bc.a"},
	{"cbc.."},
	{"c.dbb"},
	{"aadcc"}
};
char mb6[7][7]={
	{"caac.."},
	{"c..caa"},
	{"baab.."},
	{"b..baa"},
	{"caac.."},
	{"c..caa"}
};
char mb7[8][8]={
	{"aabbcc."},
	{"dd.dd.a"},
	{"..d..da"},
	{"..d..db"},
	{"dd.dd.b"},
	{"..d..dc"},
	{"..d..dc"}
};
char canvas[1200][1200];
void paint3(int x,int y){
	for(int i=0;i<3;i++)
		for(int j=0;j<3;j++)
			canvas[i+x][j+y]=mb3[i][j];
}
void paint4(int x,int y){
	for(int i=0;i<4;i++)
		for(int j=0;j<4;j++)
			canvas[i+x][j+y]=mb4[i][j];
}
void paint5(int x,int y){
	for(int i=0;i<5;i++)
		for(int j=0;j<5;j++)
			canvas[i+x][j+y]=mb5[i][j];
}
void paint6(int x,int y){
	for(int i=0;i<6;i++)
		for(int j=0;j<6;j++)
			canvas[i+x][j+y]=mb6[i][j];
}
void paint7(int x,int y){
	for(int i=0;i<7;i++)
		for(int j=0;j<7;j++)
			canvas[i+x][j+y]=mb7[i][j];
}
void painter(int id,int x,int y){
	if(id==3)
		paint3(x,y);
	if(id==4)
		paint4(x,y);
	if(id==5)
		paint5(x,y);
	if(id==6)
		paint6(x,y);
	if(id==7)
		paint7(x,y);
}
int main(){
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	cin>>n;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++)
			canvas[i][j]='.';
	}
	if(n==2){
		cout<<-1<<endl;
		return 0;
	}
	if(n==3){
		cout<<".aa"<<endl;
		cout<<"a.."<<endl;
		cout<<"a.."<<endl;
		return 0;
	}
	int x=n/4-1;
	int y=n-x*4;
	int xx=1,yy=1;
	for(int i=1;i<=x;i++){
		painter(4,xx,yy);
		xx+=4;
		yy+=4;
	}
	painter(y,xx,yy);
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++)
			cout<<canvas[i][j];
		cout<<endl;
	}
	return 0;
}


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

#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,f,n) for(int i=(f);i<(n);i++)


int main(void) {
	int n, x;
	cin >> n >> x;
	vector<int> m(n);
	rep(i, n) cin >> m[i];

	ll sum = 0;
	rep(i, n) sum += m[i];

	int minValue = 1e9;
	rep(i, n) minValue = min(minValue, m[i]);

	printf("%lld\n", n + ((x - sum) / minValue));
	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
using namespace std;

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

  int ans = a + b;
  ans = max(ans, a - b);
  ans = max(ans, a * b);

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


Measured memory_bytes: 256
#C
import sys
a, b, c, x, y = map(int,input().split())
ans = 0
if a + b <= 2*c:
    print(a*x + b*y)
else:
    ans += min(x,y) * 2*c
    r = max(x,y) - min(x,y)
    if max(x,y) == x:
        if a <= 2*c:
            ans += a*r
        else:
            ans += 2*c*r
    else:
        if b <= 2*c:
            ans += b*r
        else:
            ans += 2*c*r
    print(ans)

Measured memory_bytes: 38384
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors


N = int(input())
li = make_divisors(N)
ans = []
if len(li) % 2 == 1:
    ans.append(len(str(li[len(li)//2])))
else:
    ans.append(len(str(li[len(li) // 2])))
    ans.append(len(str(li[len(li) // 2 - 1])))
print(max(ans))


Measured memory_bytes: 64416
MD = [int(i) for i in input().split(' ')]
M = [int(i)+1 for i in range(MD[0])]
D = [int(i)+1 for i in range(MD[1])]

count = 0
for d in D:
    if d // 10 >= 2 and d % 10 >= 2:
        d2 = d // 10
        d1 = d % 10
        if d1*d2 in M:
            count+=1

print(count)

Measured memory_bytes: 61616
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops,fast-math")
#include <bits/stdc++.h>
using namespace std;
template<class t> inline t read(t &x){
	char c=getchar();bool f=0;x=0;
	while(!isdigit(c)) f|=c=='-',c=getchar();
	while(isdigit(c)) x=(x<<1)+(x<<3)+(c^48),c=getchar();
	if(f) x=-x;return x;
}
template<class t,class ...A> inline void read(t &x,A &...a){
	read(x);read(a...);
}
template<class t> inline void write(t x){
	if(x<0) putchar('-'),write(-x);
	else{if(x>9) write(x/10);putchar('0'+x%10);}
}

#define int long long

const int N=5005;
int f[N*N],n,a0,b0,c0,a1,b1,c1;

int dp(int n,int a0,int b0,int c0,int a1,int b1,int c1){
	memset(f,0,sizeof f);
	int res=n;
	for(int i=1;i<=n;i++){
		if(i>=a0) f[i]=f[i-a0]+a1;
		if(i>=b0) f[i]=max(f[i],f[i-b0]+b1);
		if(i>=c0) f[i]=max(f[i],f[i-c0]+c1);
		res=max(res,n-i+f[i]);
	}
	return res;
}

signed main(){
	read(n,a0,b0,c0,a1,b1,c1);
	write(dp(dp(n,a0,b0,c0,a1,b1,c1),a1,b1,c1,a0,b0,c0));
}

Measured memory_bytes: 199308
n = int(input())
a = [0] + list(map(int, input().split())) + [0]
c = 0
for i in range(n+1):
  c += abs(a[i+1]-a[i]) 
for i in range(1, n+1):
  print(c - abs(a[i+1]-a[i]) - abs(a[i]-a[i-1]) + abs(a[i+1]-a[i-1]))

Measured memory_bytes: 13916
#include<stdio.h>
#include<limits.h>
  
int MatrixChainOrder(int P[], int n){
  int i,j,k,l,q;
  int M[n+1][n+1];
  for(i=1;i<=n;i++) M[i][i]=0;
  for(l=2;l<=n;l++){
    for(i=1;i<=n-l+1;i++){
      j=i+l-1;
      M[i][j]=INT_MAX;
      for(k=i;k<=j-1;k++){
    q=M[i][k]+M[k+1][j]+P[i-1]*P[k]*P[j];
    M[i][j]=min(M[i][j],q);
      }
    }
  }
  return M[1][n];
}
  
int min(int a,int b){
  if(a>b)return b;
  else return a;
}
  
  
main(){
  int i,j,n;
  int P[10000];
  int *p;
  
  p=P;
  scanf("%d",&n);
  for(i=0;i<n;i++)scanf("%d %d",&P[2*i],&P[2*i+1]);
  for(i=1;i<2*n;i++){
    if(P[i]==P[i+1]){
      for(j=i+1;j<2*n;j++)P[j]=P[j+1];
    }
  }
  printf("%d\n",MatrixChainOrder(P,n));
  return 0;
}

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

int main(){
  int K,A,B;
  cin >> K >> A >> B;
  bool a=false;
  for(int i=A;i<B+1;i++){
    if(i%K==0){
      a=true;
    }
  }
  if(a){
    cout << "OK" << endl;
  }
  else{
    cout << "NG" << endl;
  }
}
    

Measured memory_bytes: 3636
#include<iostream>
using namespace std;
long long int a[100002];
int main()
{
    long long int n,i,q,b,c,d;
    long long int sum=0;
    cin>>n;
    for(i=0;i<n;i++)
    {
        cin>>d;
        sum+=d;
        a[d]++;
    }

    cin>>q;

    for(i=0;i<q;i++)
    {
        cin>>b>>c;
        sum-=(a[b]*b);
        sum+=(a[b]*c);
        a[c] = a[c] + a[b];
        a[b] = 0;
        cout<<sum<<endl;
    }

    return 0;
}


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

int main(void){

    int W, H, N;

    scanf("%d%d%d", &W, &H, &N);

    int x[N], y[N], a[N];

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

    int l = 0, r = W, b = 0, u = H;

    for(int i = 0; i < N; i++){
        if(a[i] == 1){
            if(l < x[i] && x[i] < r){
                l = x[i];
            }else if(x[i] >= r){
                l = r;
            }
        }else if(a[i] == 2){
            if(l < x[i] && x[i] < r){
                r = x[i];
            }else if(x[i] <= l){
                r = l;
            }
        }else if(a[i] == 3){
            if(b < y[i] && y[i] < u){
                b = y[i];
            }else if(y[i] >= u){
                b = u;
            }
        }else{
            if(b < y[i] && y[i] < u){
                u = y[i];
            }else if(y[i] <= b){
                u = b;
            }
        }
    }

    printf("%d\n", (r-l)*(u-b));

    return 0;
}

Measured memory_bytes: 1684
//#include<bits/stdc++.h>
#include<cstdio>
#include<algorithm>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please

const int cm = 1 << 17;
char cn[cm], * ci = cn + cm, ct;
inline char getcha() {
	if (ci - cn == cm) { fread(cn, 1, cm, stdin); ci = cn; }
	return *ci++;
}
inline int getint() {
	int A = 0;
	if (ci - cn + 16 > cm) while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';
	else while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';
	return A;
}

const int dm = 1 << 22;
char dn[dm], * di = dn;
char C[10];
int keta = 0;
inline void putint(int X) {
	keta = 0;
	while (X) {
		*(C + keta) = '0' + X % 10;
		X /= 10;
		keta++;
	}
	for (int i = keta - 1; i >= 0; i--)* di++ = (*(C + i));
	*di++ = '\n';
}
inline void putmae() {
	for (int i = keta - 1; i >= 0; i--)* di++ = (*(C + i));
	*di++ = '\n';
}

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


	int N = getint();
	int n = 1 << N;
	int dp1[1 << 18], dp2[1 << 18] = {};
	rep(i, n) dp1[i] = getint();

	rep(k, N) {
		int m = 1 << k;
		int m2 = ~(1 << k);
		for (int j = n - 1 & m2; j >= 0; j = j - 1 & m2) {
			int i = j | m;

			if (dp1[i] >= dp1[j]) {
				dp2[i] = max(dp2[i], dp1[j]);
			}
			else {
				dp2[i] = max(dp1[i], dp2[j]);
				dp1[i] = dp1[j];
			}
		}
	}

	int saidai = 0;
	rep1(i, n - 1) {
		if (saidai < dp1[i] + dp2[i]) {
			saidai = dp1[i] + dp2[i];
			putint(saidai);
		}
		else putmae();
	}
	fwrite(dn, 1, di - dn, stdout);

	Would you please return 0;
}

Measured memory_bytes: 9216
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
const string YES = "Yes";
const string NO = "No";

void solve(std::string S, std::string T){
    vector<vector<int>> sAlpha(26),tAlpha(26);
    for(int i=0;i<S.size();i++){
        int s = S[i] -'a';
        sAlpha[s].push_back(i);
    }
    set<char> alreadyChecked;
    for(int i=0;i<26;i++){
        if(sAlpha[i].size()==0){
            continue;
        }
        // cerr <<"i="<< i<<endl;
        char t = T[sAlpha[i][0]];
        if(alreadyChecked.find(t) != alreadyChecked.end()){
            cout << NO << endl;
            return;
        }
        // cerr <<"t=" << t << endl;
        for(int j=0;j<sAlpha[i].size();j++){
            // cerr <<"j=" << j << endl;
            if(T[sAlpha[i][j]]  != t){
                cout << NO <<endl;
                return;
            }
        }
        alreadyChecked.insert(t);
    }
    cout <<YES << endl;


}

// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    std::string S;
    std::cin >> S;
    std::string T;
    std::cin >> T;
    solve(S, T);
    return 0;
}


Measured memory_bytes: 2184
# -*- coding: utf-8 -*-
a,b = map(int, input().split())

def g(x):
    if x%2==1:
        return ((x+1)//2)%2
    else:
        return ((x//2)%2)^x

def f(a,b):
    return g(b) ^ g(a-1)

print(f(a,b))


Measured memory_bytes: 2940
import sys
from sys import stdin
input = stdin.readline

class BinaryTreeNode:
    def __init__(self, node):
        self.node = node
        self.left = None
        self.right = None

def Insert(parent, child):
    if parent.node > child.node:
        if parent.left != None:
            Insert(parent.left, child)
        else:
            parent.left = child
    else:
        if parent.right != None:
            Insert(parent.right, child)
        else:
            parent.right = child

def Find(root, key):
    if root.node == key:
        print("yes")
    elif root.left == None and key < root.node:
        print("no")
    elif root.right == None and root.node < key:
        print("no")
    else:
        if key < root.node:
            Find(root.left, key)
        else:
            Find(root.right, key)
        

IN_RESULT = []
def Inorder(root):
    if root.left == None:
        IN_RESULT.append(str(root.node))
        if root.right != None:
            Inorder(root.right)
    else:
        Inorder(root.left)
        IN_RESULT.append(str(root.node))
        if root.right != None:
            Inorder(root.right)
        else:
            pass
        
PRE_RESULT = []
def Preorder(root):
    PRE_RESULT.append(str(root.node))
    if root.left != None:
        Preorder(root.left)
    else:
        pass
    
    if root.right != None:
        Preorder(root.right)
    else:
        pass
    
n = int(input())

command = input()
if command[0] == "i":
    root = BinaryTreeNode(int(command[7:]))

for _ in range(n-1):
    command = input()
    if command[0] == "i":
        child = BinaryTreeNode(int(command[7:]))
        Insert(root, child)
    
    elif command[0] == "p":
        Inorder(root)
        Preorder(root)
        print(" "+" ".join(IN_RESULT))
        print(" "+" ".join(PRE_RESULT))
        IN_RESULT = []
        PRE_RESULT = []
    
    else:
        Find(root, int(command[5:]))


Measured memory_bytes: 148724
#include <bits/stdc++.h>
using namespace std;
 
#define ff first
#define ss second
#define mp(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define boost ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define check(x) cout << #x << " : " << (x) << endl
#define all(v) v.begin(),v.end() 
#define endl '\n'  
#define show(a) for(auto i:a) cout<<i<<" ";cout<<endl
typedef long long ll; 
typedef unsigned long long ull; 
typedef long double ld;
typedef pair< int , int > mypair;
typedef priority_queue <int> max_heap;
typedef priority_queue <int, vector<int>, greater<int> > min_heap;
const ll mod=1e9+7;
const ll inf=1e9;
const ll N=1e5+10;


int main()
{
	boost;
	ll a,b;
	cin>>a>>b;
	ll g=__gcd(a,b);
	vector<ll> fac;
	fac.pb(1);
	for(ll i=2;i*i<=g;i++)
	{
		if(g%i == 0) 
		{
			fac.pb(i);
			while(g%i==0) g/=i;
		}
	}
	if(g>1) fac.pb(g);
	cout<<fac.size();

   	return 0;
}

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

int main(){
  
  int N;
  int y;
  int max_num = -1000001;
  int min_num = 1000000;
  long long sum = 0;
  
  cin >> N;
  
  	for (int i = 0; i < N; i++) {
      cin >> y;
      
      max_num = max(max_num, y);
      min_num = min(min_num, y);
      sum += y;
    }
  	
    cout << min_num << " " << max_num << " " << sum << endl;
}




Measured memory_bytes: 3132
/*  -*- coding: utf-8 -*-
 *
 * f.cc: F - Laminate
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

const int MAX_N = 300;
const long long LINF = 1LL << 62;

/* typedef */

typedef long long ll;

/* global variables */

int hs[MAX_N + 1];
ll dp[MAX_N + 1][MAX_N + 1];

/* subroutines */

inline void setmin(ll &a, ll b) { if (a > b) a = b; }

/* main */

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

  hs[0] = 0;
  for (int i = 1; i <= n; i++) scanf("%d", hs + i);

  int m = n - k;
  for (int i = 0; i <= m; i++)
    fill(dp[i], dp[i] + n + 1, LINF);
  dp[0][0] = 0;

  for (int i = 0; i < m; i++)
    for (int j = 0; j < n; j++)
      if (dp[i][j] < LINF)
	for (int j1 = j + 1; j1 <= n; j1++)
	  setmin(dp[i + 1][j1], dp[i][j] + max(0, hs[j1] - hs[j]));

  ll mind = LINF;
  for (int j = 0; j <= n; j++) setmin(mind, dp[m][j]);

  printf("%lld\n", mind);
  return 0;
}


Measured memory_bytes: 896
#include <bits/stdc++.h>
using ll = long long;
// #define int ll
#define FOR(i, a, b) for (int i = (a); i < int(b); ++i)
#define RFOR(i, a, b) for (int i = (b)-1; i >= int(a); --i)
#define rep(i, n) FOR(i, 0, n)
#define rep1(i, n) FOR(i, 1, int(n) + 1)
#define rrep(i, n) RFOR(i, 0, n)
#define rrep1(i, n) RFOR(i, 1, int(n) + 1)
#define all(c) begin(c), end(c)
// const int MOD = 1000000007;

template <typename T>
void __print__(std::ostream &os, const char *, const char *tail, const T &fst) {
    os << fst << tail;
}
template <typename Fst, typename... Rst>
void __print__(std::ostream &os, const char *del, const char *tail, const Fst &fst,
               const Rst &... rst) {
    os << fst << del;
    __print__(os, del, tail, rst...);
}

#ifdef LOCAL
#define dump(...)                                         \
    do {                                                  \
        std::ostringstream os;                            \
        os << __LINE__ << ":\t" << #__VA_ARGS__ << " = "; \
        __print__(os, ", ", "\n", __VA_ARGS__);           \
        std::cerr << os.str();                            \
    } while (0)
#else
#define dump(...)
#endif

template <typename Fst, typename... Rst>
void println(const Fst &fst, const Rst &... rst) {
    __print__(std::cout, "\n", "\n", fst, rst...);
}
template <typename Fst, typename... Rst>
void print(const Fst &fst, const Rst &... rst) {
    __print__(std::cout, " ", "\n", fst, rst...);
}

template <typename iter>
void println_(iter bgn, iter end) {
    while (bgn != end) println(*bgn++);
}

template <typename iter>
void print_(iter bgn, iter end) {
    while (bgn != end) {
        std::cout << *bgn++;
        std::cout << (bgn == end ? "\n" : " ");
    }
}

int _ = (std::cout.precision(10), std::cout.setf(std::ios::fixed), std::cin.tie(0),
         std::ios::sync_with_stdio(0), 0);

template <typename T>
std::vector<T> ndarray(int n, T v) {
    return std::vector<T>(n, v);
}
template <typename... Args>
auto ndarray(int n, Args... args) {
    auto val = ndarray(args...);
    return std::vector<decltype(val)>(n, move(val));
}

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

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

using namespace std;

int main() {
    int q, h, s, d;
    while (cin >> q >> h >> s >> d) {
        vector<tuple<int, int, int>> v; // rel price, amount, price
        v.emplace_back(q * 8, 1, q);
        v.emplace_back(h * 4, 2, h);
        v.emplace_back(s * 2, 4, s);
        v.emplace_back(d * 1, 8, d);
        ll n;
        cin >> n;
        n *= 4;
        sort(all(v));
        ll res = 0;
        ll rem = n;
        for (auto &x : v) {
            ll p, v, rp;
            tie(p, v, rp) = x;
            ll k = rem / v;
            res += k * rp;
            rem -= k * v;
            if (rem == 0) break;
        }
        cout << res << endl;
    }
}


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

#define rep(i,x,y) for(ll i=(x);i<(y);i++)
#define rrep(i,x,y) for(ll i=(ll)(y)-1;i>=(x);i--)
#define all(x) (x).begin(),(x).end()
#define itrout(x) for(int i=0;i<x.size();i++) {cout << x[i] << (i==x.size()-1 ? "\n" : " ");}
#ifdef LOCAL
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl
#define debugbit(x, n) cerr << #x << " = " << bitset<n>(x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl
#define itrdebug(x) cerr << #x << " "; for (auto & el : (x)) {cerr << (el) << " ";} cerr << endl
#define dassert(...) assert(__VA_ARGS__)
#else
#define debug(x)
#define debugbit(x, n)
#define itrdebug(x)
#define dassert(...)
#endif
//#define int long long

typedef long long ll;
const ll MOD = 1e9 + 7;
const long double EPS = 1e-8;

void dfs(int h, int w, vector<vector<int>>& distance, int cost, const vector<vector<char>>& S, set<pair<int, int>>& next) {
    distance[h][w] = cost;
    next.insert({h, w});
    static vector<pair<int, int>> directions = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
    rep(i,0,4) {
        int nh = h + directions[i].first, nw = w + directions[i].second;
        if (S[nh][nw] == '.' && distance[nh][nw] == -1) {
            dfs(nh, nw, distance, cost, S, next);
        }
    }
}
void magic(int h, int w, vector<vector<int>>& distance, int cost, const vector<vector<char>>& S, set<pair<int, int>>& next) {
    rep(dh,-2,3) rep(dw, -2, 3) {
        int nh = h + dh, nw = w + dw;
        if (nh <= 0 || nh >= S.size()-1 || nw <= 0 || nw >= S[0].size()-1) continue;
        if (distance[nh][nw] != -1 || S[nh][nw] == '#') continue;
        distance[nh][nw] = cost+1;
        next.insert({nh, nw});
    }
}

signed main(){
    int H, W;
    cin >> H >> W;
    int ch, dh, cw, dw;
    cin >> ch >> cw >> dh >> dw;
    vector<vector<char>> S(H+2, vector<char>(W+2, '#'));
    rep(h,1,H+1) rep(w,1,W+1) cin >> S[h][w];
    vector<vector<int>> distance(H+2, vector<int>(W+2, -1));
    set<pair<int, int>> current, next;
    current.insert({ch, cw});
    rep(i,0,H*W+1) {
        for (const auto& cur : current) {
            dfs(cur.first, cur.second, distance, i, S, next);
        }
        if (distance[dh][dw] != -1) break;
        current = next;
        next.clear();
        for (const auto& cur : current) {
            magic(cur.first, cur.second, distance, i, S, next);
        }
        if (distance[dh][dw] != -1) break;
        current = next;
        next.clear();
    }
    cout << distance[dh][dw] << endl;
    return 0;
}


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

template <class T, class seq_t = std::vector<T>>
class Z_algorithm
{
    const seq_t key;
    const size_t len;
    std::vector<size_t> z;
    bool is_built;
  public:
    Z_algorithm(const seq_t &_key) : key(_key), len(_key.size()), is_built(false) {}

    const std::vector<size_t> &build()
    {
        assert(len);
        is_built = true;
        z.assign(len, 0);
        for(size_t i{1}, j{0}; i != len; ++i)
        {
            if(z[i - j] + i < z[j] + j)
            {
                z[i] = z[i - j];
            }
            else
            {
                size_t k{z[j] + j > i ? z[j] + j - i : 0};
                while(k + i < len && key[k] == key[k + i]) ++k;
                z[i] = k;
                j = i;
            }
        }
        z.front() = len;
        return z;
    }

    size_t size() const { return len; }
    size_t operator[](size_t i) const { return build(), z[i]; }

    std::vector<size_t> pattern_search(const seq_t &str) const
    {
        seq_t tmp(key);
        tmp.insert(end(tmp), begin(str), end(str));
        Z_algorithm other(tmp);
        const auto &nz = other.build();
        std::vector<size_t> res(nz.begin() + len, nz.end());
        for(size_t &x : res) if(x > len) x = len;
        return res;
    }
};

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

    int n; cin>>n;
    vector<int> a(n),b(n);
    for(int i=0; i<n; ++i)
    {
        cin>>a[i];
    }
    for(int i=0; i<n; ++i)
    {
        cin>>b[i];
    }
    vector<int> aa(n*2),bb(n);
    for(int i=0; i<n; ++i)
    {
        bb[i]=b[i]^b[(i+1)%n];
    }
    for(int i=0; i<n*2; ++i)
    {
        int ii=i%n;
        aa[i]=a[ii]^a[(ii+1)%n];
    }

    Z_algorithm<int> z(bb);

    auto pref(z.pattern_search(aa));

    for(int k=0; k<n; ++k)
    {
        if(pref[k]==bb.size())
        {
            cout << k << " " << (b[0]^a[k]) << "\n";
        }
    }
}

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

int main() {
    int N, T, A;
    cin >> N >> T >> A;
    vector<int> data(N);
    for (int i = 0; i < N; i++) {
        cin >> data.at(i);
    }
    double min = 10e6, diff;
    int num;

    for (int i = 0; i < N; i++) {
        diff = abs(T - data.at(i) * 0.006 - A);
        if (min > diff) {
            min = diff;
            num = i + 1;
        }
    }
    cout << num << endl;
}


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


int main()
{
    int N;
    bool ok = false;
    cin >> N;
    for (int i = 1; i <= 9;i++){
        if(N%i == 0){
            if(N/i>= 1 && N/i<=9){
                ok = true;
                break;
            }
        }
    }
    if(ok){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
}

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

int main()
{
  int a,b,c;
  int h,m,s;

  cin >> a >> b >> c;

  if(a < b && b < c){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  
  return 0;
} 

Measured memory_bytes: 1156
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <numeric>
#include <bitset>

using namespace std;
using ll = long long;
using ld = long double;
const ll mod =  1000000007;
const ll inf = 1e18;

#define REP(i, n) for (ll i = 0; i < (n); ++i)
#define REP_FROM(i, j, n) for (ll i = (j); i < (n); ++i)
#define all(x) (x).begin(),(x).end()

template<typename T> void print_vec(vector<T> a) {int n = a.size();REP(i, n) {cout >> a[i]; if(i!=n-1) cout << " "; else cout << endl;}}
ll power(ll base, ll exponent){ if(exponent % 2){ return power(base, exponent - 1) * base % mod; }else if(exponent){ ll root_ans = power(base, exponent / 2); return root_ans * root_ans % mod; }else{ return 1; }}
ll inverse(ll x){ return power(x, mod - 2);}
ll gcd(ll a, ll b) {if(a < b) gcd(b, a);ll r;while(r=a%b) {a=b;b=r;}return b;}
template<typename T> ll sum(T begin, T end) {return accumulate(begin, end, 0ll);}
struct combination{ vector<ll> fact, inv; combination(int sz) : fact(sz + 1), inv(sz + 1){ fact[0] = 1; for(int i = 1; i <= sz; i++){ fact[i] = fact[i - 1] * i % mod; } inv[sz] = power(fact[sz], mod - 2); for(int i = sz - 1; i >= 0; i--){ inv[i] = inv[i + 1] * (i + 1) % mod; } } ll C(int p, int q) const{ if(q < 0 || p < q) return 0; return (fact[p] * inv[q] % mod * inv[p - q] % mod); } };


int bsearch(const vector<ll>& a, ll x){
  int lft = 0;
  int rgt = a.size();
  while (rgt - lft > 1) {
    int mid = (lft + rgt) / 2;
    if(a[mid] < x) {
      lft = mid;
    }
    else {
      rgt = mid;
    }
  }
  return lft;
}

signed main() {
  ios::sync_with_stdio(false);
  ll a, b;
  cin >> a >> b;
  ll c = 1e9+1;
  REP(k, c) {
    if(abs(a -k) == abs(b-k)) {
      cout << k << endl;
      return 0;
    }
  }
  cout << "IMPOSSIBLE" << endl;
  return 0; 
}


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

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        List<Integer> c = new ArrayList<>();
        while(true) {
            String s = sc.nextLine();
            if(s.equals("0")) {
                break;
            }
            int a = s.length();
            int total = 0;
            for(int i=0; i<a; i++) {
                String s1 = s.substring(i, i +1);
                int b = Integer.parseInt(s1);
                total += b;
            }
            c.add(total);
        }
        for(int d : c) {
            System.out.println(d);
        }
    }

}



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

using namespace std;

int main(){
    string s;
    cin >> s;
    int cnt=0;
    char cur_c=s[0];
    for(int i=1;i<s.length();i++){
        if(s[i]!=cur_c){
            cur_c=s[i];
            cnt++;
        }
    }
    cout << cnt << endl;
}

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

int main()
{
	int a,b,c;
	while(cin>>a>>b)
	{
		c=a+b;
		int k=0;
		while(c>0)
		{
			c/=10;
			k++;
		}
		cout<<k<<endl;
	}
	return 0;
}

Measured memory_bytes: 1156
N, M=map(int, input().split())
ans=["-1"]*N
f=0
for i in range(M):
  s, c=map(int, input().split())
  if s==1 and c==0 and N!=1:
    f=1
  if ans[s-1]!=str(c) and ans[s-1]!="-1":
    f=1
  ans[s-1]=str(c)

if f==1:
  print(-1)
else:
  if ans[0]=="-1" and N!=1:
    ans[0]="1"
  elif M==0 and N==1:
    ans[0]="0"
  a="".join(ans)
  b=a.replace("-1", "0")
  print(b)
   

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


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



Measured memory_bytes: 3656
f=[1]
for i in range(1,101):
    f.append(i*f[i-1])

n,m=map(int,input().split())
sum=0
if m>=2:
    sum+=(f[m]//(f[2]*f[m-2]))
if n>=2:
    sum+=(f[n]//(f[n-2]*f[2]))
print(sum)

Measured memory_bytes: 3064
#include<iostream>
#include<iomanip>

using namespace std;

int main(){
  cout<<fixed<<setprecision(3);
  int a, b, c, d, e, f;

  while(cin>>a){
    cin>>b>>c>>d>>e>>f;

    double x = ((double)c*e- b*f)/(a*e-b*d) + 1e-10;
    double y = (c-a*x)/b;
    cout<<x<<" "<<y<<endl;
  }
}



Measured memory_bytes: 3204
import java.util.*;
public class Main {
  public static void main(String[] args) {
  	Scanner s = new Scanner(System.in);
    int n = s.nextInt();
    int[] arr = new int[n];
    for(int i=0;i<n;i++) {
     arr[i] = s.nextInt(); 
    }
    
    long total = 0;
    for(int i=1;i<n;i++) {
     int v = arr[i-1] - arr[i];
      if(v > 0) {
       arr[i] += v;
       total += (long)v;
      }
    }
    System.out.println(total);
  }
}


Measured memory_bytes: 60444
import sys
def input(): return sys.stdin.readline().rstrip()
def f(x,y,z):
    return x**2 + y**2 + z**2 + x*y + y*z + z*x
def main():
    n = int(input())
    A = [0]*(n+1)
    for x in range(1,100):
        for y in range(x, 100):
            for z in range(y, 100):
                num = f(x,y,z)
                if num > n:
                    break
                if x == y and y == z:
                    A[num] += 1
                elif x == y or y == z or z == x:
                    A[num] += 3
                else:
                    A[num] += 6
    for i in range(1,n+1):
        print(A[i])

if __name__=='__main__':
    main()

Measured memory_bytes: 9220
w,h,n=map(int,input().split())
lw=0;rw=w;lh=0;rh=h
for _ in range(n):
  x,y,a=map(int,input().split())
  if a==1:
    lw=max(lw,x)
  elif a==2:
    rw=min(rw,x)
  elif a==3:
    lh=max(lh,y)
  else:
    rh=min(rh,y)
print(max(0,(rh-lh))*max((rw-lw),0))

Measured memory_bytes: 3064
import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        int K = sc.nextInt();
        int n = s.length();
        int[] dist = new int[n];
        char[] ans = s.toCharArray();
        for(int i=0;i<n;i++) dist[i]=('z'-ans[i]+1)%26;
        for(int i=0;i<n;i++){
            if(K<dist[i]) continue;
            K -= dist[i];
            ans[i]='a';
        }
        K = K%26;
        int cur = ans[n-1]-'a';
        cur = (cur+K)%26;
        ans[n-1]=(char)(cur+'a');
        String res = new String(ans);
        System.out.println(res);
    }
}


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

typedef long long ll;

int main() {
    int N, M;
    ll ans = 0;
    cin >> N >> M;
    multiset<int>A;

    for (int i = 0; i < N; i++) {
        ll x;
        cin >> x;
        A.insert(x);
    }

    for (int i = 0; i < M; i++) {
        auto itr = A.end();
        itr--;
        ll a = *itr;
        a /= 2;
        A.erase(itr);
        A.insert(a);
    }
    
    for (auto itr = A.begin(); itr != A.end(); itr++) {
        ans += *itr;
    }
    cout << ans << endl;
}


Measured memory_bytes: 4992