akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

using namespace std;

/*  テンプレここから */
typedef long long ll;

#define rep(i, n) for(int i = 0; i < n; i++)
#define repi(i, start, end) for(int i = start; i < end; i++)
#define all(x) (x).begin(), (x).end()
#define INF (1e9)
#define add_mod(a, b, x) ( (ll)(a) + (ll)(b) ) % (ll)(x)
#define mul_mod(a, b, x) ( ((ll)(a) % (ll)(x)) * ((ll)(b) % (ll)(x)) ) % (ll)(x)
#define out(x) cout << (x) << endl;
#define outyes(bool_val) cout << (bool_val ? "yes" : "no") << endl;
#define outYes(bool_val) cout << (bool_val ? "Yes" : "No") << endl;
#define outYES(bool_val) cout << (bool_val ? "YES" : "NO") << endl;
#define outPossible(bool_val) cout << (bool_val ? "Possible" : "Impossible") << endl;
#define outPOSSIBLE(bool_val) cout << (bool_val ? "POSSIBLE" : "IMPOSSIBLE") << endl;

ll sub_mod(ll a, ll b, ll x){
    ll tmp = (a - b) % x;
    if(tmp < 0) tmp += x;
    return tmp;
}
ll gcd(ll a, ll b){
    if(b == 0) return a;
    else return gcd(b, a % b);
}

int dx[] = {0, 1, 0, -1};
int dy[] = {-1, 0, 1, 0};
/*  テンプレここまで */

vector<vector<int>> graph(10, vector<int>());
int n, m, cnt = 0;

void search(int i, vector<int> visited){
    visited[i] = 1;
    for(auto itr = graph[i].begin(); itr != graph[i].end(); ++itr){
        if(visited[*itr] == 0){
            if(accumulate(all(visited), 0) == n-1){
                ++cnt;
                return;
            }
            search(*itr, visited);
        }
    }
}

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

    cin >> n >> m;

    rep(i, m){
        int a, b;
        cin >> a >> b;
        graph[a].push_back(b);
        graph[b].push_back(a);
    }

    vector<int> visited(n + 1, 0);
    search(1, visited);

    cout << cnt << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<stack>
#include<queue>
#include<cmath>

using namespace std;

int main(){
  char S[5];
  cin>>S;
  int res=0;
  for (int i=0;i<4;i++){
    if (S[i]=='+') res++;
    if (S[i]=='-') res--;
  }
  cout<<res;
  return 0;
}


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

int main() {
  int d,t,s;
  cin >> d >> t >> s;
  if(d <= t*s) cout << "Yes" << endl;
  else cout << "No" << endl;
}

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

int main()
{
  int n;
  cin>>n;
  vector<int> v(n);
  for(int i=0;i<n-1;i++)
    cin>>v[i];
  int sum=v[0];
  for(int i=1;i<n;i++)
    sum+=min(v[i-1], v[i]);
  sum+=v[n-2];
  cout<<sum;
  return 0;
}


Measured memory_bytes: 256
from collections import deque
n,k,c = map(int,input().split())
s=list(input())
L=deque([])
R=deque([])
i=1
while 0<i<n+1 and len(L)<k:
    if s[i-1]!='x':
        L.append(i)
        i+=c+1
    else:
        i+=1

i=n
while 0<i<n+1 and len(R)<k:
    if s[i-1]!='x':
        R.appendleft(i)
        i-=c+1
    else:
        i-=1
#print(L)
#print(R)

for i in range(k):
    if L[i]==R[i]:
        print(L[i])


Measured memory_bytes: 65224
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n;
	cin >> n;
	string s[3];
	for (int i = 0; i < 3; i++) {
		cin >> s[i];
	}
	int ans = 0;
	for (int i = 0; i < n; i++) {
		set<char> st;
		for (int j = 0; j < 3; j++) {
			st.insert(s[j][i]);
		}
		ans += (int) st.size() - 1;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#ifdef _DEBUG
#define _GLIBCXX_DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

#define int long long
//typedef __int128_t Int;
#define DBG 1
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define loop(n) rep(loop,(0),(n))
#define all(c) begin(c),end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
const double PI = acos(-1);
const double EPS = 1e-9;
template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a > b) { a = b; return true; } return false; }

signed main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout<<fixed<<setprecision(12);

  int N, X; cin >> N >> X;

  int x=min(N-X,X),y=max(N-X,X);

  int ans=0;
  while(x){
    int r=y%x;
    int p=y/x;

    ans+=p*3*x;


    y=x;
    x=r;
  }
  cout<<ans<<endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int n;
  cin >> n;
  vector<int> a(100000);
  for(int x = 1; x < 105; x++){
    for(int y = 1; y < 105; y++){
      for(int z = 1; z < 105; z++){
        int ans = x*x+y*y+z*z+x*y+y*z+z*x;
        a[ans-1]++;
      }
    }
  }
  for(int i = 0; i < n; i++){
    cout << a[i] << endl;
  }
}

Measured memory_bytes: 3712
/*
    JAI JAGANNATH!
*/
//@Author : zanj0
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;
typedef long long int lli;
#define ff              first
#define ss              second
#define pb              push_back
#define mp              make_pair
#define pii             pair<lli,lli>
#define vi              vector<lli>
#define mii             map<lli,lli>
#define pqb             priority_queue<lli>
#define pqs             priority_queue<lli,vi,greater<lli> >
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(arr,n,type)  type *arr=new type[n];
#define w(x)            lli x; cin>>x; while(x--)
mt19937                 rng(chrono::steady_clock::now().time_since_epoch().count());

typedef tree<lli, null_type, less<lli>, rb_tree_tag, tree_order_statistics_node_update> pbds;


void zanj0()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
}
void solve() {
	lli a, b, c, d;
	cin >> a >> b >> c >> d;
	bool f = true;
	while (a > 0 && c > 0) {
		if (!f) {
			a -= d;
		} else {
			c -= b;
		}
		f = !f;
	}

	if (a > 0) {
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}
}
int main()
{
	zanj0();
	solve();
	return 0;
}

Measured memory_bytes: 3664
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;

template <typename T>
void print_vec(const vector<T>& v, bool is_reverse=false, int num=0){
  if(num == 0) num = (int)v.size();
  if(is_reverse) for(int i=num-1; i>=0; i--){ cout<<v[i]; if(i!=0) cout<<" ";}
  else for(int i=0; i<num; i++){ cout<<v[i]; if(i!=num-1) cout<<" ";}
  cout << endl;
}

