akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<ll> vll;
typedef vector<vector<ll>> vvll;
typedef vector<vector<vector<ll>>> vvvll;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
typedef vector<vector<vector<bool>>> vvvb;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<vpll> vvpll;
typedef vector<double> vd;
typedef vector<vd> vdd;

typedef pair<double, double> pd;
typedef vector<pd> vpd;


#define FOR(i,x,y) for(ll i=(ll)x; i<(ll)y; ++i)
#define REP(i,y) FOR(i, 0, y)
#define RFOR(i,x,y) for(ll i=(ll)x; i>=(ll)y; --i)
#define RREP(i,x) RFOR(i, x, 0)
#define ALL(a) a.begin(), a.end()
#define pb push_back
#define debug_print(x...) cerr << "line " << __LINE__ << " : "; debug_print_in(x);

template <typename First>
void debug_print_in(First first){
  cerr << first << endl;
  return;
}

template <typename First, typename... Rest>
void debug_print_in(First first, Rest... rest){
  cerr << first << " ";
  debug_print_in(rest...);
  return;
}

void IN(void){
  return;
}

template <typename First, typename... Rest>
void IN(First& first, Rest&... rest){
  cin >> first;
  IN(rest...);
  return;
}

template <typename First>
void OUT(First first){
  cout << first << endl;
  return;
}

template <typename First, typename... Rest>
void OUT(First first, Rest... rest){
  cout << first << " ";
  OUT(rest...);
  return;
}

template<class t, class u> t chmax(t&a,u b){if(a<b)a=b; return a;};
template<class t, class u> t chmin(t&a,u b){if(a>b)a=b; return a;};
int popcount(int t){return __builtin_popcount(t);} //GCC
int popcount(ll t){return __builtin_popcountll(t);} //GCC

template <typename T>
void vec_print(vector<T> VEC){
  REP(i, VEC.size()){
    cerr << VEC[i] << " ";
  }
  cerr << endl;
};

template <typename T>
void mat_print(vector<vector<T> > MAT){
  REP(i,MAT.size()){
    REP(j,MAT[i].size()){
      cerr << MAT[i][j] << " ";
    }
    cerr << endl;
  }
};

constexpr int INF = (1<<30);
constexpr ll INFLL = 1LL<<62;
constexpr long double EPS = 1e-12;
constexpr ll MOD = (ll)((1E+9)+7);

int main(){
  cin.tie(0); // cut the cin and cout (default, std::flush is performed after std::cin)
  ios::sync_with_stdio(false); // cut the iostream and stdio (DON'T endl; BUT "\n";)

  ll N;
  IN(N);
  vll S(1<<N);
  REP(i,1<<N) IN(S[i]);
  sort(ALL(S));
  reverse(ALL(S));

  vb flags(1<<N, false);
  flags[0] = true;

  priority_queue<ll> que;

  REP(i,N){
    /*
    RREP(j,(1<<N)-1){
      if(!flags[j]) continue;
      FOR(k,j+1,1<<N){
        if(!flags[k] && S[k]<S[j]){
          flags[k]=true;
          break;
        }
      }
    }
    */
    REP(j,1<<N){
      if(!flags[j]){
        if(que.empty()) continue;
        if(que.top()>S[j]){
          flags[j] = true;
          que.pop();
        }
      }else{
        que.push(S[j]);
      }
    }
    //vec_print(flags);
  }

  REP(i,1<<N){
    if(!flags[i]){
      OUT("No");
      return 0;
    }
  }

  OUT("Yes");

  return 0;
}


Measured memory_bytes: 3448
#include <bits/stdc++.h>
#define N (long long)(1e9 + 7)
#define MAX 500000
using namespace std;

long long factorial[MAX] = {0}, finverse[MAX] = {0},
          inverse[MAX] = {0};

void smodfact() {
  factorial[0] = factorial[1] = 1;
  finverse[0] = finverse[1] = 1;
  inverse[1] = 1;
  for(int i = 2; i < MAX; ++i) {
    factorial[i] = factorial[i - 1] * i % N;
    inverse[i] = N - (inverse[N % i] * (N / i)) % N;
    finverse[i] = finverse[i - 1] * inverse[i] % N;
  }
}

long long calccomb(long long n, long long k) {
  if(n == k && n == 0) return 1;
  if(n < 0 || k < 0 || n < k) return 0;
  return factorial[n] * finverse[k] % N * finverse[n - k] %
         N;
}

long long n, m, k;
vector<vector<long long>> dp;

long long solve();

int main() {
  smodfact();
  cin >> m >> n >> k;
  dp.resize(m);
  for(int i = 0; i < m; ++i) dp[i].assign(n, 0);
  cout << solve() << endl;
  return 0;
}

long long solve() {
  long long ans = 0;
  for(long long i = 0; i < m; ++i)
    for(long long j = 0; j < n; ++j) {
      ans += ((i + 1) * i / 2 % N * (2 * j + 1) % N +
              (j + 1) * j / 2 % N * (2 * i + 1) % N) %
             N;
      ans %= N;
    }
  while(ans < 0) ans += N;
  ans %= N;
  return ans * calccomb((n * m - 2), k - 2) % N;
}

Measured memory_bytes: 22912
N,T = map(int, input().split())

A = list(map(int, input().split()))

"""
先頭からAを見ていって、最小値を保存しておく。
例えば先頭から何番目かまで見ていって最小値が４の時、それ以降で最大利益が更新される場合、その組の最小値は４以下。
例えば（4,10）とかだった最大利益の組が、（４，１１）とか（３，１０）とかにかわる（Aに重複がないから）。
ので、最小値と最大利益を覚えておいて、最大利益が同じになる組をかぞえる。
最大利益が更新されたら組の数を１にする
最後に組の数を出力
"""
max_income = 0
min_num = A[0]
comb = 0

for n in A[1:]:
    # 最小値が更新される場合
    if n < min_num:
        min_num = n
    #最大利益が更新される場合
    # (4,9)が最大利益の時に10が出てくるとか
    elif n - min_num > max_income:
        max_income = n - min_num
        comb = 1
    #最大利益が同じ組が見つかった場合
    #(4,9)が最大利益のときに、3->8とか出てくるなど。
    #(5以上,x)で最大利益の組がみつかることはない（４との組で最大利益が更新されるから）
    elif n - min_num == max_income:
        comb += 1

print(comb)

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

