akhauriyash/Code-Regression huggingface dataset:
/*
Author : N_o_o_B
Created : April 22 2020 15:46:17 
*/
#include <bits/stdc++.h>
using namespace std;
/*
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
*/
#define TRACE
#ifdef TRACE
#define trace(...) { cerr<<"[ "; __trace__(#__VA_ARGS__, __VA_ARGS__);}
#undef endl
template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const pair<Arg1,Arg2> &x) {
    return out<<"("<<x.first<<","<<x.second<<")";
}
 
template <typename Arg1>
ostream& operator << (ostream& out, const vector<Arg1> &a) {
    out<<"[";for(const auto &x:a)out<<x<<",";return out<<"]";
}
 
template <typename Arg1>
ostream& operator << (ostream& out, const set<Arg1> &a) {
    out<<"[";for(const auto &x:a)out<<x<<",";return out<<"]";
}
 
template <typename Arg1,typename Arg2>
ostream& operator << (ostream& out, const map<Arg1,Arg2> &a) {
    out<<"[";for(const auto &x:a)out<<x<<",";return out<<"]";
}
 
template <typename Arg1>
void __trace__(const string name, Arg1&& arg1){
    cerr << name << " : " << arg1 << " ] " << endl;
}
 
template <typename Arg1, typename... Args>
void __trace__(const string names, Arg1&& arg1, Args&&... args){
    const string name = names.substr(0,names.find(','));
    cerr<<name<<" : "<<arg1<<" | ";
    __trace__(names.substr(1+(int)name.size()), args...);
}
#else
    #define trace(args...)
#endif
 
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<pair<int,int>> vii;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<pair<ll,ll>> vll;
typedef vector<vl> vvl;
//typedef tree<pii, null_type, less<pii>, rb_tree_tag, tree_order_statistics_node_update> oset;
#define fori(i,n) for(int i=0;i<n;i++)
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define repd(i,a,b) for(int i=a;i>=b;i--)
#define ford(i,n)  for(int i=n-1;i>=0;i--)
#define trav(x,a) for(auto& x:a)
#define all(x) x.begin(),x.end()
#define pb push_back
#define endl '\n'
#define sz(a) (int)a.size()
#define fi first
#define se second
clock_t time_p=clock();
void time_taken()
{
    time_p=clock()-time_p;
    cerr<<"Time Taken : "<<(float)(time_p)/CLOCKS_PER_SEC<<"\n";
}
//const ll mod=998244353;
const ll mod=1e9+7;
const ll INF=1e18;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);
    cout.precision(12);cout << fixed;

    int n;
    cin >> n;

    int l = log2(n);

    cout << (1<<l) << endl;



    time_taken();
    return 0;
}

Measured memory_bytes: 512
n,m = map(int, input().split())
a = [list(input()) for i in range(n)]
b = [list(input()) for i in range(m)]

for i in range(n):
    if n < i + m:
        break
    for j in range(n):
        if n < j + m:
            break
        if all(a[j+k][i:i+m] == b[k] for k in range(m)):
            print("Yes")
            exit()
print("No")

Measured memory_bytes: 3064
import java.util.*;
import java.lang.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int s = sc.nextInt();
		int[] a = new int[1000001];
		a[1] = s;
		Set<Integer> set = new TreeSet<>();
		set.add(s);
		for (int i = 2; i <= 1000000; i++) {
			if ((a[i - 1]) % 2 == 0) {
				a[i] = a[i - 1] / 2;
			} else {
				a[i] = 3 * a[i - 1] + 1;
			}
			if (set.contains(a[i])) {
				System.out.println(i);
				break;
			} else {
				set.add(a[i]);
			}
		}
	}
}

Measured memory_bytes: 27220
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main()
{
    int n;
    cin >> n;
    vector<vector<char>> s(n, vector<char>(2*n));
    for(int i = 0; i < n; i++)
    {
        for(int j = 0; j < n; j++)
        {
            cin >> s[i][j];
            s[i][j+n] = s[i][j];
        }
    }

    int ans = 0;
    for(int i = 0; i < n; i++)
    {
        bool flag = true;
        for(int y = 0; y < n; y++)
        {
            for(int x = i; x < i+n; x++)
            {
                int z = x-i-y;
                if(z <= 0) continue;
                if(s[y][x] != s[y+z][x-z])
                {
                    flag = false;
                    break;
                }
            }
            if(!flag) break;
        }
        if(flag) ans++;
    }
    cout << ans * n << endl;
}


Measured memory_bytes: 384
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <cmath>
#include <string>
#include <functional>

using namespace std;
typedef long long int ll;
typedef pair <int,int> P;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) for (int i = 0; i < (n); i++)
#define fst first
#define snd second
#define pb push_back
#define ALL(obj) (obj).begin(), (obj).end()
#define debug(x) cout << #x << ": " << x << endl
const int MOD = 1000000007;
const int INF = 100100100;
const double EPS = 0.000000001;

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

bool pairCompare(const P& pair1, const P& pair2) {
    return pair1.second > pair2.second;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll a, b;
  ll ans, aans, bans;
  ll count = 0;
  cin >> a >> b;
  a = a - 1;
  if(a & 1){
    count = (a + 1) / 2;
    if(count & 1) aans = 1;
    else aans = 0;
  }
  else {
    count = a / 2;
    if(count & 1) aans = 1 ^ a;
    else aans = 0 ^ a;
  }

  if(b & 1){
    count = (b + 1) / 2;
    if(count & 1) bans = 1;
    else bans = 0;
  }
  else {
    count = b / 2;
    if(count & 1) bans = 1 ^ b;
    else bans = 0 ^ b;
  }

  ans = aans ^ bans;
  cout << ans << endl;
  return 0;
}


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

int main(){
  string S;
  cin >> S;
  if(S[0] == 'A' && S[1] == 'A' && S[2] == 'A')
    cout << "No";
  else if(S[0] == 'B' && S[1] == 'B' && S[2] == 'B')
    cout << "No";
  else
    cout << "Yes";
  return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;}
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define dame { puts("-1"); return 0;}
#define yn {puts("Yes");}else{puts("No");}
const int MX = 200005;
#define RET(ans) {cout<<ans<<endl;return 0;} 

    // 二次元ベクターの基本
    /*
    vector<vector<int>> dp; // 宣言
    dp.resize(n); // 1次元めの要素数決定
    dp[i].push_back(int); // プッシュバック
    rep(i,n){
        sort(dp[i].begin(),dp[i].end()); // 二次元めを昇順ソート
    }
    */

    // 整数スキャン（複数）
    /*
    int x,y,z;
    scanf("%d%d%d",&x,&y,&z);

    // n個の整数のスキャン
    /*
    ll a[n] = {};
    rep(i,n){
        scanf("%lld",&a[i]);
    }
    */

    // 文字列スキャン
    /*
    string s; cin >> s;
    */

    // n個の文字列スキャン
    /*
    vector<string> slist;
    rep(i,n){
        string s; cin >> s;
        slist.push_back(s);
    }
    */

