akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int n;
	cin>>n;
	int a[n], b[n];
	for(int i=0; i<n; i++)
	{
		cin>>a[i];
	}
	for(int i=0; i<n; i++)
	{
		b[a[i]-1]=i+1;
	}
	for(int i=0; i<n; i++)
	{
		cout<<b[i]<<" ";
	}
}

Measured memory_bytes: 1536
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

int main(){
    int n, m;
    cin>>n>>m;
    vector<int>vec(m, 0);
    for(int i=0;i<m;i++){
        int a, b;
        cin>>a>>b;
        if(b>n){
            vec[i]=b-n;
        }
    }
    sort(vec.begin(), vec.end());
    int ans = 0;
    for(int i=0;i+1<vec.size();i++){
        ans+=vec[i];
    }
    cout<<ans<<endl;

    return 0;
}


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


int main()
{
  int a;
  cin >> a;
  printf("%d\n", a + a * a + a * a * a);
  return 0;
}

Measured memory_bytes: 3656
#include <iostream>
#include <string>
#include <vector>
#include <iomanip>
#include <algorithm>
#include <tuple>
#include <queue>
#include <set>
#include <math.h>
#include <array>
#include <list>
#include <set>
#define MOD 1000000007
#define INF 1000000000
using namespace std;
typedef long long ll;
typedef tuple<ll,int,int> p;
typedef vector<int> vi;
set <int> st;
double ax,ay,bx,by,cx,cy;
double triangle=0.0;
vector<int> videos(105);
double now=0;
queue<int> num;
vector<string> s(15);
int l,ssize;
vi a(105,0);
vi b(105,0);
int main(int argc,char const* argv[])
{
  string s;
  cin >> s;
  if((int)s.size()==2)
    {
      cout << s << endl;
    }
  else if((int)s.size()==3)
    {
      reverse(s.begin(),s.end());
      cout << s << endl;
    }
  return 0;
}


Measured memory_bytes: 256
a = list(input())

for i in range(8):
    cou = int(a[0])
    ans = a[0]
    for j in range(3):
        if i >> j & 1 == 1:
            cou += int(a[j+1])
            ans += "+" + a[j+1]
        elif i >> j & 1 != 1:
            cou -= int(a[j+1])
            ans += "-" + a[j+1]
    if cou == 7:
        print(ans + "=7")
        exit()

Measured memory_bytes: 3064
#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<string>
#include<cstring>
#include<cstdlib>
using namespace std;
int n;string s,t; 
int main()
{
  cin>>n>>s>>t;
  for(int i=n;i>=0;i--)if(s.substr(n-i,i)==t.substr(0,i)){cout<<n+n-i<<endl;return 0;}
  return 0;
}


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

#define ll long long
#define vi vector<int>
#define vl vector<ll>
#define pii pair<int,int>
#define pll pair<ll,ll>
// pll pp; -> (pp.first,pp.second)
// vector<vl> pp(n,vl(2)); sort(pp.begin(),pp.end(),[](vl a,vl b){return a[0]<b[0];});

#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define RREP(i,n) for(ll (i)=(n)-1;(i)>=0;(i)--)
#define FOR(i,a,b) for(ll (i)=(a);(i)<(b);(i)++)
#define FORR(i,a,b) for(ll (i)=(b)-1;(i)>=(a);(i)--)
#define DEBUG(x) cout << #x << ": " << x << endl
#define CHMAX(a,b) a=max((a),(b))
#define CHMIN(a,b) a=min((a),(b))
/*}}}*/
ll MOD = 1e9+7;
int main() {
  ll n,m;
  cin >> n >> m;
  vl a(n);
  REP(i,n) cin >> a[i];
  ll cnt = 0;
  vl dp(n+1,0);
  REP(i,n+1){
    if(i==0){
      dp[i] = 1;
      continue;
    }
    if(cnt<m && i==a[cnt]){
      cnt++;
      dp[i] = 0;
      continue;
    }
    dp[i] += dp[i-1];
    dp[i] %= MOD;
    if(i==1) continue;
    dp[i] += dp[i-2];
    dp[i] %= MOD;
  }
  cout << dp[n]<< endl;
  return 0;
}


Measured memory_bytes: 1792
import math
def I():
  return input()
def II():
  return int(input())
def MII():
  return map(int, input().split())
def LMII():
  return list(map(int, input().split()))

n = II()
x = 0
m = 100
while m < n:
  m = m*101//100
  x += 1
  
print(x)

Measured memory_bytes: 63112
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
#define chmin(a, b) ((a)=min((a), (b)))
#define chmax(a, b) ((a)=max((a), (b)))
#define fs first
#define sc second
#define eb emplace_back
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;

const ll MOD=1e9+7;
const ll INF=1e18;
const double pi=acos(-1);
const double eps=1e-10;

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

int n;
const int MAX_V = 100010;

vector<vector<int>> g(MAX_V);
bool visited[MAX_V];
int indeg[MAX_V];
list<int> out;

void bfs(int s){
    queue<int> que;
    que.push(s);
    visited[s] = true;

    while(que.size()){
        int cv = que.front(); que.pop();
        out.push_back(cv);
        for(int i=0; i<g[cv].size(); i++){
            int nv = g[cv][i];
            indeg[nv]--;
            if(indeg[nv] == 0 && !visited[nv]){
                visited[nv] = true;
                que.push(nv);
            }
        }
    }
}

void tsort(){
    for(int i=0; i<n; i++){
        for(int j=0; j<g[i].size(); j++){
            int v = g[i][j];
            indeg[v]++;
        }
    }

    for(int i=0; i<n; i++){
        if(indeg[i] == 0 && !visited[i]) bfs(i);
    }

    for(auto itr=out.begin(); itr!=out.end(); itr++){
        cout << *itr + 1 << endl;
    }
}

int main(){
    int m; cin>>n>>m;
    while(m--){
        int s, t; cin>>s>>t;
        s--, t--;
        g[s].eb(t);
    }

    tsort();
}


Measured memory_bytes: 5028
#include<iostream>
#include<vector>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<queue>
#include<set>
using namespace std;
int gi() {
	int w=0;bool q=1;char c=getchar();
	while ((c<'0'||c>'9') && c!='-') c=getchar();
	if (c=='-') q=0,c=getchar();
	while (c>='0'&&c <= '9') w=w*10+c-'0',c=getchar();
	return q? w:-w;
}
int a[100001];
int main()
{
	int n=gi(),i,x,y,s,g;
	for (i=1;i<=n;i++) a[i]=gi();
	sort(a+1,a+1+n);
	reverse(a+1,a+1+n);
	x=y=1;
	while (x<n&&a[x+1]>y) x++,y++;
	s=0;g=(a[x]-y)&1;
	while (++x<=n) if (y<=a[x]) s^=1; else break;
	puts(s||g?"First":"Second");
	return 0;
}