int main(){
  int N;
  cin >> N;
  vector<int> A(N);
  vector<int> pos(N);
  rep(i,N){
    cin >> A[i];
    A[i]--;
    pos[A[i]] = i;
  }
  // for(int i=0; i<N; i++){
  //   cout << i << " " << pos[i] << endl;
  // }
  int mx = 0;
  int cnt = 1;
  rep(i,N-1){
    if(pos[i] < pos[i+1]){
      cnt++;
    }else{
      chmax(mx,cnt);
      cnt = 1;
    }
  }
  chmax(mx,cnt);
  cout << N-mx << endl;
  return 0;
}

Measured memory_bytes: 1792
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#define FOR(i, i0, n) for(int i = (i0); i < (n); i ++)
#define COUT(val) cout << (val) << "\n";
using namespace std;
using ll = long long int;
const int MOD = 1000000007;

int main(void){
    int h, w;
    cin >> h >> w;
    vector<vector<bool>> a(h, vector<bool>(w));
    FOR(i, 0, h) FOR(j, 0, w){
        char c; cin >> c; if(c == '#') a[i][j] = true;
    }
    vector<vector<int>> dp(h, vector<int>(w));
    dp[0][0] = 1;
    FOR(i, 0, h) FOR(j, 0, w){
        if(a[i][j]) continue;
        if(i > 0) dp[i][j] += dp[i-1][j];
        if(j > 0) dp[i][j] += dp[i][j-1];
        dp[i][j] %= MOD;
    }
    
    COUT(dp[h-1][w-1]);
}


Measured memory_bytes: 4352
#include"bits/stdc++.h"
using namespace std;
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
const long long mod = 1000000007;
const long long inf = 1ll << 61;
typedef pair<int, int> P;
typedef pair<int,P> PP;
typedef pair<int,PP> PPP;
struct edge { int to;  int cost; };

int DP[200][4][4][4];

void f(int i, int a, int b, int c, int cpr){
	rep(p, 4){
		if(p != cpr) {
			DP[i+1][b][c][p] += 
			DP[i][a][b][c];
			DP[i][b][c][p] %= 1000000007;
		}
	}
}

signed main() {
	int N;
	cin >> N;

	DP[0][0][0][0] = 1;

	int ans = 0;

	rep(i, N + 1){
		rep(a, 4){
			rep(b, 4){
				rep(c, 4){
					if(!DP[i][a][b][c]){
						continue;
					}
					if(i==N){
						ans += DP[i][a][b][c];
						ans %= 1000000007;
						continue;
					}
					if(b==3&&c==1){
						f(i,a,b,c,2);
					}
					else if(a==3&&c==1){
						f(i,a,b,c,2);
					}
					else if(b==1&&c==3){
						f(i,a,b,c,2);
					}
					else if(b==3&&c==2){
						f(i,a,b,c,1);
					}
					else if(a==3&&b==1){
						f(i,a,b,c,2);
					}
					else f(i,a,b,c,-1);
				}
			}
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <cmath>
#include <iomanip>
#include <map>

using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;

// #define rep(i,n) for(int i=0;i<(n);++i)
#define all(f,c,...) (([&](decltype((c)) cccc) { return (f)(begin(cccc), end(cccc), ## __VA_ARGS__); })(c))
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) for(int i=0;i<(n);++i)
#define repi(i,a,b) for(int i=(a);i<(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)

#define rrep(i,n) for(int i=(n);i>=0;--i)
const int dx[4]={1,0,-1,0}, dy[4]={0,1,0,-1};
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;}

// debug
template<class T>ostream& operator<<(ostream& os,const vector<T>& vec){os<<"{";for(int i=0;i<vec.size();++i)os<<(i?", ":"")<<vec[i];os<<"}";return os;}
template<class T1,class T2>ostream& operator<<(ostream& os,const pair<T1,T2>& rhs){os<<"("<<rhs.first<<", "<<rhs.second<<")";return os;}

#ifdef LOCAL
void debug() {cerr << "\n";}
template<class First> void debug(const First& first) {cerr<<first<<"\n";}
template<class First, class... Rest> void debug(const First& first, const Rest&... rest) {cerr<<first<<",";debug(rest...);}
#else
#define debug(...) 42
#endif


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

  vi A(N);
  map<int, ll> m;
  rep(i, N) {
    cin >> A[i];
    ++m[A[i]];
  }
  ll ans = 0;
  for (const auto& e : m) {
    ans += e.second * (e.second-1) / 2;
  }
  rep(i, N) {
    cout << ans - m[A[i]] * (m[A[i]]-1)/2 + (m[A[i]]-2) * (m[A[i]]-1)/2 << endl;
  }

  return 0;
}


Measured memory_bytes: 11264
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <utility>
#include <queue>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <climits>
using namespace std;

#define MOD1097 1000000007

#define ll long long
#define pint pair<int, int>
#define pll pair<ll, ll>
#define pb push_back
#define mpair make_pair
#define pm(first, second) pb(mpair(first, second))
#define fpf first.first
#define fps first.second
#define spf second.first
#define sps second.second

#define all(X) (X).begin(), (X).end()
#define rall(X) (X).rbegin(), (X).rend()
#define divcel(a, b) (((a) + ((b) - 1)) / (b))

int main(){

	string S, T;
	cin >> S >> T;
	int cnt = 0;
	for(int i = 0; i < S.size(); i++){
		if(S[i] != T[i])cnt++;
	}
	cout << cnt << endl;

	return 0;
}