int main() {
    int k,t;
    cin >> k >> t;
    int a[t] = {};
    rep(i,t){
        scanf("%d",&a[i]);
    }
    sort(a,a+t);
    

    int ans = 0;
    int sum = 0;
    rep(i,t-1){
        sum += a[i];
    }
    ans = max(0,a[t-1]-sum-1);
    cout << ans << endl;
    return 0;
}
 
 


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

using namespace std;

class Counting {
	unsigned long long p, n;
	vector<long long> invMemo, facMemo, facInvMemo;
public:
	Counting(unsigned long long nn, unsigned long long np) {
		p = np;
		n = nn;
		invMemo.resize(n + 1);
		facMemo.resize(n + 1);
		facInvMemo.resize(n + 1);
		facMemo[0] = 1;
		facMemo[1] = 1;
		facInvMemo[0] = 1;
		facInvMemo[1] = 1;
		invMemo[0] = 0;
		invMemo[1] = 1;
		for (unsigned long long i = 2; i <= n; i++) {
			invMemo[i] = p - (p / i)*invMemo[p%i] % p;
			facMemo[i] = (facMemo[i - 1] * i) % p;
			facInvMemo[i] = (facInvMemo[i - 1] * invMemo[i]) % p;
		}
	}
	unsigned long long fac(unsigned long long k) {
		return facMemo[k];
	}
	unsigned long long facInv(unsigned long long k) {
		return facInvMemo[k];
	}
	unsigned long long choose(unsigned long long n, unsigned long long k) {
		if (!(0 <= k && k <= n))
			return 0;
		return (((facMemo[n] * facInvMemo[k]) % p)*facMemo[n - k]) % p;
	}
	unsigned long long divide(unsigned long long a, unsigned long long b) {
		return (a * invMemo[b]) % p;
	}
	unsigned long long mod(unsigned long long a) {
		a %= p;
		if (a < 0) a += p;
		return a;
	}
	unsigned long long power(unsigned long long a, unsigned long long e) {
		unsigned long long ans = 1;
		for (; e > 0; e /= 2) {
			if (e % 2 != 0)
				ans = ans * a % p;
			a = a*a%p;
		}
		return ans;
	}
};

long long a, b, aa, bb, ans = 0;