Measured memory_bytes: 640
from sys import exit
import math
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

n,k = mi()
a = li()

pre = a[0]
cnt=0
for i in range(k,n,1):
    if pre < a[i]:
        print("Yes")
    else:
        print("No")
    cnt+=1
    pre = a[cnt]

Measured memory_bytes: 33036
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rrep(i,n) for (int i = (int)(n)-1; i>=0; --i)
#define For(i,a,b) for(auto i=(a);i<=(b);++i)
#define rFor(i,a,b) for(auto i=(b);i>=(a);--i)
#define call(var) cerr<<#var<<"="<<var<<"\n";
#define dup(x,y) (((x)+(y)-1)/(y))
#define all(x) (x).begin(),(x).end()
using ll=long long;
using vi = vector<int>;
using vl = vector<ll>;
using vb = vector<bool>;
using Graph = vector<vi>;
using P = pair<int,int>;
const int MOD=(int)1e9+7;
const int INF=(int)1e9;
const ll LINF=(ll)1e18;
const double pi = acos(-1);
template<class t,class u> inline bool chmax(t&a,u b){if(a<b){a=b;return true;}return false;}
template<class t,class u> inline bool chmin(t&a,u b){if(b<a){a=b;return true;}return false;}
template<class T> istream& operator>>(istream& is, vector<T>& a){rep(i,a.size()) is >> a[i]; return is;}
template<class T> ostream& operator<<(ostream& os, vector<T>& a){rep(i,a.size()) os << a[i] << " "; return os;}
template<class T, class U> istream& operator>>(istream& is, pair<T,U>& p){is >> p.first >> p.second; return is;}
template<class T, class U> ostream& operator<<(ostream& os, const pair<T,U>& p){os << "("<< p.first << "," << p.second << ")"; return os;}
template<class T, class U> ostream& operator<<(ostream& os, const map<T,U>& mp){for(auto& t : mp) os << t.first << " " << t.second << "\n"; return os;}

int main(){
    ll n;cin >> n;
    string ans = "";
    bool ok = false;
    while(n){
        ans += (char)('a' + (n-1)%26);
        --n;
        n /= 26;
    }
    reverse(all(ans));
    cout << ans << "\n";
}

Measured memory_bytes: 3624
//#include "pch.h"
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <limits.h>
#include <string>
#include <deque>
#include <cmath>
#include <bitset>
#include <time.h>
#include <stdio.h>

using namespace std;
typedef long long ll;
typedef pair<double, double> P;

#define rip(i, n, s) for (int i = (s);i < (int)( n ); i++)
#define mpa make_pair
#define all(a) a.begin(), a.end()

template<typename T>
void vdeb(vector<T> &da) {
	int size = da.size();
	for (int i = 0;i < size;i++) {
		if (i == size - 1) {
			cout << da[i] << endl;
		}
		else {
			cout << da[i] << ' ';
		}
	}
}
template<typename T>
void vvdeb(vector<T> &da) {
	int size = da.size();
	for (int i = 0;i < size;i++) {
		vdeb(da[i]);
	}
}

double ans = 15000;
P now;

double dist(P x, P y){
	double rr = (x.first-y.first)*(x.first-y.first) + (x.second-y.second)*(x.second-y.second);
	//cout << rr << endl;
	return sqrt(rr);
}

double q(double x){
	return x*x;
}

P cent(P x, P y, P z){
	double a = x.first, b = x.second, c = y.first, d = y.second,e = z.first, f = z.second;
	P ret;
	ret.second = ((e-a)*(q(a) + q(b) - q(c) - q(d)) - (c-a)*(q(a) + q(b) - q(e) - q(f))) /((e-a)*(b-d)-(c-a)*(b-f));
	ret.second /= 2;
	b = x.first, a = x.second, d = y.first, c = y.second, f = z.first, e = z.second;
	ret.first = ((e-a)*(q(a) + q(b) - q(c) - q(d)) - (c-a)*(q(a) + q(b) - q(e) - q(f))) /((e-a)*(b-d)-(c-a)*(b-f));
	ret.first /= 2;
	return ret;
}

double cal(P x, P y, P z){
	double s = (x.first-z.first)*(x.second-y.second);
	//cout << s << endl;
	s-= (x.second - z.second)*(x.first-y.first);
	s *= 2;
	s = abs(s);
	if(s == 0){
		double ret = max(dist(x,y),max(dist(y,z),dist(z,x)));
		return 15000;
	}
	double ret = dist(x,y) * dist(y,z) * dist(z,x);
	//cout << ret/s << endl;
	now = cent(x,y,z);
	//cout << s << endl;
	return ret/s;
}


int main(){
	int n;
	cin >> n;
	vector<P> da(n);
	rip(i,n,0) cin >> da[i].first >> da[i].second;
	if(n==2){
	printf("%07f\n", dist(da[0], da[1])/2);
	return 0;
	}
	rip(i,n-2,0){
		rip(j,n-1,i+1){
			rip(k,n,j+1){
				double dit = cal(da[i], da[j], da[k]);
				//printf("%d %d %d\n",i,j,k);
				rip(l,n,0){
					if(dit < dist(da[l], now) - 0.0000001 && l !=i && l != j && l != k){
						dit = 15000;
					}
				}
				ans = min(ans, dit);
			}
		}
	}
	rip(i,n-1,0){
		rip(j,n,i+1){
			double dit = dist(da[i],da[j])/2;
			now.first = (da[i].first + da[j].first)/2;
			now.second = (da[i].second + da[j].second)/2;
			rip(l,n,0){
				if(dit < dist(da[l], now) && l !=i && l != j){
					dit = 15000;
				}
			}
			ans = min(ans, dit);
		}
	}
	printf("%.07f\n", ans);
}


Measured memory_bytes: 256
//#include "SaveFuncs.cpp"

/*****/

#include <iostream>
#include <array>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <queue>
#include <stack>
#include <map>
#include <iomanip>	//cout << fixed << setprecision(桁数);
#include <stdexcept>

using namespace std;
using ll = long long;