Measured memory_bytes: 3896
#include <iostream>
#include<algorithm>
#include<string>
#include <cmath>
#include <vector>
#include <map>
#include <cstdio>
#pragma region Macros
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<=n;i++)
#define int long long
#define all(x) (x).begin(),(x).end()
#define swap(a,b) (a += b,b = a - b,a -= b)
int gcd(int a, int b) // assuming a,b >= 1
{
    if (a < b)
        swap(a, b);
    if (b == 0)
        return a;
    if (a % b == 0)
        return b;
    return gcd(b, a % b);
}
int lcm(int a, int b) // assuming a,b >= 1
{
    return  a * b / gcd(a, b);
}
using namespace std;
#pragma endregion
signed main() {
    int D;
    cin >> D;
    cout << "Christmas";
    rep(i, 25 - D)
        cout << " Eve";
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1e18;
const int inf = 1e9;
#define rep(i, a, b) for (int i = a; i < b; i++)
#define per(i, b, a) for (int i = a - 1; i >= b; i--)
#define int long long
using Graph = vector<vector<int>>;
using pint = pair<int, int>;
int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
int dxx[8] = {1, 1, 1, 0, 0, -1, -1, -1}, dyy[8] = {-1, 0, 1, -1, 1, -1, 0, 1};

signed main() {
    int h;
    cin >> h;
    int ans = 0, cnt = 1;
    while (h > 0) {
        h /= 2;
        ans += cnt;
        cnt *= 2;
    }
    cout << ans << "\n";
}


Measured memory_bytes: 3580
/*　　　　　　　{:i:i:|i:i:/l/l--　 　 　--l/li:i:i|i:i:i:i}
　　　　　　 　 {:rx|:i:i ィi芥ミ 　 　 .ィi芥ミｉ:ｉ|ﾍ:i:i:}
.　　　 　 　 　 ｛ﾏ|ｉ:  {::’:} 　 　 　{:‘::} :ｉ:i:|〉｝:/
　　 　 　 　 　 乂|:i:| ｀¨¨¨¨´ 　 　　｀¨¨¨´  :i:ｉ:|ｼ/
　 　 　 　 　 　 ﾉ:|:i|　　　　　　′　　　 　   |:i:i:|ﾂ
　　　　　　　　/:/|:i:| ､　　　 　_ _ 　　　　  |:i:i:|
　 　 　　 　 /:/ .|:i:|/ ＼　　　 　 　     ｨ〔|:i:/
　　 　 　  　 〈;/ く刈＿ 个 　   -   　＜}　./|/_〉
　　     　　 r-っ'~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ~ﾞ|___
　　 　     /／ニつ　　　　　　 ､　　　　　　　ノﾆﾆ　＼
.　　　     |　　ニ⊃ 　./　/　 ──   /　/　　..⊆ﾆﾆ　　:|
.　　　     |　　丁´　 /|￣|￣  ─‐ /|￣|￣ 　 .￣|丁 　|
.　　　     |　　ﾉ.  　 |￣|￣  ─‐  |￣|￣ 　 　.|八 　|
.　　　     |　　||. 　 |￣|￣ |￣| |￣|￣ 　   .|　|
.　 　 　   |  　||   　￣￣￣　￣ 　￣￣￣　　  .|　|  |
.　 　 　  　    ||＿＿＿＿＿＿＿＿＿＿＿＿______|__　　 ',
　 　      ,′　 | ７ﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆ}  ,′
.　　     {　　　|/　}ﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆﾆ{/ 　 　
*///讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐讐。
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <cmath>
#include <limits>

using namespace std;

#define rep(b) for(int i=0;i<int(b);i++)
#define ll long long
#define fst first
#define snd second
#define pf(b) printf("%.12f\n",(double)b)
#define _GLIBCXX_DEBUG
const double pai = 3.1415926535897;
#define _cos(n) cos(n*pai/180)
#define l_b lower_bound
#define u_b upper_bound
#define b_s binary_search

//factorial(練習)　階乗
int fact(int n) {
	int a = 1;
	for (int i = 1;i <= n;i++) a *= i;
	return a;
}
int sa(int n, int m) {      //差！
	if (n < m)return m - n;
	else return n - m;
}
int keta(int num) {
	int n = 0;
	if (num == 0) {
		return 1;
	}
	while (num != 0) {
		num /= 10;
		n++;
	}
	return n;
}
ll a, b, c, d, x, y,z,k;
signed main() {
	cin >> a >> b >> c >> d;
	x = a * d;
	y = b * c;
	z = a * c;
	k = b * d;

	cout << max(max(x, y),max(z,k)) << endl;
}

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

class bigdata
{
public:
  list < int >data;
  string to_str ()
  {
    string str (data.size (), '0');
    int i = 0;
    auto it = data.begin ();
    while (it != data.end ())
      {
	string buf = to_string (*it);
	  str[i] = buf[0];
	  it++;
	  i++;
      }
    return str;
  }
  bigdata & operator= (string str)
  {
    for (int i = 0; i < str.length (); i++)
      data.push_back (stoi (str.substr (i, 1)));
  }
  bigdata & operator+ (bigdata & obj)
  {
    if (this->data.size () < obj.data.size ())
      {
	int buf = obj.data.size () - this->data.size ();
	for (int i = 1; i <= buf; i++)
	  this->data.push_front (0);
      }
    if (this->data.size () > obj.data.size ())
      {
	int buf = this->data.size () - obj.data.size ();
	for (int i = 1; i <= buf; i++)
	  obj.data.push_front (0);
      }
    this->data.push_front (0);
    obj.data.push_front (0);

    auto it_a = this->data.begin ();
    auto it_b = obj.data.begin ();

    while (it_a != this->data.end ())
      {
	*it_a += *it_b;
	auto bufit = it_a;
	for (int i = 0; i < this->data.size () - 1; i++)
	  {
	    if (*bufit >= 10)
	      {
		bufit--;
		*bufit += 1;
		++bufit;
		*bufit -= 10;
		bufit--;
	      }
	  }
	it_a++;
	it_b++;
      }
    it_a = this->data.begin ();
    if (*it_a == 0)
      this->data.pop_front ();
    return *this;
  }
};

int
main ()
{
  string s1, s2;
  int loop;
  cin >> loop;
  while (loop-- > 0)
    {
      cin >> s1 >> s2;
      bigdata data1, data2;
      data1 = s1;
      data2 = s2;
      data1 = data1 + data2;
      if ((data1.to_str().length()) > 80)
	cout << "overflow" << endl;
      else
	cout << data1.to_str () << endl;
    }
}

Measured memory_bytes: 1300
N,K = map(int, input().split())

ans = 0
for b in range(K+1,N+1):
    p = (N+1) // b
    q = (N+1) % b
    
    ans += p*(b-K) + bool(q)*max(0,q-K)
    
if K==0:
    ans -= N
    
print(ans)

Measured memory_bytes: 3060
#include <cstdio>
#include <iostream>
#define MN 101000
#define mod 1000000007

int cnt[MN], a[MN];
int fac[MN], f[MN], inv[MN];

int A(int a, int b) {return 1ll * fac[a] * inv[a - b] % mod;}

int main()
{
	int n, m = 100000, x; scanf("%d%d", &n, &x);
	int Min = 1e9;
	for(int i = 1; i <= n; i++) scanf("%d", &a[i]), cnt[a[i]]++, Min = std::min(Min, a[i]);
	for(int i = 1; i <= m; i++) cnt[i] += cnt[i - 1];
	
	fac[0] = inv[0] = inv[1] = 1;
	for(int i = 1; i <= n; i++) fac[i] = 1ll * fac[i - 1] * i % mod;
	for(int i = 2; i <= n; i++) inv[i] = 1ll * (mod - mod / i) * inv[mod % i] % mod;
	for(int i = 1; i <= n; i++) inv[i] = 1ll * inv[i] * inv[i - 1] % mod;
	
	f[x] = A(n, cnt[m] - cnt[x]);
	for(int i = x; i >= 1; i--)
	{
		for(int j = 1; j <= n; j++)
		{
			if(a[j] > i) continue;
			int k = i % a[j];
			f[k] = (f[k] + 1ll * f[i] * A(cnt[i] - 1, cnt[i] - cnt[k] - 1)) % mod;
		}
	}
	int ans = 0;
	for(int i = 0; i < Min; i++) ans = (ans + 1ll * f[i] * i) % mod;
	printf("%d\n", ans);
}

Measured memory_bytes: 896
#include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define all(x) (x).begin(),(x).end()
#define INF 10000000
using ll = long long ;
ll gcd(ll a, ll b) {
  if(b == 0) return a;
  return gcd(b, a % b);
}
ll lcm(ll a,ll b){
    ll g = gcd(a,b);
    return a / g * b;
}
template< int id > struct CompTupleBy
{
  template<class T> 
  bool operator()( const T& a, const T& b ) const {
    return std::get<id>(a) < std::get<id>(b);
  }
};

using namespace std;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n,m;
    cin >> n >> m;
    vector<int> vec(n+1,0);
    rep(i,m){
        int a,b;
        cin >> a >> b;
        if (a==1){
            vec[b] += 1;
        }
        if (b==n){
            vec[a] += 1;
        }
    }
    rep(i,n+1){
        if (vec[i]>=2){
            cout << "POSSIBLE" << endl;
            return 0;
        }
    }
    cout << "IMPOSSIBLE" << endl;
    


        
}