int main() {
	cin >> a >> b;
	aa = -a;
	bb = -b;
	long long a1 = 10000000000, a2 = 10000000000, a3 = 10000000000, a4 = 10000000000;
	if (b >= a) {
		a1 = 0;
		a1 += b - a;
	}
	if (b >= aa) {
		a2 = 1;
		a2 += b - aa;
	}
	if (bb >= a) {
		a3 = 1;
		a3 += bb - a;
	}
	if (bb >= aa) {
		a4 = 2;
		a4 += bb - aa;
	}
	ans = min(a1, a2);
	ans = min(ans, a3);
	ans = min(ans, a4);
	cout << ans << endl;
//	cin >> a;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
int main()
{
    ll n;cin>>n;
    ll arr[n+1];
    for(ll i=1;i<=n;i++)
        cin>>arr[i];
  ll dp[n+1];
    dp[0]=0;
    dp[1]=0;
    dp[2]=abs(arr[2]-arr[1]);

    for(ll i=3;i<=n;i++)
    {
        dp[i]=min((dp[i-1]+abs(arr[i]-arr[i-1])),dp[i-2]+abs(arr[i]-arr[i-2]));
    }
    cout<<dp[n]<<endl;
}


Measured memory_bytes: 1792
#include<stdio.h>

int main(){
	int n,m,i,a,b,temp[2][200001]={0};
	scanf("%d%d",&n,&m);
	for(i=0;i<m;i++){
		scanf("%d%d",&a,&b);
		if(a==n){
			temp[1][b]=1;
		}
		if(b==n){
			temp[1][a]=1;
		}
		if(a==1){
			temp[0][b]=1;
		}
		if(b==1){
			temp[0][a]=1;
		}
	}
	for(i=0;i<=200000;i++){
		if(temp[0][i]==1&&temp[1][i]==1){
				puts("POSSIBLE");
				return 0;
		}
	}
	puts("IMPOSSIBLE");
	return 0;
}

Measured memory_bytes: 1664
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <queue>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

// rep(i, 100) { cout << i << endl; } => 0 1 2 ... 99
#define rep(i, n) for(int i = 0, i##_len = (n); i < (int)n; i++)

// std::sort(all(v));
#define all(x) (x).begin(), (x).end()

// long long int
using ll = long long;

// utility to cast return value of size function to int
#define SZ(x) ((int)(x).size())

// VS defines "_DEBUG" macro when debug configuration.
#if _DEBUG
#define dump(x) cerr << #x << " = " << (x) << endl
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl
#else
#define dump(x)
#define debug(x)
#endif

// update max
template<class T>bool chmax(T & prov, const T & cur)
{
	if (cur > prov)
	{
		prov = cur;
		return true;
	}
	return false;
}

// update min
template<class T>bool chmin(T & prov, const T & cur)
{
	if (cur < prov)
	{
		prov = cur;
		return true;
	}
	return false;
}

int main()
{
	ll A;
	cin >> A;
	string str;
	cin >> str;
	int dot_pos = str.find('.');
	ll b_up = atol(str.substr(0, dot_pos).c_str());
	ll b_down = atol(str.substr(dot_pos + 1).c_str());
	ll B100 = b_up * 100 + b_down;

	ll ans = A * B100 / 100;
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 3628
#include<iostream>
#include<iomanip>
#include<queue>
#include<string>
#include<stack>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<cassert>
#include<ctime>
#include<algorithm>
#include<utility>
#include<map>
#include<set>
#include<vector>
#include<functional>

using namespace std;

typedef  long long           ll;
typedef  unsigned            ui;
typedef  unsigned long long  ull;
typedef  pair<int,int>       i_i;
typedef  pair<ll,int>        ll_i;
typedef  pair<ll,ll>         ll_ll;
typedef  pair<double,int>    d_i;
typedef  pair<double,double> d_d;

#ifdef DEBUG
#define dprintf      printf
#define dputs        puts
#define dout(x)      cout<<#x" = "<<(x)<<endl
#define darray(x,n)  {int i;rep(i,n)cout<<#x"["<<i<<"] = "<<*((x)+i)<<endl;}
#define dloop(i,s,g) for(int (i)=(s);(i)<(g);(i)++)
#define drep(i,n)    for(int (i)=0;(i)<(n);(i)++)
#define dstop()      scanf("%*c")
#else
#define dprintf      (1)?0:printf
#define dputs        (1)?0:puts
#define dout(x)
#define darray(x,n)
#define dloop(i,s,g) if(int i=0){}else
#define drep(i,n)    if(int i=0){}else
#define dstop()
#endif

#define F    first
#define S    second
#define pb   push_back
#define mp   make_pair

#define loop(i,s,g) for((i)=(s);(i)<(g);(i)++)
#define rep(i,n)    for((i)=0;(i)<(n);(i)++)
#define all(x)      (x.begin(),x.end())
#define in(T,...) T __VA_ARGS__; impl(__VA_ARGS__)
#define array(T,id,n) T id[(n)]; for(int i=0;i<(n);i++)cin>>id[i]
#define putv(n)     cout<<(n)<<endl

//#define int long long
#ifndef int
#define INF __INT32_MAX__
#else
#define INF __INT64_MAX__
#endif

void impl(){};
template <typename T,typename... TS >
void impl(T &head,TS &... tail)
{
  cin>>head;
  impl(tail ...);
}

signed main(void)
{
  in(int,r,g);
  putv(r+(g-r)*2);
  return 0;
}


Measured memory_bytes: 256
import java.util.*;
 
public class Main {
	public static void main(String[] args) {
    	Scanner sc = new Scanner(System.in);
    	int m = sc.nextInt();
        int d = sc.nextInt();
        int count = 0;
        for(int i = 2; i < m + 1; i++){
        	for(int j = 2; j < d + 1; j++){
                int a = j / 10;
          		int b = j % 10;
                if(a != 1 && b != 1 && i == a * b){
                	count++;
                }
            }
        }
        System.out.println(count);
    }
}

Measured memory_bytes: 35712
#include <iostream>
#include<string.h>
#include<math.h>
#include<algorithm>


using namespace std;

int main() {
	int N,D,a;
	cin >> N>>D;
	a = D * 2 + 1;
	if (N % a == 0)cout << N / a << endl;
	else cout<<N/a + 1 <<endl;
	return 0;
}


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

int main()
{
    ll q,h,s,d;
    ll n;
    cin>>q>>h>>s>>d>>n;
    ll min1=min({4*q,2*h,s});
    ll min2=min(2*min1,d);
    ll ans=0;
    ans+=(n/2)*min2;
    if(n&1){
        ans+=min1;
    }
    cout<<ans<<endl;

}


Measured memory_bytes: 256
//inlclude before define 
#define _USE_MATH_DEFINES

//include
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<type_traits>
#include<numeric>
#include<assert.h>
//#include<deque>
#include<iomanip>
#include<set>
#include<tuple>
#include<map>
using namespace std;

//typedef
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;
typedef pair<int, int> P1;
typedef long long int ll;

//define
#define INF 1e9
#define NUM 1000000007
#define all(x) begin(x), end(x)
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define REP(i,a,b) for(int i=int(a);i<int(b);i++)
#define chmin(a,b) a=min((a),(b))
#define chmax(a,b) a=max((a),(b))

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

	if (n == 25) {
		cout << "Christmas" << endl;
	} else if (n == 24) {
		cout << "Christmas Eve" << endl;
	} else if (n == 23) {
		cout << "Christmas Eve Eve" << endl;
	} else {
		cout << "Christmas Eve Eve Eve" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <chrono>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <unordered_map>
#include <vector>
using namespace std;

#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()

const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
/*----------------------------------------*/
int main() {
  cin.tie(0); ios::sync_with_stdio(false);
  // freopen("input.txt", "r", stdin);

  int n, k; cin >> n >> k;
  vector<int> a(n); REP(i, n) cin >> a[i];
  sort(ALL(a), greater<int>());
  if (k > a.front()) {
    cout << "IMPOSSIBLE\n";
    return 0;
  }
  int mn = a.front();
  FOR(i, 1, n) mn = __gcd(mn, a[i]);
  cout << (k % mn == 0 ? "POSSIBLE\n" : "IMPOSSIBLE\n");
  return 0;
}


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

using namespace std;
int n,a[100005],b[100005],deg[100005],cuoi,so;
set<int> s;
set<int> :: iterator it;
set<pair<int,int> > s2;
set<pair<int,int> > ::iterator it2;
bool check[100005];
vector <int> mkq;
int main()
{
    
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin>>n;
    for (int i=1;i<=n;++i) {cin>>a[i];s.insert(i);deg[a[i]]++;}

    for (int i=1;i<=n;++i) s2.insert({deg[i],-i});

    if (n<=10)
    {
        for (int i=1;i<=n;++i) b[i]=i;
        do
        {
           bool  kt=true;
            for (int i=1;i<n;++i) if (a[b[i]]==b[i+1]) kt=false;
            if (kt)
            {
                for (int i=1;i<=n;++i) cout<<b[i]<<' ';return 0;
            }
        }
        while (next_permutation(b+1,b+n+1));
        cout<<-1;return 0;
    }
    for (int i=1;i<=n-10;++i)
    {

        while (check[-((*s2.rbegin()).second)])

            {
                it2=s2.end();it2--;
                s2.erase(it2);}

        if ((*s2.rbegin()).first==n-i)
        {
            cuoi=-(*s2.rbegin()).second;
            mkq.push_back(cuoi);
            check[cuoi]=true;
            s.erase(cuoi);

            so=a[cuoi];
            if (!check[so])
            {
                s2.erase({deg[so],-so});
                deg[so]--;
                s2.insert({deg[so],-so});
            }


            continue;
        }
        it=s.begin();
        so=*it;
        if (a[cuoi]!=so)
        {
            cuoi=so;
            mkq.push_back(cuoi);
            check[cuoi]=true;
            s.erase(cuoi);

            so=a[cuoi];

            if (!check[so])
            {
                s2.erase({deg[so],-so});
                deg[so]--;
                s2.insert({deg[so],-so});
            }

        }
        else
        {
            it++;
            so=*it;
            cuoi=so;
            mkq.push_back(cuoi);
            check[cuoi]=true;
            s.erase(cuoi);

            so=a[cuoi];

            if (!check[so])
            {
                s2.erase({deg[so],-so});
                deg[so]--;
                s2.insert({deg[so],-so});
            }
        }
    }
    so=0;
    for (it=s.begin();it!=s.end();it++) {b[++so]=*it;}
    do
        {
            bool kt=true;
            if (a[cuoi]==b[1]) kt=false;
            for (int i=1;i<10;++i) if (a[b[i]]==b[i+1]) kt=false;
            if (kt)
            {
                for (int i=0;i<n-10;++i) cout<<mkq[i]<<' ';
                for (int i=1;i<=10;++i) cout<<b[i]<<' ';return 0;
            }
        }
        while (next_permutation(b+1,b+11));
    cout<<-1;
    return 0;
}


Measured memory_bytes: 11136
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define fi first
#define se second
#define mp make_pair
#define itrfor(itr,A) for(auto itr = A.begin(); itr !=A.end();itr++)
template <class T> using reversed_priority_queue = priority_queue<T, vector<T>, greater<T> >;
typedef long long llong;
char moji[26]={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
char moji2[26]={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
char moji3[10]={'0','1','2','3','4','5','6','7','8','9'};
#define Sort(a) sort(a.begin(),a.end());
#define Reverse(a) reverse(a.begin(),a.end());
#define print(a) cout << a << endl;
#define MOD llong(1e9+7)
#define MAX int(2 * 1e5 +5)
#define debug(x)  cout << #x << " = " << (x) << endl;
#define pi acos(-1.0)
#define int llong
#define INF llong(1e17)
void myprint(int* A,int A_num){
   REP(i,A_num) cout << A[i] << " ";
   cout << endl;
}


llong GCD(llong A[],int n){
    llong a,b,c;
    a=A[0];
    b=A[1];
    int i=1;
    while(1){
        if(a<b) swap(a,b);
        while(1){
            if(a%b==0) break;
            c=b;
            b= a%b;
            a=c;
        }
        i+=1;
        if(i==n) break;
        a=A[i];
    }
    return b;
}


int solve(int x, int divizor){
    int res;

    res =  x / divizor;
    if(x % divizor != 0) res += 1;
    return res;
}

int solve2(int x, int divizor){
    int res;

    res =  x / divizor;
    return res;
}

signed main(){
    int a,b,c,d;
    cin >> a >> b >> c >> d;
    int cdiv = solve2(b,c) - solve(a,c) + 1;
    int ddiv = solve2(b,d) - solve(a,d) + 1;
    int A[2] = {c,d};
    int mcd = c * d / GCD(A,2);
    int tmp = solve2(b,mcd) - solve(a,mcd) + 1;

    cout << b - a + 1 - cdiv - ddiv + tmp << endl;
}

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

#define F first
#define S second
#define PB push_back

using namespace std;

typedef long long LL;
typedef pair<int, int> PII;
typedef priority_queue<int> HEAP;
typedef priority_queue<int, vector<int>, greater<int> > RHEAP;

const int N = 15, M = 1010;

int n, m, k;
int g[N][M];
char s[N][M], f[M];

bool check(int n, int l, int r)
{
	for (int i = 1; i <= n; i ++ )
		if (g[i][r] - g[i][l - 1] > k)
			return false;
	return true;
}

int main()
{
	cin >> n >> m >> k;
	for (int i = 1; i <= n; i ++ ) cin >> s[i] + 1;
	
	int res = 0x3f3f3f3f;
	for (int t = 0; t < 1 << (n - 1); t ++ )
	{
		int cnt = 0, h = 1;
		bool flag = true;
		memset(g, 0, sizeof g);
		
		for (int i = 1; i <= n; i ++ )
		{
			for (int j = 1; j <= m; j ++ )
				if (s[i][j] == '1')
				{
					g[h][j] ++ ;
					if (g[h][j] > k)
					{
						flag = false;
						break;
					}
				}
			if ((t >> (i - 1)) & 1) cnt ++ , h ++ ;
		}
		
		if (!flag) continue;
		
		// cout << t << endl;
		// for (int i = 1; i <= h; i ++ )
		// {
			// for (int j = 1; j <= m; j ++ )
				// cout << g[i][j] << ' ';
			// puts("");
		// }
		
		for (int i = 1; i <= h; i ++ )
			for (int j = 1; j <= m; j ++ )
				g[i][j] += g[i][j - 1];
		
		for (int i = 1; i <= m; i ++ )
		{
			int j = i;
			while (j <= m && check(h, i, j)) j ++ ;
			
			if (j <= m) cnt ++ ;
			i = j - 1;
		}
		// cout << cnt << endl;
		res = min(res, cnt);
	}
	
	cout << res << endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc=new Scanner(System.in);
        String s=sc.next().replace("BC","a");
        String[] s2=s.split("",0);
        long count=0;
        int as=0;
        for(int i=s2.length-1;i>=0;i--){
            if(s2[i].equals("a")){
                as++;
            }
            else if(s2[i].equals("A")){
                
                count+=as;
            }
            else{
                as=0;
            }
        }
        System.out.println(count);
    }
}


Measured memory_bytes: 53044
#include <climits>
#include <iostream>
#include <algorithm>
#include <stack>
#include <vector>
#include <math.h>
#include <map>

using namespace std;

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

	int res = 0;

	for (int i = 0; i < n; i++) {
		int temp;
		cin >> temp;
		if (temp >= k) res++;
	}

	cout << res << endl;
}


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

using namespace std;

int main() {
  int n;
  scanf("%d", &n);
  long long l = 1, r = 1e6;
  while (l < r) {
    long long mid = (l + r) >> 1;
    if (mid * (mid + 1) / 2 < n) {
      l = mid + 1;
    } else {
      r = mid;
    }
  }
  cout << l << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define LL long long
const int N = 200000;
int n, m; LL k;
double xi[N], dx[N];
struct perm {int d[N]; perm () {memset(d, 0, sizeof d);}} P;
perm operator * (perm a, perm b)
{
    perm c;
    for (int i = 1; i < n; ++ i) c.d[i] = a.d[b.d[i]];
    return c;
}
perm operator ^ (perm a, LL b)
{
    perm c;
    for (int i = 1; i < n; ++ i) c.d[i] = i;
    for (; b; b >>= 1, a = a * a)
        if (b & 1) c = c * a;
    return c;
}
int main()
{
    scanf("%d", &n);
    for (int i = 1; i <= n; ++ i) scanf("%lf", &xi[i]);
    for (int i = n; i > 1; -- i) dx[i - 1] = xi[i] - xi[i - 1];
    for (int i = 1; i < n; ++ i) P.d[i] = i;
    scanf("%d%lld", &m, &k);
    for (int i = 1; i <= m; ++ i)
    {
        int x;
        scanf("%d", &x);
        swap(P.d[x - 1], P.d[x]);
    }
    P = P ^ k;
    for (int i = 1; i < n; ++ i) xi[i + 1] = xi[i] + dx[P.d[i]];
    for (int i = 1; i <= n; ++ i) printf("%.1lf\n", xi[i]);
}


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

const long long MOD = 1e9 + 7;

int main() {
    long long n, k;
    cin >> n >> k;
    vector<int> a(n);
    for (int i = 0; i < n; i++) cin >> a[i];
    
    long long cnt1 = 0;
    //１つ目
    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            if (a[i] > a[j]) cnt1++;
        }
    }
    //2つめ以降
    long long cnt2 = 0;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            if (a[i] > a[j]) cnt2++;
        }
    }

    long long ans = 0;
    ans = (cnt1 * k % MOD + k * (k - 1) / 2 % MOD * cnt2 % MOD) % MOD;

    cout << ans << endl;

    //cout << cnt1 << " " << cnt2 << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<stdio.h>
#include <cstdio>
#include <algorithm>
#define ll long long
using namespace std;
const int maxn=2e5+500;
const int inf=0x3f3f3f3f;
const int p=1e9+7;
int n;
//int a[maxn],b[maxn];
int a,b;
int da[maxn],db[maxn];
vector<int>v[maxn];
void dfs1(int s,int cnt){
    for(int i:v[s]){
        if(da[i])continue;
        da[s]=cnt+1;
        dfs1(i,cnt+1);
        da[s]=0;
    }
    da[s]=cnt;
}
void dfs2(int s,int cnt){
    for(int i:v[s]){
        if(db[i])continue;
        db[s]=cnt+1;
        dfs2(i,cnt+1);
        db[s]=0;
    }
    db[s]=cnt;
}
int main()
{
    ios_base::sync_with_stdio(false);cin.tie(0);
    cin>>n>>a>>b;
    for(int x,y,i=1;i<n;i++){
        cin>>x>>y;
        v[x].push_back(y);
        v[y].push_back(x);
    }
    dfs1(a,0);
    dfs2(b,0);
    int ans=0;
    vector <int>tmp;
    for(int i=1;i<=n;i++){
        if(da[i]<db[i]){
            ans=max(ans,db[i]-1);
        }
    }
    cout<<ans<<endl;
    return 0;

}



Measured memory_bytes: 13440
#include <iostream>
#include <algorithm>

using namespace std;

const long MOD = 1000000007;
typedef pair<int, int> P;
typedef long long ll;

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

    int a[n];
    for(int i=0; i<n; i++){
        cin >> a[i];
    }
    sort(a, a+n);
    P l[n-1];
    for(int i=0; i<n-1; i++){
        int t = a[i];
        if(a[i] > a[n-1]/2) t = a[n-1] - a[i];
        l[i] = P(t, a[i]);
    }
    sort(l, l+n-1);

    cout << a[n-1] << " " << l[n-2].second << endl;

    return 0;
}


