akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i, n) for (int i=0; i<n; ++i)
#define rep1(i, n) for (int i=1; i<=n; ++i)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
constexpr ll  MOD = (1e9+7);
constexpr int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }
constexpr int lcm(int a, int b) { return a / gcd(a, b) * b; }

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;
}
ll factorial(ll n, ll m=2) {
    // calculate n!
    m = max(2LL, m);
    ll rtn = 1;
    for (ll i=m; i<=n; i++) {
        rtn = (rtn * i) % MOD;
    }
    return rtn;
}
ll modinv(ll a, ll m) {
    ll b = m, u = 1, v = 0;
    while (b) {
        ll t = a / b;
        a -= t * b;
        swap(a, b);
        u -= t * v;
        swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}
ll modpow(ll a, ll n) {
    ll res = 1;
    while (n > 0) {
        if (n & 1)
            res = res * a % MOD;
        a = a * a % MOD;
        n >>= 1;
    }
    return res;
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    double r; cin >> r;
    double pi = 3.141592653589793238;
    cout << setprecision(30)<< pi * r * 2 << endl;
    return 0;
}

Measured memory_bytes: 3796
n = gets.to_i
a,b = gets.split.map &:to_i
p = gets.split.map &:to_i

x = p.count{|i|i <= a}
y = p.count{|i|a < i && i <= b}
z = p.count{|i|b < i}

puts [x,y,z].min

Measured memory_bytes: 1788
var input = require("fs").readFileSync("/dev/stdin", "utf8").trim().split("\n");
var obj = {
  "list" : input, "index" : 0, "max" : input.length,
  "hasNext" : function(){return (this.index < this.max);},
  "next" : function(){
    if(!this.hasNext()){throw "NoSuchElementException:次に要素は無いよ";}
    var returnObj = this.list[this.index];
    this.index++;
    return returnObj;
  }
}
Main();
function next(){return obj.next();}
function nextInt(){return myconv(next(),1);}
function nextStrArray(){return myconv(next(),2);}//半角スペース分割
function nextIntArray(){return myconv(next(),4);}//半角スペース + 数値化
function nextCharArray(){return myconv(next(),6);}//1文字分割
function hasNext(){return obj.hasNext();}
function myout(t){console.log(t);}//標準出力
function myerr(t){console.error(t);}//標準エラー出力
//[no]要素の扱い。数値型
//不明値、異常時:引数そのまま返す　1:数値へ変換
//2:半角SPで分割 4:半角SPで分割し、数値配列へ
//6:1文字で分割  7:1文字で分割し、数値配列へ
//8:半角SPで結合 9:改行で結合 0:文字なしで結合
function myconv(i,no){try{switch(no){case 1:return parseInt(i);case 2:return i.split(" ");case 4:return i.split(" ").map((a)=>Number(a));case 6:return i.split("");case 7:return i.split("").map((a)=>Number(a));case 8:return i.join(" ");case 9:return i.join("\n");case 0:return i.join("");default:return i;}}catch(e){return i;}}
function Main(){
  var one = nextIntArray();
  var A = one[0];
  var B = one[1];
  var K = one[2];
  for(var i = 0; i < K; i++){
    if(i % 2 == 0){
       if(A % 2 == 1){
          A--;
       }
       B += A / 2;
       A /= 2;
    }else{
       if(B % 2 == 1){
          B--;
       }
       A += B / 2;
       B /= 2;
    }
  }
  myout(A + " " + B);
}

Measured memory_bytes: 7372
// Problem : C - management
// Contest : AtCoder - AtCoder Beginner Contest 163
// URL : https://atcoder.jp/contests/abc163/tasks/abc163_c
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update

using namespace std;
using namespace __gnu_pbds;

typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update>
ordered_set;	

#define FOR(i,a,b) for(int i = (a); i <= (b); ++i)
#define FORD(i,a,b) for(int i = (a); i >= (b); --i)
#define RI(i,n) FOR(i,1,(n))
#define REP(i,n) FOR(i,0,(n)-1)
#define mini(a,b) a=min(a,b)
#define maxi(a,b) a=max(a,b)
#define pb push_back
#define st first
#define nd second
#define sz(w) (int) w.size()
typedef vector<int> vi;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<pii, int> para;
const ll inf = 1e18 + 7;
const ll maxN = 1e6 + 5;
const ll MOD = 1e9 + 7;

int n, ile[maxN];
// sprawdz MODULO!
int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	cin >> n;
	REP(i, n - 1) {
		int a;
		cin >> a;
		ile[a]++;
	}
	RI(i, n) cout << ile[i] << "\n";
	return 0;
}
 


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

using VS = vector<string>;    using LL = long long;
using VI = vector<int>;       using VVI = vector<VI>;
using PII = pair<int, int>;   using PLL = pair<LL, LL>;
using VL = vector<LL>;        using VVL = vector<VL>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
#define debug(x) cerr << #x << ": " << x << endl
const int INF = 1e9;                          const LL LINF = 1e16;
const LL MOD = 1000000007;                    const double PI = acos(-1.0);
int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };

/* -----  2018/02/15  Problem: 070_abc_d / Link: https://abc070.contest.atcoder.jp/tasks/abc070_d?lang=en  ----- */
/* ------問題------

N 頂点の木が与えられます。
木とはグラフの一種であり、頂点の数を N とすると、辺の数が N−1 本である閉路のない連結グラフです。
i(1≦i≦N−1) 番目の辺は 頂点 ai と 頂点 bi を距離 ci で結びます。

また、Q 個の質問クエリと整数 K が与えられます。
j(1≦j≦Q) 番目の質問クエリでは、頂点 xj から 頂点 K を経由しつつ、頂点 yj まで移動する場合の最短経路の距離を求めてください。

-----問題ここまで----- */
/* -----解説等-----



----解説ここまで---- */
void D(vector<vector<PLL>>& G, VL&dist, int s, int t) {

	const int INF = INT_MAX;
	const long long INIT_NUM = LLONG_MAX / 10;// dist の型
#define DijkV 200020

	priority_queue<PLL, vector<PLL>, greater<PLL>> que; //優先度付きqueue 降順(距離、頂点)
	que.push(PLL(0LL, s)); // push(距離,頂点)

	while (!que.empty()) {
		PLL p = que.top(); que.pop(); //queueのデータ構造
		int v; /* 頂点*/ long long d; /* 頂点vまでの距離 */
		tie(d, v) = p;

		if (d > dist[v]) continue; //最適でないならば考慮しない

		FOR(i, 0, (int)G[v].size()) { //頂点vからはi本の辺が存在
			int nv = G[v][i].first; // v->nv
			if (dist[nv] > dist[v] + G[v][i].second) {
				dist[nv] = dist[v] + G[v][i].second;
				que.push(PLL(dist[nv], nv)); //push(距離,頂点) 
			}
		}
	}

#undef DijkV
}

