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

using namespace std;
using namespace boost::multiprecision;

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REPI(i,a,b) for(int i=int(a);i<int(b);++i)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define ALL(x) (x).begin(),(x).end()

int main () {
  long long a, b, c, i, tmpA,tmpB,tmpC;

  cin >> a >> b >> c;

  for(i = 0; i < 100; i++) {
    if((a % 2 == 1) || (b % 2 == 1) || (c % 2 == 1)) break;
    tmpA = a;
    tmpB = b;
    tmpC = c;

    a = (tmpB+tmpC)/2;
    b = (tmpA+tmpC)/2;
    c = (tmpA+tmpB)/2;
  }

  cout << ((i == 100) ? -1 : i) << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <math.h>
#include <cmath>

using namespace std;
using ll =long long;
using vi = vector<int>; 
using vvi = vector<vi>; 
using vl = vector<ll>; 
using vvl = vector<vl>; 

#define rep(i,n) ;for( int i =0; i < n ; i ++)
#define all(a) a.begin(),a.end()
#define f(i,a,b) for(int i=a;i<b;i++)
#define MOD 1000000007
bool is_int_lround(double x){
  return std::lround(x)==x;
}
int ketasuu(int x){
  int n=0;
  while(x>0){
    x /=10 ;
    n ++;
  }
  return n;
}


ll conbi(int n,int m){
  
  cin>>n>>m;
  vector<ll> a(100);
  a[0] =1;
  for(int i=0;i<14;i++){
    a[i+1]=a[i]*(i+1);
  }
  return a[n] /(a[m] *a[n-m]);
}

int main(){
  int K;cin>>K;
  int tot=0;
  for(int i=1;i<=K;i++){
    for(int j=1;j<=K;j++){
      for(int k =1; k<=K;k++){
        tot +=__gcd(__gcd(i,j),k);
      }
    }
  }
  cout<<tot<<endl;
}
  


Measured memory_bytes: 3652
N = int(input())
n = 0
C = []
S = []
F = []
T = []
while n < N-1:
    c,s,f = map(int,input().split())
    C.append(c)
    S.append(s)
    F.append(f)
    n = n + 1
n = 0
while n < N-1:
    t = S[n]
    T.append(t)
    for i in range(n,N-1):
        if T[n]<=S[i]:
            T[n] = S[i]
        if T[n]%F[i] != 0:
            a = T[n]%F[i]
            T[n] = T[n] + F[i] - a
        T[n] = T[n] + C[i]
    print(T[n])
    n = n+1
print(0)


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

string Vote(int* Arr, int n, int m, int sum) {
	int z = 0;

	double ref = (double)1 / (4 * m);
	for (int i = 0; i < n; i++) {
		double d = (double)Arr[i] / sum;
		if (d >= ref)
			z++;

		if (z == m)
			return "Yes";
	}
	return "No";
}

int main() {
	int n = 0, m = 0;
	cin >> n >> m;
	int* Arr = new int[n] {};
	int sum = 0;

	for (int i = 0; i < n; i++) {
		cin >> Arr[i];
		sum += Arr[i];
	}
	
	cout << Vote(Arr, n, m, sum) << endl;

	return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define endl '\n'

using namespace std;
template<class T, class T2> inline void chkmax(T &x, const T2 &y) { if(x < y) x = y; }
template<class T, class T2> inline void chkmin(T &x, const T2 &y) { if(x > y) x = y; }
const int MAXN = (1 << 20);

int n;
int64_t l, a[MAXN];

void read()
{	
	cin >> n >> l;
	for(int i = 0; i < n; i++)
		cin >> a[i];
}	

void solve()
{
	int left = 0;
	for(int i = 0; i < n - 1; i++)
		if(a[left] + a[left + 1] < a[i] + a[i + 1])
			left = i;

	if(a[left] + a[left + 1] < l) { cout << "Impossible" << endl; return; }
	
	left++;

	cout << "Possible" << endl;
	for(int i = 1; i <= left - 1; i++)
		cout << i << endl;

	for(int i = n; i >= left + 1; i--)
		cout << i - 1 << endl;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);

	read();
	solve();
	return 0;
}



Measured memory_bytes: 1664
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000
#define int long long int

signed main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, A, B;
    cin >> N >> A >> B;

    if( A > B) {
        cout << '0' << endl;
    }
    else if( A != B && N == 1) {
        cout << '0' << endl; 
    } else {
        cout << (N-2)*(B-A) + 1 << endl;
    }
    return 0;

}


Measured memory_bytes: 256
N,M,C = map(int,input().split())
B = list(map(int,input().split()))
A = [list(map(int,input().split())) for i in range(N)]

ans = 0
for i in range(0,N,1):
    tmp=C
    for j in range(0,M,1):
        tmp+=A[i][j]*B[j]
    if tmp > 0:
        ans+=1
print(ans)

Measured memory_bytes: 62332
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in); 
		int N = sc.nextInt();
		int Count = 0;
		for(int i = 1; i <= N; i++) {
			if(i != sc.nextInt()) {
				Count++;
				if(Count > 2) {
					break;
				}
			}
		}
		if(Count == 0 || Count == 2) System.out.println("YES");
		else System.out.println("NO");
	}
}

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

int main() {
    string t;
    cin >> t;
    for (char &c : t) {
        if (c == '?') c = 'D';
    }
    cout << t << endl;
    return 0;
}


Measured memory_bytes: 3760
import numpy as np
N = int(input())
A_array = np.array(list(map(int, input().split())))

count = np.sum(A_array < 0)
# print(count)
A_array_abs = np.abs(A_array)
# print(A_array_abs)
A_array_abs = np.sort(A_array_abs)
# print(A_array_abs)
if A_array_abs[0] == 0 or count % 2 == 0:
    print(np.sum(A_array_abs))
else:
    print(np.sum(A_array_abs[1:]) - A_array_abs[0])


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