Measured memory_bytes: 1408
#include<iostream>
#include<sstream>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<complex>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cassert>

#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define mp make_pair
#define pb push_back
#define each(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define dbg(x) cerr<<__LINE__<<": "<<#x<<" = "<<(x)<<endl

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
const int inf = (int)1e9;
const double INF = 1e12, EPS = 1e-9;

int main(){
	int cs;
	scanf("%d", &cs);
	while(cs--){
		unsigned int d[9], k = 0;
		rep(i, 9) scanf("%x", d + i);
		rep(i, 32){
			unsigned int s = 0;
			rep(j, 8) s += (d[j] ^ k) & (1ll << i + 1) - 1;
			if((s & (1ll << i + 1) - 1) != ((d[8] ^ k) & (1ll << i + 1) - 1)) k ^= 1ll << i;
		}
		printf("%x\n", k);
	}
	return 0;
}

Measured memory_bytes: 1196
#import <Foundation/Foundation.h>
#import <stdio.h>
#define $(...)  ([NSSet setWithArray: @[__VA_ARGS__]])
int main(){
  @autoreleasepool{
  char a,b,c;
  scanf("%c%c%c",&a,&b,&c);
  printf([$(@(a),@(b),@(c)) isEqualToSet:$(@('a'),@('b'),@('c')) ]?"Yes":"No");
  }
  return 0;
}