template <typename T>
void print_pairvec(const vector<T> &v, int num=0){
  if(num == 0) num = (int)v.size();
  cout << endl;
  for(int i=0; i<num; i++){ cout << v[i].first << " " << v[i].second << endl;}
}


template <typename TYPE>
void print_vec2(const vector<vector<TYPE>>& v){
  cout << endl; cout << "       ";
  for(int i=0; i<v[0].size(); i++) cout << i << "   "; 
  cout << endl;
	for(int i=0; i<v.size(); i++){
		cout << "i=" << i << ":   ";
		for(int j=0; j<v[i].size(); j++){
			if(v[i][j] == 0) cout << "\x1B[0m" << v[i][j] << "   ";
      else cout << "\x1B[31m" << v[i][j] << "   ";//https://stackoverrun.com/ja/q/12618775
		}
		cout << "\x1B[0m" << endl;
	}
}

int main(){
  ll W, H, x, y;
  cin >> W >> H >> x >> y;
  double S = W * H /2.0;
  // ll S = W * H;
  ll ans = 0;
  if(W == 2*x && H == 2*y) ans = 1;

 cout << fixed;//小数点を確実に10桁で表示するためのもの
 cout << setprecision(10); 

  cout << S << " " << ans << endl;
//  if(S%2 == 0) cout << S/2 << " " << ans << endl;
//  else cout << S/2 << ".5 " << ans << endl;

	return 0;
}



Measured memory_bytes: 3724
#include <bits/stdc++.h>
#define lli long long int
using namespace std;
#define MOD 1000000007
#define mod 1000000037
#define mod1 998244353
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); 
#define INF 2*1e9