int main (){
    int N, K;
    cin>>N>>K;
	string Vec;
  	cin>>Vec;
    int L=0;
    int Check=0;
    int Max=0;
    for(int R=0; R<N; R++){
        if(R==0){
            if(Vec.at(0)=='1'){
                
            }
            else{
              	//cout<<"V"<<endl;
                Check ++;
                
            }
        }
        else if(Vec.at(R)=='1'){
            //cout<<"C"<<endl;
        }
        else{
            if(Vec.at(R-1)=='0'){
               //cout<<"E"<<endl;
            }
            else{
                if(Check==K){
                    Max=max(Max, R-L);
                    while(Vec.at(L)=='1'){
                        L ++;
                    }
                    while(Vec.at(L)=='0'){
                        L ++;
                    }
                    
                }
                else{
                    Check ++;
                }
               
            }
        }
    }
  	Max=max(Max, N-L);
    cout<<Max;
}




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

typedef long long ll;

int N;
int a[100];

int main() {
    cin >> N;
    rep(i, N) cin >> a[i];

    int ans = 1e9;
    for (int i = -100; i <= 100; i++) {
        int tmp = 0;
        for (int j = 0; j < N; j++) {
            tmp += pow((a[j] - i), 2);
        }
        ans = min(tmp, ans);
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<fstream>
#include<stdio.h>
#include<string>
#include<vector>
#include<map>
#include<math.h>
#include<algorithm>
#include<iomanip>
#include<set>

using namespace std;

int main() {
  int n;
  cin >> n;
  vector<long long> a(3 * n);
  for(int i = 0; i < n * 3; i++) cin >> a[i];
  long long fsum = 0, bsum = 0;
  map<long long, int> fmp, bmp;
  for(int i = 0; i < n; i++) fmp[a[i]]++;
  for(int i = 0; i < n; i++) fsum += a[i];
  for(int i = 2 * n; i < 3 * n; i++) bmp[-a[i]]++;
  for(int i = 2 * n; i < 3 * n; i++) bsum += a[i];
  vector<long long> fsubsum(n + 1), bsubsum(n + 1);
  fsubsum[0] = fsum;
  for(int i = 0; i < n; i++) {
    fsubsum[i + 1] = fsubsum[i];
    if(a[i + n] > fmp.begin()->first) {
      fmp.begin()->second--;
      fsubsum[i + 1] -= fmp.begin()->first;
      if(fmp.begin()->second == 0) fmp.erase(fmp.begin());
      fmp[a[i + n]]++;
      fsubsum[i + 1] += a[i + n];
    }
  }
  bsubsum[0] = bsum;
  for(int i = 0; i < n; i++) {
    bsubsum[i + 1] = bsubsum[i];
    if(-a[- i - 1 + 2 * n] > bmp.begin()->first) {
      bmp.begin()->second--;
      bsubsum[i + 1] += bmp.begin()->first;
      if(bmp.begin()->second == 0) bmp.erase(bmp.begin());
      bmp[-a[- i - 1 + 2 * n]]++;
      bsubsum[i + 1] += a[- i - 1 + 2 * n];
    }
  }
  long long ans = fsubsum[0] - bsubsum[n];
  for(int i = 1; i < n + 1; i++) ans = max(ans, fsubsum[i] - bsubsum[n - i]);

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


Measured memory_bytes: 16640
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <algorithm>
#include <iomanip>
#include <math.h>
#include <string.h>
#include <cstdio>
#include <tuple>
#include <numeric>
#include <functional>
using namespace std; using ll = long long; using ld = long double;  using pll = pair<ll, ll>;
using vl = vector<ll>; using vll = vector<vl>; using vlll = vector<vll>; using vpll = vector<pll>;
using vs = vector<string>; using tll = tuple<ll, ll, ll>; using vtll = vector<tll>;
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; }
const ld PI = 3.1415926535897932;
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define co(i) cout << i << endl;
#define co2(i,j) cout << i << " " << j << endl;
#define co3(i) cout << i << " ";
#define po(i) cout << i.first << " " << i.second << endl;
void in() {}
void debug_out() { cerr << endl; }
template<typename Head, typename... Tail>
void debug_out(Head h, Tail... t) {
	cerr << " " << h;
	if (sizeof...(t) > 0) cerr << " :";
	debug_out(t...);
}
template <typename T>
ostream& operator<<(ostream& os, vector<T> vec) {
	for (size_t i = 0; i < vec.size(); i++)os << vec[i] << (i + 1 == vec.size() ? "" : " ");
	return os;
}
ll ctoi(char c) {
	switch (c) {
	case '0': return 0; case '1': return 1; case '2': return 2;
	case '3': return 3; case '4': return 4; case '5': return 5;
	case '6': return 6; case '7': return 7; case '8': return 8;
	case '9': return 9;  default: return 0;
	}
}
bool pairCompare(const pll firstElof, pll secondElof)
{
	return firstElof.second < secondElof.second;
}
//**Snippetリスト**//
//rep, vin, all, iteLoop, bitSearch, bitList, nod, LIS, digitDP, treeDP, Rerooting//
//gcdlcm, isPrime, eratos, primeFactorize, Npow, combination, divisor, modinv, doubling//
//dfs, bfs, dijkstra, WarshallFloyd, BellmanFord, UnionFind, Kruskal, RMQ, LCA, FordFulkerson//
ll i, j, k, l; ll N, M, K, H, W, L, X, Y, Z, R, Q, T;
ll MOD = 1000000007, INF = 1LL << 60, ans = 0, z = 0, o = 1;
vl flag, D; vector<vpll> path;
int main() {
	ll R, C, K;
	cin >> R >> C >> K;
	vll M(R, vl(C));
	for (i = 0; i < K; i++) {
		ll r, c, v;
		cin >> r >> c >> v;
		M[r - 1][c - 1] = v;
	}
	vlll dp(R, vll(C, vl(4, -INF)));
	dp[0][0][0] = 0;
	dp[0][0][1] = M[0][0];
	for (i = 0; i < R; i++) {
		for (j = 0; j < C; j++) {
			for (k = 0; k <= 3; k++) {
				if (i != R - 1) {
					chmax(dp[i + 1][j][0], dp[i][j][k]);
					if (M[i + 1][j] != 0) chmax(dp[i + 1][j][1], dp[i][j][k] + M[i + 1][j]);
				}
				if (j != C - 1) {
					chmax(dp[i][j + 1][k], dp[i][j][k]);
					if (M[i][j + 1] != 0 && k != 3) chmax(dp[i][j + 1][k + 1], dp[i][j][k] + M[i][j + 1]);
				}
			}
		}
	}
	for (k = 0; k <= 3; k++) {
		chmax(ans, dp[R - 1][C - 1][k]);
	}
	co(ans);
}






Measured memory_bytes: 706716
import java.util.*;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();

		int result=0;
		boolean flag = false;
		for(int i = 0; i < 3; i++){
			if(str.charAt(i) == 'R'){
				result++;
				flag = true;
			}
			else{
				if(flag == true) break;
			}
		}

		System.out.println(result);
	}
}