Measured memory_bytes: 9380
#include <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <string>
#include <cstring>

#define sz(v) ((int)((v).size()))
#define all(v) (v).begin(), (v).end()

using namespace std;

typedef long long ll;
typedef pair<int,int> pii;

const int INF = 0x3c3c3c3c;
const ll LINF = 1ll*INF*INF*2;

const int MAX_N = 1000001;
int n;

vector<int> v;

int main(void) {
	scanf("%d", &n);n--;
	if(n==1) {
		printf("2 2\n1 2 0\n1 2 1");
		return 0;
	}

	int t = n;
	int dig=0;
	int cnt=0;
	while(t) {
		if(t&1) {
			cnt++;
			v.push_back(dig);
		}
		dig++;
		t>>=1;
	}
	printf("%d %d\n", dig, 2*dig+cnt-2);
	for(int i=1; i<dig; i++) printf("%d %d %d\n%d %d %d\n", i, i+1, 0, i, i+1, 1<<(i-1));

	int cur=0;
	for(int i=sz(v)-1; i>0; i--) {
		cur+=(1<<v[i]);
		printf("%d %d %d\n", v[i-1]+1, dig, cur);
	}
	printf("%d %d %d\n", 1, dig, n);
}


Measured memory_bytes: 256
#include <iostream>
#define rep(i, n) for (int i=0; i<n; i++)
using namespace std;
int main(void){
    int N, X, Y, j, d, x, y;
    cin >> N >> X >> Y;
    x = X - 1;
    y = Y - 1;
    int k[N];
    rep(i, N)k[i]=0;
    rep(i, N){
        for (j=i+1; j<N; j++){
            if (i <= y && j <= x) d = j - i;
            else if (i <= x && j>x && j<= y) d = min(j-i, x+y-i-j+1);
            else if (i <= x && j > y) d = x-y-i+j+1;
            else if (i>x && i<= y && j>x && j<=y) d = min(j-i, y-x+i-j+1);
            else if (i>x && i<=y && j>y) d = min(j-i, i+j-x-y+1);
            else if (i>y && j>y) d = j -i;
            k[d]++;
        }

    }
    for (int i=1; i<N; i++) cout << k[i] << endl;
    return 0;
}