LL N;

LL ans = 0LL;

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

	cin >> N;
	vector<vector<PLL>> G(N);
	FOR(i, 0, N-1) {
		int a, b, c;
		cin >> a >> b >> c;
		a--, b--;
		G[a].push_back(PLL(b, c));
		G[b].push_back(PLL(a, c));
	}

	int Q, K; cin >> Q >> K;
	K--;
	VL dist(N, LINF);
	dist[K] = 0;

	D(G, dist, K,N);
	FOR(i, 0, Q) {
		int x, y;
		cin >> x >> y;
		x--; y--;
		ans = dist[x] + dist[y];
		cout << ans << "\n";
	}

	return 0;
}


Measured memory_bytes: 11120
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define ll long long
#define rep(i,n) for (int i = 0; i < n; i++)
#define vl vector<ll>
#define vpl vector<pair<ll,ll>>
#define vvl vector<vector<ll>> //a(縦行,vector<ll>(横列));
#include<algorithm>//__gcd(a,b)

int main(){

    map<string, int> dict; // 文字列と出現回数の辞書作成

    int n; cin >> n; // 下for文のループ回数
    int sum=0;
    for (string x; n--; dict[x]++) { // 辞書内の文字列xに対応する出現回数を+1する
        cin >> x; // 文字列 x 入力
  dict[x]++;
  if(dict[x]==1)sum++;

    }
    cout<<sum<<endl;
}

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

const int N = 110000;
const int MOD = 998244353;

int D[N], frq[N];

inline int modExp(int a, int n, int mod) {
	int ret = 1;
	while (n) {
		if (n & 1) ret = (long long)ret * a % mod;
		a = (long long)a * a % mod;
		n >>= 1;
	}
	return ret;
}

int main() {
	
	ios::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	
	int n; cin >> n;
	for (int i = 1; i <= n; i++) cin >> D[i], frq[D[i]]++;
	if (D[1] != 0) cout << "0\n";
	else {
		if (frq[0] != 1) cout << "0\n";
		else {
			int ans = 1, Max = 0;
			for (int i = 0; i < n; i++) if (frq[i]) Max = i;
			for (int i = 0; i <= Max; i++) if (!frq[i]) {
				cout << "0\n";
				return 0;
			}
			for (int i = 1; i <= Max; i++) ans = (long long)ans * modExp(frq[i - 1], frq[i], MOD) % MOD;
			cout << ans << "\n";
			return 0;
		}
	}
	
	return 0;
}


Measured memory_bytes: 1024
num_bars = 3
length_list = list(map(int,input().split()))

x = abs(length_list[0])
k = length_list[1]
d = length_list[2]

amari =  x % d
syou = x // d

#print(amari)
#print(syou)

val = x

if x - k * d > amari:
  val = x - k * d
elif (k - syou ) % 2 == 0:
  val = amari
else :
  val = d - amari
  
  
print(val)
  
  

Measured memory_bytes: 9208
import java.io.*;
import java.util.*;
 
public class Main{
	
	int H, W, K;
	int[][] flg;
	int[] dh = {1, 0, -1, 0};
	int[] dw =  {0, 1, 0, -1};
	
	public void solve(){
		H = nextInt();
		W = nextInt();
		K = nextInt();
		
		flg = new int[H][W];

		int h = 0, w = 0;
		for(int i = 0; i < H; i++){
			String str = next();
			for(int j = 0; j < W; j++){
				if(str.charAt(j) == '#'){
					flg[i][j] += 2;
				}else if(str.charAt(j) == 'S'){
					h = i;
					w = j;
				}
			}
		}
		Queue<Pair> queue = new ArrayDeque<>();
		int[][] count = new int[H][W];
		count[h][w] = 1;
		queue.offer(new Pair(h, w));
		
		int mind = H * W;
		
		while(!queue.isEmpty()){
			Pair p = queue.poll();
			int cnt = count[p.h][p.w] - 1;
			mind = Math.min(mind, dis(p.h, p.w));
			if(cnt < K){
				for(int i = 0; i < 4; i++){
					int hh = p.h + dh[i];
					int ww = p.w + dw[i];
					if(0 <= hh && hh < H && 0 <= ww && ww < W &&
						count[hh][ww] == 0 && flg[hh][ww] == 0){
						count[hh][ww] = cnt + 2;
						queue.offer(new Pair(hh, ww));
					}
				}
			}
		}
		//if(mind == 0) mind = 1;
		out.println((mind + K - 1) / K + 1);
	}
	
	int dis(int h, int w){
		int ret = Math.min(h,  w);
		ret = Math.min(ret, H - h - 1);
		ret = Math.min(ret, (W - 1 - w));
		return ret;
	}
	
	class Pair{
		int h;
		int w;
		public Pair(int h, int w){
			this.h = h;
			this.w = w;
		}
		
		
	}
	
	private static PrintWriter out;
	public static void main(String[] args){
		out = new PrintWriter(System.out);
		new Main().solve();
		out.flush();
	}
	
	
	
	public static int nextInt(){
		int num = 0;
		String str = next();
		boolean minus = false;
		int i = 0;
		if(str.charAt(0) == '-'){
			minus = true;
			i++;
		}
		int len = str.length();
		for(;i < len; i++){
			char c = str.charAt(i);
			if(!('0' <= c && c <= '9')) throw new RuntimeException();
			num = num * 10 + (c - '0');
		}
		return minus ? -num : num;
	}
	
	public static long nextLong(){
		long num = 0;
		String str = next();
		boolean minus = false;
		int i = 0;
		if(str.charAt(0) == '-'){
			minus = true;
			i++;
		}
		int len = str.length();
		for(;i < len; i++){
			char c = str.charAt(i);
			if(!('0' <= c && c <= '9')) throw new RuntimeException();
			num = num * 10l + (c - '0');
		}
		return minus ? -num : num;
	}
	public static String next(){
		int c;
		while(!isAlNum(c = read())){}
		StringBuilder build = new StringBuilder();
		build.append((char)c);
		while(isAlNum(c = read())){
			build.append((char)c);
		}
		return build.toString();
	}
	
	
	private static byte[] inputBuffer = new byte[1024];
	private static int bufferLength = 0;
	private static int bufferIndex = 0;
	private static int read(){
		if(bufferLength < 0) throw new RuntimeException();
		if(bufferIndex >= bufferLength){
			try{
				bufferLength = System.in.read(inputBuffer);
				bufferIndex = 0;
			}catch(IOException e){
				throw new RuntimeException(e);
			}
			if(bufferLength <= 0) return (bufferLength = -1);
		}
		return inputBuffer[bufferIndex++];
	}
	
	private static boolean isAlNum(int c){
		return '!' <= c && c <= '~';
	}
}

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

using namespace std;

#define INF 1e9
#define MAXN 100005
#define MAXM 100005
#define ll long long
#define vi vector<int>
#define vll vector<long long>
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define pii pair<int, int>