Measured memory_bytes: 1024
e = false;
while (s = gets) && !e do
  array = s.split(" ");
  a = array[0].to_i;
  op = array[1];
  b = array[2].to_i;

  if op == "+" then
    puts (a + b).to_s;
  elsif op == "-" then
    puts (a - b).to_s;
  elsif op == "*" then
    puts (a * b).to_s;
  elsif op == "/" then
    puts (a / b).to_s;
  elsif op == "?" then
    e = true;
  end
end

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

struct edge{
    int from,to;
};

vector<edge> alledge;

vector<int> edges[50];

int main() {


    int n,m;

    cin >> n >> m;

    for(int i=0; i<m; i++){
        int a,b;
        cin >> a >> b;
        edge e;
        a--;b--;
        e.from = a;
        e.to = b;
        edges[a].push_back(b);
        edges[b].push_back(a);
        alledge.push_back(e);
    }

    int ans = 0;

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

        edge del = alledge[i];

        queue<int> q;

        q.push(alledge[i].from);

        bool check[50] ={false};

        check[alledge[i].from] = true;

        while(!q.empty()){

            int t = q.front();
            q.pop();

            for(int j=0; j<edges[t].size(); j++){
                if(!check[edges[t][j]] && !(edges[t][j] == alledge[i].to && t == alledge[i].from) && !(edges[t][j] == alledge[i].from && t == alledge[i].to) ){
                    check[edges[t][j]] = true;
                    q.push(edges[t][j]);
                }
            }

        }

        for(int j=0; j<n; j++){
            if(!check[j]){
                ans++;
                break;
            }
        }
    }

    cout << ans << endl;





    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <math.h>
#include <map>
#include <unordered_map>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define lper(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
#define pb(s) push_back(s)
#define ci(x) cin >>x
#define co(x) cout<<x<<endl
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9;
const ll INF=4e18;
const ll dy[4]={1,0,-1,0};
const ll dx[4]={0,-1,0,1};
template<class t,class u> void chmax(t&a,u b){if(a<b)a=b;}
template<class t,class u> void chmin(t&a,u b){if(b<a)a=b;}

long long fac(ll a) {
 long long ans=1;
 while(a>1){
 ans*=a;
 ans%=1000000007;
     a--;
    }
    return ans;
     }

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

	set<int> st;
	repl(i,1,n+1) 
	{
		cin >> x;
		if(st.count(x))
			st.erase(x);
		else
			st.insert(x);
	}

	cout << st.size() << endl;
	return 0;	
}


Measured memory_bytes: 4864
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<cmath>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<numeric>
#include<functional>
#include<algorithm>
#include<bitset>
#include<tuple>
#include<unordered_set>
#include<random>
#include<array>
#include<cassert>
using namespace std;
#define INF (1<<29)
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define uniq(v) v.erase(unique(all(v)),v.end())




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

	int n;
	string a, b, c;
	cin >> n >> a >> b >> c;

	int ans = 0;


	rep(i,n) {
		if (a[i] == b[i] && b[i]==c[i]) {

		}
		else if (a[i]!=b[i] && a[i] !=c[i] && b[i]!=c[i]) {
			ans += 2;
		}
		else {
			ans++;
		}
	}
	cout << ans << endl;


	return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<iostream>
#include<string>
#include<vector>
#include<stack>
#include<bitset>
#include<cstdlib>
#include<cmath>
#include<set>
#include<list>
#include<deque>
#include<map>
#include<queue>
#define INF 0x3f3f3f3f
using namespace std;
typedef long long ll;
int a[100010];
int b[100010];
int main(void)
{
    int T,x,y,n,m,k,r,d,s=1,t=INF;
    scanf("%d%d",&n,&m);
    for(int i=0; i<m; i++)
    {
        scanf("%d %d",&x,&y);
        if(s<x)
            s=x;
        if(y<t)
            t=y;
    }
    if(t-s+1>=0)
        printf("%d\n",t-s+1);
    else
        printf("0\n");
    return 0;
}









Measured memory_bytes: 256
#include<stdio.h>
  
int main()
{
  int t[4][14];
  int n, i,j,c;
  char m, d;
  for(i=0; i < 4; i++){
    for(j=0; j < 14; j++){
      t[i][j]=0;
    }
  }
 scanf("%d", &c);
  for(i = 0; i < c; i++){
    scanf("%c", &d);
    scanf("%c %d", &m, &n);
    if(m == 'S'){
      t[0][n] = 1;
    }
    else if(m == 'H'){
      t[1][n] = 1;
    }
    else if(m == 'C'){
      t[2][n] = 1;
    }
    else if(m == 'D'){
      t[3][n] = 1;
    }
  }
  for(j=1; j < 14; j++){
    if(t[0][j] != 1){
      printf("S %d\n", j);
    }
  }
  
 for(j=1; j < 14; j++){
    if(t[1][j] != 1){
      printf("H %d\n", j);
    }
  }
  
 for(j=1; j < 14; j++){
    if(t[2][j] != 1){
      printf("C %d\n", j);
    }
  }
  
 for(j=1; j < 14; j++){
    if(t[3][j] != 1){
      printf("D %d\n", j);
    }
  }
 return 0;
}