Measured memory_bytes: 35608
import sys
sys.setrecursionlimit(10000000)
MOD = 10 ** 9 + 7
INF = 10 ** 15

def main():
    N = int(input())
    num = []
    now = 0
    for i in range(12):
        now += pow(26,i + 1)
        num.append(now)
    #print(num)
    for i in range(12):
        if num[i] >= N:
            length = i
            break
    #print(length)
    ans = ''
    if length > 0:
        N -= num[length - 1]
    N -= 1
    
    #print(N)
    now = pow(26,length)
    for j in range(length + 1):
        x = N//now
        ans += chr(x + 97)
        N %= now
        now //=26
        #print(ans)
    
    print(ans)
if __name__ == '__main__':
    main()

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


#define pub push_back
#define pob pop_back
#define fi first
#define se second
#define PI acos(-1.0)
#define emp emplace_back
#define INF 2e9
#define INFLL 9e18
#define EPS 1e-9
#define DEBUG 0
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) (a*(b/gcd(a,b)))


#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin, (x).rend()

#define sz(a) int((a).size())


using namespace std;

typedef vector<int> vi;
typedef vector<int>::iterator iter;
typedef vector<vi> vvi;
typedef pair<int, int> pa;
typedef vector<pa> vii;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef double ld;


double logdob(ll number, ll base){
   return log2(number)*1.0/log2(base);
}

ll log(ll number,ll base){
    return log2(number)/log2(base);
}

ll power(ll x, ll y){
    return (pow(x, y) + EPS);
}



int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(0);
    cout << fixed;
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);

        int a,b;
        cin >> a >> b;
        cout << a*b;
    return 0;
}



Measured memory_bytes: 3696
n,m = map(int, input().split())
ans = {}

I = [int(j) for j in input().split()]
k = I.pop(0)
ans = set(I)
for i in range(n-1):
    I = [int(j) for j in input().split()]
    k = I.pop(0)
    ans = ans & set(I)

print(len(ans))

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
using ll = long long;
#define vl vector<long long>
#define vvl vector<vector<long long>>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
using pll = pair<long long,long long>;
#define cY cout<<"Yes"<<endl
#define cN cout<<"No"<<endl
const long long INF = 1LL << 60;
const long long MOD = 1000000007;

//最大最小の入れ替え
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;
}

//約数列挙
vector<long long> divisor(long long n) {
    vector<long long> ret;
    for (long long i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i * i != n) ret.push_back(n / i);
        }
    }
    sort(ret.begin(), ret.end()); // 昇順に並べる
    return ret;
}
//コンビネーション
ll nCr(ll n, ll r) {
    ll ans = 1;
    for (int i = n; i > n - r; --i) {
        ans = ans*i;
    }
    for (int i = 1 ; i < r + 1; ++i) {
        ans = ans / i;
    }
    return ans;
}
//素因数分解
map< ll, ll > prime_factor(ll n) {
  map< ll, ll > ret;
  for(ll i = 2; i * i <= n; i++) {
    while(n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if(n != 1) ret[n] = 1;
  return ret;
}

//以下回答
int main(){
    ll N,K;
    cin>>N>>K;
    ll count=0;
    map<ll,ll> m;
    ll ans=0;
    rep(i,N){
        ll a;
        cin>>a;
        m[a]++;
    }
    ll s=m.size();
    vl vec(s);
    ll i=0;
    for(auto p:m){
        auto v=p.second;
        vec.at(i)=v;
        i++;
    }
    sort(all(vec));
    if(s<=K){
        cout<<0<<endl;
    }else{
        rep(i,vec.size()){
            ans+=vec.at(i);
            s--;
            if(s<=K){
                cout<<ans<<endl;
                break;

            }
        }
    }
}


Measured memory_bytes: 14336
#define _CRT_SECURE_NO_DEPRECATE
#pragma GCC optimize("O3")
#pragma GCC target("sse4")
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds; 
using namespace std;
#define int long long int
#define SYNC std::ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
#define FRE freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
typedef long double ld;
typedef pair<int,int> ii;
typedef pair<int,ii> iii;
typedef vector<int> vi;
typedef vector<ii>   vii;
//typedef tree<int, null_type, less<int>, rb_tree_tag, 
//             tree_order_statistics_node_update> 
//    data_set;
#define rep(i,l,r)   for(int i=(l);i<(r);i++)
#define deb(x)     cout << (#x) << " is " << (x) << endl
#define dbg(x)     cout << x << ' '
#define here cout << " Hey baitch!!\n";
#define  pb push_back
#define  F  first
#define  S  second
#define all(v) (v).begin(),(v).end()
#define sz(a) (int)((a).size())
#define sq(x) ((x)*(x))
const int MOD = 1e9+7;
const int MOD1 = 998244353;
const int N = 2e5+5;
const int INF = 1000111000111000111LL;
const ld PI = 3.1415926535898;
int mod_exp(int base,int exp,int mod) {
    int ans =1;while(exp)   {
        if(exp%2)   ans = (ans%mod*base%mod)%mod;
        base=(base%mod*base%mod)%mod;exp/=2;ans%=mod;
    }return ans;
}
int inv_mod(int base,int mod) {
	return mod_exp(base,mod-2,mod);
}
int n;
int a[25][25];
int dp[21][(1ll<<21)];
int32_t main()
{
	SYNC
	cin >> n;
	rep(i,0,n) {
		rep(j,0,n) {
			cin >> a[i][j];
		}
	}
	
	memset(dp,0,sizeof 0);
	// rep(i,0,n){
	// 	rep(j,0,(1ll<<n)) {
	// 		dp[i][j] = 0;
	// 	}
	// }
	rep(j,0,n) {
		dp[0][(1ll<<j)] = a[0][j];
	}
	rep(i,1,n) {
		rep(j,0,(1ll<<n)) {
			if(dp[i-1][j]) {
				rep(k,0,n) {
					if(a[i][k] && !(j&(1ll<<k))) {
						dp[i][j|(1ll<<k)] += dp[i-1][j];
						dp[i][j|(1ll<<k)] %= MOD;
					}
				}
			}
		}
	}
	int ans = 0;
	for(int j = 0; j < (1ll<<n); j++) {
		ans += dp[n-1][j];
		ans %= MOD;
	}
	cout << ans;
    return 0;
}

Measured memory_bytes: 307456
#include <algorithm>
#include <iostream>
#include <vector>
#include <cmath>
#include <numeric>
#include <queue>
#include <assert.h>

using namespace std;

template <typename T, typename Pr = less<T>>
class pqueue {
public:
	pqueue() : total_(T()) {}
	void   push(T x)     { total_ += x;             values_.push(x); }
	void   pop()         { total_ -= values_.top(); values_.pop(); }
	T      top()   const { return values_.top(); }
	bool   empty() const { return values_.empty(); }
	T      total() const { return total_; }
	T      size()  const { return (T)values_.size(); }
private:
	priority_queue<T, vector<T>, Pr> values_;
	T total_;
};


int main(int argc, char** argv) {
    int Q, qtype;

    cin >> Q;

	pqueue<long long, less<long long>> first_half;
	pqueue<long long, greater<long long>> last_half;
	long long a, b, b_sum = 0;


	for (int i = 0; i < Q; i++) {
		cin >> qtype;

		if (qtype == 1) {
			cin >> a >> b;

			if (first_half.size() <= last_half.size()) {
				first_half.push(a);
			}
			else {
				last_half.push(a);
			}

			// swap
			if (!first_half.empty() && !last_half.empty() &&  first_half.top() > last_half.top()) {
				first_half.push(last_half.top());
				last_half.pop();
				last_half.push(first_half.top());
				first_half.pop();

				assert(first_half.top() <= last_half.top());
				assert(first_half.size() >= last_half.size());
			}
			b_sum += b;
		}
		else {
			long long median = first_half.top();
			long long sum = (first_half.size() * median - first_half.total()) + (last_half.total() - last_half.size() * median) + b_sum;
			cout << median << ' ' << sum << endl;
		}
	}
}

Measured memory_bytes: 3828
n = int(input())
t,a = map(int,input().split())
h= list(map(int,input().split()))

min_diff = 10**10
ans = 0
for i in range(n):
  temp = abs(a - (t - h[i]*0.006))  
  if min_diff > temp:
    min_diff = temp
    ans = i+1
print(ans)    

Measured memory_bytes: 3060
import java.util.Scanner;

public class Main{
public static void main(String[] args){
Scanner sc = new Scanner(System.in);
double r = sc.nextDouble();
double pi = Math.PI;
double area = r*r*pi;
double length = 2*r*pi;
System.out.printf("%f %f", area, length);
}   
}


Measured memory_bytes: 28408
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int num = sc.nextInt();
        int[] a = new int[num];
        
        for(int i = 0; i < num; i++){
            a[i] = sc.nextInt();
        }
        
        int max = a[0];
        int min = a[0];
        long sum = 0;
        
        for(int i = 0; i < num; i++){
            if(a[i] > max){
                max = a[i];
            }
            if(a[i] < min){
                min = a[i];
            }
            sum += a[i];
        }
        
        System.out.printf("%d %d %d\n", min, max, sum);
    }
}