int main()
{
    int n,k;
    cin >> n >> k;
    lli a=0,b=0;
    lli ans=0;
    lli l=k,r=n-k;
    for(int i=0;i<k;i++)
        a+=i;
    for(int i=n;i>n-k;i--)
        b+=i;
    ans=(b-a+1)%MOD;
    for(int i=k;i<=n;i++)
    {
        a+=l;
        b+=r;
        l+=1;r-=1;
        ans=(ans+b-a+1)%MOD;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3636
var i,j,n,ans:longint;
var s:ansistring;
begin
  readln(s);n:=length(s);
  i:=1;j:=n;
  while (i<=j) do
  begin
    if s[i]=s[j] then begin inc(i);dec(j);continue;end;
    if (s[i]='x') then begin inc(ans);inc(i);continue;end;
    if s[j]='x' then begin inc(ans);dec(j);continue;end;
    writeln(-1);exit;
  end;
  writeln(ans);
end.

Measured memory_bytes: 256
#include<iostream>
#include<cmath>
#include<vector>
#include<queue>
#include<algorithm>
#include <stack>
#include<set>
#include<cstring>
#include<iterator>
#include <map>
using namespace std;

int main() {
    long long ans = 0, i, n;
    cin >> n;
    double d, ch, ch1;
    cin >> d;
    for (i = 0; i < n; i++){
        cin >> ch >> ch1;
        if (ch * ch + ch1 * ch1 <= d * d)
            ans++;
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 3776
#include<iostream>
#include<fstream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<deque>
#include<set>
#include<map>
#include<bitset>
#include<ctime>
#include<queue>
using namespace std;
#define int long long
#define pii pair <int, int>
#define XX first
#define YY second

// constants:
const int mn = 500005;
const int mod = 1000000007;
const long long inf = 4444444444444444444;
const int sminf = 1111111111;
const bool is_multitest = 0;
const bool is_interactive = 0;

// i/o methods:
const bool input_from_file = 0;
const bool output_to_file = 0;
#define filename ""
#define in_extension "inp"
#define out_extension "out"

// data preprocessing: (e.g.: divisor generating, prime sieve)
int factr[mn];
void preprocess()
{
    factr[0]=1;
    for (int i=1; i<mn; i++) factr[i]=(factr[i-1]*i)%mod;
}

// global variables:
int powmod(int u, int v)
{
    if (v==0) return 1;
    int mid=powmod(u, v/2);
    mid=(mid*mid)%mod;
    if (v%2==0) return mid;
    else return (mid*u)%mod;
}
int dpret[105][105];
int dp(int u, int s)
{
    int ret=factr[u+s-1];
    ret=(ret*powmod(factr[s], mod-2))%mod;
    ret=(ret*powmod(factr[u-1], mod-2))%mod;
    return ret;
}

int getdpnn(int u, int k)
{
    int ret=1;
    for (int i=u; i<u+k; i++) ret=(ret*i)%mod;
    for (int i=1; i<=u; i++) ret=(ret*powmod(i, mod-2))%mod;
    return ret;
}

// main solution goes here:
int n, k;
void execute(int test_number)
{
    for (int i=0; i<105; i++) for (int j=0; j<105; j++) dpret[i][j]=-1;
    cin>>n>>k;
    // for (int i=1; i<=8; i++)
    // {
    //     for (int j=1; j<=8; j++) cout<<dp(i, j)<<"\t";
    //     cout<<"\n";
    // }

    if (k>=n)
    {
        cout<<dp(n, n);
    }
    else
    {
        int ans=dp(n, n);

        for (int i=k+1; i<n; i++)
        {
            ans=(ans-dp(n-i, n-(n-i))*dp(n-i+1, i)%mod+mod)%mod;
        }
        cout<<ans;
    }

    // cout<<(dp(n, n)-(dp(n-k-1, n)*dp(n-k, k+1))%mod+mod)%mod;
}
// REMEMBER TO CHOOSE TEST METHODS
// PLEASE REMOVE cout AND cerr DEBUG LINES BEFORE SUBMITTING PROBLEMS
// Solution by low_



















signed main()
{
#ifdef lowie
    freopen("test.inp", "r", stdin);
    freopen("test.out", "w", stdout);
#else
    if (input_from_file) freopen(filename"."in_extension, "r", stdin);
    if (output_to_file) freopen(filename"."out_extension, "w", stdout);
#endif
    if (!is_interactive)
    {
        ios_base::sync_with_stdio(0);
        cin.tie(0);
        cout.tie(0);
    }

    preprocess();
    int ntest;
    if (is_multitest) cin >> ntest;
    else ntest = 1;

    for (int testno = 1; testno <= ntest; testno++)
    // use for instead of while to serve facebook hacker cup test format
    {
        execute(testno); // only start coding in this function, not in main
    }
}
// Template by low_
// Contact me via mail: ttuandung1803@gmail.com
// ...or codeforces: www.codeforces.com/profiles/low_
// ...or if you're interested in food: www.instagram.com/lowie.exe/

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



int main() {
    int a;
    string s;
    cin >> a >> s;
    
    if(a >= 3200)
        cout << s << endl;
    else
        cout << "red" << endl;
    
    
    return 0;
}


Measured memory_bytes: 3624
#include <iostream>
#include <stdio.h>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <cmath>
#include <math.h>
#include <memory.h>
#include <deque>
#include <stdlib.h>
#include <time.h>
using namespace std;
typedef long long ll;
#define mp make_pair
const int M=100005;
const int N=1000001;
const int K=1000000000;
const ll MAX=1000000000000000000ll;
int n,a[M],dp[M],k;
int main(){
    cin>>n>>k;
    for(int i=0;i<n;i++)
    	scanf("%d",a+i);
    for(int i=n-2;i>=0;i--)
    {
    	dp[i]=K;
    	for(int j=1;j<=k&&i+j<n;j++)
    		dp[i]=min(dp[i],dp[i+j]+abs(a[i]-a[i+j]));
    }
    cout<<dp[0];
}

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

int gcd(int x, int y) { return (x % y)? gcd(y, x % y): y; }

int main() {
  int k, ans = 0;
  cin >> k;
  
  for (int x = 1; x <= k; x++){
      for (int y = 1; y <= k; y++){
          for (int z = 1; z <= k; z++){
                    ans += gcd(x, gcd(y, z));
          }
      }
  }
  cout << ans;
  return 0;
}


Measured memory_bytes: 3636
#define _USE_MATH_DEFINES
#include<iostream>
#include<vector>
#include<cstdio>
#include<string>
#include<algorithm>
#include <sstream>
#include<map>
#include<cmath>
#include<queue>
#include <functional>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define PI 3.141592


using namespace std;

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

	string str = "";
	cin >> str;

	int index = str.length() / 2;

	string A = str.substr(0, index);
	string B = str.substr(index);

	if (A == B)
	{
		cout << "Yes";
	}
	else
	{
		cout << "No";
	}
}


Measured memory_bytes: 256
import sys, io, os, re
from bisect import bisect, bisect_left, bisect_right, insort, insort_left, insort_right
from pprint import pprint
from math import sin, cos, pi, radians, sqrt, floor, ceil
from copy import copy, deepcopy
from collections import deque, defaultdict
from fractions import gcd
from functools import reduce
from itertools import groupby, combinations
from heapq import heapify, heappush, heappop

# sys.setrecursionlimit(5000)

n1 = lambda: int(sys.stdin.readline().strip())
nn = lambda: list(map(int, sys.stdin.readline().strip().split()))
f1 = lambda: float(sys.stdin.readline().strip())
fn = lambda: list(map(float, sys.stdin.readline().strip().split()))
s1 = lambda: sys.stdin.readline().strip()
sn = lambda: list(sys.stdin.readline().strip().split())
nl = lambda n: [n1() for _ in range(n)]
fl = lambda n: [f1() for _ in range(n)]
sl = lambda n: [s1() for _ in range(n)]
nm = lambda n: [nn() for _ in range(n)]
fm = lambda n: [fn() for _ in range(n)]
sm = lambda n: [sn() for _ in range(n)]

def array1(n, d=0): return [d] * n
def array2(n, m, d=0): return [[d] * m for x in range(n)]
def array3(n, m, l, d=0): return [[[d] * l for y in xrange(m)] for x in xrange(n)]
def linc(A, d=1): return list(map(lambda x: x + d, A))
def ldec(A, d=1): return list(map(lambda x: x - d, A))

S = s1()

if S[-1] == "s": S += "es"
else: S += "s"

print(S)

Measured memory_bytes: 72884
#include <bits/stdc++.h>
using namespace std;
#define mp(a,b) make_pair(a,b)
#define ff first
#define setp(a) setprecision(a)<<fixed
#define ss second
#define fori(v) for(ll i=0; i<v; i++)
#define forj(v) for(ll j=0; j<v; j++)
#define fork(v) for(ll k=0; k<v; k++)
#define forl(v) for(ll l=0; l<v; l++)
#define fort(v) for(ll t=0; t<v; t++)
#define forz(v) for(ll z=0; z<v; z++)
#define forx(v) for(ll x=0; x<v; x++)
#define fory(v) for(ll y=0; y<v; y++)
#define ll long long 
#define MAX 2020
#define MAX2 2020
#define pb(a) push_back(a)
#define M 1010
#define N 100100
typedef long double ld;
typedef complex<ld> pt;
typedef vector<pt> pol;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<ld> vd;
typedef vector<vd> vvd;
typedef pair<ll, ll> pii;
typedef vector<pii> vpii;
const ll INF = 0x3f3f3f3f;
const ll inf =  2*pow(10,9);
ll modulo = pow(10,9) + 7;

// matrix structure for classic Matrix exponentiation type of problems


struct Matrix{ // !!! everything is an integer , and we take modulo while exponentiating (is available up to 2^30) / multiplying 
			   // n should be nonzero
	vector<vector<ll> > arr;
	int n, m;
	Matrix(){}
	Matrix(int n, int m, bool id){			// if id is true (it must be a square matrix!!) identity matrix is created
		this->n = n , this->m = m;
		arr.resize(n, vector<ll> (m, 0));
		if(id)
			fori(n)
				arr[i][i] = 1;
	}
	Matrix(vector<vector<ll> > arr){
		this->arr = arr;
		n = arr.size();
		m = arr[0].size();
	}
	Matrix Multiply(Matrix& A){
		int n1 = A.n , m1 = A.m;
		assert(m==n1);
		vector<vector<ll> > lz;
		lz.resize(n); 
		fori(n){
			lz[i].resize(m1);
			forj(m1)	lz[i][j] = 0;
		}
		fori(n)
			for(int j1=0; j1<m1; j1++)
				for(int i1=0; i1 <n1; i1++)
					lz[i][j1]+=arr[i][i1]*A.arr[i1][j1], lz[i][j1]%=modulo;
		return Matrix(lz);
	}
	vector<ll>& operator [] (ll  i){
		return arr[i];
	}
};
void display(Matrix& A){
	cout<<"number of rows "<<A.n<<" number of columns "<<A.m<<endl;
	fori(A.n){
		forj(A.m)
			cout<<A.arr[i][j]<<' ';
		cout<<'\n';
	}
}
#define Max_pow 63
Matrix exponentiate(Matrix& B, ll pv){
	Matrix start( B.n, B.n, 1);
	for(ll i = 62; i>-1; i--){
		start = start.Multiply(start);
		if(((ll)1<<i) & pv)
			start = start.Multiply(B);
	}
	return start;
}
void deal(){
	ll n , k;
	cin>>n>>k;
	Matrix tr(n,n,0);
	fori(n)
		forj(n)
			cin>>tr[i][j];
	tr = exponentiate(tr, k);
	ll sum = 0;
	fori(n)
		forj(n)
			sum+=tr[i][j], sum%=modulo;
	cout<<sum;
}

int main()  
{
	cin.tie(0);
	ios_base::sync_with_stdio(0);
	deal();
} 









Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
 
int main() {
int N; cin>>N;
  vector<string> S(N);
  for(int i=0; i<N; i++){
    cin>>S.at(i);
  }
  int X=1;
  sort(S.begin(),S.end());
  for(int i=0; i<N-1; i++){
    if(S.at(i)!=S.at(i+1))
      X++;
    else continue;
  }
  cout<<X<<endl;
}

Measured memory_bytes: 9600
#include<iostream>
#include<queue>
#include<algorithm>
#include<vector>
#include<string>
#include<functional>
using namespace std;
string input;
class substr {
public:
	string str;
	int place;

};
bool operator<(substr a, substr b) {
	return a.str < b.str;
}

bool operator>(substr a, substr b) {
	return a.str > b.str;
}

substr bout;
bool issamebefore(substr&a) {
	substr b = bout;
	bout = a;
	return a.str == b.str;
}
void setup() {
	substr a;
	a.str = "";
	a.place = 0;
	bout = a;
}
bool updateandisok(substr&a) {
	if (a.place + a.str.size() < input.size()) {
		a.str += input[a.place + a.str.size()];
		return true;
	}
	return false;
}
int main() {
	cin >> input;
	priority_queue<substr, vector<substr>, greater<substr> > que;
	for (int i = 0; (unsigned int)i < input.size(); ++i) {
		substr d;
		d.place = i;
		d.str = input[i];
		que.push(d);
	}
	int time;
	cin >> time;
	setup();
	int count = 0;
	substr ans;
	while (true) {
		substr now = que.top();
		que.pop();
		if (!issamebefore(now)) {
			++count;
		}
		if (count == time) {
			ans = now;
			break;
		}
		if (updateandisok(now)) {
			que.push(now);
		}
	}
	cout << ans.str << endl;
	return 0;
}

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

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


// std::vector Declaration
template<typename T>
vector<T> make_v(size_t a) { return vector<T>(a); }
template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts) {
   return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

// std::vector Initialization
template<typename T>
void fill_all(T& arr, const T& v) { arr = v; }
template<typename T, typename U>
void fill_all(T& arr, const U& v) { for (auto& i : arr) fill_all(i, v); }

// std::vector Debug
template<typename T>
ostream& operator<<(ostream& os, const vector<T>& v) {
   os << "[";
   bool a = 1;
   for (auto e : v ) {
      os << (a ? "" : " "); 
      os << e;
      a = 0;
   }
   os << "]";
   return os;
}

// std::pair Debug
template<typename T, typename U>
ostream& operator<<(ostream& os, const pair<T, U>& p) {
   os << "(" << p.first << " " << p.second << ")";
   return os;
}

// std::set Debug
template<typename T>
ostream& operator<<(ostream& os, const set<T>& st) {
   os << "{";
   bool a = 1;
   for (auto e : st) {
      os << (a ? "" : " ");
      os << e;
      a = 0;
   }
   os << "}";
   return os;
}

// std::multiset Debug
template<typename T>
ostream& operator<<(ostream& os, const multiset<T>& st) {
   os << "{";
   bool a = 1;
   for (auto e : st) {
      os << (a ? "" : " ");
      os << e;
      a = 0;
   }
   os << "}";
   return os;
}

// std::map Debug
template<typename T, typename U>
ostream& operator<<(ostream& os, const map<T, U>& mp) {
   os << "{";
   bool a = 1;
   for (auto e : mp) {
      os << (a ? "" : " ");
      os << e.first << ":" << e.second;
      a = 0;
   }
   os << "}";
   return os;
}

// std::tuple Debug
template<int N,class Tuple>
void out(ostream& os,const Tuple& t){}
template<int N,class Tuple,class H,class ...Ts>
void out(ostream& os,const Tuple& t){
   if(N)os<<" ";
   os<<get<N>(t);
   out<N+1,Tuple,Ts...>(os,t);
}
template<class ...Ts>
ostream& operator<<(ostream& os, const tuple<Ts...>& t){
   os<<"(";
   out<0,tuple<Ts...>,Ts...>(os,t);
   os<<")";
   return os;
}

// Debug
#define DUMP(x) cout<<#x<<" = "<<(x)<<endl


struct edge { int to, cost; };

const LL LINF = 1LL<<60;
const int IINF = 1<<30;
const LL MOD = 1e9+7;

int main()
{
   string s; cin >> s;
   int cnt = 0;
   for (auto c : s) {
      if (c == 'o') ++cnt;
   }

   cnt += (15 - s.size());
   cout << (cnt >= 8 ? "YES" : "NO") << endl;

   return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<deque>
#include<cmath>
#include<map>
#include<cstring>

using namespace std;
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LLINF = 1LL<<60;
#define P pair<ll, ll>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define print(x) cout << (x) << endl

class mint {
    long long x;
public:
    mint(long long x=0) : x((x%MOD+MOD)%MOD) {}
    mint operator-() const {
      return mint(-x);
    }
    mint& operator+=(const mint& a) {
        if ((x += a.x) >= MOD) x -= MOD;
        return *this;
    }
    mint& operator-=(const mint& a) {
        if ((x += MOD-a.x) >= MOD) x -= MOD;
        return *this;
    }
    mint& operator*=(const  mint& a) {
        (x *= a.x) %= MOD;
        return *this;
    }
    mint operator+(const mint& a) const {
        mint res(*this);
        return res+=a;
    }
    mint operator-(const mint& a) const {
        mint res(*this);
        return res-=a;
    }
    mint operator*(const mint& a) const {
        mint res(*this);
        return res*=a;
    }
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t>>1);
        a *= a;
        if (t&1) a *= *this;
        return a;
    }
    // for prime MOD
    mint inv() const {
        return pow(MOD-2);
    }
    mint& operator/=(const mint& a) {
        return (*this) *= a.inv();
    }
    mint operator/(const mint& a) const {
        mint res(*this);
        return res/=a;
    }

    friend ostream& operator<<(ostream& os, const mint& m){
        os << m.x;
        return os;
    }
};
/* -- template -- */
const int MAX_DISH = 301;

double dp[MAX_DISH][MAX_DISH][MAX_DISH];
int cnt[3];
int N;
double solve(int one, int two, int thr) {
    if(one == 0 && two == 0 && thr == 0) return 0.0;
    if(dp[one][two][thr] > 0) return dp[one][two][thr];
    double ret = 0;
    if(one > 0) ret += solve(one - 1, two, thr) * one;
    if(two > 0) ret += solve(one + 1, two - 1, thr) * two;
    if(thr > 0) ret += solve(one, two + 1, thr - 1) * thr;
    ret += N;
    ret /= (one + two + thr);
    return dp[one][two][thr] = ret;
}

int main() {
    cin >> N;
    rep(i, N) {
        int a; cin >> a;
        rep(j, 3)
            if(a == j + 1)
                ++cnt[j];
    }
    printf("%.16f", solve(cnt[0], cnt[1], cnt[2]));
}


Measured memory_bytes: 213376
package main

import (
    "fmt"
    "sort"
)

func main() {
    var n, l int
    fmt.Scan(&n, &l)

    s := make([]string, n)
    for i := 0; i < n; i++ {
        fmt.Scan(&s[i])
    }

    sort.Strings(s)

    for j := 0; j < n; j++ {
        fmt.Print(s[j])
    }
    fmt.Println()
}

Measured memory_bytes: 512
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from heapq import *

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))

sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, M = MAP()

dic = defaultdict(list)
for i in range(N):
    a, b = MAP()
    dic[a].append((-1) * b)

ans = 0
incre = []

# M日後から1 ~ M日前
for i in range(1, M+1):
    for j in dic[i]:
        heappush(incre, j)
    if incre:# is exist 
        ans += -heappop(incre)
print(ans)




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

#define REP(i,n) for(int i=0; i < (n); ++i)
#define REPR(i,n) for(int i=(n); i >= 0; --i)
#define FOR(i, m, n) for(int i = (m); i < (n); ++i)

using ll = long long;
#define INF 1e9


int main(){
  int n;
  cin >> n;
  vector<int> a(n), b;
  REP(i, n){
    cin >> a[i];
    if(i % 2 == 0){
      b.push_back(a[i]);
    }
    else{
      b.insert(b.begin(), a[i]);
    }
  }

  if(n % 2){
    REPR(i, n-1){
      cout << b[i] << " ";
    }
    cout << endl;
  }
  else{
    REP(i, n){
      cout << b[i] << " ";
    }
    cout << endl;
  }
  



  return 0;
}


Measured memory_bytes: 3828
#include<bits/stdc++.h>
#include<iostream>
#include<cmath>
#include<vector>
#include<string>
#include<queue>
#include<set>
#include<map>
#include<algorithm>
#include<functional>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pullull;
typedef pair<ll, int> plli;
typedef pair<int, pii> pipii;
typedef vector<vector<int> > mati;
typedef vector<vector<double> > matd;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<vector<vector<ll>>> vvvll;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
typedef vector<vector<vector<bool>>> vvvb;