int N;
ll ans = 0;
string st[MAXN];
map<string, int> mp;

ll Combi(int a){
    return (ll)a*(a-1)/2;
}

void solve(){
    rep(i, N){
        sort(st[i].begin(), st[i].end());
        mp[st[i]]++;
    }


    for (auto it=mp.begin(); it!=mp.end(); ++it)
        ans += Combi(it->second);

    cout << ans << endl;
}

int main(){
    cin >> N;

    rep(i, N){
        cin >> st[i];
    }

    solve();
}


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

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, k, n) for (int i = (int)(k); i < (int)(n); i++)
#define rrep(i, n) for (int i = (int)(n)-1; i >= 0; i--)
#define rREP(i, k, n) for (int i = (int)(n)-1; i >= k; i--)

#define fi first
#define se second

#define vi vector<int>
#define pb push_back
#define mp make_pair

#define pcnt __builtin_popcount

typedef long long ll;

const int inf = 100100100;
const int MOD = (int) 1e9 + 7;
const double EPS = 1e-9;

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; }
int main() {
    int g[510][510]={};
    int n,m,q;
    cin >> n>> m >>q;
    rep(i,m){
        int a,b;
        cin >> a >> b;
        g[a][b]+=1;
    }
    rep(i,501){
        rep(j,501){
            g[i][j+1] += g[i][j];
        }
    }
    rep(i,501){
        rep(j,501){
            g[i+1][j] += g[i][j];
        }
    }
    rep(i,q){
        int a,b;
        cin >> a >> b;
        cout << g[b][b]-g[a-1][b]-g[b][a-1]+g[a-1][a-1] << endl;
    }
    return 0;
}

Measured memory_bytes: 1920
#include <bits/stdc++.h>
using namespace std;
int main(){
    int n;
    cin>>n;
    vector<int> a(n);
    for(int i=0;i<n;i++){
        cin>>a.at(i);
    }
    int counter=0;
    for(int i=0;i<n;i++){
        int minj=i;
        int flag=0;
        for(int j=i+1;j<n;j++){
            if(a.at(minj)>a.at(j)){
                minj=j;
                flag=1;
            }
        }
        if(flag){
        swap(a.at(i),a.at(minj));
        counter++;
        }
    }
    for(int i=0;i<n-1;i++){
        cout<<a.at(i)<<' ';
    }
    cout<<a.at(n-1)<<endl<<counter<<endl;
}


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

#ifdef DEBUG
    #define IFD if(true)
#else
    #define IFD if(false)
#endif

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

int main()
{
    int N;
    int A[100001];
    int l_pre[100002];
    int l_post[100002];

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

    l_pre[0] = 0;
    l_pre[1] = A[1];
    IFD cout << l_pre[1] << " ";
    for(int i = 2; i <= N; i++) {
        l_pre[i] = gcd(A[i], l_pre[i - 1]);
        IFD cout << l_pre[i] << " ";
    }
    IFD cout << endl;

    l_post[N + 1] = 0;
    l_post[N] = A[N];
    IFD cout << l_post[N] << " ";
    for(int i = N - 1; i >= 1; i--) {
        l_post[i] = gcd(l_post[i + 1], A[i]);
        IFD cout << l_post[i] << " ";
    }
    IFD cout << endl;

    int ans = -1;
    for(int i = 1; i <= N; i++) {
        ans = max(ans, gcd(l_pre[i - 1], l_post[i + 1]));
    }

    cout << ans << endl;

    return 0;
}


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

using namespace std;

int main()
{
 long long n,d;
 cin>>n>>d;
 d*=d;
 int ans=0;
 while(n--)
 {
     long long x,y;
     cin>>x>>y;
    long long dd=x*x+y*y;
    if(dd<=d)
    ans++;
 }
 cout<<ans;
    return 0;
}



Measured memory_bytes: 3632
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
using ll = long long;
using u64 = uint_fast64_t;
using pii =  pair<int, int>;
using pll =  pair<long long, long long>;
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define all(x) (x).begin(),(x).end()
constexpr char ln =  '\n';
constexpr long long MOD = 1000000007;
//constexpr long long MOD = 998244353;
template<class T1, class T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return true;} return false; }
template<class T1, class T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return true;} return false; }
inline int popcount(int x) {return __builtin_popcount(x);}
inline int popcount(long long x) {return __builtin_popcountll(x);}
void print() { cout << "\n"; }
template<class T, class... Args>
void print(const T &x, const Args &... args) {
    cout << x << " ";
    print(args...);
}
///////////////////////////////////////////////////////////////////////////////////////////////////////////////

const int COL = 64;
template<int MAX_COL>
struct BitMatrix {
    int N,M;
    vector<bitset<MAX_COL>> A;
    BitMatrix(int N, int M) : N(N),A(N),M(M) {}

    int GaussJordan() {
        int rank = 0;
        for (int col = 0; col < M; ++col) {
            int pivot = -1;
            for (int row = rank; row < N; ++row) {
                if (A[row][col]) {
                    pivot = row;
                    break;
                }
            }
            if (pivot == -1) continue;
            swap(A[pivot], A[rank]);
            for (int row = 0; row < N; ++row) {
                if (row != rank && A[row][col]) A[row] ^= A[rank];
            }
            ++rank;
        }
        return rank;
    }
};

using BM = BitMatrix<COL>;

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    int N; cin >> N;
    vector<u64> A(N);
    rep(i,N) cin >> A[i];

    BM mat(N,60);
    vector<int> cnt(60);
    rep(i,N) {
        rep(bit,60) if ((A[i]>>bit)&1) cnt[bit]++;
    }
    rep(i,N) {
        rep(bit,60) {
            if (cnt[bit]%2==0 and ((A[i]>>bit)&1)) mat.A[i][59-bit] = 1;
        }
    }
    int MAX = mat.GaussJordan();
    u64 ans1 = 0;
    int rank = 0;
    rep(i,MAX) {
        u64 a = 0;
        rep(bit,60) {
            if (mat.A[i][59-bit]) a += 1ull<<bit;
        }
        ans1 ^= a;
    }

    u64 ans2 = 0;
    rep(i,N) ans2 ^= A[i];
    cout << ans1*2 + ans2 << ln;
}

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

int main() {
  long long A,V,B,W,T;
  cin >> A >> V >> B >> W >> T;
  long long D;
  
  if (A > B){
    D = A - B;
  }
  else {
    D = B - A;
  }
  
  
  if (V > W){
    if ((D + V - W - 1) / (V - W) <= T ){
      cout << "YES" << endl;
    }
  else {
    cout << "NO" << endl;
    }
  }
  else {
    cout << "NO" << endl;
  }
}
    
  
  

Measured memory_bytes: 3636
package main

import "fmt"