Measured memory_bytes: 41952
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <queue>
#include <map>
#include <string>
#include <sstream>
#include <set>
#include <bitset>
#include <cmath>
using namespace std;

const int maxv = 10 + 5, INF = 0x3f3f3f3f;

int n, d[maxv][maxv];

int main() {
    while (cin >> n && n) {
        for (int i = 0; i < maxv; ++i)
            for (int j = 0; j < maxv; ++j)
                d[i][j] = (i == j ? 0 : INF);
        int V = 0;
        for (int i = 1; i <= n; ++i) {
            int a, b, c; cin >> a >> b >> c;
            d[a][b] = d[b][a] = c;
            V = max(V, max(a, b));
        }
        for (int k = 0; k <= V; ++k)
            for (int i = 0; i <= V; ++i)
                for (int j = 0; j <= V; ++j)
                    d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
        int ans = INF, loc;
        for (int i = 0; i <= V; ++i) {
            int sum = 0;
            for (int j = 0; j <= V; ++j) {
                if (i == j) continue;
                else sum += d[i][j];
            }
            if (sum < ans) { ans = sum; loc = i; }
        }
        cout << loc << ' ' << ans << endl;
    }
    return 0;
}


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

int main() {
    int N, M, X, temp; // N:cell max, M:station max, X:start point
    std::cin >> N >> M >> X;
    
    std::vector<int> A;
    for (auto i=0; i<M; ++i) {
        std::cin >> temp;
        A.push_back(temp);
    }
    
    int lcost = 0;
    for (int i=0; i<=X; ++i) {
        auto result = std::find(A.begin(), A.end(), i);
        if (result != A.end()) lcost++;
    }
    int rcost = 0;
    for (int i=N; i>=X; --i) {
        auto result = std::find(A.begin(), A.end(), i);
        if (result != A.end()) rcost++;
    }
    std::cout << (lcost < rcost ? lcost : rcost) << std::endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
	int i;
	int n;
	long ans;
	
	scanf("%d", &n);
	ans = 1;
	for(i = 2; i <= n; i++){
		ans *= i;
	}
	
	printf("%ld\n", ans);
	return (0);
}

Measured memory_bytes: 588
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <cstring>
#include <functional>

using namespace std;

#define rep(i,n) for((i)=0;(i)<(int)(n);(i)++)
#define foreach(itr,c) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)

const int dx[] = {0,1,0,-1};
const int dy[] = {1,0,-1,0};
vector<string> field;

void dfs(int y, int x){// cout << y << " " << x << endl;
    int i;

    rep(i,4){
        int my = y + dy[i];
        int mx = x + dx[i];
        if(my < 0 || mx < 0 || 12 <= my || 12 <= mx) continue;
        if(field[my][mx] == '1'){
            field[my][mx] = '0';
            dfs(my,mx);
        }
    }
}