Measured memory_bytes: 256
/*
*   Author : Ligyagami // Tushar Goyal
*/

#include <bits/stdc++.h>

using namespace std;

#define en '\n'
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define ll long long

void solve()
{
    ll n;
    ll m;
    cin>>n>>m;

    ll Sum = 0ll;
    for(int i=0;i<m;i++)
    {
        ll temp;
        cin>>temp;

        Sum += temp;
    }

    if(Sum > n)
        cout<<-1;
    else
        cout<<n - Sum;

        return ;
}

int main()
{
   fast;

   int T;
   T = 1;

   while(T--)
    {
      solve();
    }

   return 0;

}


Measured memory_bytes: 3604
n,m=map(int,input().split())
anslis=set()
plis=[0]*n
acount=0
pcount=0
for i in range(m):
	p,s=map(str,input().split())
	if int(p) not in anslis:
		if s=="WA":
			plis[int(p)-1]+=1
		elif s=="AC":
			anslis.add(int(p))
			acount+=1
			pcount+=plis[int(p)-1]
print(acount,pcount)

Measured memory_bytes: 12772
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<iostream>
using namespace std;

int main()
{
	char s[105], t[105];
	while(cin>>s>>t)	{
		int ls = strlen(s);
		int lt = strlen(t);
		sort(s, s + ls);
		sort(t, t + lt);
		if(s[0] < t[lt - 1])
			printf("Yes\n");
		else {
			int flag = 1;
			for(int i=0; i<ls; i++)
				for(int j=0; j<lt; j++)
					if(s[i] != t[j])
						flag = 0;
			if(flag == 1 && ls<lt)
				printf("Yes\n");
			else
				printf("No\n");
		}
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(false), cin.tie(NULL)
#define int long long
#define ld long double
#define sb __builtin_popcount
#define vi vector<int>
#define vc vector<char>
#define ii pair<int, int>
#define pq priority_queue<ii, vector<ii>, greater<ii>>
#define vii vector<ii>
#define sz(a) int((a).size())
#define for0(i, n) for (int i = 0; i < n; i++)
#define for1(i, n) for (int i = 1; i <=n; i++)
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rloop(i,a,b) for(int i=a;i>=b;i--)
#define in(a, b) (b.find(a) != string::npos)
#define minin(a) *min_element(all(a))
#define maxin(a) *max_element(all(a))
#define X first
#define Y second
#define fill(a, x) memset(a, x, sizeof(a))
#define pb push_back
#define pf push_front
#define all(v) v.begin(), v.end()
#define rall(v) reverse(v.begin(), v.end())
#define el "\n"
#define mx3(a, b, c) max(max(a, b), c)
#define mn3(a, b, c) min(min(a, b), c)
#define S(v) accumulate(all(v), (ll)0)
#define SP(n) cout.precision(n)
#define PI = atan(1.0) * 4.0;
#define MOD = 1e9 + 7;
void start() {
    fio;
    SP(10);
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
}

int32_t main() {
    start();
    int n;
    cin >> n;
    map<string, int> mp;
    string s;
    for (int i = 0; i < n; i++) {
        cin >> s;
        mp[s]++;
    }
    cout << "AC " << "x " << mp["AC"] << el;
    cout << "WA " << "x " << mp["WA"] << el;
    cout << "TLE " << "x " << mp["TLE"] << el;
    cout << "RE " << "x " << mp["RE"] << el;
    return 0;
}


Measured memory_bytes: 3664
#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;
 
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
#define endl '\n'

void solvetask(){
    long long n,x,m; cin >> n >> x >> m;
    map<long long, long long> pos;
    pos[x] = 1;
    vector<long long> a = {0, x};
    long long ans = x;
    for (long long i=2; i<=n; i++){
        x = x * x % m;
        if (pos[x]){
            long long remain = n - i, sum = 0;
            for (long long j=pos[x]; j < i; j++) sum += a[j];
            sum *= (n - i + 1) / (i - pos[x]);
            for (long long j=0; j < (n - i + 1) % (i - pos[x]); j++) sum += a[j + pos[x]];
            ans += sum;
            break;
        }
        ans += x;
        a.push_back(x);
        pos[x] = i;
    }
    cout << ans << endl;
}
 
int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int t=1; //cin >> t;
    while(t--) solvetask();
}

Measured memory_bytes: 6724
S = list(input())
ans_list = []
for i in S:
  if i == "0":
    ans_list.append("0")
  elif i == "1":
    ans_list.append("1")
  else:
    if len(ans_list) != 0:
      del ans_list[-1]
ans = "".join(ans_list)    
print(ans)

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

using namespace std;

#define all(v)				((v).begin()), ((v).end())
#define allr(v)				((v).rbegin()), ((v).rend())
#define sz(v)				((int)((v).size()))
#define rep(i, v)		for(int i=0;i<sz(v);++i)
#define lp(i, n)		for(int i=0;i<(int)(n);++i)
#define lpi(i, j, n)	for(int i=(j);i<(int)(n);++i)
#define lpd(i, j, n)	for(int i=(j);i>=(int)(n);--i)
#define ll long long
#define pb					push_back
#define fIO ios_base::sync_with_stdio(0);cin.tie(0);

const ll oo = 1e8;
const double pi = 3.1415926535897;


const double EPS = (1e-7);
int dcmp(double x, double y) {	return fabs(x-y) <= EPS ? 0 : x < y ? -1 : 1;	}


typedef vector<int>                vi;
typedef vector<pair<int,int>>      vii;
typedef vector<ll>                 vll;
typedef vector<double>             vd;
typedef vector< vi >               vvi;
typedef vector< vd >               vvd;
typedef vector<string>             vs;
typedef pair<int, int>             pii;

/**
    * PLEASEEE READDD PROBLEEEM CARFULLY ****
    * Always check for OVERFLOW ll vs int
    * Always check for array bounds
    * Check for function return
    * READ OUTPUT SECTION AGAIN!!!
**/

struct edge{
    int from, to, w;

    edge(){}
    edge(int x, int y, int we): from(x), to(y), w(we){}

    bool operator < (const edge &rhs) const{
        return w > rhs.w;
    }

};

int main(){
    fIO

    int n;
    cin >> n;

    map<string, int> mp;
    while(n--) {
        string s;
        cin >> s;

        mp[s]++;
    }

    int cnt = 0;
    vs ans;
    for(auto it : mp) {
        if(it.second > cnt) {
            cnt = it.second;
            ans.clear();
            ans.pb(it.first);
        }else if(it.second == cnt) {
            ans.pb(it.first);
        }
    }
    for(auto el : ans) cout << el << "\n";

}










Measured memory_bytes: 25584
#include <iostream>
#include <cmath>
using namespace std;
#define rep(i,x) for(int i = 0; i < (x); ++(i))
int main() {
	int n;
	cin >> n;
	while(n--) {
		double x[4], y[4];
		double EPS = 1e-10;
		rep(i,4) {
			cin >> x[i] >> y[i];
		}
		if(abs((x[1] - x[0]) * (y[3] - y[2]) - (x[3] - x[2]) * (y[1] - y[0])) > EPS) {
			cout << "NO" << endl;
		} else cout << "YES" << endl;
	}
	return 0;
}

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

void solve()
{
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i, n - 1)
    {
        int x;
        cin >> x;
        x--;
        a[x]++;
    }
    rep(i, n) cout << a[i] << endl;
}

