akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <ext/rope>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#define int long long
#define pb push_back
#define x first
#define y second
#define mk(a,b) make_pair(a,b)
#define rr return 0
#define sqr(a) ((a)*(a))
#define all(a) (a).begin(), (a).end()
#define sz(a) (int)(a).size()

using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds;

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

template<class value, class cmp = less<value> >
using ordered_set = tree<value, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
template<class value, class cmp = less_equal<value> >
using ordered_multiset = tree<value, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
template<class key, class value, class cmp = less<key> >
using ordered_map = tree<key, value, cmp, rb_tree_tag, tree_order_statistics_node_update>;

/// find_by_order()
/// order_of_key()
mt19937 rng(chrono::high_resolution_clock::now().time_since_epoch().count());
inline int randll(int l = INT_MIN, int r = INT_MAX) {
    return uniform_int_distribution<int>(l, r)(rng);
}
const int INF = 1e9, MOD = 1e9 + 7; /// think
const ll LINF = 1e18;


const int dx[] = {0, 0, 1, -1}, dy[] = {1, -1, 0, 0};
inline bool inside (int x, int y, int n, int m) {
    return 0 <= x && 0 <= y && x < n && y < m;
}

template<class T> bool umin (T &a, T b) {return a > b ? (a = b, true) : false; }
template<class T> bool umax (T &a, T b) {return a < b ? (a = b, true) : false; }

main()
{
    ios::sync_with_stdio(0);
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    ll n;
    cin >> n;
    ll ans = LINF;
    for (ll i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            umin(ans, i + n / i - 2);
        }
    }
    cout << ans << '\n';
}


Measured memory_bytes: 3644
#!/usr/bin/python

import sys

def main(argv):
    for line in sys.stdin:
        k, s = line.rstrip("\n").split(" ")
        k = int(k)
        s = int(s)
        counter = 0
        for x in xrange(0, k + 1):
            for y in xrange(x, k + 1):
                if x + y <= s:
                    z = s - x - y
                    if z >= y and z <= k:
                        if (x+y+z) == s:
                            if x == y and y == z:
                                counter += 1
                            elif x == y or y == z or x == z:
                                counter += 3
                            else: 
                                counter += 6
        print counter

if __name__ == "__main__":
    main(sys.argv)

Measured memory_bytes: 2692
#include<bits/stdc++.h>
#define FOR(i,a,b) for(int i = (a);i<=(b);i++)
#define ROF(i,a,b) for(int i = (a);i>=(b);i--)
#define MST(a,x) memset(a,x,sizeof(a))
#define ll long long
#define PB push_back
#define PH push
#define MP make_pair
#define Fint first
#define SD second
#define N 405
#define M 51
#define INF 1000000007
#define MOD 1000000007
#define MOD2 1000000009
#define eps 1e-14
using namespace std;
inline int Max(int a,int b)
{
    return (((b-a)>>(32-1))&(a^b))^b;
}
inline int Min(int a,int b)
{
    return (((b-a)>>(32-1))&(a^b))^a;
}

int a[N],b[N],c[N];
int dp[2][N][N];
int main()
{
    int n,ma,mb;
    while(cin>>n>>ma>>mb)
    {
        FOR(i,1,n)
        {
            cin>>a[i]>>b[i]>>c[i];
        }
        FOR(i,0,N-1)
        {
            FOR(j,0,N-1)
            {
                dp[0][i][j] = INF;
            }
        }
        int ans = INF;
        dp[0][0][0] = 0;
        FOR(i,1,n)
        {
            int f = (i&1);
            FOR(j,0,N-1)
            {
                FOR(k,0,N-1)
                {
                    dp[f][j][k] = INF;
                }
            }
            FOR(j,0,N-1)
            {
                FOR(k,0,N-1)
                {
                    dp[f][j][k] = dp[1-f][j][k];
                    if(j>=a[i]&&k>=b[i])dp[f][j][k] = min(dp[f][j][k],dp[1-f][j-a[i]][k-b[i]]+c[i]);
                    if(j*mb == k*ma&&j+k>0)
                    {
                        ans = min(ans,dp[f][j][k]);
                    }
                }
            }
        }
        if(ans>=INF)cout<<-1<<endl;
        else cout<<ans<<endl;
    }
    return 0;
}


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

#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define rept(i,n) for(int (i)=0;(i)<=(int)(n);(i)++)
#define reps(i,s,n) for(int (i)=(s);(i)<(int)(n);(i)++)
#define repst(i,s,n) for(int (i)=(s);(i)<=(int)(n);(i)++)
#define repr(i,n) for(int (i)=(n);(i)>=0;(i)--)
#define each(itr,v) for(auto (itr):(v))
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define mp(x,y) make_pair((x),(y))
#define fi first
#define se second
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define ln "\n"
#define show(x) cout << #x << " = " << x ln
#define dbg(x) cout<<#x"="<<x ln

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

const int inf = (int)1e9;
const ll linf = (ll)1e18;
const int mod = (int)(1e9+7);
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};

struct oreno_initializer {
	oreno_initializer() {
		cin.tie(0);
		ios::sync_with_stdio(0);
	}
} oreno_initializer;

// ━━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…
// .｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋.｡.:( ^ω^)・ﾟ＋
// ・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・‥…━━━☆・

string s;

int main() {
	cin >> s;
	
	vi p;
	rep(i,s.length()) {
		if (s[i]=='1') p.pb(1);
		else if (s[i]=='0') p.pb(0);
		else if (!p.empty()) p.pop_back();
	}
	rep(i,p.size()) cout << p[i];
	cout << ln;
}

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

 int main(){
    ios::sync_with_stdio(false);
  cin.tie(0);
  long double d,t,s;
  cin>>d>>t>>s;
  long double check = d/s;
  if(check<=t){cout<<"Yes";}
  else{
  	cout<<"No";
  }
     }
     
 