func main() {
	var s string
	fmt.Scan(&s)
	ans := ""
	for _, c := range s {
		switch string(c) {
		case "0":
			ans += "0"
		case "1":
			ans += "1"
		case "B":
			if len(ans) > 0 {
				ans = ans[:len(ans)-1]
			}
		}
	}
	fmt.Println(ans)
}


Measured memory_bytes: 512
program prob2
    implicit none
    integer::n, i, j
    read(*,*) n
    do i = 1, 10000
        if(N <= (i**2+i)/2) then
            do j = i, 1, -1
                if(N == 0) then
                    exit
                else if(N >= j) then
                    write(*,*) j
                    N = N - j
                end if
            end do
            stop
        end if
    end do
end program

Measured memory_bytes: 2780
using System;
class Solution
{
   static void Main(string[] args)
   {
     string[] input = Console.ReadLine().Split(' ');
     int a = int.Parse(input[0]);
     int b = int.Parse(input[1]);
     int c = int.Parse(input[2]);
     
     if(a == b && b == c)
     {
       if(a + b > c)
       	Console.WriteLine("Yes");
       else
         Console.WriteLine("No");
     }
     else
       Console.WriteLine("No");
   }
}


Measured memory_bytes: 11092
#import numpy as np
#from numpy import*
#from scipy.sparse.csgraph import shortest_path #shortest_path(csgraph=graph) # dijkstra# floyd_warshall
#from scipy.sparse import csr_matrix

from collections import* #defaultdict Counter deque appendleft
from fractions import gcd
from functools import* #reduce
from itertools import* #permutations("AB",repeat=2) combinations("AB",2) product("AB",2) groupby accumulate
from operator import mul,itemgetter
from bisect import* #bisect_left bisect_right
from heapq import* #heapify heappop heappushpop
from math import factorial,pi
from copy import deepcopy
import sys
sys.setrecursionlimit(10**8)
#input=sys.stdin.readline  #危険！基本オフにしろ！
 
def main():
    n,*a=map(int,open(0).read().split())
    print(1/sum(1/i for i in a))
if __name__ == '__main__':
    main()

Measured memory_bytes: 5608
#include <stdio.h>

#define MAX_N 246912

int isPrime[ MAX_N + 1 ] = { 0, 0, 1 }, num_p[ MAX_N + 1 ] = {};

int main( void ) {
	int i, j, n;

	for ( i = 3; i <= MAX_N; i += 2 )
		isPrime[ i ] = 1;

	for ( i = 3; i * i <= MAX_N; i += 2 )
		if ( isPrime[ i ] )
			for ( j = i * 2; j <= MAX_N; j += i )
				isPrime[ j ] = 0;

	for ( i = 2; i <= MAX_N; i++ )
		num_p[ i ] = num_p[ i - 1 ] + isPrime[ i ];

	for ( ; scanf( "%d", &n ), n; printf( "%d\n", num_p[ n * 2 ] - num_p[ n ] ) ) ;

	return 0;
}

Measured memory_bytes: 2528
# -*- coding: utf-8 -*-
# ABCD
S = list(map(int, list(input())))

for bit in range(2**3):
    formula_sum = S[0]
    formula = str(S[0])
    for shift in range(3):
        # 1だったら+
        if (bit >> shift)&1:
            formula_sum += S[shift+1]
            formula += '+{}'.format(S[shift+1])
        else:
            formula_sum -= S[shift+1]
            formula += '-{}'.format(S[shift+1])
    
    if formula_sum == 7:
        print(formula+'=7')
        exit(0)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
	#define author          "Sihare0riginals"
	#define ss       		string 
	#define lli      		long long int
	#define ld       		long double
	#define f        		first
	#define s        		second
	#define all(v)   		v.begin(),v.end()
	#define I(a,i)			memset(a,i,sizeof(a));
	#define pb       		push_back
	#define mp       		make_pair
	#define L(i,start,end)  for(lli i=start;i<=end;i++)
	#define R(i,start,end)  for(lli i=start;i>=end;i--)
	#define ip(n) 			cin>>n;lli ip[n+1];L(i,1,n)cin>>ip[i];
const lli LINF = 1e18,mod=1e9+7;
void Bl0ck_M0mb0();


signed main()
{
	Bl0ck_M0mb0();
	lli t=1;
	//cin>>t;
	while(t--){
		lli n;
		cin>>n;
		lli A[n+1],sum=0;
		map<lli,lli> ip;
		L(i,1,n)
		{
			cin>>A[i];
			sum+=A[i];
			ip[A[i]]++;
		}
		lli q;
		cin>>q;
		L(i,1,q)
		{
			lli bi,ci;
			cin>>bi>>ci;
			lli sz=ip[bi];
			ip[ci]+=ip[bi];
			ip[bi]=0;
			sum-=sz*bi;
			sum+=sz*ci;
			cout<<sum<<endl;
		}
	}
	return 0;
}


















void Bl0ck_M0mb0(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);cout.tie(NULL);
	#ifndef ONLINE_JUDGE
	freopen("ip.txt","r",stdin);
	freopen("op.txt","w",stdout);
	#endif
}
/*
#define dbg1D(i,start,end,arr) for(lli i=start;i<=end;i++) cout<<i<<"th : "<<arr[i]<<endl;
#define dbg2D(i,j,s1,e1,s2,e2,arr) for(lli i=s1;i<=e1;i++){cout<<i<<"th :";for(lli j=s2;j<=e2;j++)cout<<arr[i][j]<<" ";cout<<endl;}
#define M map<lli,lli> \n #define sz(s) s.size()-1
#define P pair<lli,lli> 
#define V vector<lli>
lli dx[4]={-1, 0, 0, +1};
lli dy[4]={0, -1, +1, 0};
lli power(lli a,lli b,lli m){ if(b==0) return 1; if(b==1) return a%m;
 	lli t=power(a,b/2,m); t=(t*t)%m; if(b&1) t=(t*a)%m; return t;}
lli modInverse(lli a, lli m) { return power(a, m-2, m); } */

Measured memory_bytes: 10356
import math as mt
N,M=list(map(int,input().split()))
if N==M:
  print(1)
  exit()