int main()
{
    // srand((unsigned)time(NULL));
    // int t = clock();
    solve();
    // double et = 1.0 * (clock() - t) / CLOCKS_PER_SEC;
    // printf("Execution Time: %.4lf sec\n", et);
    return 0;
}

Measured memory_bytes: 4032
//bcw0x1bd2 {{{
#include<bits/stdc++.h>
#include<unistd.h>
using namespace std;
#define F first
#define S second
#define MP make_pair
#define PB push_back
#define IOS ios_base::sync_with_stdio(0); cin.tie(0);
#define SZ(x) ((int)((x).size()))
#define ALL(x) begin(x),end(x)
#define REP(i,x) for (int i=0; i<(x); i++)
#define REP1(i,a,b) for (int i=(a); i<=(b); i++)

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

#ifdef DARKHH
#define FILEIO(name)
#else
#define FILEIO(name) \
  freopen(name".in", "r", stdin); \
  freopen(name".out", "w", stdout);
#endif

#ifdef DARKHH
template<typename T>
void _dump( const char* s, T&& head ) { cerr<<s<<"="<<head<<endl; }

template<typename T, typename... Args>
void _dump( const char* s, T&& head, Args&&... tail ) {
  int c=0;
  while ( *s!=',' || c!=0 ) {
    if ( *s=='(' || *s=='[' || *s=='{' ) c++;
    if ( *s==')' || *s==']' || *s=='}' ) c--;
    cerr<<*s++;
  }
  cerr<<"="<<head<<", ";
  _dump(s+1,tail...);
}

#define dump(...) do { \
  fprintf(stderr, "%s:%d - ", __PRETTY_FUNCTION__, __LINE__); \
  _dump(#__VA_ARGS__, __VA_ARGS__); \
} while (0)

template<typename Iter>
ostream& _out( ostream &s, Iter b, Iter e ) {
  s<<"[";
  for ( auto it=b; it!=e; it++ ) s<<(it==b?"":" ")<<*it;
  s<<"]";
  return s;
}

template<typename A, typename B>
ostream& operator <<( ostream &s, const pair<A,B> &p ) { return s<<"("<<p.first<<","<<p.second<<")"; }
template<typename T>
ostream& operator <<( ostream &s, const vector<T> &c ) { return _out(s,ALL(c)); }
template<typename T, size_t N>
ostream& operator <<( ostream &s, const array<T,N> &c ) { return _out(s,ALL(c)); }
template<typename T>
ostream& operator <<( ostream &s, const set<T> &c ) { return _out(s,ALL(c)); }
template<typename A, typename B>
ostream& operator <<( ostream &s, const map<A,B> &c ) { return _out(s,ALL(c)); }
#else
#define dump(...)
#endif
// }}}
// Let's Fight! ~OAO~~

#define int long long
int ip[3];

int32_t main() {
  IOS;
  REP(i,3) cin >> ip[i];
  sort(ip,ip+3);
  int ans = 1LL<<62;
  do {
    if (ip[0] & 1) ans = min(ans, ip[1]*ip[2]);
    else ans = 0;
  } while (next_permutation(ip,ip+3));

  cout << ans << endl;

  return 0;
}



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

a=[[0 for i in range(n)]for j in range(n)]

for i in range(n):
    p=[int(x) for x in input().split()]
    for j in range(n):
        if j+1 in p[2:]:
            a[i][j]=1
"""for i in range(n):
    for j in range(n):
        print(a[i][j],"",end="")
    print("")
"""
for i in range(n):
    print(*a[i])


Measured memory_bytes: 6392
#include <stdio.h>
#include <assert.h>
#include <fstream>
#include <iostream>
#include <algorithm>
#include <array>
#include <vector>
#include <queue>
#include <set>
#include <cmath>
#include <unordered_map>
//#include <unordered_set>
//#include <boost/container/static_vector.hpp>
//#include <boost/unordered_set.hpp>
//#include <boost/unordered_map.hpp>
//#include <unistd.h>

const int MAX_N = 200050;
const long long MAX_VAL = (long long)100000000000;
int N;
long long A[MAX_N], B[MAX_N];

int main(int argc, char **argv) {
    std::cin >> N;
    for (int i = 1; i <= N; i++) {
        std::cin >> A[i] >> B[i];
    }


    long long total = 0;
    long long minb = MAX_VAL;
    for (int i = 1; i <= N; i++) {
        total += A[i];
        if (B[i] < A[i]) {
            minb = std::min(minb, B[i]);
        }
    }

    if (minb == MAX_VAL) {
        std::cout << 0 << std::endl;
    } else {
        std::cout << total - minb << std::endl;
    }

    return 0;
}

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