Measured memory_bytes: 3748
var toInt = x=>parseInt(x,10);
var toIntArr = arr=>arr.map(x=>toInt(x));
var abs = x=>x>0?x:-x;
function min(){var rest = arguments,val=rest[0];for(var i=1;i<rest.length;i++)if(rest[i]<val)val = rest[i];return val}
function max(){var rest = arguments,val=rest[0];for(var i=1;i<rest.length;i++)if(rest[i]>val)val = rest[i];return val}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));
 
function Main(input){
	var input = input.split('\n');
	//input = input.map(e => toIntArr(e.split(' ')));
	var s = input[0].split('').map(el=>el==='B'?1:0);
	var l = s.length;
	var ans = 0;
	var num = 0;
	for(var i = 0; i<l ;i++){
		if(s[l-i-1]){
			ans += i - num;
			num++;
		}
	}

	console.log(ans);
}

Measured memory_bytes: 25032
#include <bits/stdc++.h>
 
#define ALL(l)  (l).begin(),(l).end()
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
using namespace std;
typedef long long ll;
//const ll mod =  1000000007;
//const ll maxn = 1000000000;

//---------------------------------------------------------------------------------------------------
using vi = vector<int>; // intの1次元の型に vi という別名をつける
using vll = vector<ll>; // intの1次元の型に vi という別名をつける
using vvll = vector<vll>; // intの2次元の型に vvi という別名をつける
using vs = vector<string>; // stringの1次元の型に vs という別名をつける
using pll = pair<ll, ll>; // これ以降 pii という型名はpair<ll, ll> と同じ意味で使える
//---------------------------------------------------------------------------------------------------

int main(){
 ll k;
 cin>>k;
 vll a(1000000);
 priority_queue< ll, std::vector<ll>, std::greater<ll> > q;
 rep(i,9){
    q.push(i+1);
    a.at(i+1)=i+1;
    //ans++;
 }
 int i=10;
 while( i<100000){
     ll j=q.top();
     //cout<<j<<endl;
     q.pop();
     ll j_1=j%10;
     
     if(j_1==0){
         q.push(j*10);
         a.at(i)=j*10;
         i++;
         q.push(j*10+1);
         a.at(i)=j*10+1;
         i++;
     }
     else if(j_1==9){
         q.push(j*10+8);
         a.at(i)=j*10+8;
         i++;
         q.push(j*10+9);
         a.at(i)=j*10+9;
         i++;
     }else{
         q.push(j*10+j_1-1);
         a.at(i)=j*10+j_1-1;
         i++;
         q.push(j*10+j_1);
         a.at(i)=j*10+j_1;
         i++;
          q.push(j*10+j_1+1);
         a.at(i)=j*10+j_1+1;
         i++;
     }
 }
 cout<<a.at(k)<<endl;
}
   



Measured memory_bytes: 9208
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		int a = sc.nextInt();
		// スペース区切りの整数の入力
		long b = sc.nextLong();
		long c = sc.nextLong();
		// 文字列の入力
		if(b * c < a){
            System.out.println("No");
        }else{
            System.out.println("Yes");
        }
		
		
		
	}
}

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

const int Nmax=200010;