L=list(map(int,input().split()))
Z=L[0:M]
S=L[::-1]
A=S[0:M]
if len(L)%2==0:
  print(mt.floor((N-M)//(M-1))+2)
else:
  if min(L) in A or min(L) in Z:
    print(mt.floor((N-M)//(M-1))+2)
  else:
    print(mt.floor((N-M)//(M-1))+1)
  

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

using namespace std;

#define REP(i,m) for(int i=0; i<m; i++)
#define FOR(i,n,m) for(int i=n; i<m; i++)
#define INF 1000000007
#define INFL (1LL << 60)
#define MOD 998244353
#define ALL(v) v.begin(),v.end()
#define pb push_back
#define ll long long int

int main(){
	int a, b;
	cin >> a >> b;
	if(a <= 5) cout << 0 << endl;
	else if(a <= 12) cout<< b/2 << endl;
	else cout << b << endl;
	return 0;
} 


Measured memory_bytes: 256
N, K = list(map(int, input().split()))
height = list(map(int, input().split()))
ans = 10 ** 10
if N==K:
    cost=0
    for i in range(1,N):
        if height[i-1]>=height[i]:
            cost+=height[i-1]-height[i]+1
            height[i]+=height[i-1]-height[i]+1
    print(cost)
    exit()
for i in range(2 ** N):
    count=1
    cost = 0
    height2 = height.copy()
    for j in range(N):
        if i >> j & 1:
            if j!=0:
                tarou=max(height2[:j])
                if height2[j]<=tarou:
                    cost+=tarou-height2[j]+1
                    height2[j]+=tarou-height2[j]+1
                    count+=1
                else:count+=1
    # zenkai=0
    # for x in range(1,N):
    #     if height2[zenkai] < height2[x]:
    #         count += 1
    #         zenkai=x
    if ans > cost and count >= K:
        ans = cost

print(ans)

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

#define fr first
#define sc second
#define mk make_pair
#define pb push_back

using namespace std;

typedef long long ll;

const int N = 1e6 + 5;

int main() {
	int n, k;
	cin >> n >> k;
	int ans = 1;
	for (int i = 1; i < n; i ++)
		ans *= k - 1;
	ans *= k;
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define null NULL
#define mp make_pair
#define pb(a) push_back(a)
#define sz(a) ((int)(a).size())
#define all(a) a.begin() , a.end()
#define fi first
#define se second
#define relaxMin(a , b) (a) = min((a),(b))
#define relaxMax(a , b) (a) = max((a),(b))
#define SQR(a) ((a)*(a))
#define PI 3.14159265358979323846
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;

// Modular operations
const int MOD = 1E9 + 7;

int Add(int a, int b, int m = MOD){
  a += b;
  if(a >= m) a -= m;
  return a;
}

int Sub(int a, int b, int m = MOD){
  a -= b;
  if(a < 0) a += m;
  return a;
}

int AddTo(int& to, int w, int m = MOD){
  to += w;
  if(to >= m) to -= m;
  return to;
}

int SubTo(int& to, int w, int m = MOD){
  to -= w;
  if(to < 0) to += m;
  return to;
}

int Mult(int a, int b, int m = MOD){
  return (a * 1LL * b) % m;
}

int Pow(int a, ll deg, int m = MOD){
  int res = 1 % m;
  for(;deg > 0;deg >>= 1, a = Mult(a, a, m))
    if(deg & 1) res = Mult(res, a, m);
  return res;
}

int Oem(int to, int m = MOD){
  return Pow(to, m - 2, m);
}

int Div(int a, int b, int m = MOD){
  return Mult(a, Oem(b, m), m);
}

// Solution
const int MAXN = 2E5 + 10;

int par[MAXN];

int GetPar(int vr){
  return par[vr] == vr ?
    vr : par[vr] = GetPar(par[vr]);
}

void Merge(int a, int b){
  a = GetPar(a), b = GetPar(b);
  par[a] = b;
}

int n, x, y;
int col[MAXN], w[MAXN];

bool Compare(int f, int s){
  return w[f] < w[s];
}

vi by_col[MAXN];
vi glob;

int fact[MAXN];

int Shuffle(const vi& of){
  int tot = 0;
  for(int e : of) tot += e;

  int ch = fact[tot], zm = 1;
  for(int e : of) zm = Mult(zm, fact[e]);

  return Div(ch, zm);
}

int main(){
  for(int i = 0;i < MAXN;++i) par[i] = i;

  fact[0] = 1;
  for(int i = 1;i < MAXN;++i)
    fact[i] = Mult(i, fact[i - 1]);

  scanf("%d%d%d", &n, &x, &y);
  for(int i = 0;i < n;++i){
    scanf("%d%d", &col[i], &w[i]);
    glob.pb(i);
    by_col[col[i]].pb(i);
  }

  sort(all(glob), Compare);
  for(int i = 1;i <= n;++i)
    sort(all(by_col[i]), Compare);

  for(int i = 1;i <= n;++i)
    for(int j = 1;j < sz(by_col[i]);++j)
      if(w[by_col[i][0]] + w[by_col[i][j]] <= x)
        Merge(by_col[i][0], by_col[i][j]);

  int a = glob[0], b = -1;
  for(int e : glob)
    if(b == -1 && col[a] != col[e]){
      b = e;
      break;
    }
  if(b == -1) b = a;

  for(int e : glob){
    if(col[a] != col[e] && w[a] + w[e] <= y) Merge(a, e);
    if(col[b] != col[e] && w[b] + w[e] <= y) Merge(b, e);
  }

  map<int, map<int, int>> grp;
  for(int i = 0;i < n;++i)
    ++grp[GetPar(i)][col[i]];

  int ans = 1;
  for(const auto& e : grp){
    vi use;
    for(const auto& r : e.se) use.pb(r.se);
    ans = Mult(ans, Shuffle(use));
  }

  printf("%d\n", ans);

  return 0;
}


Measured memory_bytes: 39668
import java.math.BigInteger;
import java.util.Scanner;
public class Main
{
	public static void main(String[] args) 
	{
		Scanner in=new Scanner(System.in);
		for(;;)
		{
			double n=in.nextDouble();
			if(n<0)
				return;
			int bs4=(int) (n*16);
			if(bs4/16.0!=n||bs4>=4096)
				System.out.println("NA");
			else 
			{
				BigInteger b=new BigInteger(bs4+"");
				String st=b.toString(2);
				while(st.length()<12)
					st="0"+st;
				StringBuilder sb=new StringBuilder();
				sb.append(st);
				sb.insert(8,".");
				System.out.println(sb);
			}
		}
	}

}

Measured memory_bytes: 13000
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define REP(i,a,b) for (int i = a; i < (b); ++i)
#define all(x) (x).begin(),(x).end()
const int INF = 1000000007;
typedef long long ll;
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll lcm(ll a, ll b) { return a * b / (gcd(a,b)); }
int main(){
  ios::sync_with_stdio(false);cin.tie(nullptr);
  int n;
  cin >> n;
  vector<int>a(n);
  vector<int>b(n);
  vector<int>c(n);
  rep(i,n)cin >> a[i];
  rep(i,n)cin >> b[i];
  ll A = 0;
  rep(i,n)A += a[i];
  ll B_sum = 0;
  rep(i,n)B_sum += b[i];
  int countt = 0;
  rep(i,n){
    if(a[i] >= b[i])countt++;
  }
  if(countt == n){
    cout << 0 << endl;
    return 0;
  }
  if(A < B_sum){
    printf("-1\n");
    return 0;
  }
  ll ans = 0;
  vector<ll>d;
  rep(i,n){
    c[i] = b[i];
    A -= c[i];
    if(c[i] < a[i])d.push_back(a[i] - c[i]);
    if(c[i] != a[i])ans++;
  }
  sort(d.begin(),d.end());
  ll tmp = 0;
  rep(i,n){
    if(A >= d[i]){
      A -= d[i];
      tmp++;
    }
    else{
      break;
    }
  }
  if(ans - tmp == 0 && A > 0){
    cout << 1 << endl;
  }
  else{
    cout << ans - tmp << endl;
  }
  return 0;
}

Measured memory_bytes: 2044
#include <cstdio>
#include <cstdint>
#include <vector>
#include <algorithm>
#include <utility>
#include <set>
#include <string>
#include <queue>
#include <numeric>
#include <tuple>

constexpr intmax_t  operator ""_jd(unsigned long long n) { return n; }
constexpr uintmax_t operator ""_ju(unsigned long long n) { return n; }
constexpr size_t    operator ""_zu(unsigned long long n) { return n; }
// constexpr ptrdiff_t operator ""_td(unsigned long long n) { return n; }

int main() {
  size_t n;
  scanf("%zu", &n);

  std::vector<intmax_t> a(n);
  for (auto& ai: a) scanf("%jd", &ai);

  intmax_t sum = std::accumulate(a.begin(), a.end(), 0_jd);

  intmax_t res = sum;
  intmax_t acc = 0;
  for (size_t i = 0; i < n; ++i) {
    acc += a[i];
    intmax_t min, max;
    std::tie(min, max) = std::minmax(acc, sum-acc);

    intmax_t cur = max-min;
    res = std::min(res, cur);
  }
  printf("%jd\n", res);
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define ll long long
#define rep(i, n) for(int i=0; i<n; i++)
#define REP(i, n) for(int i=0; i<=n; i++)
#define repr(i, n) for(int i=n; i>0; i--)
#define REPR(i, n) for(int i=n; i>=0; i--)
const ll INF = 1e18;
const int INT_INF = 1e9;
const ll MOD = 1e9+7;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using namespace std;

string s;

int main() {
    cin >> s;
    if (s[0]==s[1] || s[1]==s[2] || s[2]==s[3]) {
        cout << "Bad" << endl;
    } else {
        cout << "Good" << endl;
    }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<int,int>;
#define enld '\n'
#define rep(i,n) for(int i=0; i<(n); i++)
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("Ofast")
constexpr ll INF = 1e18;
constexpr int inf = 1e9;
constexpr ll mod = 1000000007;
constexpr ll mod2 = 998244353;
const double PI = 3.1415926535897932384626433832795028841971;
const int dx[6] = {1, 0, -1, 0,1,1};
const int dy[6] = {0, 1, 0, -1,1,-1};
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
// ---------------------------------------------------------------------------

int N;
vector<vector<int>> G;
vector<int> dp;

void dfs(int v){
    int res = 0;
    vector<int> suzu;
    for(int nv: G[v]){
        dfs(nv);
        suzu.emplace_back(dp[nv]);        
    }
    sort(suzu.rbegin(),suzu.rend());
    for(int i=0; i<suzu.size(); i++){
        chmax(res,suzu[i]+i+1);
    }
    dp[v] = res;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> N;
    G = vector<vector<int>>(N);
    dp = vector<int>(N,0);
    for(int i=1; i<N; i++){
        int p;
        cin >> p;
        p--;
        G[p].emplace_back(i);
    }
    dfs(0);
    cout << dp[0] << "\n";
    return 0;
}

Measured memory_bytes: 17024
def saidai_kouyakusu(a, b):
    a_ = max(a, b)
    b_ = min(a, b)
    q = a_ % b_
    if q == 0:
        return b_
    else:
        return saidai_kouyakusu(b_, q)
      
a, b = input().split()
a = int(a)
b = int(b)
print(a * b // saidai_kouyakusu(a, b))

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

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

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

    double A,B,H,M; cin >> A >> B >> H >> M;
    double ans;

    double ang = H*30+M*30/60-M*6;

    //cout << ang << endl;

    ang = min(ang,360-ang);

    ang = ang/180.0*acos(-1);

    //cout << ang << " " << cos(ang) << endl;

    ans  = sqrt(A*A+B*B-2.0*A*B*cos(ang));

    printf("%.20f\n",ans);

    return 0;

}

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

using namespace std;

#ifdef WIN32
	#define I64 "%I64d"
#else
	#define I64 "%lld"
#endif

typedef long long ll;

#define f first
#define s second
#define mp make_pair
#define pb push_back
#define all(s) s.begin(), s.end()
#define sz(s) (int(s.size()))
#define fname "a"


int main()
{
	#ifdef LOCAL
	freopen(fname".in", "r", stdin);
	freopen(fname".out", "w", stdout);
	#endif

	int a, b;
	scanf("%d%d", &a, &b);
	if (a == 1) a += 13;
	if (b == 1) b += 13;
	puts(a > b ? "Alice" : a < b ? "Bob" :  "Draw");

	return 0;
}


Measured memory_bytes: 384
import java.util.*;

class Main{
	public static void main(String[] $){
		Scanner s=new Scanner(System.in);
		
		int h=s.nextInt(),w=s.nextInt();
		char[][]f=new char[h][w];
		for(int i=0;i<h;++i)
			f[i]=s.next().toCharArray();
		
		UF uf=new UF(h*w);
		
		long[]white=new long[h*w];
		long[]black=new long[h*w];
		
		for(int i=0;i<h;++i) {
			for(int j=0;j<w;++j) {
				for(int d=0;d<4;++d){
					int y=i+dy[d];
					int x=j+dx[d];
					if(0<=y&&y<h&&0<=x&&x<w&&f[i][j]!=f[y][x])
						uf.connect(i*w+j,y*w+x);
				}
			}
		}
		
		for(int i=0;i<h;++i) {
			for(int j=0;j<w;++j) {
				(f[i][j]=='.'?white:black)[uf.root(i*w+j)]++;
			}
		}
		
		long r=0;
		for(int i=0;i<h*w;++i) {
			if(uf.root(i)==i) {
				r+=white[i]*black[i];
			}
		}
		System.out.println(r);
	}
	static int[] dx= {0,1,0,-1};
	static int[] dy= {1,0,-1,0};
}


class UF{
	public int[] uni;
	public UF(int size){
		Arrays.fill(uni=new int[size],-1);
	}
	public int root(int t){
		return uni[t]<0?t:(uni[t]=root(uni[t]));
	}
	public boolean connect(int p,int c){
		p=root(p);
		c=root(c);
		if(p==c)
			return false;
		if(uni[p]>uni[c]){
			int buf=c;
			c=p;
			p=buf;
		}
		uni[p]+=uni[c];
		uni[c]=p;
		return true;
	}
	public boolean isConnected(int a,int b){
		return root(a)==root(b);
	}
	public int groupSize(int t){
		return -uni[root(t)];
	}
}


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

int main() {
	int n;
	cin >> n;
	int l = n / 100;
	int r = n % 100;
	if (r == 0) {
		if (l == 0)cout << "NA" << endl;
		else if (l <= 12) cout << "MMYY" << endl;
		else cout << "NA" << endl;
	}
	else if (r <= 12) {
		if (l == 0)cout << "YYMM" << endl;
		else if (l <= 12) cout << "AMBIGUOUS" << endl;
		else cout << "YYMM" << endl;
	}
	else {
		if (l == 0)cout << "NA" << endl;
		else if (l <= 12)cout << "MMYY" << endl;
		else cout << "NA" << endl;
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define MAXN 110
#define pii  pair<int, int>
#define pll  pair<long long, long long>
#define ss second
#define ff first
 
using ll = long long;
using namespace std;
const int mod = 1e9 + 7;
int adj[MAXN][MAXN];

void solve(int n){
    for (int k=1; k<=n; k++){
        for (int i=1; i<=n; i++){
            for (int j=1; j<=n; j++){
                adj[i][j] = min(adj[i][k] + adj[k][j], adj[i][j]);
            }
        }
    }
}

void init(int n){
    for (int i=0; i<=n; i++){
        for (int j=0; j<=n; j++){
            adj[i][j] = mod;
        }
    }
}

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

    init(n);
    vector<pair<int, pii>> edge(m);

    for (int i=0; i<m; i++){
        cin >> edge[i].ss.ff >> edge[i].ss.ss >> edge[i].ff;
        adj[edge[i].ss.ff][edge[i].ss.ss] = adj[edge[i].ss.ss][edge[i].ss.ff] = edge[i].ff;
    }

    solve(n);

    int ans = 0;

    for (int i=0; i<m; i++){
        int x = edge[i].ss.ff, y = edge[i].ss.ss, c = edge[i].ff;
        if (adj[x][y] != c) ans++;
    }

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

Measured memory_bytes: 256
import bisect
n = int(input())

li = list(map(int, input().split()))
li.sort()

count = 0

for i in range(n - 2):
  for j in range(i + 1, n - 1):
    bi = bisect.bisect_left(li, li[i] + li[j])
    count += bi - j - 1
print(count)

Measured memory_bytes: 3188
using System;
using System.Collections.Generic;
class Program
{
  static void Main()
  {
    int N = int.Parse(Console.ReadLine());
    string[] v_ = Console.ReadLine().Split(' ');
    var v = new List<int>();
    for (int i = 0; i < N; i++){
      v.Add(int.Parse(v_[i]));
    }
    v.Sort();
    
    double vsum = 0;
    for (int i = 0; i < N; i++){
      if (i == 0){
        vsum += v[0] / Math.Pow(2, N - 1);
      }
      else
      {
        vsum += v[i] / Math.Pow(2, N - i);
      }
    }
    
    Console.WriteLine(vsum);
  }
}

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

using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;
using LL = long long;
using VL = vector<LL>;
using VVL = vector<VL>;
using PLL = pair<LL, LL>;
using VS = vector<string>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))

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

#define FF first
#define SS second

#define DUMP(x) cout<<#x<<":"<<(x)<<endl
template<class S, class T>
istream& operator>>(istream& is, pair<S,T>& p){
  return is >> p.FF >> p.SS;
}
template<class T>
istream& operator>>(istream& is, vector<T>& xs){
  for(auto& x: xs)
	is >> x;
  return is;
}
template<class S, class T>
ostream& operator<<(ostream& os, const pair<S,T>& p){
  return os << p.FF << " " << p.SS;
}
template<class T>
ostream& operator<<(ostream& os, const vector<T>& xs){
  for(unsigned int i=0;i<xs.size();++i)
	os << (i?" ":"") << xs[i];
  return os;
}
template<class T>
void maxi(T& x, T y){
  if(x < y) x = y;
}
template<class T>
void mini(T& x, T y){
  if(x > y) x = y;
}


const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL MOD = 1e9+7;

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

  string a, b;
  cin >> a >> b;
  string s = a + b;
  LL x = stoll(s);

  for(LL i=1;i*i<=x;++i)
	if(i*i == x){
	  cout << "Yes" << endl;
	  return 0;
	}
  cout << "No" << endl;

  return 0;
}


Measured memory_bytes: 256
n=gets.to_i
hs=gets.split.map(&:to_i)
ans=0
cur=0
(n-1).times do |i|
  if hs[i]>=hs[i+1]
    cur+=1
  else
    ans=[ans,cur].max
    cur=0
  end
end
puts [ans,cur].max


Measured memory_bytes: 11012
process.stdin.resume();
process.stdin.setEncoding('utf8');
process.stdin.on('data', function (chunk) {
    var line = chunk.toString().split(' ');
    var a = Number(line[0]);
    var b = Number(line[1]);
    if (a > b){
        console.log("a > b");
    }else if(a < b){
        console.log("a < b");
    }else{
        console.log("a == b");
    }
});

Measured memory_bytes: 15548
import java.util.Scanner;

public class Main{
	public static boolean solve(double[][] x){
		if( x[1][0]-x[0][0] == 0 && x[3][0]-x[2][0] == 0 ){
			return true;
		} else if( x[1][0]-x[0][0] == 0 || x[3][0]-x[2][0] == 0 ){
			return false;
		}
		double a = (x[1][1]-x[0][1])/(x[1][0]-x[0][0]);
		double b = (x[3][1]-x[2][1])/(x[3][0]-x[2][0]);
		return a == b;
	}
	
	public static void main(String[] args){
		Scanner stdIn = new Scanner(System.in);
		int n = stdIn.nextInt();
		String[] result = new String[n];
		for(int k = 0; k < n; k++){
			double[][] a = new double[4][2];
			for(int i = 0; i < 4; i++){
				for(int j = 0; j < 2; j++){
					a[i][j] = stdIn.nextDouble();
				}
			}
			if( solve(a) ){
				result[k] = "YES";
			} else {
				result[k] = "NO";
			}
		}
		
		for(int i = 0; i < n; i++){
			System.out.println(result[i]);
		}
	}
}

Measured memory_bytes: 12000
//I am so vegetable
//#define err
#pragma GCC optimize(2)
#include <bits/stdc++.h>
#define FIO ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define PB push_back
#define IN insert
#define ER erase
#define CT count
#define EP empty
#define _for(i,a,b) for(int i = (a);i<(b);++i)
#define _rfor(i,a,b) for(int i = (a);i>(b);--i)
#define _sfor(p,st) for(auto &p:st)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const int INF = 0x3f3f3f3f;
const int MOD = 1e9+7;
const double eps = 1e-6;
const double pi = acos(-1.0);
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
ll qpow(ll x, ll y) { ll ans = 1; for (; y > 0; y >>= 1) { if (y & 1)ans *= x; x *= x; }return ans; }
ll qpow(ll x, ll y, int MOD) { ll ans = 1; for (; y > 0; y >>= 1) { if (y & 1)ans = ans*x%MOD; x = x*x%MOD; }return ans; }
void exgcd(ll a,ll b,ll &x,ll &y){
    if(!b){x=1;y=0;return;}
    exgcd(b,a%b,x,y);
    ll X=x;
    x=y; y=X-a/b*y;
}
ll inv(ll x, int mod = MOD) { return qpow(x, mod - 2) % mod; }
ll m_m(ll a){ return (a%MOD+MOD)%MOD; }

int main() {
	//ofstream cout("E:\\acm dream\\out.txt",ios::out);
	FIO;
    #ifdef err
	double be = clock();
    #endif
    set<int>app;
    int x,n;cin>>x>>n;
    _for(i,0,n){
        int x;cin>>x;
        app.IN(x);
    }
    int r = x,l = x;
    while(app.CT(l))--l;
    while(app.CT(r))++r;
    if(r==x)cout<<x;
    else if(r-x>=x-l)cout<<l;
    else cout<<r;
    #ifdef err
	double en = clock();
    cout<<"time: "<<fixed<<setprecision(8)<<en-be;
    #endif
	return 0;
}

Measured memory_bytes: 3656
import java.util.*;

class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int a=sc.nextInt(), b=sc.nextInt();
        sc.close();
        if(a%3==0 || b%3==0 || (a+b)%3==0) System.out.println("Possible");
        else System.out.println("Impossible");
    }
}


Measured memory_bytes: 21844
#include <bits/stdc++.h>
#define endl "\n"
using namespace std;
long long a[21],b[21],c,n,z,x,s;
int main()
{
    ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
    /*A
    cin>>a>>b>>c;
    long long s=0;
    for(int i=a;i<=c;i+=a)s+=b;
    cout<<s<<endl;*/
    //C
    cin>>n;
    for(int i=1; i<=n; i++)cin>>a[i];
    for(int i=1; i<=n; i++)cin>>b[i];
    for(int i=1;i<=n;i++){
        x=a[i]-b[i];
        if(x>0)s+=x;
    }
    cout<<s<<endl;
//    */
    /*B


    */
}


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

int main() {
  int A,B;
  cin >> A >> B;
  
  int a = 2*A - 1;//A 2 times
  int b = 2*B - 1;//B 2 times
  int c = A + B;//A and B
  
  int coin = max(a,max(b,c));
  cout << coin <<endl;
}

Measured memory_bytes: 256
import sys


inint = lambda: int(sys.stdin.readline())
inintm = lambda: map(int, sys.stdin.readline().split())
inintl = lambda: list(inintm())
instrm = lambda: map(str, sys.stdin.readline().split())
instrl = lambda: list(instrm())

o = input()
e = input()

ans = ""

for i in range(len(e)):
    ans += o[i]
    ans += e[i]

if len(o) - len(e) == 1:
    ans += o[-1]

print(ans)

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

int N;
int ans = 0;

void dfs ( string S, int bit )
{
	if ( S != "" && stol(S) > N ) return;
	if ( bit == 7 ) ans++;
	dfs( S + '3', bit | 1 );
	dfs( S + '5', bit | 2 );
	dfs( S + '7', bit | 4 );
}

int main()
{
	cin >> N;

	dfs("", 0);

	cout << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const long long INF = 1e7 + 1;
const long long MOD = 1000000007;
const long double PI = 3.1415926;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()
typedef long long int ll;
typedef vector <ll> vi;
typedef vector < pair<ll, ll > > vp;
typedef vector <vector<ll>> vv;
typedef vector <string> vs;
typedef vector <char> vc;


ll n, m, k, ans = 0, sum = 0, cnt = 0;
string s;
//char c;

#define Endl endl


/*--------------------template--------------------*/


int main() {
    cin >> s;
    ll a[4] = { 0 };
    REP(i, 4) {
        a[i] = s[i] - '0';
    }

    ans = a[0] + a[1] + a[2] + a[3];
    if (ans == 7) {
        cout << a[0] << '+' << a[1] << '+' << a[2] << '+' << a[3] << "=7" << endl;
        return 0;
    }
    ans = a[0] + a[1] + a[2] - a[3];
    if (ans == 7) {
        cout << a[0] << '+' << a[1] << '+' << a[2] << '-' << a[3] << "=7" << endl;
        return 0;
    }
    ans = a[0] + a[1] - a[2] + a[3];
    if (ans == 7) {
        cout << a[0] << '+' << a[1] << '-' << a[2] << '+' << a[3] << "=7" << endl;
        return 0;
    }
    ans = a[0] + a[1] - a[2] - a[3];
    if (ans == 7) {
        cout << a[0] << '+' << a[1] << '-' << a[2] << '-' << a[3] << "=7" << endl;
        return 0;
    }
    ans = a[0] - a[1] + a[2] + a[3];
    if (ans == 7) {
        cout << a[0] << '-' << a[1] << '+' << a[2] << '+' << a[3] << "=7" << endl;
        return 0;
    }
    ans = a[0] - a[1] + a[2] - a[3];
    if (ans == 7) {
        cout << a[0] << '-' << a[1] << '+' << a[2] << '-' << a[3] << "=7" << endl;
        return 0;
    }
    ans = a[0] - a[1] - a[2] + a[3];
    if (ans == 7) {
        cout << a[0] << '-' << a[1] << '-' << a[2] << '+' << a[3] << "=7" << endl;
        return 0;
    }
    ans = a[0] - a[1] - a[2] - a[3];
    if (ans == 7) {
        cout << a[0] << '-' << a[1] << '-' << a[2] << '-' << a[3] << "=7" << endl;
        return 0;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i < b; i++)
#define Rep(i, a, b) for(int i = a; i <= b; i++)
#define _GLIBCXX_DEBUG
#define Vl vector<ll>
#define Vs vector<string>
#define Vp vector<pair<ll, ll>>
#define ll long long
#define ALL(v) (v).begin(),(v).end()
using namespace std;  
const double pi = acos(-1.0);
const ll MOD = 1e9 + 7;
const ll INF = 1LL << 60;



int main() {
  ll n; cin >> n;
  Vl a(n+1), b(n);
  rep(i, 0, n+1) cin >> a[i];
  rep(i, 0, n) cin >> b[i];

  ll ans = 0;
  rep(i, 0, n){
    if(a[i] >= b[i]){
      ans += b[i];
      b[i] = 0;
    }else{
      ans += a[i];
      b[i] -= a[i];
    }

    if(a[i+1] >= b[i]){
      ans += b[i];
      a[i+1] -= b[i];
    }else{
      ans += a[i+1];
      a[i+1] = 0;
    }
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 1792