int main(){
    int i,j,k;
    int n = 12;
    int cnt = 0;
    string in;

    while(cin >> in){
        cnt++;
//        cout << cnt << endl;
        if(cnt % 12 != 0){
            field.push_back(in);
            continue;
        }
        field.push_back(in);
//        rep(i,field.size()) cout << field[i] << endl;

        int res = 0;
        rep(i,n) rep(j,n){
            if(field[i][j] == '1'){
 //               cout << "go to dfs" << endl;
                res++;
                dfs(i,j);
            }
        }
        printf("%d\n",res);
        field.clear();
    }

  return 0;
}

Measured memory_bytes: 0
def _run(N, D, points):
    D2 = D * D
    count = 0
    for x, y in points:
        if x * x + y * y <= D2:
            count += 1
    print(str(count))


def _main():
    N, D = map(int, input().split())
    points = []
    for i in range(N):
        x, y = map(int, input().split())
        points.append((x, y))
    _run(N, D, points)


if __name__ == "__main__":
    _main()


Measured memory_bytes: 35900
class Node():
    def __init__(self, idx=None):
        self.idx = idx
        self.edge = []
        self.level = None
        self.par = None

class Edge():
    def __init__(self, to, cap, rev=None):
        self.to = to
        self.cap = cap
        self.rev = rev

from collections import deque

class BipartiteMatching():
    def __init__(self, n, m):
        self.n = n
        self.m = m
        self.inf = 10**18
        self.source = Node()
        self.sink = Node()
        self.lt = [Node(i) for i in range(n)]
        self.rt = [Node(i) for i in range(m)]
        for i in range(n):
            edge = Edge(self.lt[i], 1)
            rev = Edge(self.source, 0)
            edge.rev, rev.rev = rev, edge
            self.source.edge.append(edge)
            self.lt[i].edge.append(rev)
        for i in range(m):
            edge = Edge(self.sink, 1)
            rev = Edge(self.rt[i], 0)
            edge.rev, rev.rev = rev, edge
            self.rt[i].edge.append(edge)
            self.sink.edge.append(rev)

    def add(self, x, y):
        lt = self.lt[x]
        rt = self.rt[y]
        edge = Edge(rt, 1)
        rev = Edge(lt, 0)
        edge.rev, rev.rev = rev, edge
        lt.edge.append(edge)
        rt.edge.append(rev)

    def maximum_matching(self):
        flow = 0
        while True:
            queue = deque([self.source])
            self.source.level = 0
            self.sink.level = None
            for i in range(self.n):
                self.lt[i].level = None
            for i in range(self.m):
                self.rt[i].level = None
            while queue:
                node = queue.popleft()
                for edge in node.edge:
                    to = edge.to
                    if edge.cap and to.level is None:
                        to.level = node.level + 1
                        queue.append(to)
            if self.sink.level is None: break
            stack = [self.source]
            self.source.par = None
            self.sink.par = None
            for i in range(self.n):
                self.lt[i].par = None
            for i in range(self.m):
                self.rt[i].par = None
            while stack:
                node = stack.pop()
                if node is self.sink:
                    break
                for edge in node.edge:
                    to = edge.to
                    if edge.cap and node.level < to.level:
                        to.par = edge.rev
                        stack.append(to)
            node = self.sink
            while node is not self.source:
                node.par.cap = 1
                node.par.rev.cap = 0
                node = node.par.to
            flow += 1
        return flow

N = int(input())
R = [tuple(map(int, input().split())) for _ in range(N)]
B = [tuple(map(int, input().split())) for _ in range(N)]

bip = BipartiteMatching(N, N)

for i in range(N):
    a, b = R[i]
    for j in range(N):
        c, d = B[j]
        if a < c and b < d:
            bip.add(i, j)

print(bip.maximum_matching())

Measured memory_bytes: 10132
#include <bits/stdc++.h>
using namespace std;
#define ll long long 
#define MOD 1000000007
ll fact[200005];
#define eps 1e-9
#define INF 1e17
#define N 200005
inline ll mul(ll a,ll b){
  a=(a+MOD)%MOD;
  b=(b+MOD)%MOD;
  ll c=a*b;
  c=(c+MOD)%MOD;
  return c;
}
ll power(ll a,ll b,ll c){
  ll ans=1;
  while(b){
    if(b&1){
      ans=mul(ans,a);
    }
    a=mul(a,a);
    b=b/2;
  }
  return ans;
 }
ll min(ll a,ll b){return a<b?a:b;}
ll max(ll a,ll b){return a>b?a:b;}
int main() {
        ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
        ll n; cin>>n;
        ll a[n+1];
        for(int i=1;i<=n;++i)cin>>a[i];
        map<ll,ll> m1,m2;
        m2[1+a[1]]++;
        ll cnt=0;
        for(int i=2;i<=n;++i){
            ll x=i-a[i];
            cnt=cnt+m2[x];
            m2[i+a[i]]++;
        }
        cout<<cnt;
        return 0;
}


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

using namespace std;

int n,t;
set<int> sets;

int main()
{
    scanf("%d",&n);
    for(int i=0;i<n;i++)
    {
        scanf("%d",&t);
        if(sets.find(t)==sets.end())
            sets.insert(t);
        else
            sets.erase(t);
    }
    printf("%d\n",sets.size());
    return 0;
}


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

using namespace std;

long long A[100000];
long long B[100000];