int main() {
	int N;
	int a[100];
	cin >> N;
	for(int i=0;i < N;i++) cin >> a[i];
	sort(a, a+N);
	int Alice=0,Bob=0,cnt=0;
	for(int i=N-1;i >= 0;i--){
		if(cnt%2==0) Alice+=a[i];
		else Bob+=a[i];
     	cnt++;
	}
	cout << Alice - Bob << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;

int main() {
  cin.tie(nullptr); ios::sync_with_stdio(false);
  int n; cin >> n;
  set<string> se;
  while (n--) {
    string s; cin >> s;
    se.insert(s);
  }
  int m; cin >> m;
  bool b = true;
  while (m--) {
    string s; cin >> s;
    if (se.count(s)) {
      cout << (b ? "Opened" : "Closed") << " by " << s << '\n';
      b ^= true;
    } else {
      cout << "Unknown " << s << '\n';
    }
  }
}


Measured memory_bytes: 3252
#include<bits/stdc++.h>
using namespace std;
int main(){
  int N,M;
  cin>>N>>M;
  vector<long long>A(N);
  for(int i=0;i<N;i++){
    cin>>A.at(i);
  }
  long long sum=0;
  for(int i=0;i<N;i++){
    sum=sum+A.at(i);
  }
  int count=0;
  for(int i=0;i<N;i++){
    if(4*M*A.at(i)>=sum){
      count=count+1;
    }
    else{
    }
  }
  if(count>=M){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;

const int MOD = 1e9 + 7;
int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int now = 0;
  for (int i = 0; i < n; i++) {
    if (a[i] == now + 1) {
      now++;
    }
  }
  if (now == 0) {
    cout << -1 << endl;
  } else {
    cout << n - now << endl;
  }
  return 0;
}

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

using ll = long long;
using ld = long double;
using vi = vector<int>;
using vll = vector<ll>;
using P = pair<int, int>;

constexpr int INF = 1e9;
constexpr ll INFLL = 1e18;
constexpr int MOD = 1e9 + 7;
const ld PI = acosl(-1);

#define rep(i,n) for(int i=0; i<(n); ++i)
#define all(n) n.begin(),n.end()

void dfs(vector<deque<int>> a, int n){
    if(a[n].size() == 0){
        cout << (char)(n + 'A') << endl;
        return;
    }
    int t = a[n].front();
    a[n].pop_front();
    dfs(a, t);
}

int main(){
    ios::sync_with_stdio(false); cin.tie(nullptr);
    //cout << fixed << setprecision(6);
    vector<deque<int>> a(3);
    rep(i, 3){
        string s; cin >> s;
        rep(j, s.length())
            a[i].push_back((int)(s[j] - 'a'));
    }

    dfs(a, 0);
    return 0;
}

Measured memory_bytes: 896
// Problem : D - Replacing
// Contest : AtCoder - AtCoder Beginner Contest 171
// URL : https://atcoder.jp/contests/abc171/tasks/abc171_d
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

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

typedef long long   ll;
const ll mod = 1e9 + 7;

#define speedup_IO      ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define forn(i,a,n)     for(ll i = (a); i < (n); i++)
#define ford(i,n,a)     for(ll i = (n); i >= (a); i--)
#define pb              push_back
#define lb              lower_bound   // first element >= val(itr) 
#define ub              upper_bound   // first element >  val(itr)
#define vll             vector<ll>
#define pll             pair<ll,ll>
#define all(a)          (a).begin(),(a).end()
#define reset(a,x)      memset(a,x,sizeof(a)) //x can be 0 or -1

ll mypow(ll base, ll exp) {ll res = 1; while (exp) {if (exp & 1) res = (res * base) % mod; exp >>= 1, base = (base * base) % mod;} return res;}
ll gcd(ll a, ll b)  { return b ? gcd(b, a % b) : a; }
ll mult(ll a, ll b) { if (a < 0) {a += mod;} if (b < 0) {b += mod;} return ((a % mod) * (b % mod)) % mod;   }
ll add(ll a, ll b)  { if (a < 0) {a += mod;} if (b < 0) {b += mod;} return (a % mod + b % mod) % mod;       }
ll sub(ll a, ll b)  { if (a < 0) {a += mod;} if (b < 0) {b += mod;} return (a % mod + mod - b % mod) % mod; }

#ifdef LOCAL_TEST
  #include"C:\\Users\\kaush\\OneDrive\\Desktop\\debug.h"
#endif

const ll inf = 1e18;
const int nax = 2e5 + 5;

void SolveTestCase()
{
  ll n,q;
  cin>>n;
  ll a[n];
  map<ll,ll>cnt;
  ll sum = 0;
  forn(i,0,n){
    cin>>a[i];
    cnt[a[i]]++;
    sum += a[i];
  }
  
  cin>>q;
  ll b,c;
  forn(i,0,q){
    cin>>b>>c;
    
    sum += (c-b)*cnt[b];
    cout<<sum<<endl;

    cnt[c] += cnt[b];
    cnt[b] = 0;
  }
}

int main()
{
  speedup_IO;

  int t = 1;
  //cin >> t;
  forn(i, 0, t)
  {
    SolveTestCase();
  }

  return 0;
}


Measured memory_bytes: 10320
#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 ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
// order_of_key (val): returns the no. of values less than val
// find_by_order (k): returns the kth largest element.(0-based)

#define ll long long int
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define pi pair<ll,ll>
#define md (ll)(1e9+7)
#define all(X) X.begin(),X.end()

// for pair comparison function(ascending order) use return (i1.ff < i2.ff);

/* string operations :
   str.substr (x,y) : returns a substring str[x],str[x+1],...str[x+y-1]
   str.substr (x) : returns a substring str[x],... end of string
   str.find(qtr) : returns the first occurenece of qtr in str */

const int M=1e6+6;

ll pwr(ll a,ll n,ll m)
{
	ll p=1;
	while(n>0)
	{
		if(n%2==1)
			p=(p*a)%m;
		a=(a*a)%m;
		n=n/2;
	}
	return p;
}

ll vis[M],dp[M];
vector<ll> tope,adj[M],rdj[M];

void dfs(ll u)
{
	vis[u] = 1;
	for(auto v:adj[u])
	{
		if(vis[v] == 0)
			dfs(v);
	}
	tope.pb(u);
}

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

	ll n,m,i,u,v,mx = 0;

	cin >> n >> m;

	for(i=1;i<=m;++i)
	{
		cin >> u >> v;
		adj[u].pb(v);
		rdj[v].pb(u);
	}

	for(i=1;i<=n;++i)
	{
		if(vis[i] == 0)
			dfs(i);
	}

	reverse(all(tope));
	for(auto u:tope)
	{
		for(auto v:rdj[u])
		{
			dp[u] = max(dp[u],dp[v]+1);
			mx = max(mx,dp[u]);
		}
	}

	cout << mx << endl;
	return 0;
}


	


Measured memory_bytes: 62712
package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)
	nums := []uint{2, 1}
	for {
		if len(nums) >= n+1 {
			fmt.Println(nums[n])
			break
		} else {
			nums = append(nums, nums[len(nums)-1]+nums[len(nums)-2])
		}
	}
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P;
typedef vector<ll> VI;
typedef vector<VI> VVI;
const ll MOD = 1000000007;
const ll INF = 2147483647;
const ll LINF = 9223372036854775807;
#define REP(i, n) for (int i = 0; i < n; i++)
#define ALL(v) v.begin(), v.end()

int main() {
	double r; cin >> r;
	double pi=3.14159265358;
	cout << setprecision(10) << 2*r*pi << endl;
	return 0;
}


Measured memory_bytes: 3772
// #define STOPIT
#include<bits/stdc++.h>
#define rep(i,n,m) for(int i = (n); i <(m); i++)
#define rrep(i,n,m) for(int i = (n) - 1; i >=(m); i--)
using namespace std;
using ll = long long;

void debug_impl() { cerr << endl; }
template <typename Head, typename... Tail>
void debug_impl(Head head, Tail... tail) { cerr << " " << head; debug_impl(tail...); }
#ifndef STOPIT
    #define debug(...)\
    do {\
        cerr << boolalpha << "[" << #__VA_ARGS__ << "]:";\
        debug_impl(__VA_ARGS__);\
        cerr << std::noboolalpha;\
    } while (false)
#else
    #define debug(...) {}
#endif

template < typename Container, typename Value = typename Container::value_type, enable_if_t<!is_same< Container, string >::value, nullptr_t> = nullptr>
istream& operator>> (istream& is, Container& v)
  { for (auto & x : v) { is >> x; } return is; }