Measured memory_bytes: 2056
parseInt(x) = parse(Int, x)
parseMap(x::Array{SubString{String},1}) = map(parseInt, x)

function main()
	n,x = readline() |> split |> parseMap
	l = readline() |> split |> parseMap
	for i in 2:n
		l[i] += l[i-1]
	end
	flg = 0
	for i in 1:n
		if l[i]>x
			println(i)
			flg = 1
			break
		end
	end
	if flg==0
		println(n+1)
	end
end

main()

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

using namespace std;
typedef long long ll;
const int maxn = 1e5 + 5;

int n, a, b;

int main() {
    ios::sync_with_stdio(0);
    cin >> n >> a >> b;
    cout << min(n * a, b) << '\n';
    return 0;
}

Measured memory_bytes: 256
n=int(input())
s=input().split()
s=[int(i) for i in s]
s.sort()
a=0
for i in range(len(s)-2):
	for j in range(i+1,len(s)-1):
		for k in range(j+1,len(s)):
			if s[i]!=s[j] and s[j]!=s[k] and s[i]+s[j]>s[k]:
				a+=1
				
print(a)

Measured memory_bytes: 9196
/*
___mennat khoday ra azz o va jall ke taatash mojebe ghorbat ast o be shokr andarash mazide nemat.
___har nafasi ke foro miravad momedde hayatast o chon bar miayad mofarrahe zat.
___pas dar har nafasi 2 nemat mojod ast o bar har nematy shokry vajeb.

___az dast o zabane ke barayad ?
___kaz ohdeye shokrash be dar ayad !


___man be to dami gharar natvanam kard
___va ehsane to ra shomar natvanam kard
####################
___gar bar tane man zaban shavad har moyee
___yek shokre to az hezar natvanam kard

*/

#include <bits/stdc++.h>

#define pb push_back
#define SALI main
#define left(x) ((x)*2)
#define right(x) (((x)*2)+1)
#define fuck(x) cout << #x << " : " << x << endl;
#define findLowVec(v,x) (lower_bound(v.begin(), v.end(), x) - v.begin())
#define findUpVec(v,x) (upper_bound(v.begin(), v.end(), x) - v.begin())
#define findLowArr(a,n,x) (lower_bound(a, a+n, x) - a)
#define findUpArr(a,n,x) (upper_bound(a, a+n, x) - a)
#define int long long

using namespace std;

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

template<class A, class B> ostream& operator <<(ostream& out, const pair<A, B> &p)
{return out << "(" << p.first << ", " << p.second << ")";}

template<class A> ostream& operator <<(ostream& out, const vector<A> &v)
{out << "[";for(int i = 0; i < v.size(); i++) {if(i) out << ", ";out << v[i];}return out << "]";}

template<class A,class B> ostream& operator <<(ostream& out, const set<A,B> &s)
{out << "[";for(auto i = s.begin(); i != s.end(); i++) {out << ", ";out << *i;}return out << "]";}

template<class A> ostream& operator <<(ostream& out, const set<A> &s)
{out << "[";for(auto i = s.begin(); i != s.end(); i++) {out << ", ";out << *i;}return out << "]";}

const int mod = 1e9 + 7;

int32_t SALI()
{
    string s; int n,d; cin >> s >> d; n = s.size();

    int dp[n+2][d];
    memset(dp,0,sizeof(dp));
    dp[0][0] = 1;
    for(int i = 1; i < n; i++){ // i raghami
        for(int dg = 0; dg < 10; dg++){
            for(int j = 0; j < d; j++){ // k mod= j - dg
                dp[i][j] += dp[i-1][ ((((j-dg)%d)+d)%d) ];
                dp[i][j] %= mod;
            }

        }
    }
    int ans = 0;
    int sum = 0;
    for(int i = 0; i < n; i++){
        for(int j = 0; j < s[i]-'0'; j++){ // x + sum + j mod= 0
            ans += dp[n-i-1][ (((-1*(sum+j))%d)+d)%d];
            ans %= mod;
        }
        sum += s[i]-'0';
    }
    if(d != 1) ans = (ans-1+mod)%mod;
    if(sum % d == 0 && d != 1) ans = (ans+1)%mod;
    cout << ans << endl;
}




/**< WRITEN BY ALI ADELKHAH */



Measured memory_bytes: 11324
#include <bits/stdc++.h>
#include <math.h>
#define rep(i,n) for (int i = 0; i< (n); i++)
#define REP(i,n) for (int i = 1; i<= (n); i++)
#define MAX_MOD 1000000007LL
#define MOD 998244353LL
const long double PI = acos(-1);
using ll = long long;
using ld = long double;
using namespace std;

int main() {
    string s;
    cin >> s;
    int cnt = 0;
    rep(i,s.size()) {
        if (s[i] == 'x') {
            cnt++;
        }
    }
    if (cnt >= 8) {
        cout << "NO" << endl;
    } else {
        cout << "YES" << endl;
    }
    return 0;
}

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

using namespace std;

const int N = 1e5 + 7 , mod = 1e9 + 7 ;

long long n ; 
long long x[N] ; 
long long a[N] ;

int main()
{
        ios_base::sync_with_stdio(0);
        cin.tie(0);
//        freopen("in.in" , "r" , stdin) ; 
        cin>>n ; 
        long long a[n+1] ; 
        long long ans = 0 , mx = 1 ;      
        long long rem = 0 ;   
        for(int i = 0 ;i <=n;i++){
                long long t ; 
                cin>>a[i] ; 
                rem+=a[i] ; 
        }
        x[n] = a[n] ; 
        for(int i = n ; i ; i--)
                x[i-1] = a[i-1] +  x[i] ; 
        for(int i = 0 ; i <=n;i++){
                long long t = a[i] ; 
                if(t > mx){
                        return cout<<-1,0 ; 
                }
                long long all = min(mx  , rem); 
                mx-=a[i] ; 
                ans+=all ;
                mx*=2 ;   
                if(mx > 1e15)
                        mx = 1e15 ; 
                rem-=a[i] ; 
        }
        cout<< ans ; 
        return 0;
}