int main(){
    int N;
    cin >> N;
    for(int i = 0; i < N + 1; i++){
        cin >> A[i];
    }
    for(int i = 0; i < N; i++){
        cin >> B[i];
    }

    long long ans = 0;    
    for(int i = 0; i < N; i++){
        if(A[i] < B[i]){
            ans += A[i];
            B[i] -= A[i];
            if(A[i + 1] > B[i]){
                A[i + 1] -= B[i];
                ans += B[i];
            } else {
                ans += A[i + 1];
                A[i + 1] = 0;
            }
        } else {
            ans += B[i];
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
#define repr(i,k,n) for(int i = (k); i < (n); i++)
#define rep(i,n) repr(i,0,n)
#define ALL(a) begin(a),end(a)
const int MOD = 1000000007;
typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
int ctoi(const char c){
  switch(c){
    case '0': return 0;
    case '1': return 1;
    case '2': return 2;
    case '3': return 3;
    case '4': return 4;
    case '5': return 5;
    case '6': return 6;
    case '7': return 7;
    case '8': return 8;
    case '9': return 9;
  }
}
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a,b,c;
    int ca, sa;
    int ans;
    cin >> a >> b >> c;
        ca = (a*a+b*b-c*c) / (2 * a * b);
        sa = 1 - (ca * ca);
        ans = 0.5 * sa * a * b;
    cout << ans << endl;
}

Measured memory_bytes: 256
import java.io.*;

class Main{
  public static void main(String[] args) throws IOException{
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    String str1 = br.readLine();
    String[] str2 = str1.split(" ");
    int n = Integer.parseInt(str2[0]);
    int m = Integer.parseInt(str2[1]);

    int[][] A = new int[n][m];
    int[] B = new int[m];
    int[] C = new int[n];

    for (int i = 0; i < n; i++){
      String[] str3 = br.readLine().split(" ");
      for (int j = 0; j < m; j++){
        A[i][j] = Integer.parseInt(str3[j]);
      }
    }
    for(int i = 0; i < m; i++){
        B[i] = Integer.parseInt(br.readLine());
    }
    for(int i = 0; i < n; i++){
      for(int j = 0; j < m; j++){
        C[i] += A[i][j] * B[j];
      }
    }
    for(int i = 0; i < n; i++){
        System.out.println(C[i]);
    }
  }
 }

Measured memory_bytes: 27712
// B - Varied
#include <bits/stdc++.h>
using namespace std;

int main(){
	string s; cin>>s;
	vector<int> c(26);
	for(int i=0; i<s.size(); ++i){
		if(c[s[i]-'0'] == 0) c[s[i]-'0']++;
		else{
			puts("no");
			return 0;
		}
	}
	puts("yes");
}

Measured memory_bytes: 256
#coding:UTF-8
def IS(N,A):
    for i in range(int(N)):
        v=A[i]
        j=i-1
        while j>=0 and A[j]>v:
            A[j+1]=A[j]
            j=j-1
        A[j+1]=v
        ans=""
        for k in range(len(A)):
            ans+=str(A[k])+" "
        print(ans[:-1])

if __name__=="__main__":
    N=input()
    a=input()
    A=a.split(" ")
    for i in range(len(A)):
        A[i]=int(A[i])
    IS(N,A)

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

#define ll long long int
#define loop(i,s,e) for(ll i=s; i<e; i++)
#define endl '\n'
#define vll vector<ll>
#define pll pair<ll, ll>
#define ff first
#define ss second
#define bug(...)        __f (#__VA_ARGS__, __VA_ARGS__)
#define N 100001
#define pb push_back
#define INF LLONG_MAX
#define inf INT_MAX
#define minusinf INT_MIN

template <typename Arg1>
void __f (const char* name, Arg1&& arg1) { cout << name << " : " << arg1 << endl; }
template <typename Arg1, typename... Args>
void __f (const char* names, Arg1&& arg1, Args&&... args)
{
     const char* comma = strchr (names + 1, ',');
     cout.write (names, comma - names) << " : " << arg1 << " | "; __f (comma + 1, args...);
}

void alpha(){

	ll a, b;
	cin>>a>>b;

	ll num1[b+1]={0}, num2[a+1];


	if(a<=b){
		loop(i,0,b) cout<<a;
	}
	else{
		loop(i,0,a) cout<<b;
	}

	return;

}

int main(){

	ios_base:: sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);

    ll t=1;
	//cin>>t;

  	while(t--) alpha();

	return 0;

}

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

int main(){
int n;
cin >> n ;
vector<ll> a(n);
for(int i = 0; i< n; i++)cin >> a[i];
ll p = 0;
for(int i = 0; i< n; i++) p ^= a[i];
vector<ll> b(n);
for(int i = 0; i< n; i++){
 b[i] = p ^ a[i] ;
}
for(int i = 0; i< n; i++)cout << b[i] << " ";
 return 0;
}
 

Measured memory_bytes: 6388
#include <string>
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <vector>
#include <cmath>
#include <map>
#define rep(i,n) for(int i = 0; i < (n); i++)
using namespace std;

int main()
{
    int n;
    cin >> n;
    map<string, int> mp;
    rep(i,n){
        string s;
        cin >> s;
        mp[s]++;
    }
    int mx = 0;
    for(const auto& p : mp) mx = max(mx, p.second);
    for(const auto& p : mp){
        if(p.second != mx) continue;
        cout << p.first << endl;
    }
    return 0;
}

Measured memory_bytes: 17664
//#define _GLIBCXX_DEBUG

#include<bits/stdc++.h>
using namespace std;

#define endl '\n'
#define lfs cout<<fixed<<setprecision(10)
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define fi first
#define se second
#define MP make_pair
#define MT make_tuple
#define PB push_back
#define EB emplace_back
#define rep(i,n,m) for(ll i = (n); i < (ll)(m); i++)
#define rrep(i,n,m) for(ll i = (ll)(m) - 1; i >= (ll)(n); i--)
using ll = long long;
using ld = long double;
const ll MOD1 = 1e9+7;
const ll MOD9 = 998244353;
const ll INF = 1e18;
using P = pair<ll, ll>;
template<typename T1, typename T2>
bool chmin(T1 &a,T2 b){if(a>b){a=b;return true;}else return false;}
template<typename T1, typename T2>
bool chmax(T1 &a,T2 b){if(a<b){a=b;return true;}else return false;}
ll median(ll a,ll b, ll c){return a+b+c-max({a,b,c})-min({a,b,c});}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
template<typename T1,typename T2>
void ans(bool x,T1 y,T2 z){if(x)cout<<y<<endl;else cout<<z<<endl;}  
template<typename T>
void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++)
{cout<<v[i][0];for(ll j=1;j<w;j++)cout spa v[i][j];cout<<endl;}};
void debug(vector<string>&v,ll h,ll w){for(ll i=0;i<h;i++)
{for(ll j=0;j<w;j++)cout<<v[i][j];cout<<endl;}};
template<typename T>
void debug(vector<T>&v,ll n){if(n!=0)cout<<v[0];
for(ll i=1;i<n;i++)cout spa v[i];cout<<endl;};
template<typename T>
vector<vector<T>>vec(ll x, ll y, T w){
  vector<vector<T>>v(x,vector<T>(y,w));return v;}