template < typename Container, typename Value = typename Container::value_type, enable_if_t<!is_same< Container, string >::value, nullptr_t> = nullptr >
ostream& operator<< (ostream& os, Container const& v) {
  os << "{";
  for (auto it = v.begin(); it != v.end(); it++)
    {os << (it != v.begin() ? "," : "") << *it;}
  return os << "}";
}
int main()
{
    ll H, W;
    cin >> H >> W;
    if (H==1 or W==1)
    {
        cout << 1 << endl;
    }
    else
    {
        ll ans = (H/2)*W+(H%2)*(W+1)/2;
        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
    static int m2;
    static int m3;
    static int m5;
    static int a1;
    static HashMap<Long, Long> map = new HashMap<>();
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < t; i++) {
		    long n = sc.nextLong();
		    m2 = sc.nextInt();
		    m3 = sc.nextInt();
		    m5 = sc.nextInt();
		    a1 = sc.nextInt();
		    map.clear();
		    map.put(0L, 0L);
		    map.put(1L, (long)a1);
		    sb.append(dfw(n)).append("\n");
		}
		System.out.print(sb);
	}
	
	static long dfw(long x) {
	    if (map.containsKey(x)) {
	        return map.get(x);
	    }
	    long min;
	    if (x <= Long.MAX_VALUE / a1) {
	        min = x * a1;
	    } else {
	        min = Long.MAX_VALUE;
	    }
	    if (x % 2 == 0) {
	        min = Math.min(min, dfw(x / 2) + m2);
	    } else {
	        min = Math.min(min, dfw((x + 1) / 2) + a1 + m2);
	        min = Math.min(min, dfw((x - 1) / 2) + a1 + m2);
	    }
	    if (x % 3 == 0) {
	        min = Math.min(min, dfw(x / 3) + m3);
	    } else {
	        long mod = x % 3;
	        if (x > 3) {
	            min = Math.min(min, dfw((x - mod) / 3) + a1 * mod + m3);
	        }
	        min = Math.min(min, dfw((x + (3 - mod)) / 3) + a1 * (3 - mod) + m3);
	    }
	    if (x % 5 == 0) {
	        min = Math.min(min, dfw(x / 5) + m5);
	    } else {
	        long mod = x % 5;
	        if (x > 5) {
	            min = Math.min(min, dfw((x - mod) / 5) + a1 * mod + m5);
	        }
	        min = Math.min(min, dfw((x + (5 - mod)) / 5) + a1 * (5 - mod) + m5);
	    }
	    map.put(x, min);
	    return min;
	}
}


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

using namespace std;

#define INF 1000000007
#define LINF (1LL << 60)

typedef long long i64;
typedef pair<i64,i64> P;

inline i64 mod(i64 a, i64 m) { return (a % m + m) % m; }

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



i64 a,b;
void solve(){
	cin >> a >> b;
	a--;
	i64 B = (b%4==0 || (b+1)%4==0), A = (a%4==0 || (a+1)%4==0);
	if(!(b&1)){
		for(int i = 1; (1LL<<i) <= b; i++){
			if(b>>i & 1){
				B += (1LL<<i);
			}
		}
	}
	if(!(a&1)){
		for(int i = 1; (1LL<<i) <= a; i++){
			if(a>>i & 1){
				A += (1LL<<i);
			}
		}
	}
	cout << (A^B) << endl;
}

int main(){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	int t = 1;
	//cin >> t;
	while(t--){
		solve();
	}
	
	return 0;
}


Measured memory_bytes: 256
//Nihal Mittal - nihal_47
//Strike First , Strike Hard , No Mercy !!

/**⠀⠀⠀⠀⠀⠀⣀⣤⣤⣄⣀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⣠⣾⣿⣿⣿⣿⣿⣿⣿⣿⣿⣦⣀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⣰⣿⣿⣿⣿⠿⠿⣿⣿⣿⣿⣿⣿⣿⣧⢀⠀⠀⠀⠀
⠀⠀⠀⣿⣿⣿⠋⠀⠀⠀⠀⠀⠙⠀⠙⣿⣿⣿⣷⢳⢀⠀⠀⠀
⠀⠀⣠⣿⣿⣿⢸⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⣿⣿⣿⣿⣿⢀
⠀⠀⣸⣿⣿⣿⠸⠀⠀⠀⠒⠒⠒⠐⠀⠀⢿⣿⣿⣿⣿⣿⠀⠀
⠀⣴⣿⣿⣿⡿⠀⠒⣋⣙⡒⢰⠀⠤⣖⠒⢾⣿⣿⣿⣿⣧⠀⠀
⢺⣿⣿⣿⣿⢀⠀⠀⠉⠉⠉⠸⠀⡇⠉⠉⠀⢿⣿⣿⣿⣄⠀⠀
⠀⠙⣿⣿⣧⢻⠀⠀⠀⠀⠀⠠⠀⠰⠀⠀⠀⣸⠸⣿⣿⠿⠰⠀
⠀⠀⠀⠹⣿⣿⣿⣷⠀⡠⠙⣲⣔⣅⢡⣰⣷⣿⣿⣿⣧⠀⠀⠀
⠀⠀⠀⣼⣿⣿⣿⣿⠀⡿⠭⠭⠭⠭⢿⠀⣿⢻⣿⣿⠃⠀⠀⠀
⠀⠀⠀⠙⠛⣿⢻⠹⣿⠐⠙⠛⠟⠉⢀⣴⡟⢿⣿⡏⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⡟⠀⠀⠻⣦⣤⣶⠾⠋⠀⠀⠁⡦⢄⢀⠀⠀⠀
⠀⠀⠀⠀⡠⠁⡇⠑⢄⠀⠀⠀⠀⠀⠀⠔⠀⠀⠁⠀⠀⠀⠉⠁
⠀⠔⠊⠁⠀⠀⣇⠀⠀⠀⠑⡤⠤⢎⠁⠀⠀⡘⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⢢⠠⠀⡠⢆⠀⠀⡠⠙⢄⠀⡸⠀
**/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define ld long double
#define mk make_pair
#define pb push_back
#define in insert
#define se second
#define fi first
#define mod 1000000007
#define watch(x) cout << (#x) << " is " << (x) << "\n"
#define all(v) (v).begin(),(v).end()
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(0);
#define printclock cerr<<"Time : "<<1000*(ld)clock()/(ld)CLOCKS_PER_SEC<<"ms\n";
#define pii pair<ll,ll>
#define vi(x) vector<x>
#define maxn 100005
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update> 
using namespace std;
using namespace __gnu_pbds;