Measured memory_bytes: 5192
#include <bits/stdc++.h>
//debug
#define vecprint(v) cout << "  vector: ";rep(i,v.size())cout << v[i] << " ";cout << endl;
#define setprint(s) cout << "  set: ";for(auto i=s.begin();i!=s.end();i++)cout << *i << " ";cout << endl;
#define mappairprint(s) cout << "  map: ";for(auto i=s.begin();i!=s.end();i++)cout << i->first << " " << i->second << endl;cout << endl;
//reader
#define r1(a) cin>>(a)
#define r2(a,b) cin>>(a)>>(b)
#define r3(a,b,c) cin>>(a)>>(b)>>(c)
//writer
#define w1(a) cout<<(a)<<" "
#define w2(a,b) cout<<(a)<<" "<<(b)<<" "
#define w3(a,b,c) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "
#define wl1(a) cout<<(a)<<endl
#define wl2(a,b) cout<<(a)<<" "<<(b)<<endl
#define wl3(a,b,c) cout<<(a)<<" "<<(b)<<" "<<(c)<<endl
//variable definition
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
#define pll pair<ll,ll>
//roop
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rep1(i,n) for (int i = 1; i <= (n); ++i)
#define all(c) c.begin(),c.end()
//term
#define elif else if
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define eb emplace_back
using namespace std;
using ll = long long;
//const
constexpr double PI = 3.141592653589793238462643383279;
vector<int> dx = {1, 0, -1, 0}, dy = {0, 1, 0, -1};



int main() {
  //input
  int n;
  cin >> n;
  set<string> s;
  rep(i,n) {
    string ss;
    cin >> ss;
    s.insert(ss);
  }
  
  cout << s.size() << endl;
}

Measured memory_bytes: 19200
package main

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

var sc = bufio.NewScanner(os.Stdin)

func nextInt() int {
	sc.Scan()
	i, e := strconv.Atoi(sc.Text())
	if e != nil {
		panic(e)
	}

	return i
}
func main() {
	sc.Split(bufio.ScanWords)
	k := nextInt()
	a := nextInt()
	b := nextInt()
	for i := a; i <= b; i++ {
		if i%k == 0 {
			fmt.Println("OK")
			return
		}
	}

	fmt.Println("NG")

}


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

int main() {
  ios::sync_with_stdio(0); cin.tie(0);
  int x, n;
  cin >> x >> n;
  vector<int> p(n);
  for(int i = 0; i < n; ++i) {
    cin >> p[i];
  }
  sort(p.begin(), p.end());
  int dif = 1000000000, y = -1;
  for(int i = 0; i <= 101; ++i) {
    if(abs(x - i) < dif && !binary_search(p.begin(), p.end(), i)) {
      y = i;
      dif = abs(x - i);
    }
  }
  cout << y << '\n';
}

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

using ll = long long;

ll pow_mod(ll x, ll N, ll M) // return x^N mod M
{
	ll res = 1LL;
	while (N > 0)
	{
		if (N & 1)
			(res *= x) %= M;
		(x *= x) %= M, N >>= 1;
	}
	return res;
}

bool check(ll a, int s, ll d, ll N)
{
	ll x = pow_mod(a, d, N);
	if (x == 1)
		return true;

	for (int r = 0; r < s; r++)
	{
		if (x == N - 1)
			return true;
		x = x * x % N;
	}

	return false;
}

bool is_prime(ll N)
{
	if (N <= 1 || (N > 2 && N % 2 == 0))
		return false;

	ll d = N - 1, s = 0;
	while (!(d & 1))
		d >>= 1, ++s;

	vector<vector<ll>> test = {{2, 7, 61}, {2, 3, 5, 7, 11, 13, 17, 19, 23}};
	bool type = (N > 4759123140);

	for (int i = 0; test[type][i] < N && i < test[type].size(); i++)
	{
		if (!check(test[type][i], s, d, N))
			return false;
	}

	return true;
}

int main()
{
	ll N, ans = 0;
	cin >> N;

	while (N--)
	{
		ll a;
		cin >> a;
		ans += is_prime(a);
	}

	cout << ans << "\n";
}



Measured memory_bytes: 3152
h, w = map(int, input().split())
a = [list(map(int, input().split())) for _ in range(h)]

ans = []
for i in range(h):
    for j in range(w):
        if int(a[i][j]) % 2 == 1:
            # i < h-1なら下に移動
            if i < h-1:
                ans.append([i, j, i+1, j])
                a[i+1][j] += 1
                a[i][j] -= 1
            else:
                # j < w-1なら右に移動
                if j < w-1:
                    ans.append([i, j, i, j+1])
                    a[i][j+1] += 1
print(len(ans))
for an in ans:
    print(*[i+1 for i in an])


Measured memory_bytes: 26340
def insertion_sort(A,N):
    for i in range(N):
        v=A[i]
        j=i-1
        while j>=0 and A[j]>v:
            A[j+1]=A[j]
            j=j-1
        A[j+1]=v
        print(*A,sep=" ")
N=int(input())
A=list(map(int,input().split()))

insertion_sort(A,N)



Measured memory_bytes: 5984
#include <cctype>
#include <cmath>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#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 FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define LL long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<LL, LL> LP;
typedef pair<int, P> PP;
typedef pair<LL, LP> LPP;

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

int main(){
	LL a, b;
	while(cin >> a){
		cin >> b;
		LL sum = a + b;
		int ans = 1;
		while(sum >= 10){
			++ans;
			sum = sum / 10;
		}
		cout << ans << endl;
	}   
}

Measured memory_bytes: 3084
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;

//#define int long long
//using ll = boost::multiprecision::cpp_int;
using ll = long long;
//constexpr int INF = 1e9;//INT_MAX=(1<<31)-1=2147483647
constexpr ll INF = (ll)1e18;//(1LL<<63)-1=9223372036854775807
constexpr ll MOD = (ll)1e9 + 7;
constexpr double EPS = 1e-9;
constexpr int dx[4]={1,0,-1,0};
constexpr int dy[4]={0,1,0,-1};
#ifdef LOCAL_ENV
	#define debug(var) std::cout<<#var" = "<<var<<std::endl
#else
	#define debug(var)
#endif
#define p(var) std::cout<<var<<std::endl
#define rep(i, n)   for(ll i=0, i##_length=(n); i< i##_length; ++i)
#define repeq(i, n) for(ll i=1, i##_length=(n); i<=i##_length; ++i)
#define all(a) (a).begin(), (a).end()
#define PI (acos(-1))
template<typename T> inline T power(T x, T n){ return n ? power(x*x%MOD,n/2)*(n%2?x:1)%MOD : 1; }
template<typename T> inline T gcd(T a, T b) { return b ? gcd(b,a%b) : a; }
template<typename T> inline T lcm(T a, T b) { return a / gcd(a,  b) * b; }
template<typename T1, typename T2>inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template<typename T1, typename T2>inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
template<typename T1, typename T2> ostream& operator<<(ostream& s, const pair<T1, T2>& p) {return s << "(" << p.first << ", " << p.second << ")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& v) {
	for (int i = 0, len = v.size(); i < len; ++i){
		s << v[i]; if (i < len - 1) s << "\t";
	}
	return s;
}
template<typename T> ostream& operator<<(ostream& s, const vector< vector<T> >& vv) {
	for (int i = 0, len = vv.size(); i < len; ++i){
		s << vv[i] << endl;
	}
	return s;
}
template<typename T1, typename T2> ostream& operator<<(ostream& s, const map<T1, T2>& m) {
	s << "{" << endl;
	for (typeof(m.begin()) itr = m.begin(); itr != m.end(); ++itr){
		s << "\t" << (*itr).first << " : " << (*itr).second << endl;
	}
	s << "}" << endl;
	return s;
}