ll gcd(ll x,ll y){ll r;while(y!=0&&(r=x%y)!=0){x=y;y=r;}return y==0?x:y;}
vector<ll>dx={1,-1,0,0,1,1,-1,-1};
vector<ll>dy={0,0,1,-1,1,-1,1,-1};
template<typename T>
vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
template<typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v(ts...))>(a,make_v(ts...));
}
template<typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2>&p){
  return os << p.first << " " << p.second;
}
//mt19937 mt(chrono::steady_clock::now().time_since_epoch().count());

int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  ll res=0,buf=0;
  bool judge = true;
  ll x,y;cin>>x>>y;
  ans1(2*x<=y&&y<=4*x&&y%2==0);
  return 0;
}

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

int main(void)
{
  int n, i, j, num, picnum;
  char pic;
  int cards[4][13] = {};
  cin >> n;
  for (i = 0; i < n; i++) {
    cin >> pic >> num;
    if (pic == 'S') picnum = 0;
    if (pic == 'H') picnum = 1;
    if (pic == 'C') picnum = 2;
    if (pic == 'D') picnum = 3;
    cards[picnum][num - 1] = 1;
  }
  for (i = 0; i < 4; i++) {
    for (j = 0; j < 13; j++){
      if (cards[i][j] == 0) {
        switch(i) {
          case 0: pic = 'S'; break;
          case 1: pic = 'H'; break;
          case 2: pic = 'C'; break;
          case 3: pic = 'D'; break;
          default: pic = 'N'; break;
        }
        cout << pic << " " << j + 1 << endl;
      }
    }
  }
  return 0;
}

Measured memory_bytes: 1160
#include <iostream>
#include <vector>
int main() {
    int N;
    std::cin >> N;
    std::vector<int> CuSumWest(N,0),CuSumEast(N,0);
    std::vector<int> CDNum(N,0);//i番目がリーダーだったときに向きを変えなければならない人の数 = CDNum[i]


    for(int i=0;i<N;i++){
        if(i != 0) {
            CuSumEast[i] = CuSumEast[i - 1];
            CuSumWest[i] = CuSumWest[i - 1];
        }
        char input;
        std::cin >> input;
        if(input == 'E'){
            CuSumEast[i]++;
        }else{
            CuSumWest[i]++;
        }
    }
    for(int i=0;i<N;i++) {
        CDNum[i] = CuSumWest[i] + (CuSumEast[N-1] - CuSumEast[i]);
        if((CuSumWest[i] == 1 && i==0) || (CuSumWest[i] - CuSumWest[i-1] == 1) )
            CDNum[i] -- ;
    }

    int min = CDNum[0];

    for(int i=0;i<N;i++){
        if(min > CDNum[i]){
            min = CDNum[i];
        }
    }

    std::cout << min;

    return 0;

}

Measured memory_bytes: 3712
use std::io::*;
use std::str::FromStr;
use std::cmp::min;

fn main() {
    let n: usize = read();
    let a: usize = read();
    let b: usize = read();
    let p: Vec<usize> = (0..n).map(|_| read()).collect();

    let mut c1 = 0;
    let mut c2 = 0;
    let mut c3 = 0;
    for i in 0..n {
        if p[i] <= a {
            c1 += 1;
        } else if p[i] <= b {
            c2 += 1;
        } else {
            c3 += 1;
        }
    }
    println!("{}", min(c1, min(c2, c3)));
}

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()
}


Measured memory_bytes: 4352
from bisect import bisect_left


def solve(n, sx):
    # Minimum value of last element in len(i+1) increasing subsequence.
    tbl = [float('inf')]*n
    # 5 6 9 1 10

    for i in range(n):
        idx = bisect_left(tbl, sx[i])
        tbl[idx] = sx[i]
        # [5,inf,inf,inf]
        # .
        # .
        # [5,6,9,inf,inf]
        # [1,6,9,inf,inf,]
        # [1,6,9,10,inf,]

    return bisect_left(tbl, float('inf'))


if __name__ == '__main__':
    n = int(input())
    sx = []
    for _ in range(n):
        sx.append(int(input()))

    print(solve(n, sx))


Measured memory_bytes: 10464
using System;
class ProgramC
    {
        static void Main(string[] args)
        {
            
            string input = Console.ReadLine();
            ulong n = ulong.Parse(input);
            ulong ans = 1000000000000;

            


            for(ulong i = 1; i <= Math.Sqrt(n);i++)
            {
                if(n % i == 0)
                {
                    ulong a = n / i;
                    ulong count = a + i - 2;
                    if(count < ans)
                        ans = count;
                }
                    
                
            }

            Console.WriteLine(ans);
                
        }
    }

Measured memory_bytes: 13140
#include<bits/stdc++.h>
 using namespace std;
 map<string,long long>mp1,mp2;
 map<string,bool>mp;
 int main(){
 int n;
 cin >> n;
 for(int i=0;i<n;i++){
  string str;
  cin >> str;
  mp[str]=1;
  mp1[str]++;
 }
 int m;
 cin >> m;
 for(int i=0;i<m;i++){
  string str;
  cin >> str;
  mp[str]=1;
  mp2[str]--;
 }
 map<string,bool>::iterator itr;
 long long ans=0;
 for(itr=mp.begin();itr!=mp.end();itr++)
     ans=max(max(ans,0LL),mp1[itr->first]+mp2[itr->first]);
 cout<<ans<<endl;

}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <cmath>

using namespace std;

const double PI = 3.141592653589793;

int main() {
    double A, B, H, M;

    cin >> A >> B >> H >> M;

    double perH = 360.0 / (12.0 * 60.0);
    double perM = 360.0 / 60.0;

    double angH = perH * (H * 60 + M);
    double angM = perM * M;

    double ang = angH - angM;

    double ans = sqrt(A * A + B * B - 2 * A * B * cos(ang * PI / 180.0));

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

    return 0;
}

Measured memory_bytes: 4136
r=->i{P[i]?r[P[i]]:i};m=->i,j{B[i=r[i]]<B[j=r[j]]?m[j,i]:i!=j&&(P[j]=i;B[i]+=B[j];A[i]+=A[j])};eval"H,V="+gets.split*?,;S=$<.map(&:chop)*'';P=[];B=[];A=[];(H*V).times{|g|A[g]=1-B[g]=?.<=>c=S[g];g<V||c!=S[g-V]&&m[g,g-V];g%V>0&&c!=S[g-1]&&m[g,g-1]};a=0;(H*V).times{|g|P[g]||a+=A[g]*B[g]};p a