#define FOR(i,x,y) for(ll i=(ll)x; i<(ll)y; ++i)
#define REP(i,y) FOR(i, 0, y)
#define RFOR(i,x,y) for(ll i=(ll)x; i>=(ll)y; --i)
#define RREP(i,x) RFOR(i, x, 0)

template <typename T>
void vec_print(vector<T> VEC){
  REP(i, VEC.size()){
    cout << VEC[i] << " ";
  }
  cout << "\n";
};

template <typename T>
void mat_print(vector<vector<T> > MAT){
  REP(i, MAT.size()){
    REP(j, MAT[i].size()){
      cout << MAT[i][j] << " ";
    }
    cout << "\n";
  }
};

template <typename CLASS1, typename CLASS2>
class HOGE{
  public:
    CLASS1 key;
    CLASS2 value;
    HOGE(void){
      return;
    };
    HOGE(CLASS1 key, CLASS2 value){
      this->key = key;
      this->value = value;
    };
    ~HOGE(void){
      return;
    };

    void print(void){
      cout << "key : " << key << ", value : " << value << "\n";
      return;
    };
    
    bool operator==(const HOGE &obj){
      return (this->value == obj.value);
    };
    bool operator<(const HOGE &obj){
      return (this->value < obj.value);
    };
    bool operator>(const HOGE &obj){
      return (this->value > obj.value);
    };
};

constexpr int INF = (1<<30);
constexpr ll INFLL = 1LL<<62;
constexpr long double EPS = 1e-12;
constexpr ll MOD = (ll)((1E+9)+7);

int main(){
  cin.tie(0); // cut the cin and cout (default, std::flush is performed after std::cin)
  ios::sync_with_stdio(false); // cut the iostream and stdio (DON'T endl; BUT "\n";)

  ll N;
  cin >> N;
  vll A(N);
  ll total_A = 0;
  ll divide = 0;
  REP(i, N){
    cin >> A[i];
    total_A += A[i];
    divide += (i+1);
  }

  if(divide<=0){
    cout << "YES\n";
    return 0;
  }

  if(total_A%divide!=0){
    cout << "NO\n";
    return 0;
  }

  ll add_num = total_A/divide;
  ll over = 0;
  REP(i, N-1){
    ll over_count = 0;
    ll diff = A[i+1]-A[i];
    while(diff<add_num){
      diff+=N;
      over_count++;
    }
    if(diff!=add_num){
      cout << "NO\n";
      return 0;
    }
    over += over_count;
  }

  ll over_count = 0;
  ll diff = A[0]-A[N-1];
  while(diff<add_num){
    diff+=N;
    over_count++;
  }
  if(diff!=add_num){
    cout << "NO\n";
    return 0;
  }
  over += over_count;

  if(over!=add_num){
    cout << "NO\n";
    return 0;
  }

  cout << "YES\n";
  return 0;
}