int main(){
	string S;
    string T;
    int count = 0;
    int ans = 0;
    cin >> S >> T;
    
	count = S.length();
  
    for(int i = 0;i < count;i++){
    	if(S[i] != T[i]){
        	ans++;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3928
package main

import (
  "bufio"
  "fmt"
  "math"
  "os"
  "strconv"
)

var count int = 0

func insertionSort(a []int, n, g int) {
  for i := g; i < n; i++ {
    v := a[i]
    j := i - g
    for j >= 0 && a[j] > v {
      a[j+g] = a[j]
      j = j - g
      count++
    }
    a[j+g] = v
  }
}

func shellSort(a []int, n int) {
  var g []int

  m := 1
  l := 1
  for m <= n {
    g = append([]int{m}, g...)
    m = m + int(math.Pow(3.0, float64(l)))
    l++
  }

  fmt.Println(len(g))

  for i, m := range g {
    if i != 0 {
      fmt.Print(" ")
    }
    fmt.Print(m)
  }
  fmt.Println()

  for _, m := range g {
    insertionSort(a, n, m)
  }

  fmt.Println(count)

  for i := 0; i < n; i++ {
    fmt.Println(a[i])
  }
}

func main() {
  sc := bufio.NewScanner(os.Stdin)
  sc.Scan()

  n, _ := strconv.Atoi(sc.Text())

  a := make([]int, n)
  for i := 0; i < n; i++ {
    sc.Scan()
    a[i], _ = strconv.Atoi(sc.Text())
  }

  shellSort(a, n)
}


Measured memory_bytes: 17428
package main

import "fmt"

func main() {
	var H, W, ans int
	fmt.Scan(&H, &W)
	if H == 1 || W == 1 {
		ans = 1
	} else if H%2 == 0 || W%2 == 0 {
		ans = H * W / 2
	} else {
		ans = ((H + 1) / 2 * ((W + 1) / 2)) + (H/2)*(W/2)
	}
	fmt.Println(ans)
}


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

void solve() {
    string s;
    cin >> s;
    int sum = 0;
    for (auto &x : s) sum += (x - '0');
    (sum % 9 == 0) ? cout << "Yes\n" : cout << "No\n";
}

int32_t main() {
    solve();
}

Measured memory_bytes: 3692
#include<cstdio>
#define MAX(x,y) ((x>y)? x:y)

int date[100]={0};

int main()
{
	int n;
	while(scanf("%d",&n)!=EOF)
	{
		if(n==-1)break;
		date[n-1]++;
	}
	int max=0;
	for(int i=0;i<100;i++)
	{
		max=MAX(max,date[i]);
	}
	for(int i=0;i<100;i++)
	{
		if(max==date[i])printf("%d\n",i+1);
	}
	return 0;
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
#define mod 1000000007
using namespace std;

signed main(void)
{
	string s;
    cin>>s;

    int c = 0;
    for(int i =0;i<6;i++)
    {
    	for(int j =i+1;j<6;j++)
    	{
             if(s[i]==s[j])
             	c++;
    	}
    }

    if(s[2]==s[3] && s[4]==s[5])
    	cout<<"Yes"<<endl;
    else
    	cout<<"No"<<endl;

}	


Measured memory_bytes: 256
// g++ -std=c++11 a.cpp
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<unordered_map>
#include<utility>
#include<cmath>
#include<random>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(int i=a;i<b;i++)
#define rep(i,a) loop(i,0,a)
#define FOR(i,a) for(auto i:a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define show1d(v) {rep(_,v.size())cout<<" "<<v[_];puts("");}
#define show2d(v) {rep(__,v.size())show1d(v[__]);}
using namespace std;
//kaewasuretyuui
typedef long long ll;
// #define int ll
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
#define mt make_tuple
typedef tuple<int,int,int,int> tp;
typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
//template<class C>constexpr int size(const C &c){return (int)c.size();}
//template<class T,size_t N> constexpr int size(const T (&xs)[N])noexcept{return (int)N;}
const double PI=acos(-1);
const double EPS=1e-9;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9+10;
// int dx[]={0,1,0,-1};
// int dy[]={1,0,-1,0};//RDLU
#define yes puts("YES")
#define no puts("NO")

struct edge{int to,cap,rev;};//ikisaki youryou gyakuhen
class MF{//max flow
	public:
	int n;
	vector<vector<edge> >G;//[MAX];
	vector<bool>used;//[MAX];
	MF(int size){
		n=size;
		G=vector<vector<edge> >(n);
	}
	void add_edge(int from, int to, int cap){
		edge q={to,cap,int(G[to].size())};
		G[from].push_back(q);
		q={from,0,int(G[from].size()-1)};
		G[to].push_back(q);
	}
	int dfs(int v,int t, int f) {
		if(v==t)return f;
		used[v]=1;
		for(int i=0;i<G[v].size();i++){
			edge &e=G[v][i];
			if(used[e.to]||e.cap<=0) continue;
			int d =dfs(e.to,t,min(f,e.cap));
			if(d>0){
				e.cap-=d;
				G[e.to][e.rev].cap+=d;
				return d;
			}
		}
		return 0;
	}
	int mf(int s,int t) {//from s to t,ford_fulkerson
		int flow=0,f;
		while(1){
			used=vector<bool>(n,false);
			f=dfs(s,t,inf);
			if(f==0)return flow;
			flow+=f;
		}
	}
};
signed main(){
	ios::sync_with_stdio(false);
	cin.tie(0);

	int n;
	string s;
	cin>>n>>s;
	int a=0,b=0;
	rep(i,n)if(s[i]=='R')a++;
	else b++;
	if(a>b)cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
}


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

int main(){
  int x,y;
  cin >> x >> y;

  int ans = y - 2 * x;
  if(ans % 2 == 0 && ans/2 >= 0 && ans/2 <= x){
    cout << "Yes" << endl;
  }else cout << "No" << endl;

  return 0;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define endl "\n"
#define se second
#define ll long long
//priority_queue<int, vector<int>, greater<int> > pq;
const int N = 300030;
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
const ll mod =    1e9+7;
int main()
{
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

int n;
cin>>n;
int x=0;
int y=n-1;
int arr[n];
rep(i,0,n)
cin>>arr[i];
for(int i=0;i<n;i++)
{
	if(arr[i]>arr[x])
	x=i;
}

if(x!=0)
y=0;
else
y=1;
for(int i=0;i<n;i++)
{
	if(arr[i]>arr[y]&&i!=x)
	y=i;
}
//cout<<y<<endl;
for(int i=0;i<n;i++)
{
	if(i!=x)
	cout<<arr[x]<<endl;
	else
	cout<<arr[y]<<endl;
}



}







Measured memory_bytes: 2432