signed main()
{
    fast;

    ll a,b,c,d;
    cin>>a>>b>>c>>d;
    ll ans = max({a*c,a*d,b*c,b*d});
    cout<<ans;
}

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

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

    if (N == M) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
#include<stdio.h>
#include<algorithm>
int*t,n,m,d,i,s[99999];main(){for(;scanf("%d%d%d",&d,&n,&m),s[i=n]=d;printf("%d\n",i)){for(;--i;)scanf("%d",s+i);for(std::sort(s,s+n);m--;i+=std::min(*t-d,d-t[-1]))scanf("%d",&d),t=std::upper_bound(s,s+n,d);}}

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

MOD = 998244353
fact = [1] * (n+1) # 階乗を格納するリスト
factinv = [1] * (n+1) # 階乗を格納するリスト
for i in range(n):
    fact[i+1] = fact[i] * (i+1) % MOD # 階乗を計算
    factinv[i+1] = pow(fact[i+1], MOD-2, MOD)# MODを法とした逆元（フェルマーの小定理）

def nCk(n,k): # 組み合わせ(MOD)を返却する
    return fact[n] * factinv[n-k] * factinv[k] % MOD

ans = 0
for i in range(k+1):
    ans += m * pow(m-1, n-1-i, MOD) * nCk(n-1, i) % MOD

print(ans % MOD)


Measured memory_bytes: 24460
#include<iostream>
#include<string>
#include<vector>
#include<cstdio>
#include<sstream>
#include<algorithm>
#include<cmath>
#include<map>
#include<functional>
using namespace std;
int stoi(string x){stringstream ss;ss<<x;int tmp;ss>>tmp;return tmp;}
string itos(long double x){stringstream ss;ss<<x;return ss.str();}
int main(){
int n,ans=1;
while(cin>>n){
ans=1;
for(int i=0;i<n;i++)ans+=(i+1);
cout<<ans<<endl;
}
return 0;
}

Measured memory_bytes: 1164
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE BangPatterns #-}

import Control.Applicative
import Control.Monad
import Control.Arrow
import Data.List
import Data.Maybe
import Data.Char
import qualified Data.ByteString.Char8 as B
import Text.Printf

readInt = ( readLn :: IO Int )
readInts = map ( read :: String -> Int ) . words <$> getLine

getList = map ( fst . fromJust . B.readInt ) . B.words <$> B.getLine

which a b f = if f then a else b
mp [ a, b ] = ( a, b )

main = do
	[ x, y ] <- readInts
	putStrLn $ which "Yes" "No" $ f x == f y

f x
	| x == 2 = 3
	| x `elem` [ 4, 6, 9, 11 ] = 2
	| otherwise = 1


Measured memory_bytes: 508
#include <iostream>

void draw_sharp(int);  //横に＃を出力
void draw_sharp_dot_sharp(int);  // #......#のように出力

int main(){
	int Height, Width; //入力される、長方形のたてよこ
	while (true)
	{
		std::cin >> Height >> Width;
		if (Height == 0 && Width == 0)
			break;
		draw_sharp(Width);
		for (int i = 0; i < Height-2; i++)
		{
			draw_sharp_dot_sharp(Width);
		}
		draw_sharp(Width);
		std::cout << "\n";
	}
}

//num_sharpの数だけ横に#を出力して、最後に改行
void draw_sharp(int num_sharp){
	for (int i = 0; i < num_sharp; i++)
	{
		std::cout << "#";
	}
	std::cout << "\n";
}
//Width-2の数だけ横に.を出力して、その最初に#、最後に#と改行
void draw_sharp_dot_sharp(int Width){
	std::cout << "#";
	for (int i = 0; i < Width-2; i++)
	{
		std::cout << ".";
	}
	std::cout << "#\n";
}


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

const ll LINF = 1e18;
const int INF = 1e9;
const ll MOD = pow(10,9) + 7;

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 main(){

    int N, M;
    cin >> N >> M;
    vector<bool> issafe(N+1, true);
    for(int i = 0; i < M; i++){
        int a;
        cin >> a;
        issafe[a] = false;
    }

    vector<int> dp(N+1, 0);
    dp[0] = 1;
    if(issafe[1]) dp[1] = 1;

    for(int i = 2; i <= N; i++){
        if(issafe[i-1]) dp[i] += dp[i-1];
        if(issafe[i-2]) dp[i] += dp[i-2];
        dp[i] %= MOD;
    }
    cout << dp[N] << endl;
    
    return 0;
}

Measured memory_bytes: 764
#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.at(i);
  vector<ll> acount(100002);
  for (int i=0; i<N; i++) {
    ll tmpa = a.at(i)+1;
    acount.at(tmpa)++; acount.at(tmpa+1)++; acount.at(tmpa-1)++;
  }
  ll maxa = -1;
  for (ll i=0; i<acount.size(); i++)
    if (maxa < acount.at(i)) maxa = acount.at(i);
  cout << maxa << endl;
}

Measured memory_bytes: 1920
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; i++)
#define repr(i, n) for(int i = n; i >= 0; i--)
#define reps(i,a,b) for(int i= a; i < b; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main()
{
  double n, k;
  cin >> n >> k;
  double ans = 0;
  double r = 1 / n;
  reps(i, 1, n+1) {
    if (k <= i) {
      ans += r;
      continue;
    } else {
      double rr = r;
      double v = i;
      while(v < k) {
        rr *= 0.5;
        v*=2;
      }
      ans += rr;
    }
  }
  printf("%.10f", ans);
  return 0;
}

Measured memory_bytes: 3756
/**
 *    author        : Saurav Paul 
 *    created       : August 29, 2020 6:36 PM
 *    Problem Name  : D - Friends
 *    Problem Limit : 2000 ms , 1024 MB
 *    Problem Url   : https://atcoder.jp/contests/abc177/tasks/abc177_d
 *    @genarated by : ai-virtual-assistant
**/

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