Measured memory_bytes: 1024
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))

char s[99];
int main(){
	int cnt=0;
	while(1){
		char c=getchar();
		if(c==10)break;
		if(c=='B'){
			if(cnt>0)s[--cnt]=0;
		}else{
			s[cnt++]=c;
		}
	}
	puts(s);
}

Measured memory_bytes: 128
#include <iostream>
#include <cmath>
#include <string>
#include <set>
#include <vector>
#include <map>
#include <list>
#include <stack>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> p;

int main(void) {
    int n, i, cnt;
    cin >> n;
    
    if(n%2==0)
        cout << n << endl;
    else
        cout << n*2 << endl;
    
}


Measured memory_bytes: 256
# Date [ 2020-08-22 21:00:12 ]
# Problem [ a.py ]
# Author Koki_tkg

import sys;      from decimal import Decimal
import math;     from itertools import combinations, product
import bisect;   from collections import Counter, deque, defaultdict

# sys.setrecursionlimit(10 ** 6)
MOD = 10 ** 9 + 7
INF = 10 ** 9
PI = 3.14159265358979323846

def read_str():      return sys.stdin.readline().strip()
def read_int():      return int(sys.stdin.readline().strip())
def read_ints():     return map(int, sys.stdin.readline().strip().split())
def read_str_list(): return list(sys.stdin.readline().strip().split())
def read_int_list(): return list(map(int, sys.stdin.readline().strip().split()))
def lcm(a: int, b: int) -> int: return (a * b) // math.gcd(a, b)

def Main():
    n, x, t = read_ints()
    min = 0
    cnt = 0
    
    while True:
        cnt += x
        min += t
        if cnt >= n:
            break
    
    print(min)


if __name__ ==  '__main__':
    Main()

Measured memory_bytes: 9928
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll, ll> Pll;
#define rep(i,n) for(int (i) = 0; (i) < (int)(n); (i)++)
#define debug(var)  do{std::cout << #var << " : ";view(var);}while(0)
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
void Yes(){cout << "Yes" << endl;}
void No(){cout << "No" << endl;}
void YES(){cout << "YES" << endl;}
void NO(){cout << "NO" << endl;}
void err() {cout << -1 << endl;}
#define all(x) (x.begin(), x.end())

const int MOD = 1000000007;
const int INF = 1e9;

#define PI acos(-1);
int dx[4] = {1,-1,0,0};
int dy[4] = {0,0,1,-1};
int ddx[8] = {1,1,1,-1,-1,-1,0,0};
int ddy[8] = {0,1,-1,0,1,-1,1,-1};


int main(){
    int a, b;
    cin >> a >> b;
    cout << a*b-(a+b-1) << endl;
}

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

typedef long long ll;

int main(void)
{
    int k,a,b,i;
    cin>>k>>a>>b;
    for(i = a; i <= b; i++)
    {
        if(i % k == 0)
        {
            cout<<"OK\n";
            return 0;
        }
    }
    cout<<"NG\n";

    return 0;
}


Measured memory_bytes: 3624
#include<stdio.h>
#include<stdlib.h>
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int main(){
	int a,b,c,d;
	scanf("%d %d %d %d",&a,&b,&c,&d);
	a=abs(a-c);
	b=abs(b-d);
	c=gcd(a,b);
	a/=c;
	b/=c;
	printf("%d\n",(a+b-1)*c);
	return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#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;
typedef long long ll;

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

    int x;
    cin >> x;

    int res = 0;
    while(1){
        int now = x*res;
        if(now != 0 && now%360==0) break;
        ++res;
    }

    cout << res << endl;

    return 0;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
#include <boost/range/algorithm.hpp>
#include <boost/range/numeric.hpp>
#include <boost/range/irange.hpp>
#include <boost/range/adaptor/indexed.hpp>

using namespace std;
using namespace boost::adaptors;
using namespace std::string_literals;
using ll = int64_t;
using vecint = vector<int>;
using vecll = vector<ll>;
using boost::irange;

int main()
{
  int h,w;
  cin>>h>>w;
  vector<vecint> a(h, vecint(w));
  for(auto&& l:a) for(auto&& e:l) cin>>e;
  vector<vecint> b(h, vecint(w));
  for(auto&& l:b) for(auto&& e:l) cin>>e;
  vector<vector<vector<bool>>> table(h, vector<vector<bool>>(w, vector<bool>(55000, false)));
  table[0][0][25600] = true;
  for(auto&& i:irange(0,h)) {
    for(auto&& j:irange(0,w)) {
      int d = abs(a[i][j] - b[i][j]);
      for(auto&& k:irange(0,55000)) {
        if (!table[i][j][k]) continue;
        if (k+d < 55000) {
          if (j < w-1) table[i][j+1][k+d] = true;
          if (i < h-1) table[i+1][j][k+d] = true;
        }
        if (k >= d) {
          if (j < w-1) table[i][j+1][k-d] = true;
          if (i < h-1) table[i+1][j][k-d] = true;
        }
      }
    }
  }
  int d = abs(a.back().back() - b.back().back());
  int mn = 1000000000;
  for(auto&& i:irange(0,55000)) {
    if (!table.back().back()[i]) continue;
    int v1 = i+d-25600;
    int v2 = i-d-25600;
    mn = min({mn, abs(v1), abs(v2)});
  }
  cout<<mn<<endl;
  return 0;
}


Measured memory_bytes: 44160
s=input()
ans=[]
for i in range(len(s)):
  if s[i]=='0':
    ans.append(0)
  elif s[i]=='1':
    ans.append(1)
  elif ans==[]:
    continue
  else:
    ans.pop()
for j in range(len(ans)):
  print(ans[j],end='')

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

#ifndef __TOPCYBERFLOWER
#define debug(...) 0
#else
#define debug(...) cout << " [-] ", _dbg(#__VA_ARGS__, __VA_ARGS__)
template<class TH> void _dbg(const char *sdbg, TH h){ cout << sdbg << '=' << h << endl; }
template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) {
    while(*sdbg != ',') cout << *sdbg++;
    cout << '=' << (h) << ','; 
    _dbg(sdbg+1, a...);
}
#endif

