akhauriyash/Code-Regression huggingface dataset:
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#include<bits/stdc++.h>
using namespace std;
#define mp make_pair
#define INF 10000000
#define MOD 1000000007
#define MID (l+r)/2
#define HASHMOD 2305843009213693951
#define ll long long
#define ull unsigned long long
#define F first
#define S second
typedef pair<ll, ll> ii;
typedef pair<ii, int> iii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef map<int, int> mii;

#define EPS 1e-6

#define T double
typedef complex<T> pt;
#define x real()
#define y imag()
T dot(pt v, pt w) {return (conj(v)*w).x;}
T cross(pt v, pt w) {return (conj(v)*w).y;}
T orient(pt a, pt b, pt c) {return cross(b-a,c-a);}
T dist(pt a, pt b) {return abs(a-b);}

int main(){
	int n, m;
	cin>>n>>m;
	char a[n][m];
	for(int i=0;i<n;i++){
		for(int j=0;j<m;j++) cin>>a[i][j];
	}
	int b[n][m] = {};
	b[0][0] = 1;
	for(int i=0;i<n;i++){
		for(int j=0;j<m;j++){
			if((i|j)==0) continue;
			if(a[i][j]=='#') continue;
			if(j>0) b[i][j] += b[i][j-1];
			if(i>0) b[i][j] += b[i-1][j];
			b[i][j]%=MOD;
		}
	}
	cout<<b[n-1][m-1]<<endl;
}

Measured memory_bytes: 5120
#include <stdio.h>

int main()
{
	int N;
	scanf("%d", &N);
	
	int sum = 0;
	int temp = N;
	
	while(temp != 0){
		sum = sum + ( temp % 10 );
		temp = temp / 10;
	}
	
	if(N % sum == 0){
		printf("Yes");
	}
	
	else{
		printf("No");
	}
	
	return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <random>
#include <chrono>
#include <queue>
#include <math.h>
#include <string>
#include <sstream>
#include <stack>
#include <deque>
#define pb push_back
#define make make_pair
#define kaku(a) cout << a << endl
#define isort(a) sort(a.begin(),a.end())

using namespace std;

#define ll long long
#define rep(i,n) for(ll i=0;i<n;i++)
#define PI 3.14159265359
long long gcd(long long a,long long b){ return b==0?a:gcd(b,a%b);}
long long lcm(long long a,long long b){ return a/gcd(a,b)*b;}

typedef pair<ll,ll> Pair;
const ll inf =1000000007;

void solve(){
    ll a,b,c,d;
    cin >>a >> b >> c >>d;
    ll p=a/d;
    if(a%d!=0) p++;
    ll q=c/b;
    if(c%b!=0) q++;
    if(p<q){
        cout << "No" << endl;
    }
    else{
        cout << "Yes" << endl;
    }
}

int main(){
    solve();
}

Measured memory_bytes: 3676
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
 
namespace agc15
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] str = Console.ReadLine().Split(' ');
            long N = int.Parse(str[0]);
            long A = int.Parse(str[1]);
            long B = int.Parse(str[2]);
            long ans = (N - 2) * (B - A) + 1;
            if (B < A || ans < 0)
            { 
                ans = 0;
            }
            Console.WriteLine(ans);
        }
    }
}

Measured memory_bytes: 11092
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define REPL(i,m,n) for(ll i=(ll)(m); i<(ll)(n); i++)
#define repl(i,n) REPL(i,0,n)
#define all(v) v.begin(), v.end()
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N, M;
  cin >> N >> M;
  vector<vector<int>> G(N);
  rep(i, M) {
    int a, b;
    cin >> a >> b;
    --a, --b;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  deque<int> ans;
  ans.push_back(0);
  ans.push_back(G[0][0]);
  set<int> se;
  se.insert(0); se.insert(G[0][0]);
  auto eval = [&](int i) {
    for(int ne: G[i]) {
      if(se.count(ne)) continue;
      ans.push_back(ne);
      se.insert(ne);
      return false;
    }
    return true;
  };
  auto eval2 = [&](int i) {
    for(int ne: G[i]) {
      if(se.count(ne)) continue;
      ans.push_front(ne);
      se.insert(ne);
      return false;
    }
    return true;
  };
  while(!eval(*(--end(ans)))) {}
  while(!eval2(*(begin(ans)))) {}
  cout << ans.size() << endl;
  for(int a: ans) cout << a+1 << ' ';
  cout << endl;
  return 0;
}


Measured memory_bytes: 11392
#include <stdio.h>
#include <string.h>
int main()
{
    char o[51],e[51];
    scanf("%s%s",o,e);
    for(int i=0;i<strlen(o);i++){
        if(e[i]!='\0'){
        printf("%c%c",o[i],e[i]);
        }else{
            printf("%c",o[i]);
        }
    }
    return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
#define mx 200005
double arr[mx];
int main()
{
    int n,k,p;
    cin>>n>>k;
    for(int i=1; i<=n; i++){
        cin>>p;
        double d = (p*(p+1))/2;
        arr[i] = d/p;
    }
    double ans = 0;
    for(int i=1; i<=k; i++) ans+=arr[i];
    double sum = ans;
    for(int i = k+1, j = 1; i<=n; i++, j++){
        sum+=arr[i];
        sum-=arr[j];
        ans = max(ans, sum);
    }
    cout<<fixed<<setprecision(10)<<ans<<endl;
}


Measured memory_bytes: 1792
#[allow(unused_imports)]
use std::cmp;
#[allow(unused_imports)]
use std::collections::*;
#[allow(unused_imports)]
use std::vec::Vec;

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input!{
        s: chars,
        k: usize,
    }
    let first_over_two = s
        .iter()
        .enumerate()
        .skip_while(|&(_i, x)| x.to_string().parse::<i32>().unwrap() == 1)
        .next();
    if let Some(first_over_two) = first_over_two {
        if first_over_two.0 < k {
            println!("{}", first_over_two.1);
            return;
        }
    }
    println!("1");
}


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

using namespace std;