Measured memory_bytes: 6188
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
int main(){
    int n=0;
    string s;
    cin>>s;
    rep(i,s.size()) if(s[i]=='x') n++;
    if(15-n>=8) cout<<"YES";
    else cout<<"NO";
}

Measured memory_bytes: 256
#s=input()
#t=input()
#answer_copipe
s=input()
s_asc=''.join(sorted(s))
#print(s_asc)

t=input()
t_desc=''.join(sorted(t,reverse=True))
tal=''.join(sorted(t))
#print(t_desc)
#print(tal)

if(s_asc<t_desc):
    print("Yes")
else:
    print("No")

Measured memory_bytes: 2940
function Main(input){
  var input =input.split(" ");
  var a=parseInt(input[0],10);
  var b=parseInt(input[1],10);
  
  if(a*b%2===0){
    console.log("Even");
  }else{
    console.log("Odd");
  }
}
 
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7372
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long int
#define ld long double
#define pb push_back
#define fi first
#define se second
#define all(x) x.begin(),x.end()
#define mem(x,y) memset(x,y,sizeof(x))//memset only use to initialize 0 or -1 no other number.
#define pii pair<int,int>
#define pll pair<ll,ll>
#define INF 1e9
#define INFL 1e18
#define mod 1000000007
//#define mod 998244353
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;
using namespace __gnu_pbds; 
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> os;
typedef tree<pii,null_type,less<pii>,rb_tree_tag,tree_order_statistics_node_update> os_pair;

ll power(ll x,ll n){ll res =1;while(n>0){if(n%2==1){res=res*x;}x=x*x;n=n/2;}return res;}
ll powm(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}

//cout<< fixed << setprecision(10)
ll a[200005];
int foo(ll mx,ll k,ll n)
{
	ll cnt=0,i;
	for(i=0;i<n;i++)
	{
		if(a[i]%mx==0)
		{
			cnt+=a[i]/mx;
			cnt--;
		}
		else
		{
			cnt+=a[i]/mx;
		}
	}
	if(cnt<=k)
	return 1;
	else
	return 0;
}

int main(){

    fast;
    ll n,k,i,j;
    cin>>n>>k;
    for(i=0;i<n;i++)
    {
    	cin>>a[i];
	}
	
	sort(a,a+n);
	if(k==0)
	{
		cout<<a[n-1];
		return 0;
	}
	
	ll l=1;
	ll r=a[n-1];
	while(r>=l)
	{
	
		ll mid=(l+r)/2;
		
		if(foo(mid,k,n))
		{
			r=mid-1;
		}
		else
		{
			l=mid+1;
		}
	}
	cout<<l<<"\n";
    
	
    

}

Measured memory_bytes: 5172
class Node:
    def __init__(self, key, parent=None, left=None, right=None):
        self.key = key
        self.parent = parent
        self.left = left
        self.right = right

class Tree:
    root = None
    preorder_list = []
    inorder_list = []
    def __init__(self):
        pass
    def insert(self, node):
        y = None
        x = self.root

        while x is not None:
            y = x
            if node.key < x.key:
                x = x.left
            else:
                x = x.right
        node.parent = y

        if y == None:
            self.root = node
        elif node.key < y.key:
            y.left = node
        else:
            y.right = node
    def find(self, node):
        y = None
        x = self.root
        while x is not None:
            if node.key == x.key:
                print('yes')
                return
            elif node.key < x.key:
                x = x.left
            else:
                x = x.right
        print('no')

    def display(self):
        #print(self.root, self.root.key, self.root.parent, self.root.left, self.root.right)
        self.inorder(self.root)
        self.preorder(self.root)
        print(' '+' '.join(map(str, self.inorder_list)))
        print(' '+' '.join(map(str, self.preorder_list)))
        pass

    def preorder(self, node):
        if node == None:
            return
        self.preorder_list.append(node.key)
        if node.left is not None:
            self.preorder(node.left)
        if node.right is not None:
            self.preorder(node.right)

    def inorder(self, node):
        if node == None:
            return
        if node.left is not None:
            self.inorder(node.left)
        self.inorder_list.append(node.key)
        if node.right is not None:
            self.inorder(node.right)

n = int(input())
command_list = [list(input().split()) for _ in range(n)]

tree = Tree()
for command in command_list:
    if command[0] == 'insert':
        node = Node(int(command[1]))
        tree.insert(node)
        #print(node, node.key, node.parent, node.left, node.right)
    if command[0] == 'print':
        tree.display()
        tree.preorder_list = []
        tree.inorder_list = []
    if command[0] == 'find':
        tree.find(Node(int(command[1])))






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

#define ll long long int
#define FOR(i, a, b) for (int i = (a); i <= (b); ++i)
#define REP(i, n) for (int i = 0; i < n; ++i)
#define FOREACH(x, a) for (auto &(x) : (a))
#define ALL(a) (a).begin(), (a).end()
#define OUT(x) out << (x) << endl;
#define M0(x) memset(x, 0, sizeof(x))
#define MINF(x) memset(x, 0x3f, sizeof(x))
#define MMINUS(a) memset(a, 0xff, sizeof(a))
#define ten(n) ((int)1e##n)

const int INF = 0x3f3f3f3f;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
const double EPS = 1.0 / LINF;
const char ENDL = '\n'; // for JetBrains IDE only supports yen

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

int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }

using namespace std;

int N;
struct edge { int to, weight; };
vector<edge> G[2 * ten(5) + 1];
bool flag[2 * ten(5) + 1];
int color[2 * ten(5) + 1];

void dfs(int v) {
    FOREACH(e, G[v]) {
        if (!flag[e.to]) {
            flag[e.to] = true;
            if (e.weight & 1) {
                color[e.to] = color[v] ^ 1;
            } else {
                color[e.to] = color[v];
            }
            dfs(e.to);
        }
    }
}

int main()
{
    cin >> N;
    REP(i, N)
    {
        int u, v, w;
        cin >> u >> v >> w;
        G[u].push_back((edge){v, w});
        G[v].push_back((edge){u, w});
    }

    color[1] = 0;
    dfs(1);
    FOR(i, 1, N) cout << color[i] << endl;
}

Measured memory_bytes: 9984