/*-----8<-----8<-----*/


constexpr ll N_MAX = 300;
constexpr ll I_MAX = 1000000000;

ll N;
ll A[N_MAX][N_MAX];
ll cost[N_MAX][N_MAX];
void warshall_floyd(vector<vector<ll>> &d) {
	ll N=d.size();
	for (ll k=0; k<N; k++) {
		for (ll i=0; i<N; i++) {
			for (ll j=0; j<N; j++){
				if(d[i][k] != INF && d[k][j] != INF && d[i][k] + d[k][j] < d[i][j]){
					d[i][j] = d[i][k] + d[k][j];
				}
			}
		}
	}
}

void input() {
	scanf("%lld", &N);
	rep(i, N) rep(j, N) scanf("%lld", &A[i][j]);
}

void solve() {
	ll sum=0;
	vector<vector<ll>> d(N, vector<ll>(N, 0));
	for(ll i=0; i<N; i++) {
		for(ll j=0; j<N; j++) {
			d[i][j] = A[i][j];
			//cost[i][j]=0;
		}
	}

	warshall_floyd(d);
	rep(i,N) for(ll j=i+1;j<N;j++){
		if(A[i][j]!=d[i][j]){p(-1);return;}
		sum+=d[i][j];
	}

	rep(i,N) for(ll j=i+1;j<N;j++){
		if([&]{
			rep(k,N){
				if(k==i||k==j)continue;
				if(d[i][j]==d[i][k]+d[k][j]){
					return true;
				}
			}
			return false;
		}()){sum-=d[i][j];}
	}

	p(sum);
}

signed main() {
	input();
	solve();
	return 0;
}


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

using namespace std;

const int MX = 100000;

int x[MX];
long long p[MX];

int main() {
	int n, s;
	ignore = scanf("%d %d", &n, &s);
	for (int i = 0; i < n; i++) ignore = scanf("%d %lld", x + i, p + i);
	
	vector<int> order;
	int i = 0, j = n - 1;
	while (i < j) {
		if (p[i] >= p[j]) {
			order.push_back(j);
			p[i] += p[j];
			j--;
		}
		else {
			order.push_back(i);
			p[j] += p[i];
			i++;
		}
	}
	
	order.push_back(i);
	
	reverse(order.begin(), order.end());
	
	long long ans = 0;
	
	int L = s, R = s;
	for (int i : order) {
		if (L <= x[i] && x[i] <= R) continue;
		ans += abs(x[i] - s);
		s = x[i];
		L = min(L, s);
		R = max(R, s);
	}
	
	printf("%lld\n", ans);
	
	return 0;
}


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

using namespace std;

int main()
{
	int n;
	cin >> n;
	vector<long long> a(n);
	for(int i=0;i<n;i++)
		cin >> a[i];
	
	sort(a.begin(),a.end());
	reverse(a.begin(),a.end());
	long long x=0,y=0;
	long long bef=0;
	for(int i=0;i<n;i++)
	{
		if(a[i]==bef and x==0)
		{
			x=a[i];
			bef=0;
		}
		else if(a[i]==bef and y==0)
		{
			y=a[i];
			bef=0;
		}
		else
			bef=a[i];
	}
	cout << x*y << endl;
}


Measured memory_bytes: 1024
#define _USE_MATH_DEFINES
#include<iostream>
#include <iomanip>
#include<stdio.h>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include <queue>
#include <utility>
#include <map>
#include <set>
#include <deque>
#include <numeric>
using namespace std;