#define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; i++)
#define rep1(i, n) for(int i=1, i##_len=(n); i<i##_len; i++)
#define rrep(i, n) for(int i=(n)-1; i >= 0; i--)
#define rrep1(i, n) for(int i=(n); i > 0; i--)
#define all(x) (x).begin(), (x).end()
#define pair(a, b) make_pair(a, b);
//#define int long long
constexpr int INF = 2000000100;
constexpr ll DIV = 1000000007;	// 10e9+7
template<class T> bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> T divUp(T a, T b) { if (a % b == 0) { return a / b; } return a / b + 1; }
std::string strMulti(std::string t, int n) { std::string out = ""; for (int i = 0; i < n; i++) { out += t; } return out; }
template<class T> T math_P(T m, T n) { T ret = 1; for (T i = m; i > m - n; i--) { ret *= i; } return ret; }
template<class T> T math_C(T m, T n) { T ret = mathP(m, n); for (T i = 2; i <= n; i++) { ret /= i; } return ret; }
template<class T> bool compare_by_b(pair<T, T> a, pair<T, T> b) { if (a.second != b.second) { return a.second < b.second; } return a.first < b.first; }
template<class T> T math_gcd(T a, T b) { a = abs(a); b = abs(b); if (a < b) { std::swap(a, b); } T tmp; while (b != 0) { tmp = b; b = a % b; a = tmp; } return a; }
template<class T> T math_lcm(T a, T b) { a = abs(a); b = abs(b); if (a > b) { std::swap(a, b); } if (a == 1) { return b; } T i = a; while (i % b != 0) { i += a; } return i; }

/*****/

int Main()
{
	int A, B;
	cin >> A >> B;

	int mouse = 1;
	int cnt = 0;
	while (mouse < B)
	{
		mouse += A - 1;
		cnt++;
	}

	cout << cnt;

	return 0;
}

/*****/

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

	//std::cout << std::fixed << std::setprecision(10);

	Main();

	return 0;
}


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

using namespace std;

int main() {
	int count;
	cin >> count;
	int scoreA =0 , scoreB = 0;
	for (int i = 0; i < count; i++) {
		string a, b;
		cin >> a >> b;
		if (a < b) {
			scoreB += 3;
		}
		else if (a > b) {
			scoreA += 3;
		}
		else {
			scoreA++;
			scoreB++;
		}
		

	}
	cout << scoreA << ' ' << scoreB << endl;
	return 0;
}

Measured memory_bytes: 3180
#include<iostream>
#include<algorithm>
#include<cmath>
#include<string>
#include<vector>

using namespace std;

unsigned long long int a = 0, b = 0, c =1, d = 0, e = 9999, n = 0, maxy = 0, mini = 9999, counter = 0, sur = 0,kuso=0,kuso2=0,ans=0;
std::vector<unsigned long long int> vec{};
std::vector<std::string>str{};
std::vector<std::string>str2{};

int arraykun[2300] = {}, nyan[1001] = {}, koji[50][50];
std::string output, output2, input,nyahhoi;
int kakunou[50][50] = { 53 };

int ctoi(const char c) {
	if ('0' <= c && c <= '9') return (c - '0');
	return -1;
}
unsigned long long int LCM(unsigned long long int a, unsigned long long int b) {
	unsigned long long int i, j;
	i = a; j = b;
	while (true) {
	
		c = i % j;
		i = j;
		if (c != 0) {
		
			j = c;

		}
		else {
			break;
		}
	}
	return j * (a / j) * (b / j);
}
int main()
{
	cin >> a>>b;

	for (int i = 0; i < a; i++) {
		cin >> c;
		vec.push_back(c);
	}
	
	for (int i = 0; i < a-1; i++) {
		if (vec[i] + b > vec[i + 1]) {
			ans += vec[i + 1] - vec[i];
		}
		else {
			ans += b;
		}
	}
	cout << ans+b << endl;

}






Measured memory_bytes: 2420
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = sc.nextInt();
        }
        int ans = 0;
        for (int i = 0; i < n - 1; i++) {
            if (a[i] == a[i + 1]) {
                ans++;
                a[i + 1] = 0;
            }
        }
        System.out.println(ans);
    }

}


Measured memory_bytes: 22732
x = gets.to_i

y = 130.times.map {|i| i ** 5}

130.times do |i|
    130.times do |j|
        if y[i] - y[j] == x
            puts "#{i} #{j}"
            exit
        elsif y[i] + y[j] == x
            puts "#{i} #{-j}"
            exit
        end
    end
end


Measured memory_bytes: 14416
import java.util.Scanner;
import java.util.Arrays;

public class Main {

	public void run() {
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int[] x = new int[n];
		for(int i = 0; i < n; i++) {
			x[i] = sc.nextInt();
		}

		int[] y = Arrays.copyOf(x, x.length);

		Arrays.sort(x);

		for(int i = 0; i < n; i++) {
			if(y[i] <= x[(n - 1) / 2]) {
				System.out.println(x[(n + 1) / 2]);
			}
			else {
				System.out.println(x[(n - 1) / 2]);
			}
		}
	}

	public static void main(String[] args) {
		new Main().run();
	}
}


Measured memory_bytes: 90156
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;

int main(){
    int d[100002]={0};
    int N=0;
    cin >> N;
    for(int i=1;i<=N;i++){
        cin >> d[i];
    }
    d[N+1]=0;
    int sum=0;
    
    for(int i=0;i<=N+1;i++){
        sum += abs(d[i+1]-d[i]);
    }
    
    
    d[N+1]=0;
    
    for(int i=1;i<=N;i++){       //i番目の町を省略する
        int od=0;
        if(d[i-1]<d[i]&&d[i+1]<d[i]){
            od= min(abs(d[i]-d[i-1])*2,abs(d[i+1]-d[i])*2);
        }else if(d[i]<d[i-1]&&d[i]<d[i+1]){
            od= min(abs(d[i]-d[i-1])*2,abs(d[i+1]-d[i])*2);
        }
        cout << sum-od<<endl;
    }
    
    
    
    return 0;
}


Measured memory_bytes: 1664
#include<stdio.h>
#include<string>
#include<math.h>
#include<stdlib.h>
#include<set>
#include<bitset>
#include<map>
#include<vector>
#include<string.h>
#include<algorithm>
#include<iostream>
#include<queue>
#include<deque>
#include<stack>
#include<cmath>
#include<ctime>
#include<complex>
#include<list>
#include<limits.h>
#include<iomanip>
using namespace std;

const int N=1e5+5;
int n,rt;
map<long long,int> mp;
int sz[N];
long long dp[N];
priority_queue<long long> pq;
vector<int> nei[N];

void dfs(int x){
	for(int i=0;i<nei[x].size();i++){
		dfs(nei[x][i]);
		dp[x]+=dp[nei[x][i]]+sz[nei[x][i]];
	}
}