using namespace std;
#define TYPEMAX(type)   numeric_limits<type>::max()
#define TYPEMIN(type)   numeric_limits<type>::min()
typedef long long ll;
typedef pair<int,int> pii;
const int MX=10005;
const int SZ=1005;
pii arr[SZ];
int memo[2*MX];
int main(void){
    ios_base::sync_with_stdio(false); cin.tie(NULL);
    int h,n; cin>>h>>n;
    for(int i=1;i<=n;i++) cin>>arr[i].first>>arr[i].second;
    for(int i=1;i<2*MX;i++) memo[i]=TYPEMAX(int)/2;
    for(int i=1;i<2*MX;i++){
        for(int j=1;j<=n;j++){
            int bef=i-arr[j].first;
            if(bef<0) continue;
            if(memo[i]>memo[bef]+arr[j].second){
                memo[i]=memo[bef]+arr[j].second;
            }
        }
    }
    int ans=TYPEMAX(int)/2;
    for(int i=h;i<2*MX;i++){
        //if(memo[i]==3) debug(i);
        ans=min(ans,memo[i]);
    }
    cout<<ans;
    return 0;
}

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

const double PI = acos(-1);

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
using P = pair<ll, ll>;
using V = vector<ll>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep1(i, n) for(ll i=1;i<=(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
#define ALL(obj) (obj).begin(), (obj).end()
#define RALL(obj) (obj).rbegin(), (obj).rend()
#define MOD 1000000007
#define INF 1000000000

void solve_abc_c() {
	ll n, m;
	ll k;
	ll h, w;
	//ll x;
	//ll a;
	string s;
	string s_ans;
	ll l_ans = 0;
	double d_ans = 0;
	
	cin >> h >> w >> k;

	vector<string> hw(h);
	rep(i, h) {
		cin >> hw[i];
	}

	ll num;
	rep(hb, 1 << h) {
		rep(wb, 1 << w) {
			num = 0;
			rep(i, h) {
				rep(j, w) {
					if (((hb >> i) & 1) == 0 && ((wb >> j) & 1) == 0) {
						if (hw[i][j] == '#') {
							num++;
						}
					}
				}
			}
			if (num == k) l_ans++;
		}
	}

	cout << l_ans << "\n";
}

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

	solve_abc_c();

	return 0;
}


Measured memory_bytes: 3608
#include <iostream>
#include <vector>
#include <stack>
#include <map>
#include <cmath>
#include <algorithm>

int main(int argc, char *argv[]){
    int K; int X;
    std::cin >> K >> X;
    int left = -1000000, right = 1000000;
    int i;
    for(i=X-K+1; i<X+K; ++i){
        if(i<left){
            continue;
        }else if(i>right){
            break;
        }
        std::cout << i << " ";
    }
    std::cout << std::endl;
    return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize(3)
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/priority_queue.hpp>
#define MAXN 5005
#define INF 1000000000000000000LL
#define MOD 1000000007
#define F first
#define S second
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef pair<int,int> P;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
typedef __gnu_pbds::priority_queue<int,greater<int>,pairing_heap_tag> pq;
ll n,a,b,p[MAXN];
ll dp[MAXN];
int main()
{
    scanf("%lld%lld%lld",&n,&a,&b);
    for(ll i=1;i<=n;i++) scanf("%lld",&p[i]);
    fill(dp+1,dp+n+1,INF);
    dp[0]=0;
    for(ll i=1;i<=n;i++)
    {
        ll cntx=0,cnty=0;
        for(ll j=i-1;j>=0;j--)        
        {
            if(p[j]<p[i]) dp[i]=min(dp[i],dp[j]+cntx*b+cnty*a);
            if(p[j]<p[i]) cntx++; else cnty++;
        }
    }
    ll ans=INF;
    for(ll i=1;i<=n;i++) ans=min(ans,dp[i]+(n-i)*b);
    printf("%lld\n",ans);
    return 0;
}



Measured memory_bytes: 384
#include<bits/stdc++.h>
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define rep(i,a,b) for (int i=(a); i<(b); i++)
#define per(i,a,b) for (int i=(b-1); i>=(a); i--)
#define de(x) cout << #x << " => " << x << endl
using namespace std;

#define fi first
#define se second
#define mp make_pair
typedef pair<int,int> pii;

#define pb push_back
typedef vector<int> vi;

typedef long long ll;
typedef long double ld;

const int N = 1e2 + 7;
const ll INF = 9e18 + 7;
pii p[N]; int n, m;
///----------------------------------------------
ll gao(vector<pii> &vu, int dx) {
	if (sz(vu) < m) return INF;
	rep(i, 0, sz(vu)) swap(vu[i].fi, vu[i].se);
	sort(all(vu));
	ll ret = INF;
	rep(l, 0, sz(vu) + 1 - m) ret = min(ret, 1ll * (vu[l + m - 1].fi - vu[l].fi) * dx);
	return ret;
}
int main() {
	scanf("%d%d", &n, &m);
	rep(i, 0, n) scanf("%d%d", &p[i].fi, &p[i].se);
	sort(p, p + n);
	ll ans = -1;
	rep(lx, 0, n) rep(rx, lx, n) {
		vector<pii> vu;
		rep(x, lx, rx + 1) vu.pb(p[x]);
		ll tmp = gao(vu, p[rx].fi - p[lx].fi);
		if (!~ans || ans > tmp) ans = tmp;
	}
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<sstream>
#include<vector>
#include<algorithm>
#include<string>
#include<stdexcept>
#include<stdio.h>
#include<queue>
#include<stack>
#include <cmath>
#include<bits/stdc++.h>
#include<math.h>
#include<iomanip>
#define cinf(n,x) for(int i=0;i<n;i++) cin >> x[i];
#define pi pair<int,int> 
using namespace std;
using ll = long long;

int main(){
    ll w,h,x,y;
    cin >> w >> h >> x >> y;
    cout << fixed << setprecision(10) << (double)w*h/2 << " ";
    if(2*x == w && 2*y == h) cout << "1";
    else cout << "0";
    return 0;
}

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

int main() {
	int n;
	int a[3000];
	int ans = 0;
	cin >> n;
	for(int i=0; i!=n; i++){
		cin >> a[i];
		ans += a[i] - 1;
	}
	cout << ans << '\n';
	return 0;
}

Measured memory_bytes: 256
from sys import stdin

input = stdin.readline

n = int(input())

A = [int(input()) for _ in range(n)]

maxval = -2000000000
minval = A[0]
for i in range(1,len(A)):
	maxval = max(maxval,A[i]-minval)
	minval = min(minval,A[i])

print(maxval)




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

using namespace std;

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

  int n, m;
  cin >> n >> m;
  vector<int> X(m);
  for (auto &x : X) cin >> x;
  int res = 0;
  if (n < m) {
    sort(X.begin(), X.end());
    vector<int> gaps(m-1);
    for (int i = 1; i < m; ++i) {
      gaps[i-1] = X[i]-X[i-1];
    }
    sort(gaps.begin(), gaps.end());
    for (int i = 0; i < m-n; ++i) {
      res += gaps[i];
    }
  }
  cout << res << endl;

  return 0;
}



Measured memory_bytes: 1024
#pragma region header
#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 namespace std;
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep1(i, n) for (int i = 1; i <= (int)(n); i++)
#define rev(i, n) for(int i = (int)(n - 1); i >= 0; i--)
#define rev1(i, n) for(int i = (int)(n); i > 0; i--)
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define resort(v) sort((v).rbegin(), (v).rend())
#define vi vector<int>
#define vvi vector<vector<int>>
#define vc vector<char>
#define vvc vector<vector<char>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
using ll = long long;
using P = pair<int, int>;
/* ----------------よく使う数字や配列----------------- */
int dx[] = { 1,0,-1,0 };
int dy[] = { 0,1,0,-1 };
constexpr ll mod = 1e9 + 7;
constexpr ll inf = INT32_MAX / 2;
constexpr ll INF = LLONG_MAX / 2;
constexpr long double eps = DBL_EPSILON;
constexpr long double pi = 3.141592653589793238462643383279;
/* ----------------------end----------------------- */

/* --------------------テンプレート------------------ */
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
/* ----------------------end----------------------- */

/* --------------------ライブラリ-------------------- */
ll fact(int i) {       //階乗
    if (i == 0) return 1;
    return (fact(i - 1)) * i % mod;
}
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 keta(ll n) {        //桁数を求める
    if (n == 0) return 1;
    int count = 0;
    while (n != 0) {
        n /= 10;
        count++;
    }
    return count;
}
bool isprime(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 ketasum(ll n) {    //各桁の和
    ll sum = 0;
    while (n != 0) {
        sum += n % 10;
        n /= 10;
    }
    return sum;
}
/* ----------------------end----------------------- */
#pragma endregion
signed main() {
    string s;
    cin >> s;
    int size = s.size();
    rep(i, size) {
        if (i % 2 == 0) {
            cout << s.at(i);
        }
    }
}






Measured memory_bytes: 3612
#include<bits/stdc++.h>
#include<stdio.h>
#define debug(x) cout << '>' << #x << ':' << x << endl;

#define nitro ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL);
const int INF = 1e9+5;
using namespace std;
using ll = unsigned long long int;
const ll mod = 998244353; 

ll ncr(int n, int r = 2)
{
	ll ans = (n*(n-1))/r;
	return ans;
} 
int main()
{
	

	//freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
	//clock_t time_req;time_req = clock(); 
	ll p = 100;
	ll fv;

	double rate= 0.01;
	cin >> fv;
	int t = 0;
	while(p<fv)
	{
		ll a = p*(1+rate);
		p = a;
		//cout << a << " ";
		t++;
	}
	cout << t << endl;

	//time_req = clock()- time_req;cout << "Time Complexity:"<< \n'<<(float)time_req/CLOCKS_PER_SEC << " seconds" << endl; 
	return 0;
 }
  	

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

int N;
int v = 0;
int w = 0; //1個の寿司が乗った皿がl枚
int x = 0; //2個の寿司が乗った皿がm枚
int y = 0; //3個の寿司が乗った皿がn枚

double pow2(double val) {
    return val * val;
}

// k: 0個の皿の数
// l: 1個の皿の数
// m: 2個の皿の数
// n: 3個の皿の数
// prob: ここのステートにたどり着くまで確率
// その状態から皿が全て0枚になるまでに必要な操作回数の期待値
double get_expectation(double ***DP, int k, int l, int m) {
//double get_expectation(double ****DP, int k, int l, int m, int n, double prob) {
    if (DP[k][l][m] != -1) {
        return DP[k][l][m];
    }
    if ((k + l + m) == 0)
        return 0;
    double dk = (double) k;
    double dl = (double) l;
    double dm = (double) m;
    double dN = (double) N;
    //可能な遷移先
    // k + 1, l - 1 (l > 1)
    DP[k][l][m] = 1;
    // m + 1, n - 1 (n > 1)
    if (k >= 1) {
        //DP[k][l][m][n] += get_expectation(DP, k, l, m + 1, n - 1, prob * dn / dN);
        DP[k][l][m] += get_expectation(DP, k - 1, l, m) * dk / dN;
    }
    if (l >= 1) {
        //DP[k][l][m][n] += get_expectation(DP, k + 1, l - 1, m, n, prob * dl / dN);
        DP[k][l][m] += get_expectation(DP, k + 1, l - 1, m) * dl / dN;
    }
    // l + 1, m - 1 (m > 1)
    if (m >= 1) {
        //DP[k][l][m][n] += get_expectation(DP, k, l + 1, m - 1, n, prob * dm / dN);
        DP[k][l][m] += get_expectation(DP, k, l + 1, m - 1) * dm / dN;
    }

    DP[k][l][m] /= (1 - (N - dk - dl - dm) /dN);
    //printf("%lf\n", DP[k][l][m][n]);
    return DP[k][l][m];
}

int main() {
    scanf("%d", &N);
    int *a = malloc((N + 1) * sizeof(int));
    double ***DP = malloc((N+1) * sizeof(double**));

    for (int i = 1; i <= N; i++) {
        scanf("%d", &a[i]);
        if (a[i] == 1)
            w += 1;
        else if (a[i] == 2)
            x += 1;
        else
            y += 1;
    }

    for (int i = 0; i <= N; i++) {
        DP[i] = malloc((N+1) * sizeof(double*));
        for (int j = 0; j <= N; j++) {
            DP[i][j] = malloc((N+1) * sizeof(double));
            for (int k = 0; k <= N; k++) {
                DP[i][j][k] = -1;
            }
        }
    }

    //double ans = get_expectation(DP, v, w, x, y, 1.0);
    double ans = get_expectation(DP, w, x, y);

    printf("%1.10lf", ans);
    return 0;
}


Measured memory_bytes: 214784