int main() {
	int M, D; cin >> M >> D;
	int cnt = 0;
	for (int i = 4; i <= M; ++i) for (int j = 22; j <= D; ++j) 
		if (j % 10 > 1 && j / 10 > 1 && (j % 10) * (j / 10) == i) {
			cnt++;
		}
	cout << cnt << "\n";
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for(long long int i = 0; i < n; i++)
#define _rep(i, m, n) for(long long int i = m; i < n; i++)
#define print(n) std::cout << n << std::endl
#define _print(n) std::cout << n
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int N = 1000000;
const ll mod = 1000000007;
using Graph = vector<vector<int>>;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

ll gcd(ll A, ll B){
    if(B == 0)return A;
    return gcd(B, A % B);
}
ll lcm(ll A, ll B){
    return A * B / gcd(A, B);
}

/*------------------------------------------------------------------*/

int main(){
    int h, w; cin >> h >> w;
    vector<vector<char>> a(h, vector<char>(w));
    rep(i, h)rep(j, w) cin >> a[i][j];

    vector<bool> flag_h(h, false);
    vector<bool> flag_w(w, false);

    rep(i, h)rep(j, w) if(a[i][j] == '#') flag_h[i] = true;
    rep(i, w)rep(j, h) if(a[j][i] == '#') flag_w[i] = true;

    rep(i, h){
        if(!flag_h[i]) continue;
        rep(j, w){
            if(flag_w[j]) cout << a[i][j];
        }
        cout << endl;
    }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
//#define ull unsigned  long  long
#define int long long int
#define lld long double
#define endl "\n"
#define S second
#define F first
#define pir      pair<int,int>
#define vtr      vector<int>
#define mpp      map<int,int>
#define pb       push_back
#define popb     pop_back()
#define mk       make_pair
#define stc      set<char>
#define st       set<int>
#define stk      stack<int>
#define ctn      continue
#define MOD      1000000007
#define fr(i,a,b)   for(int i=a;i<b;i++)
#define rfr(i,a,b)  for(int i=a-1;i>=b;i--)
#define must        ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)

int gcd(int a, int b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
int lcm(int a, int b)
{
    return (a*b)/gcd(a, b);
}

int myfun(int x,int y)
{
    return x*y;
}
void primeFactors(int n)
{
    while (n%2 == 0)
    {
        cout<<2<<endl;
        n = n/2;
    }
    for (int i = 3; i <= sqrt(n); i = i+2)
    {
        while (n%i == 0)
        {
            cout<<i<<endl;
            n = n/i;
        }
    }
    if (n > 2)
        cout<<n<<endl;
}

void fillPrefixSum(int a[], int N, int prefixSum[])
{
    prefixSum[0] = a[0];

    for (int i = 1; i < N; i++)
        prefixSum[i] = prefixSum[i-1] + a[i];
}
int is_sorted(int a[],int n)
{
    for(int i=0;i<n-1;i++)
    {
        if(a[i]>a[i+1])
            return false;
    }
    return true;
}

int factorial(int n)
{
    return (n==1 || n==0) ? 1: n * factorial(n - 1);
}

int findlcm(vtr a, int n) 
{ 
    // Initialize CNTult 
    int cnt = a[0]; 
  
    // cnt contains LCM of a[0], ..a[i] 
    // after i'th iteration, 
    for (int i = 1; i < n; i++) 
        cnt = (((a[i] * cnt)) / 
                (gcd(a[i], cnt))); 
  
    return cnt; 
} 



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

bool peli(string s)
{
    int right=s.length();
    int j;
    for(int i=0,j=right-1;i<=j;i++,j--)
    {
        if(s[i]!=s[j])
        {
            return false;
        }
    }
    return true;
}


void Solve1()
{
    string s;
    cin>>s;
    int n=s.length();
    if(s[n-1]=='s') 
    {
        cout<<s<<"es";
    }
    else
    {
        cout<<s<<"s";
    }
}


signed main()
{

    must;
    int tt=1;
    //cin >> tt;
    while(tt--)Solve1();
    //double ttt;
    //ttt=double(e-s)/double(CLOCKS_PER_SEC);
    //cout<<fixed<<ttt<<setprecision(5)<<endl;
    return 0;
}


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

#define rep(i,n) for (int i = 0; i< (n); ++i)
#define vvec(m,n) vector<vector<int>> (int(m), vector<int>(n))
#define ALL(a) (a).begin(), (a).end()

using ll = long long;

int main(){
    int H, W, h, w;
    cin >> H >> W >> h >> w;
    vector<vector<int>> data(int(500), vector<int>(500));
    rep(i,H){
        rep(j,W){
            data.at(i).at(j) = 0;
        }
    }
    int count = 0;
    
    rep(i,H){
        rep(j,W){
            if(data.at(i).at(j) == 0) count++;
        }
    }
    if(h > H) h = H;
    if(w > W) w = W;
    cout << count - h*W - w*H + h*w << endl;
}

Measured memory_bytes: 1280
#include<bits/stdc++.h>
 
typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ldb;
 
#define pb push_back
#define popb pop_back
#define si size()
#define sof sizeof()
#define be begin()
#define en end()
#define all(v) v.be,v.en
#define le length()
#define mp make_pair 
#define mt make_tuple
#define F first
#define S second
#define ask(i,m,n) for(lli i=m;i<n;i++)
 
#define deci(n)  fixed<<setprecision(n)
#define high(n) __builtin_popcount(n)
#define parity(n) __builtin_parity(n)
#define ctz(n)  __builtin_ctz(n)
#define maxe *max_element
#define mine *min_element
#define anket ios::sync_with_stdio(0), cin.tie(0),cout.tie(0)
 
#define endl "\n"
#define o0(a) cout<<a<<" "
#define o1(a) cout<<a<<"\n"
#define o2(a,b) cout<<a<<" "<<b<<"\n"
#define o3(a,b,c) cout<<a<<" "<<b<<" "<<c<<"\n"
#define o4(a,b,c,d) cout<<a<<" "<<b<<" "<<c<<" "<<d<<"\n"
using namespace std;

#define mod 1000000007

inline lli modadd(lli n,lli m){
    lli sum = ((n+m)%mod+mod)%mod;
    return sum;
}

inline lli modsub(lli n,lli m){
    lli diff = ((n-m+mod)%mod+mod)%mod;
    return diff;
}

inline lli modpro(lli n,lli m){
    lli pro = ((n*m)%mod+mod)%mod;
    return pro;
}



inline lli pow(int x,int y){
    lli res = 1;
    while (y > 0) {
        if (y & 1)
            res = res * x;
        y = y >> 1;
        x = x * x;
    }
    return res;
}



inline lli powmod(lli x,lli y){
    lli res = 1;
    while (y > 0) {
        if (y & 1)
            res = modpro(res , x);
        y = y >> 1;
        x = modpro(x , x);
    }
    return res;
}

class pr{ 
	public: 
	lli parent; 
	lli rank; 
	lli mi;
}; 
lli find(pr subs[], lli i){ 
	if (subs[i].parent != i) 
		subs[i].parent = find(subs, subs[i].parent); 
	return subs[i].parent; 
} 
void Union(pr subs[], lli x, lli y){ 
	lli xroot = find(subs, x); 
	lli yroot = find(subs, y); 
	if (subs[xroot].rank < subs[yroot].rank){
	    subs[yroot].mi = min(subs[xroot].mi, subs[yroot].mi);
		subs[xroot].parent = yroot; 
		
	}
	else if (subs[xroot].rank > subs[yroot].rank){
		subs[yroot].parent = xroot;
		subs[yroot].mi = min(subs[xroot].mi, subs[yroot].mi);
	}
	else{ 
		subs[yroot].parent = xroot; 
		subs[xroot].rank++; 
		subs[yroot].mi = min(subs[xroot].mi, subs[yroot].mi);
	} 
} 

int main() {
	anket;
	lli n,a,b;
	cin>>n>>a>>b;
	if(abs(a-b) %  2 == 0){
	    o1(abs(a-b)/2);
	    return 0;
	}
	else{
	    lli c= min(min(a-1,b-1) +  abs(b-a)/2+1 , 1+min(n-a,n-b) + abs(b-a)/2);
	    o1(c);
	    return 0;
	}
	return 0;
}




Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define N 200055
#define SHIFT 100005
#define ll long long
#define debug(a) cout<<#a<<": ";for(auto i:a)cout<<i<<" ";cout<<'\n';
#define trace(a) cout<<#a<<": "<<a<<"\n"
int a[N],b[N];
int cnt[N];
int n;

ll BIT[N];
void update(int id,ll val) {
	for(;id < N;id += id&-id) {
		BIT[id] += val;
	}
}
ll query(int id) {
	ll sum = 0;
	for(;id > 0;id -= id&-id) {
		sum += BIT[id];
	}
	return sum;
}

ll calc_ans(int m) {
	int i;
	for(i = 1;i <= n;i++) {
		a[i] = (b[i] >= m ? 1 : 0);
	}
	memset(BIT,0,sizeof(BIT));
	update(0 + SHIFT,1);
	cnt[0] = cnt[1] = 0;
	ll ans = 0;
	for(i = 1;i <= n;i++) {
		cnt[a[i]]++;
		ans += (query(cnt[1] - cnt[0] + SHIFT));
		update(cnt[1] - cnt[0] + SHIFT,1);
		// trace(a[i]);
		// trace(ans);
	}
	return ans;
}

int main() {
	ios_base::sync_with_stdio(false);cout.tie(0);cin.tie(0);
	int i,j,k,l,m,t;
	cin >> n;
	vector<int> v;
	for(i = 1;i <= n;i++) {
		cin >> b[i];
		v.push_back(b[i]);
	}
	sort(v.begin(),v.end());
	ll tot = 1LL*n*(n+1);
	tot /= 2LL;
	l = 0;
	int r = n-1;
	int ans = 0;
	while(l <= r) {
		int mid = (l+r)/2;
		int val = v[mid];
		ll gr = calc_ans(val);
		// cout << val << " " << gr << endl;
		if(gr >= (tot+1)/2) {
			ans = val;
			l = mid+1;
		}
		else {
			r = mid-1;
		}
	}

	cout << ans << endl;
}

Measured memory_bytes: 3192
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds;
using namespace std;
 
#define ff                  first
#define ss                  second
#define endl                "\n"
#define loop(i,s,e)         for(int i=s;i<e;i++)
#define int                 long long
#define vi                  vector<int> 
#define S(v)                sort(v.begin(),v.end())
#define RS(v)               sort(v.rbegin(),v.rend())
#define R(v)                reverse(v.begin(),v.end())
#define mxpq(T)             priority_queue <T>
#define mnpq(T)             priority_queue<T,vector<T>,greater<T>>
#define prv(v)              for(auto &x : v)cout << x << " ";
#define piirv(v)            for(auto &x : v)cout << x.ff << " " << x.ss << endl;
#define prvv(v)             for(auto &x : v)for(auto &y : x.ss)cout << y << " ";
#define mp                  make_pair
#define pii                 pair<int,int>
#define mset(a,f)           memset(a , f , sizeof(a))
#define pb                  push_back
#define inf                 INT_MAX
#define INF                 LLONG_MAX
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> oset;
 
const int N = 2e6 + 6;
const int M = 1e9+7;
int A[N];
char mat[1001][1001];
int dp[1001][1001];
int n , m;
int dx[] = {1 , 0};
int dy[] = {0 , 1};

inline int mul(int a, int b) { return (a * b) % M; };
inline int add(int a, int b)
{
      int res = a + b;
      if ( res < 0 ) res += M;
      if ( res >= M) res -= M;
      return res;
}

int alpha( int i , int j )
{
	if( i == n-1 && j == m-1)return 1;
	int &abs = dp[i][j];
	if(abs != -1)return abs;
	int ans = 0;
	loop(id , 0 , 2)
	{
		int ni  = i + dx[id];
		int nj  = j + dy[id];

		if(ni < n && nj < m && mat[ni][nj] == '.')
			ans = add(ans , alpha(ni , nj));
	}
	return abs = ans%M;
}

void solve()
{
	cin >> n >> m;

	loop(i,0,n)loop(j,0,m)cin >> mat[i][j];

	mset(dp , -1);

	int ans = alpha(0 , 0);

	cout << ans;

}			
 
int32_t main()
{
 
cout<<fixed<<setprecision(16);
 
ios_base:: sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
 	
 
 	int t = 1;
 	// cin >> t;
 	while(t--)solve();
  
}

Measured memory_bytes: 12496
k, a, b = map(int, input().split())

if k < a:
    ans = k + 1

else:
    if b <= a + 2:
        ans = k + 1

    else:
        k -= a - 1
        q, r = divmod(k, 2)
        ans = a + q * (b - a) + r

print(ans)


Measured memory_bytes: 9000
// ====================================
//   author: M_sea
//   website: https://m-sea-blog.com/
// ====================================
#include <bits/stdc++.h>
#define file(x) freopen(#x".in","r",stdin); freopen(#x".out","w",stdout)
using namespace std;
typedef long long ll;

int read() {
	int X=0,w=1; char c=getchar();
	while (c<'0'||c>'9') { if (c=='-') w=-1; c=getchar(); }
	while (c>='0'&&c<='9') X=X*10+c-'0',c=getchar();
	return X*w;
}

const int N=20000+10;

int n,p[N],a[N],b[N];

int main() {
	n=read();
	for (int i=1;i<=n;++i) p[i]=read();
	for (int i=1;i<=n;++i) a[i]=a[i-1]+50000;
	for (int i=n;i>=1;--i) b[i]=b[i+1]+50000;
	for (int i=1;i<=n;++i) a[p[i]]-=n-i;
	for (int i=1;i<=n;++i) printf("%d ",a[i]); puts("");
	for (int i=1;i<=n;++i) printf("%d ",b[i]); puts("");
	return 0;
}

Measured memory_bytes: 3884
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep1(i, n) for (int i = 1; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const double PI=acos(-1);
const int INF = numeric_limits<int>::max();

int main(){
    int k;
    string s;
    cin >> k >> s;

    if (s.size() <= k) cout << s << endl;
    if (s.size() > k) {
        rep(i,k) cout << s[i];
        cout << "..." << endl;
    }

    return 0;
    
}

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

int main(){
    int N,M;
    string s;
    map<string, int> mp;
    cin >> N;
    for(int i=0; i<N;i++){
        cin >> s;
        auto itr = mp.find(s);
        if(itr == mp.end()){
            mp[s] = 1;
        }else{
            mp[s]++;
        }
    }

    cin >> M;
    for(int i=0; i<M;i++){
        cin >> s;
        auto itr = mp.find(s);
        if(itr == mp.end()){
            mp[s] = -1;
        }else{
            mp[s]--;
        }
    }
    int max = 0;
    for(auto itr = mp.begin(); itr != mp.end(); ++itr) {
        if(itr->second > max){
            max = itr->second;
        }
    }

    cout << max << endl;

}


Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
int main()
{
	char s[100];
	scanf("%s",s);
	
		if(s[0]=='S')
		{
			printf("Cloudy\n");
		}
		else if(s[0]=='C')
		{
			printf("Rainy\n");
		}
		else
		{
			printf("Sunny\n");
		}
	
}

Measured memory_bytes: 1580
#include <iostream>

int main() {
    using namespace std;

    int N;
    string S;
    cin >> N >> S;

    int x = 0;
    int curMax = 0;

    for (int i = 0; i<N ; i++)
    {
        if (S[i] == 'I') {
            x += 1;
            curMax = max(curMax, x);
        }
        else
        {
            x -= 1;
        }

    }

    cout << curMax;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define lli long long int
#define llu unsigned long long int
#define sa(a,n,t) for(int ii=0;ii<n;ii++) scanf("%"#t"",&(a)[ii])
#define rep(i,n) for(int i=0;i<n;i++) 
#define reps(i,a,n) for(int i=a;i<n;i++) 
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define rreps(i,a,n) for(int i=n-1;i>=a;i--)
#define validl(i,a,b) ((i>=a)&&(i<=b))?1:0
#define validmat(x,y,a,b,c,d) (validl(x,a,b) && validl(y,a,b))?1:0
#define validmn(x,y,m,n) validmat(x,y,0,m,0,n)
#define valid(i,n) validl(i,0,n)
#define v(t) vector<t>
#define vv(t) vector<vector<t> >
#define mk make_pair
#define pb push_back
#define pa(a,n,t)  for(int i=0;i<n;i++) printf("%"#t"",a[i])
#define p2 pair<int,int>
#define p3 pair<p2,int>
#define fi first
#define se second
#define sd(a) scanf("%d",&a)
#define sl(a) scanf("%lld",&a)
#define pl(a) printf("%lld",a)
#define pd(a) printf("%d",a)
#define sf(a) scanf("%lf",&a)
#define pf(a) printf("%lf",a)
#define nline printf("\n")
#define ss(a) scanf("%s",a)
#define ps(a) printf("%s",a)
#define sc(a) scanf("%c",&a)
#define pc(a) printf("%c",&a)
#define mf(m,f) m.find(f)!=m.end()
#define pp3(m) cout<<m.fi.fi<<" "<<m.fi.se<<" "<<m.se<<" "
#define pp2(m) cout<<m.fi<<" "<<m.se<<" "
#define debug 0
/*v(int) adj[200001];
void dfs(int i,int p){
    rep(j,adj[i].size()){
        if(p!=adj[i][j])
            dfs(adj[i][j],i);
    }
}*/
int main()
{
  int n;
  cin>>n;
  lli arr[200001];
  sa(arr,n,lld);
  sort(arr,arr+n);
  lli ans=arr[n-1];
  int c=2;
  int j=n-2;
  int k=0;
  while(c<n){
    //cout<<arr[j]<<" ";
    ans+=arr[j];
    k++;
    k=k%2;
    if(!k) j--;
    c++;
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 5244
package main

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

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

	sc.Scan()
	a, _ := strconv.Atoi(sc.Text())
	sc.Scan()
	b, _ := strconv.Atoi(sc.Text())

	fmt.Println(a*b, 2*a+2*b)
}



Measured memory_bytes: 1056
/*
                        ********************
			**  MANAN DIYORA  **
			**    DA-IICT     **
			**   diyora13     **
			********************
*/
#include <bits/stdc++.h>
#include <time.h>
using namespace std;

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define inarr(a,n) for(int i=0;i<n;i++) cin>>a[i]
#define outarr(a,n) for(int i=0;i<n;i++) cout<<a[i]<<" "; cout<<endl
#define maxa(a,n) *max_element(a,a+n)
#define mina(a,n) *min_element(a,a+n)
#define Max(x,y,z) max(x,max(y,z))
#define Min(x,y,z) min(x,min(y,z))
#define fr(i,s,e) for(ll i=s;i<e;i++)
#define rf(i,s,e) for(ll i=s-1;i>=e;i--)
#define gcd(a,b) __gcd(a,b)
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define F first
#define S second
#define sz size()
#define len length()
#define all(v) v.begin(),v.end()

typedef long long int ll;
typedef long double ld;
typedef pair<long long, long long> pll;
typedef vector<long long> vll;
typedef vector<pair<long long,long long> > vpll;
// freopen("input.txt","r",stdin);
// freopen("output.txt","w",stdout);
// bool sortbysec(const pair<int,int> &a,const pair<int,int> &b) { return (a.second < b.second); }
#define PI 3.141592653589793
#define MOD 1000000007

bool flag=0,flag1=0,flag2=0;

int main()
{
	IOS
	ll t=1;
//		cin>>t;
	while(t--)
	{
		ll a,b,c,k,cnt=0; cin>>a>>b>>c>>k;
		while(b<=a) b*=2,cnt++;
		while(c<=b) c*=2,cnt++;
		if(cnt<=k) cout<<"Yes";
		else cout<<"No";
	}
}

Measured memory_bytes: 3644
#include<bits/stdc++.h>
using namespace std;
void check(bool p)
{
  if(!p)
  {
    puts("-1");
    exit(0);
  }
}
string s; int N;
int main()
{
  cin >> s; N = s.size(); s = '0' + s;
  check(s[0] == s[N]);
  vector<int> V;
  for(int i=1; i<=N/2; ++i)
  {
    check(s[i] == s[N-i]);
    if(s[i] == '1') V.push_back(i);
  }
  check(s[1] == '1');
  V.push_back(N);
  reverse(V.begin(), V.end());
  for(int i=0; i<(int)V.size()-1; ++i)
    for(int j=V[i+1]; j<V[i]; ++j) printf("%d %d\n", V[i], j);
  
  return 0;
}

Measured memory_bytes: 1784
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl '\n'

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n, m;cin>>n>>m;
	cout<<n*(n-1)/2 + m*(m-1)/2<<endl;
	return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int maxm = 500002;
int N, Q, type, a, b;
char S[maxm], c;
//int memo[26][maxm];
set<int> memo[26];
int main()
{
    cin >> N;
    for (int i = 0; i < N; i++)
    {
        cin >> S[i];
        //memo[S[i] - 'a'][i + 1] = ++memo[S[i] - 'a'][0];
        memo[S[i] - 'a'].insert(i+1);
    }
    cin >> Q;
    //for (int i = 0; i < N; i++)
    //    cout << S[i];
    for (int i = 0; i < 26; i++)
    {
        memo[i].insert(maxm);
    }
    while (Q--)
    {
        int type;
        cin >> type;
        if (type == 1)
        {
            cin >> a >> c;
            memo[S[a - 1] - 'a'].erase(a);
            S[a - 1] = c;
            memo[S[a - 1] - 'a'].insert(a);
        }
        else
        {
            cin >> a >> b;
            int ans = 0;
            for (int i = 0; i < 26; i++)
            {
                auto itr = memo[i].begin();
                itr = memo[i].lower_bound(a);
                if (*itr <= b) ans++;
            }
            cout << ans << endl;
        }
    }
}

Measured memory_bytes: 24192
#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

int main(){
	int n, m;
	cin >> n >> m;
	vector<int> a(n), cnt(n);
	for (auto &ai : a) cin >> ai;
	for (int i = 0; i < m; ++i){
		int b;
		cin >> b;
		for (int j = 0; j < n; ++j){
			if (a[j] <= b){
				++cnt[j];
				break;
			}
		}
	}
	cout << max_element(begin(cnt), end(cnt)) - begin(cnt) + 1 << endl;

	return 0;
}

Measured memory_bytes: 1200
#include <iostream>
#include <vector>
#include <iomanip>
using namespace std;
using ll=long long;
const ll MOD = 1000000007;
ll INF = 90000000001000;

int n,k;
ll dp[410][410];
int flag[410][410] = {0};

ll s[410];
ll a[410];

ll rec(int l,int r){

    if(l==r) return dp[l][r] = 0;
    if(flag[l][r]) return dp[l][r];
    flag[l][r] = 1;
    ll res = INF;
    for (int i = l; i < r; ++i)
    {
       res = min(res,rec(l,i)+rec(i+1,r));
    }    
    if(!l) return dp[l][r] = res + s[r];
    return dp[l][r] = res+s[r]-s[l-1];
}



int main() {
    cin >> n;
    for (int i = 0; i < n; ++i)
    {
        cin >> a[i];
    }
    s[0] = a[0];
    for (int i = 1; i < n; ++i)
    {
       s[i] = s[i-1] + a[i];
    }



cout << rec(0,n-1);

return 0;
}




Measured memory_bytes: 2176
n, m = map(int, input().split())

cnt = [1, 2]

for i in range(1, n - 1):
    cnt.append(cnt[i] + cnt[i - 1])

if m == 0:
    print(cnt[n - 1] % 1000000007)
    exit()

l = [int(input()) for _ in range(m)]

l_diff = [l[0] - 1]
for i in range(1, m):
    l_diff.append(l[i] - l[i - 1] - 2)
l_diff.append(n - l[m - 1] - 1)

for k in range(1, m):
    if l[k] - l[k - 1] == 1:
        print(0)
        exit()


total = 1
for j in l_diff:
    if j == 0:
        pass
    else:
        total *= cnt[j - 1]

print(total % 1000000007)



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

ll gcd(ll a, ll b){
    ll r = a % b;
    while(r > 0){
        a = b;
        b = r;
        r = a % b;
    }
    return b;
}

// 素因数分解は√nまで確かめれば良い
vector<pair<ll,int>> factorize(ll n){
    vector<pair<ll,int>> res;
    for(ll i = 2; i*i <= n; ++i){
        if (n%i) continue;
        res.emplace_back(i,0);
        while(n%i == 0){
            n /= i;
            res.back().second++;
        }
    }
    if(n != 1) res.emplace_back(n,1);
    return res;
}

int main(){
    ll a, b; cin >> a >> b;
    ll g = gcd(a,b);
    auto f = factorize(g);
    int ans = f.size() + 1;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h> 
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
#include<cmath>
#include<string>
#define pb push_back
#define ll long long
#define ull unsigned long long
#define deb(x) cerr<<#x<<" "<<x<<"\n"
#define debi cerr<<"hey sparky\n"
#define x first
#define y second
#define fast ios::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#define eps (double)1e-9
#define all(x) x.begin(),x.end()
#define int long long
using namespace std;
using namespace __gnu_pbds; 
typedef tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> pdbs;
 
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
//void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}
 
template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
 
// look for  all edge cases
//search for a pattern

//const int nax = 1e5 + 2;
 

signed main() {    
    ios::sync_with_stdio(0);
    cout.tie(0);
    cin.tie(0);
    
    int n,d;
    cin >> n >> d;
    
    d = d*d;
    int ans = 0;
    for(int i =0 ; i < n; i++){
		int x,y;
		cin >> x >> y;
		int val = x*x + y*y;
		if(val <= d){
			ans += 1;
		}
	}
    cout<<ans;
    
    return 0;
}


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

// data structure
#include <deque>
#include <map>
#include <set>
#include <stack>
#include <vector>

#include <algorithm>
#include <cmath>

using namespace std;

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

  if (n.find("7") == std::string::npos)
    std::cout << "No" << std::endl;
  else
    std::cout << "Yes" << std::endl;

  return 0;
}


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

#define FI(i,a,b) for(int i=(a);i<=(b);i++)
#define FD(i,a,b) for(int i=(a);i>=(b);i--)

#define LL long long
#define Ldouble long double
#define PI 3.14159265358979323846264338327950288419

#define PII pair<int,int>
#define PLL pair<LL,LL>
#define mp make_pair
#define fi first
#define se second

using namespace std;

int N;
char s[105], t[105];

int main(){
	scanf("%d %s %s", &N, s + 1, t + 1);
	FD(i, N, 0){
		bool overlap = true;
		FI(j, 1, i) if(t[j] != s[N - i + j]){
			overlap = false;
			break;
		}
		if(overlap){
			printf("%d\n", 2 * N - i);
			return 0;
		}
	}
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
    int n,cnt=0;
    cin>>n;
    while(n>0)
    {
        int x=n%10;
        if(x==7)
        {
            cnt++;
            break;
        }
        n/=10;
    }

    if(cnt)
    {
        cout<<"Yes"<<endl;
    }
    else
    {
        cout<<"No"<<endl;

    }
    return 0;
}





Measured memory_bytes: 3636
def draw(h, w):
    print("#" * w)
    for i in range(h-2):
        print("#" + ("."*(w-2)) + "#")
    print("#" * w)
    print("")

while True:
    h, w = map(int, raw_input().split())
    if h == 0 and w == 0:
        break
    draw(h, w)

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

#pragma region Macros
using ll = long long;
#define int ll
using pii = pair<int, int>;
using tiii = tuple<int, int, int>;
template<class T = ll> using V = vector<T>;
template<class T = ll> using VV = V<V<T>>;
#define IOS\
    ios::sync_with_stdio(false);\
    cin.tie(0);\
    cout.tie(0);
#define FOR(i,l,r) for(ll i=(l);i<(r);++i)
#define REP(i,n) FOR(i,0,n)
#define REPS(i,n) FOR(i,1,n+1)
#define RFOR(i,l,r) for(ll i=(l);i>=(r);--i)
#define RREP(i,n) RFOR(i,n-1,0)
#define RREPS(i,n) RFOR(i,n,1)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(),(x).end()
#define SORT(name) sort(name.begin(), name.end())
#define RSORT(name)\
    SORT(name);\
    reverse(all(name));
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
inline void Yes(bool b = true) {cout << (b ? "Yes" : "No") << '\n';}
inline void YES(bool b = true) {cout << (b ? "YES" : "NO") << '\n';}
template <class T> inline void print(T x){ cout << x << '\n';}
template<typename T1,typename T2> inline void chmin(T1 &a, T2 b){ if(a > b) a = b; }
template<typename T1,typename T2> inline void chmax(T1 &a, T2 b){ if(a < b) a = b; }

const ll LLINF = (1LL<<60);
const int INF = (1LL<<30);
const double DINF = std::numeric_limits<double>::infinity();
#pragma endregion

#if 1
#  define DBG(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
#  define DBG(fmt, ...)
#endif

const int MOD = 1000000007;
const int MAX_N = 100010;

signed main() {
    IOS;

    string S, T;
    cin >> S >> T;
    int ans = 0;
    REP(i, S.length()) {
        if(S[i] != T[i]) { ans++; }
    }
    print(ans);

    return 0;
}


Measured memory_bytes: 3776
#include<bits/stdc++.h>
#define ll long long int 
#define fori(i,n) for(int i=0; i<n; ++i)
#define ford(i,n) for(int i=n-1; i>=0; --i)
#define vi vector<int> 
#define vs vector<string>
#define vll vector<ll>
#define di deque<int>
#define vpii vector<pair<int,int>>
#define vpll vector<pair<ll,ll>>
#define pqi priority_queue<int>
#define pqll priority_queue<ll>
#define mod1 1000000007
#define mod2 998244353
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define gcd __gcd


#define fast_cin() ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)

using namespace std;
using namespace std::chrono;

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag,tree_order_statistics_node_update> i_set;
typedef tree<ll, null_type, less<ll>, rb_tree_tag,tree_order_statistics_node_update> ll_set; 
/* new_data_set p; */
/* *p.find_by_order(3); The value at third place */
/* p.order_of_key(7); The expected index in the set in sorted order */



int main(int argc, char const *argv[]){
	fast_cin();
    int n,k;
    cin>>n>>k;
    int ans=0;
    while(n>0){
        n/=k;
        ans++;
    }
    cout<<ans<<"\n";
    return 0;
}


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

using ll = long long int;
using ld = long double;
using pii = pair<int,int>;

#define REP(i,m,n) for(ll i = m; i < (ll)(n);++i)
#define rep(i,n) REP(i,0,n)
#define all(v) v.begin(),v.end()

int main(){
  int w,h,n;
  cin >> w >> h >>n;
  vector<int> x(n),y(n),a(n);
  rep(i,n) cin >> x[i] >> y[i] >> a[i];
  vector<int> xs,xb,ys,yb;
  xs.push_back(0);
  xb.push_back(w);
  ys.push_back(0);
  yb.push_back(h);
  
  rep(i,n){
    if(a[i]==1){
      xs.push_back(x[i]);
    }
    if(a[i]==2){
      xb.push_back(x[i]);
    }
    if(a[i]==3){
      ys.push_back(y[i]);
    }
    if(a[i]==4){
      yb.push_back(y[i]);
    }
  }
  sort(all(xs));sort(all(xb));sort(all(ys));sort(all(yb));
  reverse(all(xs));reverse(all(ys));
  int s=xs[0],t=ys[0],u=xb[0],v=yb[0];
  if(u-s>0&&v-t>0){
    cout << (u-s)*(v-t) << endl;
  }
  else cout << 0 <<endl;
}
  
  

Measured memory_bytes: 256
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict
inf=float('inf')
mod = 10**9+7
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N = ST()
    print("YNeos"["9" not in N::2])
    
if __name__ == '__main__':
    main()

Measured memory_bytes: 38256
package main

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

var sc *bufio.Scanner

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

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}
	return i
}

func main() {
	sc = bufio.NewScanner(os.Stdin)
	sc.Buffer(make([]byte, 0), 1000000001*3)
	sc.Split(bufio.ScanWords)
	n := nextInt()
	order := make([]int, n)
	for o := 1; o <= n; o++ {
		oi := nextInt()
		order[oi-1] = o
	}
	aArray, bArray := make([]int, n), make([]int, n)
	for i, o := range order {
		aArray[i] = n*i + o
		bArray[i] = n*(n-i-1) + o
	}
	for i, a := range aArray {
		fmt.Print(a)
		switch {
		case i == n-1:
			fmt.Println()
		default:
			fmt.Print(" ")
		}
	}
	for i, b := range bArray {
		fmt.Print(b)
		switch {
		case i == n-1:
			fmt.Println()
		default:
			fmt.Print(" ")
		}
	}
}


Measured memory_bytes: 2560
n, k = map(int, input().split())
yenstr = input().split()

yenint = []
for y in yenstr:
    yenint.append(int(y))

# yenintを小さい順に並び変える
yensort = []
small = 1
while small <= 1000:
    for i in yenint:
        if i == small:
            yensort.append(i)
    small += 1

# 小さい方からk個の和を出す
count = 0
for j in range(0, k):
    count += yensort[j]
print(count)

Measured memory_bytes: 9140
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<cmath>
#include<queue>
#include<algorithm>
using namespace std;
const int MaxN = 3e5;
typedef long long LL;
priority_queue<int> E;
priority_queue<int, vector<int>, greater<int> >Q;
LL ans, a[MaxN + 5];
LL Max = -(1LL << 60);
LL suml[MaxN + 5], sumr[MaxN + 5];
int n;
int main()
{
	scanf("%d", &n);
	for(int i = 1; i <= 3 * n; i++)scanf("%lld", &a[i]);
	for(int i = 1; i <= n; i++){
		Q.push(a[i]);
		suml[i] = suml[i - 1] + a[i];
	}
	for(int i = 3 * n; i > 2 * n; i--){
		E.push(a[i]);
		sumr[i] = sumr[i + 1] + a[i];
	}
	for(int i = n + 1; i <= 2 * n; i++){
		LL temp = Q.top();
		Q.pop();
		ans = 0;
		if(a[i] > temp){
			ans = a[i] - temp;
			temp = a[i];
		}
		Q.push(temp);
		suml[i] = suml[i - 1] + ans;
	}
	for(int i = 2 * n; i > n; i--){
		LL temp = E.top();
		E.pop();
		ans = 0;
		if(a[i] < temp){
			ans = a[i] - temp;
			temp = a[i];
		}
		E.push(temp);
		sumr[i] = sumr[i + 1] + ans;
	}
	for(int i = n; i <= 2 * n; i++)Max = max(Max, suml[i] - sumr[i + 1]);
	printf("%lld\n", Max);
	return 0;
}

Measured memory_bytes: 7416
N = int(input())
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
div_lst = make_divisors(N)
len_div = len(div_lst)
ans = float("inf")
for i in range(len_div):
    tmp_ans = max(len(str(div_lst[i])) , len(str(div_lst[len_div - i - 1])))
    if ans > tmp_ans:

        ans = tmp_ans
print(ans)

Measured memory_bytes: 39664
#![allow(dead_code, unused_imports, non_snake_case)]

use std::io::*;
use std::cmp::{max, min, Ordering};
use std::collections::*;
use std::str::FromStr;

const MOD: i32 = 1_000_000_007;

fn main() {
    let n: u64 = input();
    let mut m = HashMap::new();

    for i in 1..n + 1 {
        let mut x = i;
        let mut div: u64 = 2;
        loop {
            if x % div == 0 {
                x /= div;
                *m.entry(div).or_insert(0) += 1;
                continue;
            }
            div += 1;
            if div > x {
                break
            }
        }
    }
    let mut ans: u64 = 1;
    for &val in m.values() {
        ans = ans * (val + 1) % 1_000_000_007;
    }
    println!("{}", ans);
}

trait Read {
    fn read(s: &str) -> Self;
}

fn input<T: Read>() -> T {
    let mut buf = String::new();
    std::io::stdin().read_line(&mut buf).unwrap();
    T::read(buf.trim_right())
}

macro_rules! read_impl {
    ($($t:ty)*) => ($(
        impl Read for $t {
            fn read(s: &str) -> $t{
                s.parse().unwrap()
            }
        }
    )*)
}
read_impl! { usize u8 u16 u32 u64 isize i8 i16 i32 i64 f32 f64 }

impl Read for String {
    fn read(s: &str) -> Self {
        s.to_string()
    }
}

impl Read for Vec<char> {
    fn read(s: &str) -> Self {
        s.chars().collect()
    }
}

impl<T: Read> Read for Vec<T> {
    fn read(s: &str) -> Self {
        s.split_whitespace().map(T::read).collect()
    }
}

impl<A: Read, B: Read> Read for (A, B) {
    fn read(s: &str) -> Self {
        let tokens: Vec<_> = s.split_whitespace().collect();
        (A::read(tokens[0]), B::read(tokens[1]))
    }
}

impl<A: Read, B: Read, C: Read> Read for (A, B, C) {
    fn read(s: &str) -> Self {
        let tokens: Vec<_> = s.split_whitespace().collect();
        (A::read(tokens[0]), B::read(tokens[1]), C::read(tokens[2]))
    }
}

impl<A: Read, B: Read, C: Read, D: Read> Read for (A, B, C, D) {
    fn read(s: &str) -> Self {
        let tokens: Vec<_> = s.split_whitespace().collect();
        (A::read(tokens[0]), B::read(tokens[1]), C::read(tokens[2]), D::read(tokens[3]))
    }
}

Measured memory_bytes: 4352
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();
        if ((a > c  && b < c) || (a < c && b > c)) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }

    }
}


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

const int MAXN = 610;
int A[MAXN][MAXN];
int n, d1, d2;
void run(int d) {
	int dig = 0;
	while (d % 4 == 0) d >>= 2, ++dig;
	if (d & 1) {
		for (int i = 0; i < n; ++i)
			for (int j = 0; j < n; ++j)
				if ((i >> dig) + (j >> dig) & 1)
					A[i][j] = true;
	} else {
		for (int i = 0; i < n; ++i)
			for (int j = 0; j < n; ++j)
				if ((i >> dig) & 1)
					A[i][j] = true;
	}
}
int main() {
	std::ios_base::sync_with_stdio(false), std::cin.tie(0);
	std::cin >> n >> d1 >> d2; n <<= 1;
	run(d1); run(d2);
	int cnt = 0;
	for (int i = 0; i < n; ++i)
		for (int j = 0; j < n; ++j)
			if (!A[i][j]) {
				std::cout << i << ' ' << j << '\n';
				if (++cnt == n * n / 4) return 0;
			}
	return 0;
}

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

  
int v[3000][3000];
ll dp[3000][3000][4];

int main(){

  
  int R, C, K;
  cin >> R >> C >> K;
  
  rep(i,K){
    int r, c, a;
    cin >> r >> c >> a;
    v[r-1][c-1] = a;
  }
  
  dp[0][0][1] = v[0][0];
  rep(r,R)rep(c,C)rep(k,4){
    if(r+1 < R){//縦に動く
      //拾わない
      dp[r+1][c][0] = max(dp[r+1][c][0], dp[r][c][k]);
      //拾う
      dp[r+1][c][1] 
        = max(dp[r+1][c][1], dp[r][c][k] + v[r+1][c]);
    }
    if(c+1 < C){ //横に動く
      //拾わない
      dp[r][c+1][k] = max(dp[r][c+1][k], dp[r][c][k]);
      //拾う
      if(k + 1 <= 3){
        dp[r][c+1][k+1] 
          = max(dp[r][c+1][k+1],dp[r][c][k]+v[r][c+1]);
      }
    }
  }
  
  ll ans = 0;
  rep(i,4) ans = max(ans, dp[R-1][C-1][i]);

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

Measured memory_bytes: 320020
#include<iostream>
using namespace std;
int main() {
	int b[110] = { 0 };
	int n, m;
	cin >> n >> m;
	for (int i = 0; i < n; i++){
		cin >> b[i];
	}
	for (int i = 1; i < m + 1; i++){
		for (int j = 0; j < n - 1; j++){

			if (b[j] % i > b[j + 1] % i) {
				int tmp = b[j];
				b[j] = b[j + 1];
				b[j + 1] = tmp;
			}
		}
	}
	for (int i = 0; i < n; i++){
		cout << b[i] << endl;
	}
	return 0;
}

Measured memory_bytes: 3080
#include<iostream>
#include<vector>
#include<string>
#include<cmath>
#include<algorithm>
#include <numeric>
#include<map>
 
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<n;i++)
#define all_map(itr,mp) for(auto itr=mp.begin();itr!=mp.end();itr++)
#define ALL(a) (a).begin(),(a).end()

int main(){
    int x;
    cin >> x;
    int ans = 1;
    for(int i = 2; i <= 31; i++){
        int tmp =  i*i;
        while(tmp <= x){
            ans = max(tmp, ans);
            tmp *= i;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <algorithm>
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i=0;i<(n);++i)
#define all(x) (x).begin(), (x).end()
#define PB(x) push_back(x)
#define MP(x,y) make_pair(x,y)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

 
int main() {

    int n,m;
    cin >> n >> m;
    vector<int> a(m);
    rep(i,m)    cin >> a[i];

    int sum = 0;
    rep(i,m) {
        sum += a[i];
    }
    if(n<sum) {
        cout<<-1<<endl;
    }
    else {
        cout<<n-sum<<endl;
    }

 return 0;
}

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

int dp[105][4][2];

int main() {
	string s; cin >> s;
	int K; cin >> K;
	int n = s.size();
	dp[0][0][0] = 1;
	rep(i, n)rep(j, 4)rep(k, 2) {
		int nd = s[i] - '0';
		rep(d, 10) {
			int ni = i + 1, nj = j, nk = k;
			if (d != 0) nj++;
			if (nj > K) continue;
			if (k == 0) {
				if (nd < d) continue;
				if (nd > d) nk = 1;
			}
			dp[ni][nj][nk] += dp[i][j][k];
		}
	}
	int ans = dp[n][K][1] + dp[n][K][0];
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
//Author: Fuadul Hasan(fuadul202@gmail.com)
#include<bits/stdc++.h>
using namespace std;

#define ll long long
const int N   = 2e5 + 5;

int main(){
	
	string s;
	cin>>s;
	for(int i=0;i<3;i++){
		if(s[i] == s[i+1]){
			cout<<"Bad"<<endl;
			return 0;
		}
	}	

	cout<<"Good"<<endl;


	

	return 0;
}

Measured memory_bytes: 3576
#include <bits/stdc++.h>
#define ll long long
#define endl "\n"
using namespace std ;
int main()
{
    ios_base::sync_with_stdio(false) ;
    cin.tie(0);
    cout.tie(0);
    set <char> st ;
    string str ;
    map <char, int> mp ;
    cin >> str ;
    for(int i = 0 ; i < str.size() ; i++)
    {
        if(str[i] >= 'a' && str[i] <='z')
        {
            mp[str[i]]++ ;
            st.insert(str[i]) ;
        }
    }
    int flag = 0 ;
    for(auto i : st)
    {
        //cout << mp[i] << endl ;
        if(mp[i] %2 != 0)
        {
            flag = 1 ;
            break ;
        }
    }
    if(!flag)
    {
        cout <<"Yes\n" ;
    }
     else cout <<"No\n" ;
}


Measured memory_bytes: 3652
fun main(args:Array<String>):Unit{
    val nine = arrayOf(1, 1, 9, 81, 729, 6561, 59049)
    val six = arrayOf(1, 6, 36, 216, 1296, 7776, 46656)
    val n = readLine()!!.toInt()
    var min = Int.MAX_VALUE
    for (i in 0 .. n){
        val res = calBy(i, nine) + calBy(n - i, six)
        if (min > res)
            min = res
    }
    println(min)
}
fun calBy(n:Int, array:Array<Int>, idx:Int = 6):Int {
    return when(n){
        0 -> 0
        else -> n / array[idx] + calBy(n % array[idx], array, idx - 1)
    }
}

Measured memory_bytes: 33688
#include<bits/stdc++.h>
using namespace std;
int main()
{
    bool ta=false;
    int head,leg;
    cin>>head>>leg;
    for(int i=0;i<=head;i++)
    {
        if(2*i+(head-i)*4==leg)
        {
            ta=true;
            break;
        }
    }
    if(ta)
    {
        cout<<"Yes"<<endl;
    }
    else
    {
        cout<<"No"<<endl;
    }
}

Measured memory_bytes: 3616