int main() {
    int H, W, N;
    cin >> W >> H >> N;
    int x0 = 0, y0 = 0, x1 = W, y1 = H;
    for (int i = 0; i < N; i++) {
        int x, y, a;
        cin >> x >> y >> a;
        if (a == 1) {
            if (x1 <= x) {
                cout << 0 << endl;
                return 0;
            }
            x0 = max(x0, x);
        }
        else if (a == 2) {
            if (x <= x0) {
                cout << 0 << endl;
                return 0;
            }
            x1 = min(x1, x);
        }
        else if (a == 3) {
            if (y1 <= y) {
                cout << 0 << endl;
                return 0;
            }
            y0 = max(y0, y);
        }
        else if (a == 4) {
            if (y <= y0) {
                cout << 0 << endl;
                return 0;
            }
            y1 = min(y1, y);
        }
    }

    cout << (x1 - x0)*(y1 - y0) << endl;

    return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-

#110_c

S = input()
T = input()

combination = []
for i, j in zip(S,T):
    combination.append([i,j])

set_S = []
set_T = []

for i,j in list(map(list, set(map(tuple, combination)))):
    set_S.append(i)
    set_T.append(j)

if len(set_S) == len(set(set_S))and len(set_T) == len(set(set_T)):
    print("Yes")
else:
    print("No")


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

long long n,k;

int main()
{
	cin>>n>>k;
	long long ans=0;
	for(int i=k+1;i<=n;i++)
		ans+=n/i*(i-k)+(n%i!=0)*max(n-n/i*i-k+(k!=0),0ll);
	cout<<ans;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll              long long int
//#define int             ll
#define ff              first
#define ss              second
#define pb              emplace_back
#define mpair           make_pair
#define pii             pair<int,int>
#define vi              vector<int>
#define mii             map<int,int>
#define pqb             priority_queue<int>
#define pqs             priority_queue<int,vi,greater<int> >
#define sbits(x)      __builtin_popcountll(x)
#define zbits(x)      __builtin_popcountlliltin_ctzll(x)
#define w(t)            int t;cin>>t;while(t--)
#define uset            unordered_set
#define dor(i, a, b)    for(int i =(a);i<=(b);i++)
#define mem(a,val)      memset((a),(val),sizeof((a))); 
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__,__VA_ARGS__)
    template <typename Arg1>
     void __f(const char* name,Arg1&& arg1){
        cout<<name<<" : "<<arg1<<std::endl;
     }
     template <typename Arg1, typename... Args>
     void __f(const char* names,Arg1&& arg1,Args&&... args){
        const char* comma = strchr(names+1 ,',');
        cout.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
     }
#else
#define trace(...)
#endif
/*     
#ifndef ONLINE_JUDGE
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif
*/
double pi = 2.0*acos(0);
void fast(){ios_base::sync_with_stdio(false);cin.tie(NULL);cout<<fixed<<setprecision(10);}
int max2(int a,int b){ if(a>b) return a;return b;}
int min2(int a,int b){ if(a<b)return a;return b;}
int max3(int a,int b,int c){ return max2(a,max2(b,c));}
int min3(int a,int b,int c){ return min2(a,min2(b,c));}

//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////



void solve()
{
  int n;
  cin>>n;
  string s;
  map<string,int>mp;
  for(int i = 0;i<n;i++)
  {
    cin>>s;
    mp[s]++;
  }
  vector<pair<int,string > >v;
  for(auto x : mp)
  {
    v.push_back(make_pair(x.second,x.first));
  }
  sort(v.begin(),v.end());
  int l = v.size()-1;
  int m = v[l].ff;
  stack<string>stk;
  int i = l;
  while(i>=0 && v[i].ff==m)
  {
     stk.push(v[i].ss);i--;
  }

  while(!stk.empty())
  {
    cout<<stk.top()<<endl;
    stk.pop();
  }

}

signed main(void)
{
      fast();
     // w(t)
      solve();

}


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

#define for_(i,a,b) for(int i=a;i<b;++i)
#define ALL(a) a.begin(),a.end()
#define INIT(a,b) memset(a,b,sizeof(a))
using lint = long long int;

// Segment Tree with Lazy Evaluate
template< typename DATA, class CALC, DATA FAIL, DATA LAZY_INIT >
class SegmentTreeLazy {
private:
	int size__;
	vector< DATA > data, lazy;
	
	inline int left_t(int k) { return (k << 1) + 1; }
	inline int right_t(int k) { return (k << 1) + 2; }
	inline int center(int l, int r) { return (l + r) >> 1; }
	
private:
	DATA calc(DATA d1, DATA d2) { return CALC().calc(d1, d2); }
	
	void lazyCalc(int k, DATA val) { lazy[k] = CALC().lazyCalc(lazy[k], val); }
	
	inline void lazyEval(int l, int r, int k) {
		data[k] = CALC().lazyEval(data[k], lazy[k], l, r);
		
		if (k < size__ - 1) {
			lazyCalc(left_t(k), lazy[k]);
			lazyCalc(right_t(k), lazy[k]);
		}
		
		lazy[k] = LAZY_INIT;
	}
	
	inline void updateAt(int k) { data[k] = calc(data[left_t(k)], data[right_t(k)]); }
	
	void update(int a, int b, DATA x, int k, int l, int r) {
		lazyEval(l, r, k);
		
		if (r <= a || b <= l) return;
		if (a <= l && r <= b) {
			lazyCalc(k, x);
			lazyEval(l, r, k);
			return;
		}
		
		update(a, b, x, left_t(k), l, center(l, r));
		update(a, b, x, right_t(k), center(l, r), r);
		updateAt(k);
	}
	
	DATA query(int a, int b, int k, int l, int r) {
		lazyEval(l, r, k);
		
		if (r <= a || b <= l) return FAIL;
		if (a <= l && r <= b) return data[k];
		DATA res =  calc(query(a, b, left_t(k), l, center(l, r)),
						 query(a, b, right_t(k), center(l, r), r));
		
		updateAt(k);
		return res;
	}
	
public:
	SegmentTreeLazy() {}
	
	SegmentTreeLazy(int n, DATA ini, DATA lini) {
		for (size__ = 1; size__ < n; size__ <<= 1);
		data.assign(2 * size__ - 1, ini);
		lazy.assign(2 * size__ - 1, lini);
	}
	
	void update(int a, int b, DATA x) { update(a, b, x, 0, 0, size__); }
	
	DATA query(int a, int b) { return query(a, b, 0, 0, size__); }
	
	int size() { return size__; }
};

template< typename T >
class LazyMinCalc {
public:
	inline T calc(T d1, T d2) { return min(d1, d2); }
	inline T lazyCalc(T lz, T val) { return min(lz, val); }
	inline T lazyEval(T d, T lz, int l, int r) { return min(d, lz); }
};

int main() {
    int N, Q;
    cin >> N >> Q;
    
    SegmentTreeLazy<int, LazyMinCalc<int>, 1L << 30, 1L << 30> seg_x(N + 1, N, N), seg_y(N + 1, N, N);
    lint ans = lint(N - 2) * (N - 2);
    for_(i,0,Q) {
        int q, x;
        cin >> q >> x;

        if (q == 1) {
            int v = seg_x.query(x, x + 1);
            // cerr << "x: " << v << endl;
            ans -= v - 2;
            seg_y.update(2, v, x);
        }

        if (q == 2) {
            int v = seg_y.query(x, x + 1);
            // cerr << "y: " << v << endl;
            ans -= v - 2;
            seg_x.update(2, v, x);
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 11444
#include<stdio.h>
int main(void){
	int a;
	int b;
	int c;
	scanf("%d %d %d\n",&a,&b,&c);
	if(a<b && b<c){
	printf("Yes\n");
	}else{
	printf("No\n");
	}
	return 0;
}


Measured memory_bytes: 2148
class UnionFind:

    def __init__(self, n):
        self.par = [-1] * n


    def unite(self, x, y):
        x = self.root(x)
        y = self.root(y)
        if x == y:
            return False
        if self.par[x] > self.par[y]:
            x, y = y, x
        self.par[x] += self.par[y]
        self.par[y] = x
        return True


    def root(self, x):
        if self.par[x] < 0:
            return x
        self.par[x] = self.root(self.par[x])
        return self.par[x]


    def same(self, x, y):
        return self.root(x) == self.root(y)


n, m = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(m)]
u = UnionFind(n)
ans = [0] * (m + 1)
ans[0] = n * (n - 1) // 2

for i, v in enumerate(reversed(ab)):
    a = v[0] - 1
    b = v[1] - 1
    ans[i + 1] = ans[i]
    if not u.same(a, b):
        sa = -u.par[u.root(a)]
        sb = -u.par[u.root(b)]
        ans[i + 1] -= sa * sb
        u.unite(a, b)


for x in reversed(ans[:m]):
    print(x)

Measured memory_bytes: 35412