int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++){
		long long x;
		scanf("%lld",&x);
		mp[x]=i;
		pq.push(x);
		sz[i]=1;
	}
	while(!pq.empty()){
		long long num=pq.top();
		pq.pop();
		int x=mp[num];
		rt=x;
		if(pq.empty()) break;
		num-=n-sz[x];
		num+=sz[x];
		if(mp.find(num)==mp.end()){
			puts("-1");
			return 0;
		}
		int y=mp[num];
		sz[y]+=sz[x];
		nei[y].push_back(x);
	}
	dfs(rt);
	if(dp[rt]!=(mp.begin())->first){
		puts("-1");
		return 0;
	}
	for(int i=1;i<=n;i++) for(int j=0;j<nei[i].size();j++) printf("%d %d\n",i,nei[i][j]);
	return 0;
}

Measured memory_bytes: 17396
#include <stdio.h>
#include <vector>

int main(void){

#ifdef __McDic__ // Local testing I/O
    freopen("VScode/IO/input.txt", "r", stdin);
    freopen("VScode/IO/output.txt", "w", stdout);
#endif

    typedef long long int lld;
    const lld MOD = 1000 * 1000 * 1000 + 7;
    int n; lld k; scanf("%d %lld", &n, &k);
    std::vector<int> a(n, 0);
    for(int i=0; i<n; i++) scanf("%d", &a[i]);

    // Pre computation
    std::vector<int> less_than(n, 0), later_less_than(n, 0);
    for(int now=0; now<n; now++){
        for(int prev=0; prev<now; prev++) if(a[prev] < a[now]) less_than[now]++;
        for(int next=now; next<n; next++) if(a[now] > a[next])
            less_than[now]++, later_less_than[now]++;
    }

    lld answer = 0;
    for(int now=0; now<n; now++){
        answer += later_less_than[now] * k % MOD; answer %= MOD;
        answer += (k-1) * k / 2 % MOD * less_than[now] % MOD; answer %= MOD; 
    } printf("%lld\n", answer);
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<math.h>
#include<string.h>
using namespace std;

int seiyaku_check(long i,long Min,long Max){
	if(Min <= i && i <= Max){
		return 1;
	}else{
		exit(1);
		//return 0;
	}
}

int main(){
	
	int a[5];
	int b;
	int c=0;
	
	for(int i=0;i<5;i++){
		cin >> a[i];
		seiyaku_check(a[i],0,123);
	}
	
	cin >> b;
	
	for(int j=0;j<4;j++){
		for(int k=j+1;k<5;k++){
			if(b*b < (a[k]-a[j])*(a[k]-a[j])){
				c++;
			}
		}
	}
	
	if(c>0){
		cout << ":(" << endl;
	}else{
		cout << "Yay!" << endl;
	}	
	
return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cmath>
#include <queue>
#include <utility>
#include <map>
#include <climits>
#include <vector>
#include <set>
#include <string>
#include <numeric>

#define FAST_IO ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr)
#define flood(arr, c, s) for (int i=0; i<s; i++) arr[i] = c
//#define int long long
using namespace std;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<pair<int, int>> vii;
const int N = 1e5 + 2;
const int INF = 1e9 + 5;
const int MOD = 1e9 + 7;

int32_t main() {
    FAST_IO;
    int x;
    cin >> x;
    for (int i = 0; i <= 200; i++) {
        for (int j = -i; j <= i; j++) {
            if ((i * i * i * i * i) - (j * j * j * j * j) == x) {
                cout << i << " " << j;
                exit(0);
            }
        }
    }
    return 0;
}

Measured memory_bytes: 3668
#include<iostream>
#include<map>
#include<algorithm>
using namespace std;
main(){
  map<string,int> M;
  M["yotta"]= 24;
  M["zetta"]= 21;
  M["exa"]= 18;
  M["peta"]= 15;
  M["tera"]= 12;
  M["giga"]= 9;
  M["mega"]= 6;
  M["kilo"]= 3;
  M["hecto"]= 2;
  M["deca"]= 1;
  M["deci"]= -1;
  M["centi"]= -2;
  M["milli"]= -3;
  M["micro"]= -6;
  M["nano"]= -9;
  M["pico"]= -12;
  M["femto"]= -15;
  M["ato"]= -18;
  M["zepto"]= -21;
  M["yocto"]= -24; 
  int te;
  cin>>te;
  while(te--){
  string num,param,unit;
  while(cin>>num>>param){    
    int p;
    if ( M[param] == 0){
      unit = param;
      p=0;
    }else {
      cin>>unit;
      p = M[param];
    }
    if ( num[0] == '0'){
      //point move right point--
      int i=0;
      for(i=2;;i++){
	p--;
	if ( num[i] != '0' && num[i] != '.')break;
      }
      num=num.substr(i);
      if ( num.size() == 1){
	cout << num[0]<<
	  " * 10^" << p << " " << unit<<endl;
      }else {
	cout << num[0]<< "." << num.substr(1) <<
	  " * 10^" << p << " " << unit<<endl;
      }

    }else if ( find(num.begin(),num.end(),'.') != num.end() ){
      //point move left point++
      int i=0;
      int itr=0;
      while(num[itr]!='.')itr++;
      p+=(itr-1);
      num=num.erase(itr,1);
      cout << num[0]<< "." << num.substr(1) <<
	" * 10^" << p << " " << unit<<endl;
    }else {
      p+=num.size()-1;
      cout << num[0]<< "." << num.substr(1) <<
	" * 10^" << p << " " << unit<<endl;
    }
    unit.clear();
  }
  return false;
  }
}

Measured memory_bytes: 0
#include <stdio.h>
int main(void){
	int a,b;
	scanf("%d %d",&a,&b);
	if(a==b){
		puts("Draw");
	}
	else if(a==1){
		puts("Alice");
	}
	else if(b==1){
		puts("Bob");
	}
	else if(a>b){
		puts("Alice");
	}
	else{
		puts("Bob");
	}
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
 
/*** Template Begins ***/
 
typedef unsigned long long    ll;
typedef pair<ll,ll>  pll;
typedef pair<ll, pair<int, int> > plll;
typedef vector<long long>  vll;
typedef vector<pll>  vp;
typedef long double ld;
#define pb           push_back
#define INF          INT_MAX/10
#define F            first
#define S            second
#define mp           make_pair
// #define ios          ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define hell         1000000007
// #define h 998244353
#define all(a)       (a).begin(),(a).end()
ll power(ll x, ll y, ll p)
{
  ll res = 1;
  x = x % p;
  while (y > 0)
  { 
    if (y & 1) 
      res = (res*x) % p;
    y = y>>1;
    x = (x*x) % p;
  } 
  return res; 
} 
const int MAXN = 2e5+5;

// Debug //
#define trace(x)                 cerr << #x << ": " << x << endl;
#define trace1(x)                cerr << #x << ": " << x << endl;
#define trace2(x, y)             cerr << #x << ": " << x << " | " << #y << ": " << y << endl;
#define trace3(x, y, z)          cerr << #x << ": " << x << " | " << #y << ": " << y << " | " << #z << ": " << z << endl;
#define trace4(a, b, c, d)       cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << endl;
#define trace5(a, b, c, d, e)    cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << endl;
// #define trace6(a, n,i;b, c, d, e, f) cerr << #a << ": " << a << " | " << #b << ": " << b << " | " << #c << ": " << c << " | " << #d << ": " << d << " | " << #e << ": " << e << " | " << #f << ": " << f << endl;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
template <typename T>
using ordered_set = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;

// Constants //
 
/*** Template Ends ***/

void solve()
{
string s;
cin>>s;
string t(s.length(),'x');
cout<<t;
}
int main()
{ 
  // ios;
  // fxreopen("inputt.txt", "w", stdout);
  ll t;
  // cin >> t;
  t=1;
  while(t--)
    solve();
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
char s[70][70];
int n, m;
int dirx[8] = {-1, 0, 1, -1, 1, -1, 0, 1}, diry[8] = {-1, -1, -1, 0, 0, 1, 1, 1};
int outside(int i, int j){
	return (i < 0 || i >= n || j < 0 || j >= m);
}

int calc(int i, int j){
	int ans = 0;
	for (int p = 0; p < 8; p++){
		int ni = i + dirx[p], nj = j + diry[p];
		if (outside(ni, nj)) continue;
		ans += (s[ni][nj] == '#');
	}
	return ans;
}
int main(){
	scanf("%d%d", &n, &m);
	for (int i = 0; i < n; i++)
		scanf("%s", s[i]);
	for (int i = 0; i < n; i++)
		for (int j = 0; j < m; j++)
			if (s[i][j] != '#')
				s[i][j] = calc(i, j) + '0';
	for (int i = 0; i < n; i++)
		printf("%s\n", s[i]);
	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<utility>
#include<vector>
#include<map>
#include<set>
#include<tuple>
#include<stack>
#include<queue>
#include<functional>
#include<iterator>
#include<cmath>

using namespace std;

typedef long long ll;

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

	int a[n];
	ll x,y=0;
	for(int i=0;i<n;i++){
		cin >> a[i];
		if(i!=0) y+=a[i];
	}
	x=a[0];

	ll sub=abs(x-y);
	ll tmp;
	for(int i=1;i<n-1;i++){
		x+=a[i]; y-=a[i];
		tmp = abs(x-y);
		sub = min(sub,tmp);
	}
	cout << sub << "\n";
	return 0;
}

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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define REP(i, n) for(int i=0; i<(n); ++i)
#define FOR(i, a, b) for(int i=(a); i<(b); ++i)
#define FORR(i, a, b) for(int i=(b)-1; i>=(a); --i)

#define DEBUG(x) cout<<#x<<": "<<x<<'\n'
#define DEBUG_VEC(v) cout<<#v<<":";REP(i, v.size())cout<<' '<<v[i];cout<<'\n'
#define ALL(a) (a).begin(), (a).end()

template<typename T> inline void CHMAX(T& a, const T b) {if(a<b) a=b;}
template<typename T> inline void CHMIN(T& a, const T b) {if(a>b) a=b;}

const ll MOD=1000000007ll;
// const ll MOD=998244353ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

const double EPS=1e-11;
#define EQ0(x) (abs((x))<EPS)
#define EQ(a, b) (abs((a)-(b))<EPS)

int num[114514];

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	// cout<<setprecision(10)<<fixed;
	int n, m, a, b;
	cin>>n>>m;
	REP(i, m){
		cin>>a>>b;
		++num[a-1];
		++num[b-1];
	}
	bool ok=true;
	REP(i, n){
		if(num[i]&1){
			ok=false;
			break;
		}
	}
	cout<<(ok ? "YES" : "NO")<<'\n';
	return 0;
}


Measured memory_bytes: 640
#include<iostream>
#include<string>
#include<vector>
#include<cmath>
#include<cstdlib>
#include<string>
#include<algorithm>
#include<functional>
#include<map>
#include<iomanip>
#include<limits>
#include<queue>
#include<set>
#include<cstdio>
#include<climits>
#include<cstring>

using namespace std;

int main(){

   int N;

   cin >> N;

   int A1[N];
   int A2[N];

   for(int i = 0;i < N;i++){
	   cin >> A1[i];
   }
   for(int i = 0;i < N;i++){
	   cin >> A2[i];
   }


   int ans = INT_MIN;
   for(int i = 0;i < N;i++){
	   int sum = 0;
	   for(int j = 0;j <= i;j++){
		   sum += A1[j];
	   }
	   for(int k = i;k < N;k++){
		   sum += A2[k];
	   }
	   ans = max(ans,sum);
   }

   cout << ans << endl;

   return 0;

}


Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>
int main(){
    int n, d, cont = 0;
    scanf("%d%d", &n, &d);
    for(int i = 0; i < n; ++i){
        double x, y;
        scanf("%lf%lf", &x, &y);
        unsigned long long x2 = pow(x, 2);
        unsigned long long y2 = pow(y, 2);
        double raiz = sqrt(x2+y2);
        
        if(raiz <= d)
            cont += 1;
    }
    printf("%d", cont);

    return 0;
}


Measured memory_bytes: 2216
module vector_int32_mod
    use,intrinsic :: iso_fortran_env
    type vector
        integer(int32),allocatable:: array(:)
        integer(int32):: l
    contains
        procedure :: push_back => vector_regist
    end type

    interface vector
        module procedure vector_init
    end interface
contains
    function vector_init() result(vec)
        type(vector):: vec
        allocate(vec%array(1))
        vec%l = 0
    end function

    subroutine vector_regist(vec, v)
        class(vector):: vec
        integer(int32):: v

        if (vec%l+1 > size(vec%array)) call add_(vec)
        vec%l=vec%l+1
        vec%array(vec%l) = v
    end subroutine


    subroutine add_(vec)
        type(vector):: vec
        integer(int32),allocatable:: tmp(:)
        integer(int32):: l

        l = size(vec%array)
        allocate(tmp(l))
        tmp(:) = vec%array(:)
        deallocate(vec%array)
        allocate(vec%array(l*2))
        vec%array(1:l) = tmp(:)
        deallocate(tmp)
    end subroutine
end module

program main
    use,intrinsic :: iso_fortran_env
    use vector_int32_mod
    implicit none
    integer(int32):: n,m,i,j
    integer(int32), allocatable:: a(:),b(:)
    type(vector):: par, siz
    logical::dm

    read*, n,m

    par = vector()
    siz = vector()
    do i=1,n
        call par%push_back(i)
        call siz%push_back(1)
    end do

    allocate(a(m),b(m))
    do i=1,m
        read*, a(i), b(i)
        dm = mergee(a(i),b(i))
    end do

    print'(i0)', maxval(siz%array)




contains
    function root(x) result(ret)
        integer(int32)x,ret

        do while(par%array(x) /= x)
            x = par%array(x)
            par%array(x) = par%array(par%array(x))
        end do
        ret = x
    end function

    function mergee(x,y) result(ret)
        integer(int32):: x,y
        logical:: ret
        x = root(x)
        y = root(y)
        if (x == y) then
            ret = .false.
            return
        end if
        if (siz%array(x) < siz%array(y)) then
            siz%array(y) = siz%array(y) + siz%array(x)
            par%array(x) = y
        else
            siz%array(x) = siz%array(x) + siz%array(y)
            par%array(y) = x
        end if
    end function

    function issame(x,y) result(ret)
        integer(int32):: x,y
        logical:: ret
        ret = root(x) == root(y)
    end function

    
end program main

Measured memory_bytes: 6584
#include <iostream>
#include <vector>
#include <limits.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <limits.h>
#include <queue>
#include <map>
#include <set>
#include <iomanip>
#include <bitset>
#include <cassert>
#include <random>
#include <functional>
#include <stack>
#include <iomanip>
#include <cassert>
//#include <boost/multiprecision/cpp_int.hpp>
#include <complex>
#include <cstdio>
#include <list>
#include <bitset>

//< in.txt > out.txt
using namespace std;
//std::ios::sync_with_stdio(false);
//std::cin.tie(0);
const long long MOD = 1e9 + 7;
typedef long long ll;
typedef long long LL;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<ld, ll> pdl;
typedef pair<ld, ld> pdd;
typedef vector<ll> VLL;
typedef vector<VLL> VVLL;
typedef unsigned long long ULL;
//typedef boost::multiprecision::cpp_int bigint;

int main() {
	std::ios::sync_with_stdio(false);
	std::cin.tie(0);
	string S;
	cin >> S;
	ll N = S.size();
	VLL Q(N + 1, 0);
	if (S[0] == '?')Q[0] = 1;
	for (ll n = 1; n < N; n++) {
		if (S[n] == '?')Q[n] = Q[n - 1] + 1;
		else Q[n] = Q[n - 1];
	}
	Q[N] = Q[N - 1];
	VLL pow3(N + 1,1);
	for (ll n = 1; n <= N; n++) {
		pow3[n] = (pow3[n - 1] * 3) % MOD;
	}
	VLL C(N,0);
	if (S.back() == '?' || S.back() == 'C')C.back() = 1;
	else C.back() = 0;
	for (ll n = N - 2; n >= 2; n--) {
		if (S[n] == '?') {
			C[n] = (3 * C[n + 1] + pow3[Q[N - 1] - Q[n]]) % MOD;
		}
		else if (S[n] == 'C') {
			C[n] = (C[n + 1] + pow3[Q[N - 1] - Q[n]]) % MOD;
		}
		else {
			C[n] = C[n + 1];
		}
	}
	VLL A(N, 0);
	if (S[0] == '?' || S[0] == 'A')A[0] = 1;
	else A[0] = 0;
	for (ll n = 1; n < N - 2; n++) {
		if (S[n] == '?') {
			A[n] = (3 * A[n - 1] + pow3[Q[n - 1]]) % MOD;
		}
		else if (S[n] == 'A') {
			A[n] = (A[n - 1] + pow3[Q[n - 1]]) % MOD;
		}
		else {
			A[n] = A[n - 1];
		}
	}
	ll ans = 0;
	for (ll k = 1; k < N - 1; k++) {
		if (S[k] == 'B' || S[k] == '?') {
			ans = (ans + A[k - 1] * C[k + 1]) % MOD;
		}
	}
	cout << ans << "\n";
	return 0;
}


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


int main()
{
    char s[10];
    scanf("%s", s);
    sort(s, s+4);
    printf((s[0]==s[1] && s[1] != s[2] && s[2] == s[3])? "Yes\n" : "No\n");
}


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

int main()
{
    int num,odd;
    double prob;
    cin>>num;
    if(num%2==0)
        odd = (num / 2);
    else
        odd = (num / 2) + 1;
    prob = odd / (float)num;
    cout<<fixed;
    cout<<setprecision(10);
    cout<<prob<<endl;
    return 0;
}


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

int main(){
  int N; cin >> N;
  int A,B,C,D; cin >> A >> B >> C >> D;
  string s; cin >> s;
  A--;
  B--;
  C--;
  D--;
  
  bool OK = true;
  for(int i = A; i <= max(C,D)-1; i++){
      //cout << i << endl;
      if(s.at(i) == '#' && s.at(i+1) == '#'){
          OK = false;
      }
  }
  
  bool change = false;
  if(C > D){
    for(int i = B-1; i <= D-1; i++){
        if(s.at(i) == '.' && s.at(i+1) == '.' && s.at(i+2) == '.'){
            change = true;
        }
      if(change) break;
    }
    if(!change && (s.at(D-1) == '#' || s.at(D+1) == '#')){
        OK = false;
        //cout << "p3" << endl;
    }
  }
  
  if(OK) cout << "Yes" << endl;
  else cout << "No" << endl;
  
}



Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, A, B;
  cin >> N >> A >> B;
  int planA = N*A;
  if (planA >= B) {
    cout << B << endl;
  }
  else if (planA < B) {
    cout << planA << endl;
  }
}

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

int main() {
    int n, k;
    cin >> n >> k;
    set<int> s;

    rep(i, k) {
        int d;
        cin >> d;
        rep(j, d) {
            int a;
            cin >> a;
            s.insert(a);
        }
    }

    cout << n - s.size() << endl;
    return 0;
}


Measured memory_bytes: 3636
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repo(i,n) for(int i = 1; i < (int)(n); i++)
#define pb push_back
#define np next_permutation
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
#define pi acos(-1.0)
int gcd(int x, int y) { return y ? gcd(y, x % y) : x; }
int lcm(int x, int y) { return x / gcd(x, y) * y; }
//cout << fixed << setprecision (20);   小数点以下2０桁まで
//intの最大値2147483647 ≒ 2×10^9
//long longの最大値9223372036854775807 ≒ 9×10^18
//'0'+=16;        で大文字に
//'大文字'+=32;    で小文字に
//s[i]-'0'でchar文字→int数に;
//string s = to_string(int数);
//int n = stoi(string文字列)
//実行時間制約2秒では２×10^8回くらいまで計算できる


int main() {
  int n;
  cin >> n;
     
  vector<int> q(n-1);
  rep(i,n-1){
    cin >> q[i];
  }
 
  ll ans = q[0]+q[n-2];
  
  repo(i,n-1){
    ans+=min(q[i-1],q[i]);
  }
  
  cout << ans << endl;
  
}

Measured memory_bytes: 256
use proconio::{fastout, input};

#[fastout]
fn main() {
    input! {n: usize};

    let mut v: Vec<Vec<i64>> = vec![vec![-1; 15]; 15];

    for i in 0..n {
        input! {a: usize};
        for _ in 0..a {
            input! {x: usize, y: i64};
            v[i][x - 1] = y;
        }
    }

    let mut ans = 0;

    for i in 0..1 << n {
        let mut d = vec![0; n];

        for j in 0..n {
            if i >> j & 1 == 1 {
                d[j] = 1;
            }
        }
        let mut ok = true;

        for j in 0..n {
            if d[j] == 1 {
                for k in 0..n {
                    if v[j][k] == -1 {
                        continue;
                    };

                    if v[j][k] != d[k] {
                        ok = false;
                        break;
                    }
                }
            }
        }
        if ok {
            ans = std::cmp::max(ans, (i as i64).count_ones());
        }
    }

    println!("{}", ans);
}


Measured memory_bytes: 2180
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {
    public static void main(String[] args) {
        FastReader sc = new FastReader();
        PrintWriter out = new PrintWriter(System.out);

        int n = sc.nextInt();
        int d = sc.nextInt();
        int[][] arr = new int[n][d];
        for (int i = 0; i < n; i++) {
            int[] tmp = new int[d];
            for (int k = 0; k < d; k++) {
                tmp[k] = sc.nextInt();
            }
            arr[i] = tmp;
        }

        int res = 0;

        for (int i = 0; i < n; i++) {

            for (int k = i + 1; k < n; k++) {
                int tmp = 0;
                for (int t = 0; t < d; t++) {
                    int a = arr[i][t] - arr[k][t];
                    tmp += (a * a);
                }
                int tmpp = (int) Math.sqrt(tmp);
                if (tmp == tmpp * tmpp) {
                    res++;
                }
            }
        }

        out.println(res);
        out.flush();
    }

    //    public static void calcD(Map<Integer, Integer> dic, int index, )

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
}

Measured memory_bytes: 21460
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<cmath>
#include<queue>
#include<stack>
#include<list>

using namespace std;
using ll = long long;

int main(){
    int h,w;
    cin>>h>>w;
    char s[h+2][w+2];

    for(int i=0;i<h+2;i++){
        for(int j=0;j<w+2;j++){
            s[i][j] = '.';
        }
    }
    for(int i=1;i<h+1;i++){
        for(int j=1;j<w+1;j++){
            cin>>s[i][j];
        }
    }

    //for(int i=0;i<w+2;i++) s[0][i] = '.';
    //for(int i=1;i<=h;i++){
        //s[i][0] = '.';
        //for(int j=1;j<=w;j++){
        //    cin>>s[i][j];
        //}
        //s[i][w+1] = '.';
    //}
    //for(int i=0;i<w+2;i++) s[h+1][i] = '.';

    bool ok=true;

    for(int i=1;i<=h;i++){
        for(int j=1;j<=w;j++){
            if(s[i][j] == '.') continue;
            ok = false;
            for(int k=-1;k<=1;k++){
                for(int l=-1;l<=1;l++){
                    if(k==0) continue;
                    if(l==0) continue;
                    if(s[i+k][j] == '#') ok = true;
                    if(s[i][j+l] == '#') ok = true;
                }
            }
            if(!ok){
                cout<<"No"<<endl;
                return 0;
            }
        }
    }

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

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
    char n[2][3],n2[2][3];
    memset(n,NULL,sizeof(n));
    memset(n2,NULL,sizeof(n2));
    for(int i=0;i<2;i++){
        for(int j=0;j<3;j++){
            cin>>n[i][j];
        }
    }
    n2[0][0]=n[1][2];
    n2[0][1]=n[1][1];
    n2[0][2]=n[1][0];
    n2[1][0]=n[0][2];
    n2[1][1]=n[0][1];
    n2[1][2]=n[0][0];
    for(int i=0;i<2;i++){
        for(int j=0;j<3;j++){
            if(n[i][j]!=n2[i][j]){
                cout<<"NO"<<endl;
                return 0;
            }
        }
    }
    cout<<"YES"<<endl;
}

Measured memory_bytes: 256
//08
#include<iostream>
#include<algorithm>
#include<vector>

using namespace std;

int o[10],r;
int g[502][501];

struct K{
  int l,r,t,b,n;
  bool operator<(K a)const{
    if(l!=a.l){
      return l<a.l;
    }else{
      return t<a.t;
    }
  }
};


void dfs(vector<K> v){
  if(v.empty())return ;
  int x=min_element(v.begin(),v.end())-v.begin();
  o[v[x].n]=++r;
  int y=v[x].b;
  int b;
  for(b=v[x].r;b<500;b++){
    if(g[y][b]==g[y-1][b]&&g[y][b]!=-1)break;
  }
  vector<K> n[2];
  for(int i=0;i<v.size();i++){
    if(i!=x){
      n[v[i].b<=y&&v[i].r<=b].push_back(v[i]);
    }
  }
  dfs(n[1]);
  dfs(n[0]);
}
  
int main(){
  bool ns=false;
  for(int n;cin>>n,n;){
    vector<K> v(n);
    fill(g[0],g[502],-1);
    for(int i=0;i<n;i++){
      v[i].n=i;
      cin>>v[i].l>>v[i].t>>v[i].r>>v[i].b;
      if(v[i].l>v[i].r){
	swap(v[i].l,v[i].r);
      }
      if(v[i].t>v[i].b){
	swap(v[i].t,v[i].b);
      }
      for(int k=v[i].t;k<v[i].b;k++){
	for(int j=v[i].l;j<v[i].r;j++){
	  g[k][j]=i;
	}
      }
    }
    r=0;
    dfs(v);
    if(ns){
      cout<<endl;
    }
    ns=true;
    for(int i=0;i<n;i++){
      cout<<o[i]<<endl;
    }
  }
  return 0;
}

Measured memory_bytes: 2200
#include <bits/stdc++.h>
typedef long long int ll;
#define rep(i,n) for (int i = 0; i< (n); i++)
#define Sort(a) sort(a.begin(), a.end())
#define Reverse(a) reverse(a.begin(), a.end())
using namespace std;


int main() {
    int k, x, a;
    
    
    cin >>k>>x;
    
    a = 1 -k;
    rep(i, (k * 2 -1)){
        if(i!=0) cout<<" ";
        cout<<x + a;
        a ++;
    }
        
    cout<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <stdio.h>
#include <math.h>
#include <set>
#include <string>
#define ll long long
using namespace std;

int main()
{
    int n;
    cin>>n;
    int sz[n];
    int shu=0;
    int max=-1;
    for(int i=0;i<n;i++)
    {
        cin>>sz[i];
        if(sz[i]>=max)
        {
            max=sz[i];
            shu++;
        }
    }
    cout<<shu<<endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rg register int
#define il inline
#define mid ((l+r)>>1)
#define  big(i,j)  (a[n+i]>x&&a[n+i+j]>x)
#define sma(i,j) (a[n+i]<=x&&a[n+i+j]<=x)
#define el else if
using namespace std;
il long long read(){
    register long long x=0,f=1;
    register char ch=getchar();
    while(ch>'9'||ch<'0'){
        if(ch=='-') f=-1;
        ch=getchar();
    }
    while(ch<='9'&&ch>='0'){
        x=10*x+ch-'0';
        ch=getchar();
    }
    return x*f;
}
const int N=1000007;
typedef long long ll;
ll n,m,w,a[N];
bool chk(int x){
	for(rg i=0;i<n;++i){
		if(big(i,1)||big(-i,-1))return false;
		el(sma(i,1)||sma(-i,-1)) return true;
	}
	return a[1]<=x;
}
int main()
{
	n=read();
	for(rg i=1;i<(n<<1);++i){
		a[i]=read();
	}
	ll l=1,r=n<<1;--r;
	while(l<r){//r为答案 
		if(chk(mid)) r=mid;
		else l=mid+1;
	}
	printf("%lld\n",r);
	return 0;
}

Measured memory_bytes: 1792
H,W=map(int,input().split())
a=[input() for i in range(H)]
useh=[True]*H
usew=[True]*W
for h in range(H):
    cnt=0
    for w in range(W):
        if a[h][w]=='.':
            cnt+=1
    if cnt==W:
        useh[h]=False
for w in range(W):
    cnt=0
    for h in range(H):
        if a[h][w]=='.':
            cnt+=1
    if cnt==H:
        usew[w]=False
for h in range(H):
    if useh[h]:
        for w in range(W):
            if usew[w]:
                print(a[h][w],end='')
        print()


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

int main(){

  int N, T, A; cin >> N >> T >> A;
  vector<int> H(N, 0);

  for(int i = 0 ; i < N ; ++i){
    cin >> H[i];
  }

  double x = (double) (T-A)/0.006;

  int ans = 0;
  double min = 999999.;
  for(int i = 0 ; i < N ; ++i){
    double tmp = min;
    // cout << "tmp : "<< tmp << endl;
    double diff = x - (double) H[i];
    // cout << diff << endl;
    min = std::min(abs(diff), min);
    // cout << "min : " << min << endl;
    if(tmp == min) continue;
    else ans = i + 1;
    // cout << ans << endl;
  }

  cout << ans << endl;

}

Measured memory_bytes: 256
from sys import stdin


if __name__ == "__main__":
    _in = [_.rstrip() for _ in stdin.readlines()]
    N, L = list(map(int,_in[0].split(' ')))
    S_arr = []
    for i in range(N):
        _ =     _in[i+1]   # type:str
        S_arr.append(_)
    # vvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv
    S_arr.sort()
    s = ''.join(S_arr)
    ## ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    print(s)


Measured memory_bytes: 38256
#include <bits/stdc++.h>
#define int long long
using namespace std;

class CumulativeSum2D{
public:
  int h,w;
  vector<vector<int> > sum;
  CumulativeSum2D(){}
  CumulativeSum2D(vector<vector<int> > A){
    assert(A.size());
    h = A.size();
    w = A[0].size();
    sum.resize(h+1,vector<int>(w+1));
    for(int i=1;i<=h;i++)
      for(int j=1;j<=w;j++) sum[i][j] += sum[i][j-1] + A[i-1][j-1];

    for(int j=1;j<=w;j++)
      for(int i=1;i<=h;i++) sum[i][j] += sum[i-1][j];
    
  }
  
  //半開区間
  int get(int x,int y,int X,int Y){
    assert(x <= X && y <= Y);
    assert(0<=x && x<=w && 0<=X && x <= w);
    assert(0<=y && y<=h && 0<=Y && Y <= h);
    return sum[Y][X] - sum[y][X] - sum[Y][x] + sum[y][x];
  }
};

int h, w, Q;
string s[2005];

signed main(){
  
  cin>>h>>w>>Q;
  
  for(int i=0;i<h;i++) cin>>s[i];
  
  vector<vector<int> > A( h, vector<int>( w ) );
  
  for(int i=0;i<h;i++){
    
    for(int j=0;j<w;j++){
      
      A[i][j] = s[i][j] - '0';
      
    }
    
  }
  
  CumulativeSum2D node( A );
  
  vector<vector<int> > H( h, vector<int>( w ) );
  
  for(int i=0;i<h-1;i++){
    
    for(int j=0;j<w;j++){
      
      if( s[i][j] == '1' ){
	
	if( s[i+1][j] == '1' ) H[i+1][j] = 1;
	
      }
      
    }
    
  }
  
  vector<vector<int> > W( h, vector<int>( w ) );

  for(int i=0;i<h;i++){
    
    for(int j=0;j<w-1;j++){
      
      if( s[i][j] == '1' ){
	
	if( s[i][j+1] == '1' ) W[i][j+1] = 1;
	
      }
      
    }
    
  }
  
  CumulativeSum2D EH( H );
  
  CumulativeSum2D EW( W );
  
  while( Q-- ){
    
    int y, x, Y, X;
    
    cin>>y>>x>>Y>>X;
    
    y--, x--, Y--, X--;
    
    Y++, X++;
    
    int ans = node.get( x, y, X, Y );
    
    ans -= EH.get( x, y + 1, X, Y );
    
    ans -= EW.get( x + 1, y, X, Y );
    
    cout<<ans<<endl;
    
  }
  
  return 0;
}


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

int main() {
    int P, Q, R;
    cin >> P >> Q >> R;
    
    int allT = P + Q + R;
    int maxT = max(P, max(Q, R));
    int minT = allT - maxT;
    cout << minT << endl;
}

Measured memory_bytes: 256