using ll = long long int ;

class TC{

    int N , M ;
    vector<int>parent ;
    int find_parent(int x){
        
        if(parent[x]==x)
            return x;
        return parent[x] = find_parent(parent[x]);
    }
    public :
    void solve(){
        cin >> N >> M ;

        for(int i = 0 ; i <= N; i++){
            parent.push_back(i) ;
        }

        for(int i = 0 ; i < M ; i++){
            int u , v;
            cin >> u >> v;
            int f1 = find_parent(u) ;
            int f2 = find_parent(v) ;

            if(f1 != f2){
                parent[f1] = f2 ;
            }
        }

        map<int,int> cnt ;
        for(int i = 1; i <= N ; i++){
            cnt[find_parent(parent[i])] ++ ;
            /* cout << i <<" " << parent[i] ; */
        }

        int ans = 0 ;
        for(auto x : cnt){
            ans = max(ans,x.second) ;
        }
        cout <<ans <<endl ;
        

    }
};

int main(){
    ios_base::sync_with_stdio(false);

    int testcases = 1;
    for(int i = 1 ; i <= testcases ; i ++){
        TC tc;
        tc.solve() ;
    }

    return 0 ;
}


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

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

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

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

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

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

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

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

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

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

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

fn main() {
    input! {
        a: usize,
        b: usize,
    }
    if 2 * b >= a {
        println!("0");
    } else {
        println!("{}", a - 2 * b);
    }
}


Measured memory_bytes: 4352
#include <stdio.h>

int F[44];

int fibonacci(int);

int main(){

  int n;

  scanf("%d",&n);

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

  
  return 0;
}

int fibonacci(int n){

  if(n==0 || n==1) return F[n]=1;
  if(F[n]!=0) return F[n];
  return F[n]=fibonacci(n-2)+fibonacci(n-1);
}

Measured memory_bytes: 596
#include <cstdio>
#include <iostream>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <string>
#include <cstring>
#include <sstream>
#include <algorithm>
#include <functional>
#include <queue>
#include <stack>
#include <cmath>
#include <iomanip>
#include <list>
#include <tuple>
#include <bitset>
#include <ciso646>
#include <cassert>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> T;
typedef vector<ll> vec;

inline bool check(ll x, ll y, ll xMax, ll yMax) { return x >= 0 && y >= 0 && xMax > x && yMax > y; }
inline int toint(string s) { int v; istringstream sin(s); sin >> v; return v; }
template<class T> inline string tostring(T x) { ostringstream sout; sout << x; return sout.str(); }
template<class T> inline T sqr(T x) { return x*x; }
template<class T> inline T mypow(T x, ll n) { T res = 1; while (n > 0) { if (n & 1)res = res * x;	x = x * x;	n >>= 1; }return res; }
inline ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }

#define For(i,a,b)	for(ll (i) = (a);i < (b);(i)++)
#define rep(i,n)	For(i,0,n)
#define rFor(i,a,b)	for(ll (i) = (a-1);i >= (b);(i)--)
#define rrep(i,n)	rFor(i,n,0)
#define each(i,n)	for(auto &i : n)
#define clr(a)		memset((a), 0 ,sizeof(a))
#define mclr(a)		memset((a), -1 ,sizeof(a))
#define all(a)		(a).begin(),(a).end()
#define sz(a)		(sizeof(a))
#define tostr(a)	tostring(a)
#define dump(val) 	cerr << #val " = " << val << endl;
#define Fill(a,v)	fill((int*)a,(int*)(a+(sz(a)/sz(*(a)))),v)

const ll dx[8] = { 1, 0, -1, 0, 1, 1, -1, -1 }, dy[8] = { 0, -1, 0, 1, -1, 1, -1, 1 };

const ll mod = 1e9 + 7;
const ll INF = 1e17 + 9;

#define int ll
#define double ld

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

	string s;
	cin >> s;

	string ans;
	each(c, s) {
		if (c == '0') {
			ans += '0';
		}else
		if (c == '1') {
			ans += '1';
		}else{
			if (ans.size())ans.pop_back();
		}
	}

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

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

 long double dp[3100][3100];

int main(){
    int n;
    cin>>n;
    vector<double>p(n);
    for(int i=0;i<n;i++)cin>>p[i];
    dp[0][0]=1.0;
    for(int i=0;i<n;i++){
        for(int j=0;j<=i;j++){
            dp[i+1][j+1]+=dp[i][j]*p[i];
            dp[i+1][j]+=dp[i][j]*(1-p[i]);
        }
    }
    long double ans=0.0;
    for(int i=n/2+1;i<=n;i++)ans+=dp[n][i];
    cout<<fixed<<setprecision(15)<<ans<<endl;
}

Measured memory_bytes: 85960
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <queue>
using namespace std;

int main() {
    int h, w, a, b;
    cin >> h >> w >> a >> b;

    int ans[1100][1100];
    for (int i = 0; i < 1100; i++) {
        for (int j = 0; j < 1100; j++) {
            ans[i][j] = 0;
        }
    }

    for (int i = 0; i < b; i++) {
        for (int j = 0; j < a; j++) {
            ans[i][j] = 1;
        }
    }

    for (int i = b; i < h; i++) {
        for (int j = a; j < w; j++) {
            ans[i][j] = 1;
        }
    }

    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            cout << ans[i][j];
        }
        cout << endl;
    }
    return 0;
}

Measured memory_bytes: 5888
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector< int > vi;
typedef vector< ll > vll;
#define boost ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define fi first
#define se second
#define endl '\n'
#define mod 1000000007
#define pb push_back
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define all(c) (c).begin(),(c).end()
#define inf INT_MAX

int main(void) {
	boost
// #ifndef ONLINE_JUDGE
// 	freopen("input.txt", "r", stdin);
// 	freopen("output.txt", "w", stdout);
// #endif
	ll n,d;
	cin>>n>>d;
    ll c=0;
   while(n--){
       ll x,y;
       cin>>x>>y;
       if(sqrt(x*x + y*y) <= d){
           c++;
       }
   }cout<<c<<endl;
	return 0;
}

Measured memory_bytes: 3692
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}
 
#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};
 
    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
 
    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}
 
#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };
 
    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };
 
    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };
 
    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };
 
    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };
 
    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };
 
    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

use std::cmp::min;

fn main() {
    input!{
        _n: usize,
        k: usize,
        s: chars,
    }

    let mut init = 0;
    let mut rl = 0;
    let mut lr = 0;

    let mut bef = s[0];

    for i in s.iter().skip(1) {
        if bef == *i {
            init += 1;
        } else if bef == 'R' && *i == 'L' {
            rl += 1;
        } else if bef == 'L' && *i == 'R' {
            lr += 1;
        }
        bef = *i;
    }

    //println!("init : {} rl: {} lr: {} ", init, rl, lr);
    
    let sm = min(rl, lr);
    let ans = init + if rl == lr {
        2 * min(sm, k)
    } else {
        if k > sm {
            2 * sm + 1
        } else {
            2 * min(sm, k)
        }
    };

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


Measured memory_bytes: 4352
import Data.List (transpose)
import Control.Applicative
import Control.Monad
mult :: Num a => [[a]] -> [[a]] -> [[a]]
mult a b' = let b = transpose b' in
    [ [sum $ zipWith (*) (a!!i) (b!!j)
        | j <- [0..length b-1]
        ]
        | i <- [0..length a-1] ]

readMatrix :: Int -> IO [[Int]]
readMatrix n = map (map read .words) <$> replicateM n getLine

main = do
    [n,m,l] <- map read . words <$> getLine
    a <- readMatrix n
    b <- readMatrix m
    mapM_ (putStrLn . unwords . map show) $ mult a b

Measured memory_bytes: 12328
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REP2(i, a, b) for (int i = (a); i < (int)(b); i++)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef long long ll;
#define ALL(V) V.begin(), V.end()
template<class T,class U>bool chmin(T&a,const U&b){if(a<=b)return false;a=b;return true;}
template<class T,class U>bool chmax(T&a,const U&b){if(a>=b)return false;a=b;return true;}


ll Main(int N)
{
    ll NN = (ll)N;
    return NN*(NN-1)/2LL;
}

int main(void){
    int N;
    cin >> N;
    cout << Main(N) << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <vector>

using namespace std;
int n;
long long a[100000]; // 10^5

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

  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  sort(a, a+n);
  long long aa,b;
  aa = b = 0;
  for (int i = n-1; i > 0; i--) {
    if (a[i] == a[i-1]) {
      if (aa == 0) {
        aa = a[i];
        i--;
      } else if (b ==0 ) {
        b = a[i];
        break;
      }
    }
  }

  cout << aa * b;
  return 0;
}


Measured memory_bytes: 1024
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
using static System.Math;
using System.Numerics;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
            Solve();
            //Out.Flush();
            Read();
        }

        static void Solve()
        {
            var (H, W) = Slice2<long>();
            var ban = new string[H];
            var bNum = 0L;
            for (var i = 0; i < H; ++i)
            {
                ban[i] = ReadLine();
                bNum += ban[i].Count(c => c == '#');
            }
            var dx = new long[] { -1, 0, 0, 1 };
            var dy = new long[] { 0, -1, 1, 0 };
            var q = new Queue<(long h, long w, long dst)>();
            if (ban[0][0] == '.')
                q.Enqueue((0, 0, 1));
            var MAX = long.MaxValue / 2;
            var dsts = Enumerable.Repeat(0, (int)H).Select(_ => Enumerable.Repeat(MAX, (int)W).ToArray()).ToArray();
            while (q.Any())
            {
                var (h, w, d) = q.Dequeue();
                if (dsts[h][w] <= d) continue;
                dsts[h][w] = d;
                for (var i = 0; i < 4; ++i)
                {
                    var (nh, nw, nd) = (h + dy[i], w + dx[i], d + 1);
                    if (nh < 0 || H <= nh || nw < 0 || W <= nw) continue;
                    if (ban[nh][(int)nw] == '#') continue;
                    q.Enqueue((nh, nw, nd));
                }
            }
            if (dsts[H - 1][W - 1] == MAX)
                WriteLine(-1);
            else
                WriteLine(H * W - dsts[H - 1][W - 1] - bNum);
        }
        static long Mod = 998244353;
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }
        static public (T1 a, T2 b) Slice<T1, T2>()
        {
            var t = ReadLine().Split();
            return (
            (T1)Convert.ChangeType(t[0], typeof(T1)),
            (T2)Convert.ChangeType(t[1], typeof(T2)));
        }
        static public (T a, T b) Slice2<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)));
        }
        static public (T a, T b, T c) Slice3<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)),
            (T)Convert.ChangeType(t[2], typeof(T)));
        }
    }
}

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

int main() {
	int n,m,i,j;
	cin >> n >> m;
	int a[n][m];
	int b[m];
	int c[n];
	for(i=0;i<n;i++){
		for(j=0;j<m;j++){
			a[i][j] = 0;
			b[j] = 0;
			cin >> a[i][j];
		}
		c[i] = 0;
	}
	for(j=0;j<m;j++){
		cin >> b[j];
	}
	for(i=0;i<n;i++){
		for(j=0;j<m;j++){
			c[i] += b[j]*a[i][j];
		}
	}
	for(i=0;i<n;i++){
		cout << c[i] << endl;
	}
	return 0;
}

Measured memory_bytes: 3120
#include <bits/stdc++.h>
using namespace std;
 
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define Eunique(v) v.erase(unique(all(v)),v.end())
#define pvec(v) rep(i,v.size()){cout << v[i] << " ";};cout<<endl;
#define pb push_back
#define pf push_front
#define mod 1e9+7
#define m_p make_pair
 
typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<int,int> pii;
typedef vector<pii> vpii;
typedef pair<ll,ll> pll;
typedef vector<pll> vpll;
typedef vector<vector<int>> vvi;
typedef vector<vector<ll>> vvll;
const double pi = acos(-1.0);
 
ll gcd(ll x, ll y) { return (y == 0) ? x : gcd(y, x % y); }
ll lcm(ll x, ll y) { return x * y / gcd(x, y); }

bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false;

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return false;
        }
    }
    return true;
}

int main()
{
    ll n,k,ans=999999999999999;
    cin >> n >> k;
    vll x(n);
    rep(i,n) cin >> x[i];
    rep(i,n-k+1){
        ans=min({ans,abs(x[i])+abs(x[i]-x[i+k-1]),abs(x[i+k-1])+abs(x[i]-x[i+k-1])});
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1024
#include <cstdio>
#include <algorithm>
#include <vector>

void printInt(long long value);
void br();
void scanInt(long long* value);
void scanIntArray(long long* array, long long count);
void scanIntVector(std::vector<long long>* v, long long count);

int main() {
	long long N, d[100000];
	scanInt(&N);
	scanIntArray(d, N);
	std::sort(d, d + N);
	printInt(d[N / 2] - d[N / 2 - 1]);
}

void printInt(long long value) {
	printf("%lld", value);
}

void br() {
	printf("\n");
}

void scanIntArray(long long* array, long long count) {
	for (long long i = 0; i < count; ++i) {
		scanInt(array + i);
	}
}

void scanIntVector(std::vector<long long>* v, long long count) {
	for (long long i = 0; i < count; ++i) {
		long long value;
		scanInt(&value);
		v->push_back(value);
	}
}

void scanInt(long long* value) {
	scanf("%lld", value);
}

Measured memory_bytes: 1024
#include <iostream>
#include <algorithm>
#include <cmath>
#include <stdio.h>
#include <stdlib.h>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <string.h>
#include <stack>
#define Endl endl
#define mp make_pair
#define rep(N) for(int i=0;i<N;i++)
#define repj(N) for(int j=0;j<N;j++)
#define ll long long 
#define pii pair<int,int>
#define pll pair<ll,ll>
#define For(I,N) for(int I=0;I<N;I++)
#define cinone(N) int N;cin>>N;
#define scanfone(N) int N;cin>>N;
#define cinng(N,M) int N[M];for(int yiuytvnm=0;yiuytvnm<M;yiuytvnm++) cin>>N[yiuytvnm];
#define scanfng(N,M) int N[M];for(int qrwuoiq=0;qrwuoiq<M;qrwuoiq++) scanf("%d",&N[qrwuoiq]);
#define over(A) {cout<<A<<endl;exit(0);}
#define all(A) A.begin(),A.end()
#define ceil(a,b) ((a-1)/b+1)
typedef unsigned long long ull;
const int inf=1039074182;
using namespace std;
char a[3005],b[3005];
int la,lb;
int dp[3005][3005];
pii trace[3005][3005];

int main()
{
//	freopen("input.txt","r",stdin);
	scanf("%s%s",a+1,b+1);
	la=strlen(a+1);
	lb=strlen(b+1);
	for(int i=1;i<=la;i++)
	{
		for(int j=1;j<=lb;j++)
		{
			if(dp[i-1][j]>=dp[i][j])
			{
				dp[i][j]=dp[i-1][j];
				trace[i][j]=mp(i-1,j);
			}
			if(dp[i][j-1]>=dp[i][j])
			{
				dp[i][j]=dp[i][j-1];
				trace[i][j]=mp(i,j-1);
			}
			if(a[i]==b[j] && dp[i-1][j-1]+1>=dp[i][j])
			{
				dp[i][j]=dp[i-1][j-1]+1;
				trace[i][j]=mp(i-1,j-1);
			}
		}
	}
	int res=0,nx,ny;
	for(int i=1;i<=la;i++)
	{
		for(int j=1;j<=lb;j++)
		{
			if(dp[i][j]>=res)
			{
				res=dp[i][j];
				nx=i;
				ny=j;
			}
		}
	}
	string s="";
	while(nx && ny)
	{
		auto t=trace[nx][ny];
		if(t.first-nx==t.second-ny) s+=a[nx];
		nx=t.first;
		ny=t.second;
	}
	reverse(all(s));
	printf("%s",s.c_str());
	return 0;
}

Measured memory_bytes: 105984
from collections import deque
N,M = map(int,input().split())
graph = [[] for i in range(N)]
for _ in range(M):
  l,r,d = map(int,input().split())
  graph[l-1].append((r-1,d))
  graph[r-1].append((l-1,-d))

q = deque([i for i in range(N)])
pos = [None for i in range(N)]
while q:
  x = q.popleft()
  if pos[x] == None:
    pos[x] = 0
  for y,d in graph[x]:
    if pos[y] == None:
      pos[y] = pos[x] + d
      q.appendleft(y)
      continue
    if pos[y] != pos[x] + d:
      print("No")
      exit()

print("Yes")


Measured memory_bytes: 115104
N, M = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]
A.sort(reverse=True)
total = sum(A)
ans = 0
for a in A:
    if a * 4 * M >= total:
        ans += 1
print('Yes' if ans >= M else 'No')

Measured memory_bytes: 3060
#pragma GCC optimize("O3")
#include<bits/stdc++.h>

using namespace std;
typedef long long ll;

#define REP(i,n) for(ll i=0;i<ll(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<ll(b);i++)
#define FORD(i,a,b) for(ll i=a;i>ll(b);i--)
#define ALL(x) x.begin(),x.end() 
#define SIZE(x) ll(x.size()) 
#define INF 1000000000000 
#define MOD 1000000007 
#define MAXR 100000 
#define PB push_back 
#define MP make_pair 
#define F first 
#define S second 
#define Umap unordered_map
#define Uset unordered_set


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

    ll A;
    double B;
    cin >> A >> B;

    ll b = B*100 + 0.5;
    ll ans = A*b / 100;

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3728