akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,a,b)  for(int i=(a),i##formax=(b);i< i##formax;i++)
#define FORR(i,a,b) for(int i=(a),i##formin=(b);i>=i##formin;i--)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define pcnt __builtin_popcount
#define sz(x) (int)(x).size()
#define maxs(x,y) x=max((x),(y))
#define mins(x,y) x=min((x),(y))
#define show(x) cout<<#x<<" = "<<(x)<<endl;
#define all(a) ((a).begin()),((a).end())
#define each(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define bit(n) (1LL<<(n))
typedef long long ll;
typedef __int128_t lll;
template<class T>using V=vector<T>;
template<class T>using VV=V<V<T>>;
template<class T,class Y>using P=pair<T,Y>;
template<class T,class Y>ostream& operator<<(ostream&o,P<T,Y>&p){return o<<"("<<p.fi<<","<<p.se<<")";}
template<class T>ostream& operator<<(ostream&o,V<T>&v){for(T&t:v)o<<t<<",";return o;}
template<class T>void uniq(V<T>&v){sort(all(v));v.erase(unique(all(v)), v.end());}
template<class A,size_t N,class T>void Fill(A(&a)[N],const T&v){fill((T*)a,(T*)(a+N),v);}

const int MOD = 1e9+7; //998244353;

lll gcd(lll a,lll b,lll&x,lll&y){if(!b){x=1;y=0;return a;}lll d=gcd(b,a%b,y,x);y-=a/b*x;return d;}
ll modInv(ll a,ll m=MOD){lll x,y;gcd(a,m,x,y);return(x%m+m)%m;}
ll modPow(lll a,lll n,ll m=MOD){lll p=1;for(;n;n>>=1,a=a*a%m)if(n&1)p=p*a%m;return p;}
//V<ll>Fac,Rac;void setF(int n,int m=MOD){Fac=Rac=V<ll>(++n);Fac[0]=1;FOR(i,1,n)Fac[i]=Fac[i-1]*i%m;Rac[n-1]=modInv(Fac[n-1],m);FORR(i,n-1,1)Rac[i-1]=Rac[i]*i%m;}
//ll comb(int a,int b,int m=MOD){return a<b||b<0?0:Fac[a]*Rac[b]%m*Rac[a-b]%m;}

const int IINF = 1e9+6;
const ll LINF = 1e18;
const int N = 1e5;
int n;
main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cin >> n;
  int p=0;
  FOR(i, 0, n){
    p = (p*10+7)%n;
    if(!p){
      cout << i+1 << endl;
      return 0;
    }
  }
  cout << -1 << endl;
}

Measured memory_bytes: 3656
using System;
using System.Collections.Generic;
using System.Windows;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Atcoder
{
    public class Program
    {
        static void Main(string[] args)
        {
            var k = Read().Int();
            var s = Read().ToString();
            var ans = string.Empty;
            if (s.Length <= k)
            {
                ans = s;
            }
            else
            {
                ans = s.Substring(0, k) + "...";
            }
            WriteRead(ans);
        }
        
        public static string Read()
        {
            return Console.ReadLine();
        }

        public static string[] ReadSplit()
        {
            return Console.ReadLine().Split(' ');
        }

        public static void WriteRead(object str)
        {
            Console.WriteLine(str);
            Read();
        }

        public static void Write(object str)
        {
            Console.WriteLine(str);
        }

        private static bool ChangeMin<T>(ref T a, T b) where T : IComparable
        {
            if (a.CompareTo(b) > 0)
            {
                a = b;
                return true;
            }
            return false;
        }

        private static bool ChangekMax<T>(ref T a, T b) where T : IComparable
        {
            if (b.CompareTo(a) > 0)
            {
                a = b;
                return true;
            }
            return false;
        }
    }
}


public static class Extentions
{
    public static int Int(this object obj)
    {
        return int.Parse(obj.ToString());
    }

    public static long Long(this object obj)
    {
        return long.Parse(obj.ToString());
    }

    public static decimal Decimal(this object obj)
    {
        return decimal.Parse(obj.ToString());
    }

    public static double Double(this object obj)
    {
        return double.Parse(obj.ToString());
    }

    public static T2 GetValueZero<T1, T2>(this Dictionary<T1, T2> d, T1 key) where T2 : struct
    {
        T2 value;
        if (d.TryGetValue(key, out value))
        {
            return value;
        }
        return new T2();
    }
}



Measured memory_bytes: 17648
#include <bits/stdc++.h>
#define ll long long

using namespace std;
const int MAXN = 200005;
const int MOD = 1000000007;

int bit[2][MAXN];
string s,t;

void update(int f,int a,int n){
	for(; a <= n; a += a & -a ) bit[f][a]++;
}

int query(int f,int a){
	int ans = 0;
	for(; a ; a -= a & -a) ans += bit[f][a];
	return ans;
}

int fun(int a,int b){
	if(a == b) return -1;
	if(a > b){
		a -= b;
		a %= 3;
		if(a == 0) return -1;
		if(a == 1) return 0;
		if(a == 2) return 1;
	}
	else{
		b -= a; b %= 3;
		if(b == 0) return -1;
		if(b == 1) return 1;
		return 0;
	}
}

int main(){
	ios_base::sync_with_stdio(false); cin.tie(0);
	cin >> s >> t;
	int n = s.length();
	int m = t.length();
	for(int i=0;i<n;i++) if(s[i] == 'A') update(0,i+1,n);
	for(int i=0;i<m;i++) if(t[i] == 'A') update(1,i+1,m);
	int q; cin >> q;
	while(q--){
		int a,b,c,d;
		cin >> a >> b >> c >> d;
		int ka = query(0,b) - query(0,a-1);
		int kb = query(1,d) - query(1,c-1);
		//cout << ka << ' ' << kb << endl;
		ka = fun(ka,b-a+1-ka);
		kb = fun(kb,d-c+1-kb);
		//cout << ka << ' ' << kb << endl;
		if(ka == kb) cout << "YES\n";
		else cout << "NO\n";
	}
	return 0;
}


Measured memory_bytes: 1744
using System;
using System.Text;
using System.Collections.Generic;
using static System.Math;
using System.Linq;
using static System.Array;

namespace ConsoleApp2
{
    class Program
    {
        static string[] S;
        static long H;
        static long W;
        static long K;
        static void Main(string[] args)
        {
            var HWK = Console.ReadLine().Split(' ').Select(x => int.Parse(x)).ToArray();
            H = HWK[0];
            W = HWK[1];
            var ans = 0;
            while(H != 0){
              H /= W;
              ans++;
            }
          
            Console.WriteLine(ans); 
        }

        static long Cul(int i)
        {
            if (i == 6)
            {
                var r = 8;
            }
            var used = new bool[W];
            var tmp = Convert.ToString(i, 2).Reverse<char>().ToArray();
            var top = 0;
            var end = 0;
            var ans = 0;
            for (int j = 0; j < tmp.Length; j++)
            {
                if(tmp[j] == '1')
                {
                    ans++;
                    var sum = 0;
                    for (int k = 0; k < W; k++)
                    {
                        if (used[k])
                        {
                            sum = 0;
                        }
                        var tmp2 = 0;
                        for (int l = top;  l <= end;  l++)
                        {
                            if (S[l][k] == '1')
                            {
                                tmp2++;
                            }
                                
                        }

                        if (sum + tmp2 > K)
                        {
                            if (tmp2 > K) return H * W;
                            sum = tmp2;
                            if (!used[k])
                            {
                                ans++;
                                used[k] = true;
                            }
                            
                        }
                        else
                        {
                            sum += tmp2;
                        }
                    }
                    top = end + 1;
                }
                end++;
            }

            var sum2 = 0;
            end = (int)H - 1;
            for (int k = 0; k < W; k++)
            {
                if (used[k])
                {
                    sum2 = 0;
                }
                var tmp2 = 0;
                for (int l = top; l <= end; l++)
                {
                    if (S[l][k] == '1') tmp2++;
                }

                if (sum2 + tmp2 > K)
                {
                    if (tmp2 > K) return H * W;
                    sum2 = tmp2;
                    if (!used[k])
                    {
                        ans++;
                        used[k] = true;
                    }
                }
                else
                {
                    sum2 += tmp2;
                }
            }
            return ans;
        }

    }
}


Measured memory_bytes: 13268
#include<stdio.h>
#define MAX 100005
#define NIL -1
struct Node_struct{int p, l, r;}; /*p: 親(parent), l: 一番左の子(left child), r:右の兄弟(right sibling)*/
typedef struct Node_struct Node;
Node T[MAX];
int D[MAX];

void print(int u){
  int i, c;
  printf("node %d: parent = %d, depth = %d, ", u, T[u].p, D[u]);

  if(T[u].p == NIL) printf("root, ");
  else if(T[u].l == NIL) printf("leaf, ");
  else printf("internal node, ");
  
  printf("[");
  for (i=0, c = T[u].l; c != NIL; i++, c = T[c].r){
    if(i) printf(", ");
    printf("%d", c);
  }
  printf("]\n");
  
}

void calcDepth(int u, int p){
  D[u] = p;
  if(T[u].r != NIL) calcDepth(T[u].r,p);
  if(T[u].l != NIL) calcDepth(T[u].l,p + 1);
}

int main(){
  int i, j, k;
  int n;
  int id, sib, child;
  int root = NIL;
  scanf("%d", &n);
  for(i=0; i<n; i++) T[i].p = T[i].l = T[i].r = NIL;
  
  for(i=0; i<n; i++){
    scanf("%d %d", &id, &k);
    for(j = 0, sib = NIL; j<k; j++){ //子を入力する (input children)
      scanf("%d", &child);
      T[child].p = id;
      if(j == 0) T[id].l = child; //idの一番左の子 (the most left child of id)
      else T[sib].r = child; //左の兄弟に繋げる (connect to left sibling)
      sib = child;//次の子供の左の兄弟 (the left sibling of the next child)
    }
  }

  //根を求める (find the root)
  for(i=0; i<n; i++){
    if(T[i].p == -1) root = i;
  }
  
  //それぞれのノードの深さを求める (find depth of each node)
  calcDepth(root, 0);

  //出力 (output)
  for(i=0; i<n; i++) print(i);
  
  return 0;
}



Measured memory_bytes: 6380
#include <iostream>
//#include <iomanip>
//#include <algorithm>
//#include <numeric>
//#include <queue>
//#include <stack>
//#include <math.h>
#include <vector>
//#include <unordered_map>
//#include <string>
typedef long long LL;
//typedef long double LD;
using namespace std;

int main() {
    int n;
    LL ans=0;
    vector<vector<int>> fe(10, vector<int>(10, 0));
    cin >> n;
    int tmp;
    int tmp_f;
    int tmp_e;
    for(int i=1; i<=n; i++){
        tmp=i;
        tmp_e=tmp%10;
        tmp_f=tmp_e;
        tmp/=10;
        while(tmp!=0){
            tmp_f=tmp;
            tmp/=10;
        }
        fe[tmp_f][tmp_e]++;
        //cout << i << " " << tmp_f << " " << tmp_e << endl;
    }
    for(int i=1; i<=9; i++){
        for(int j=1; j<=9; j++){
            ans+=fe[i][j]*fe[j][i];
        }
    }
    cout << ans << endl;

    return 0;
}

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

using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, d;
  cin >> n >> d;
  int tmp = 2 * d + 1;
  cout << (n + tmp - 1) / tmp << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define double long double
#define N 100010
using namespace std;
const int INF = 1LL<<55;
const int mod = (1e9)+7;
const double EPS = 1e-8;
const double PI = 6.0 * asin(0.5);
typedef pair<int,int> P;
typedef long long ll;
ostream& operator<<(ostream& o,P p){return o<<"("<<p.first<<","<<p.second<<")";}
istream& operator>>(istream& i,P &p){return i>>p.first>>p.second;}
template<class T> T Max(T &a,T b){return a=max(a,b);}
template<class T> T Min(T &a,T b){return a=min(a,b);}
template<class T> void prArr(T a,string s=" "){int i=0;for(auto t:a)cout<<i++? s:""<<t;cout<<endl;}


signed main(){
  string s;
  cin>>s;
  s[0] = '2';
  s[1] = '0';
  s[2] = '1';
  s[3] = '8';
  cout<<s<<endl;
  return 0;
}


Measured memory_bytes: 256
n = int(input())
k = 0
arr = [0] * n
def break2(n):
  k = 0
  while n % 2 == 0:
    k += 1
    n = n // 2
  return k
for i in range(n):
  arr[i] = break2(i + 1)
print(arr.index(max(arr)) + 1)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string str1;
  int N,K,X;
  cin >> N >> K >> str1;
  
  if(str1.at(K-1) == 'A')
    str1.at(K-1) = 'a';
  
  if(str1.at(K-1) == 'B')
    str1.at(K-1) = 'b';
  
  if(str1.at(K-1) == 'C')
    str1.at(K-1) = 'c';
  

  cout << str1 << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>   
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
#include<stdio.h>
#include<string.h>
#include <bitset>

using namespace std;
#define int  long long
 
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
#define MEM_SIZE 10000
#define DEBUG_OUT true
#define ALL(x) (x).begin(),(x).end()

// int DP[MEM_SIZE][MEM_SIZE] = {0};
// int GMEM[MEM_SIZE][MEM_SIZE] = {0};
template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return; std::cout << e <<" ";}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){std::cout<< e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == false)return;for(const auto& v : vv){ DEBUG(v); } }
template<class T,class... Ts> void DEBUG(T d, Ts... e){if(DEBUG_OUT == false)return;DEBUG(d);DEBUG(e...);}
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
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); }

void solve(void)
{
  int N;
  cin>>N;
  vector<pair<int,int> > vp (N);
  for (int i = 0; i < N; i++)
  {
    int X;cin>>X;
    vp[i].first = X;
    vp[i].second = i;
  }
  sort(ALL(vp));
  int ANS = 0;
  for (int i = 0; i < N; i++)
  {
    ANS += abs((i - vp[i].second)%2);
    // DEBUG(i,vp[i].second,"\n");
  }
  cout<<ANS/2<<endl;
  
  
  return;
}

int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(15);
  solve();

  return 0;
}


Measured memory_bytes: 1792
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main() {
	int N;
	cin >> N;
	vector<int>V(N), C(N);
	vector<int>ans(N);
	for (int i = 0;i < N;i++) {
		cin >> V[i];
	}
	for (int i = 0;i < N;i++) {
		cin >> C[i];
	}
	for (int i = 0;i < N;i++) {
		if (V[i] > C[i]) {
			ans[i] = V[i] - C[i];
		}
		else {
			ans[i] = 0;
		}
	}
	int ANS = 0;
	for (int i = 0;i < N;i++) {
		ANS += ans[i];
	}
	cout << ANS << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cctype>
#include <string>

using namespace std;

int main() {
	string line;
  	getline(cin,line);
  	for (int i=0;i<line.size();i++){
  		if(isalpha(line.at(i))){
        	if(islower(line.at(i))){
              cout<<(char)toupper(line.at(i));
            }else{
              cout<<(char)tolower(line.at(i));
            }
        }else{
          cout<<(char)line.at(i);
        }
     }
  cout<<endl;
}	


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

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

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

const int INF=1<<30;
const ll LINF = 1e18+5;

int int_abs(int x) {
    if (x >=0) return x;
    else return -1*x;
}

bool dp[80][80][160*80+1];

int main() {
    int H, W;
    int A[80][80] = {};
    int B[80][80] = {};
    cin >> H >> W;
    rep(i, H) rep(j, W) cin >> A[i][j];
    rep(i, H) rep(j, W) cin >> B[i][j];

    int C[80][80] = {};
    rep(i,H) rep(j,W) C[i][j] = (int)abs(A[i][j] - B[i][j]);

    rep(i,H) rep(j,W) rep(k,160*80+1) dp[i][j][k] = false;
    
    rep(i,H) {
        rep(j, W){
            if (i==0 && j==0) {
                dp[i][j][C[i][j]] = true;
                continue;
            }
            rep(k, 160*80+1) {
                if (i!=0) {
                    dp[i][j][k] |= dp[i-1][j][int_abs(k-C[i][j])];
                    dp[i][j][k] |= dp[i-1][j][k+C[i][j]];
                }
                if (j!=0) {
                    dp[i][j][k] |= dp[i][j-1][int_abs(k-C[i][j])];
                    dp[i][j][k] |= dp[i][j-1][k+C[i][j]];
                }
            }
        }
    }
    rep(i,160*80+1) {
        if(dp[H-1][W-1][i]){
            cout << i << endl;
            break;
        }
    }
    return 0;
}

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

vector<int> get_all_values(const int N, const int v) {
  vector<int> all_values;

  int current = v;
  while (current <= N) {
    all_values.push_back(current);
    current *= v;
  }

  return all_values;
}

int solve(const int N) {
  // Get all values
  vector<int> all_values{1};
  for (const auto v : get_all_values(N, 6)) {
    all_values.push_back(v);
  }
  for (const auto v : get_all_values(N, 9)) {
    all_values.push_back(v);
  }

  // Sort in descent order
  sort(begin(all_values), end(all_values), greater<int>());

  // Initialize DP
  vector<int> dp(N + 1, N);
  dp[0] = 0;

  // DP
  for (auto i = 0; i < N; ++i) {
    for (const auto v : all_values) {
      if (i + v > N) {
        continue;
      }

      dp[i + v] = min(dp[i + v], dp[i] + 1);
    }
  }

  return dp[N];
}

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

  // Solve
  int ans = solve(N);

  // Answer
  cout << ans << endl;

  return 0;
}


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

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

typedef long long ll;
typedef array<int, 3> tri;
typedef array<int, 2> duo;
typedef long double ld;

template <class T> istream& operator>>(istream& I, vector<T>& v) {for (T &e: v) I >> e; return I;}
template <class T> ostream& operator<<(ostream &O, const vector<T>& v) {for (const T &e: v) O << e << ' '; return O;}



void _main() {
        ll a, b, x, y; cin >> a >> b >> x >> y;
        cout << fixed << setprecision(10) << a * b / 2. << ' ' << (x == a / 2. && y == b / 2.);
}



signed main() {
        ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
//        freopen("input.txt", "r", stdin);
        int _t = 1;
//        cin >> _t;
        while (_t--) _main();
        return 0;
}


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

int main(){
  int N;
  cin >> N;
  vector<int> a(N);
  int loop,isTrue=1;
  cin >> a[0];
  int Maxi=a[0],Mini=a[0];
  for(loop=1;loop<N;loop++){
    cin >> a[loop];
    if(Maxi<a[loop]){
      Maxi=a[loop];
    }else if(Mini>a[loop]){
      Mini=a[loop];
    }
  }
  if(Maxi-Mini>1){
    isTrue=0;
  }else if(Maxi-Mini){
    int colorable=Maxi-1;
    //人と完全に違う色を被った猫はMaxi-1匹以下であることが保証される
    //countの値はcolorable以下でなければならない
    int count=0;
    for(loop=0;loop<N;loop++){
      if(a[loop]==Mini)
        count++;
    }
    int colorRem=Maxi-count;
    //人と同じ色を被った猫について、まず「何色が残っているか」を確認する
    //残った色数colorRemと同じ色を被った猫数N-countについて、
    //colorRem*2<=N-countであることが保証される
    if(colorable<count||colorRem*2>N-count)
      isTrue=0;
  }else{
    if(N-Maxi!=1&&N/2<Maxi){
      isTrue=0;
    }
  }
  if(isTrue){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  return 0;
}


Measured memory_bytes: 640
program ABC_082_A_RoundUptheMean
   implicit none
   integer a, b
   read(*, *) a, b
   if(mod(a+b, 2) == 0) then
       write(*, *) (a + b) / 2
   else 
       write(*, *) (a + b) / 2 + 1
   end if
end program ABC_082_A_RoundUptheMean

Measured memory_bytes: 896
# -*- coding: utf-8 -*-
"""
D - Disjoint Set of Common Divisors
https://atcoder.jp/contests/abc142/tasks/abc142_d

"""
import sys


from collections import defaultdict

def prime_factor(N):
    factors = defaultdict(int)
    for i in range(2, int(N**0.5)+1):
        while N % i == 0:
            factors[i] += 1
            N //= i
    if N != 1:
        factors[N] = 1

    return factors

def solve(A, B):
    pA = prime_factor(A)
    pB = prime_factor(B)
    res = [1]
    for k in pA.keys():
        if k in pB:
            res.append(k)
    return len(res)


def main(args):
    A, B = map(int, input().split())
    ans = solve(A, B)
    print(ans)


if __name__ == '__main__':
    main(sys.argv[1:])


Measured memory_bytes: 3316
const main = input => {
const data = input.split("\n");
const hn = data[0].split(" ");
const a = data[1].split(" ");
const A = a.map(v=>parseInt(v)).reduce((acc,cur)=> acc + cur,0);
if( hn[0] <= A){
  console.log("Yes");
} else{
  console.log("No");
}
};
main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 16716
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,n) for(long long i=0;i<n;++i)
#define REPP(i,m,n) for(long long i=m;i<n;++i)
#define rep(i,n) for(long long i = n-1;i>=0;--i)
#define repp(i,n,m) for(long long i = n-1; i >= m; --i)
#define ALL(N) (N.begin(),N.end())
#define de cout << "line : " << __LINE__ << " debug" << endl;
#define pb push_back
#define pq priority_queue
#define fi first
#define se second
#define Dcout(N) cout << setprecision(20) << N << endl
constexpr ll INF = 2147483647;
constexpr long long INFF = 9223372036854775807;

signed main() {
    cin.tie(0);
	ios::sync_with_stdio(false);
    int N;cin >> N;
    vector<int> A(N),E;
    REP(i,N){
        cin >> A[i];
        if(i % 2 == 0) E.pb(A[i]);
    }
    sort ALL(A);sort ALL(E);
    int Ei = 0,cnt = 0;
    REP(i,N){
        if(A[i] == E[Ei]){
            Ei++;
            if(i % 2 == 1) cnt++;
        }
    }
    cout << cnt << endl;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define ALL(a)  (a).begin(),(a).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef pair<long long, long long> Pll;
typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<long long> vll;
typedef vector<vector<long long>> vvll;
template <typename T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template <typename T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL << 60;
const int INT_INF = 1 << 30;
#define MOD 1000000007LL
#define endl "\n"

int main(){
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  ll N, C;
  cin >> N >> C;
  vll s(N), t(N), c(N);
  vector<priority_queue<Pll>> vque(C);
  priority_queue<Pll> que;
  for(int i = 0; i < N; i++){
    cin >> s.at(i) >> t.at(i) >> c.at(i);
    c.at(i)--;
    vque.at(c.at(i)).push(Pll(t.at(i), s.at(i)));
  }
  for(int i = 0; i < C; i++){
    while(!vque.at(i).empty()){
      Pll st = vque.at(i).top(); vque.at(i).pop();
      while(!vque.at(i).empty()){
        Pll next = vque.at(i).top();
        if(st.second == next.first){
          vque.at(i).pop();
          st.second = next.second;
        }
        else break;
      }
      que.push(st);
    }
  }
  vector<priority_queue<Pll, vector<Pll>, greater<Pll>>> ans(C);
  while(!que.empty()){
    ll ss = que.top().second;
    ll tt = que.top().first;
    que.pop();
    for(int i = 0; i < C; i++){
      if(ans.at(i).empty()){
        ans.at(i).push(Pll(ss, tt));
        break;
      }
      else if(ans.at(i).top().first > tt){
        ans.at(i).push(Pll(ss, tt));
        break;
      }
    }
  }
  ll count = 0;
  for(int i = 0; i < C; i++){
    if(ans.at(i).size() > 0) count++;
  }
  cout << count << endl;
}

Measured memory_bytes: 8688
package main
import (
	"fmt"
	"os"
	"bufio"
)

var sc = bufio.NewScanner(os.Stdin)

func main(){
	sc.Scan()
	str := sc.Text()
	// rev_str := make([]string, len(str))
	defer fmt.Println()
	for _, v := range []rune(str){
		defer fmt.Print(string(v))
	}
}


Measured memory_bytes: 1064
#include <iostream>
#include <algorithm>
#include <vector>
#include <string.h>
#define MOD 998244353
#define int long long
using namespace std;
long long T, N, a, b, c, d, e, f;
int psum[200100];
int m(int a, int b = MOD - 2)
{
	if (b == 0)
		return 1;
	if (b % 2)
	{
		return a * m(a, b - 1) % MOD;
	}
	else
	{
		int aa = m(a, b / 2);
		return aa * aa % MOD;
	}
}
signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cin >> a >> b >> c;
	int cc = 1;
	int ans = 0;
	int i;
	for (i = 0; i <= c; i++)
	{
		int p = b * m(b - 1, a - 1 - i)%MOD;
		p = p * cc % MOD;
		ans += p;
		cc *= (a - 1 - i);
		cc %= MOD;
		cc = cc * m(i + 1)%MOD;
	}
	cout << ans % MOD;
}

Measured memory_bytes: 3656
#include<stdio.h>
int main(void){
   int num, i, n, key;
   scanf("%d", &num);
   while ( num ) {
      key = 0;
      while ( num != 1) {
         if ( num % 2 == 0 ) num /= 2;
         else num = num * 3 + 1;
         key++;
      }
      printf("%d\n", key);
      scanf("%d", &num);
   }
   return 0;
}

Measured memory_bytes: 1704
#include <stdio.h>
#include <stdlib.h>

int compare_int(const void *a,const void *b){
  if(*(int*)a-*(int*)b > 0) return 1;
  return -1;
}

int main(void){
  int N,x;
  scanf("%d%d",&N,&x);

  int a[N];
  for (int i = 0; i < N; i++) {
    scanf("%d",&a[i]);
  }

  qsort(a,N,sizeof(int),compare_int);

  int ans = 0;
  for (int i = 0; i < N; i++) {
    if(i == N-1){
      if(x == a[i]) ans++;
    }else if(x >= a[i]){
      ans++;
      x -= a[i];
    }
  }

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

  return 0;
}

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

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

typedef long long ll;

int main() {
  int n, k;
  cin >> n >> k;
  vector<int> sum(n + 1, 0);
  map<int, int> cnt_map;

  ll cnt = 0;
  FOR(i, 0, n + 1) {
    int value;
    if (i != 0) {
      cin >> value;
      value += sum[i - 1];
      sum[i] = value % k;
    }
    if (i >= k) {
      int prev_i = i - k;
      int prev_sum_minus_i = (sum[prev_i] + k - prev_i % k) % k;
      cnt_map[prev_sum_minus_i]--;
    }
    int sum_minus_i = (sum[i] + k - i % k) % k;
    cnt += cnt_map[sum_minus_i];
    cnt_map[sum_minus_i]++;
  }
  cout << cnt << endl;
  return 0;
}

Measured memory_bytes: 10368
n = int(input())
V = input().split()

d0, d1 = {}, {}
for i in range(n//2):
    v = V[2*i]
    if v in d0:
        d0[v] += 1
    else:
        d0[v] = 1

    v = V[2*i+1]
    if v in d1:
        d1[v] += 1
    else:
        d1[v] = 1

s0 = sorted(d0.items(), key=lambda x: -x[1])
k0_0, v0_0 = s0[0]
s1 = sorted(d1.items(), key=lambda x: -x[1])
k1_0, v1_0 = s1[0]

if k0_0 != k1_0:
    print(n - v0_0 - v1_0)
else:
    k0_1, v0_1 = s0[1] if len(s0)>1 else ('0',0)
    k1_1, v1_1 = s1[1] if len(s1)>1 else ('0',0)
    if v0_0+v1_1 <= v0_1+v1_0:
        print(n - v1_0 - v0_1)
    else:
        print(n - v0_0 - v1_1)


Measured memory_bytes: 63856
fun nextPermutation(a: CharArray, b: Int, e: Int): Boolean {
  fun swap(a: CharArray, i: Int, j: Int) {
    val tmp = a[i]
    a[i] = a[j]
    a[j] = tmp
  }

  fun reverse(a: CharArray, b: Int, e: Int) {
    var b = b
    var e = e
    while (b < e) {
      e--
      swap(a, b, e)
      b++
    }
  }

  var e = e
  if (e - b < 2) return false
  val p = e
  e--
  while (b != e) {
    val q = e
    e--
    if (a[e] < a[q]) {
      var r = p
      while (a[e] >= a[--r]);
      swap(a, e, r)
      reverse(a, q, p)
      return true
    }
  }
  reverse(a, b, p)
  return false
}



fun main(args: Array<String>) {
  val s = readLine()!!
  if (s == "zyxwvutsrqponmlkjihgfedcba") {
    println(-1)
    return
  }
  // println("zyxwvutsrqponmlkjihgfedcba".reversed())
  if (s.length < 26) {
    val alphabet = "abcdefghijklmnopqrstuvwxyz"
    val c = alphabet.first { !s.contains(it) }
    println(s + c)
    return
  }

  val cs = s.toCharArray()
  nextPermutation(cs, 0, cs.size)
  val t = String(cs)
  for (i in 0 until t.length) {
    if (!s.startsWith(t.substring(0, i))) {
      println(t.substring(0, i))
      return
    }
  }
  // println(String(cs))
  throw RuntimeException()
}


Measured memory_bytes: 33744
from fractions import gcd


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

A.sort()
ans = int(1e9)
for i in range(0, N - 1):
    if A[i] < A[i + 1]:
        ans = min(ans, gcd(A[i], A[i + 1]))
    else:
        ans = min(ans, A[i])

print(ans)


Measured memory_bytes: 88428
import copy
n=int(input())
a=list(map(int,input().split()))
a.sort()
c=i=st=0

while i <n-1:
  
  if 2*(a[st]+c) >= a[i+1]:
    c+=a[i+1]
    i+=1
    
  else:
    c=a[st]+c
    st=i+1
    i+=1
    
print(n-st)

Measured memory_bytes: 21124
#include <bits/stdc++.h>
using namespace std;
 
#define rep(i, N) for (int i = 0; i < N; i++)
#define pb push_back
 
typedef long long ll;
typedef pair<ll, int> ll_i;

int main() {
    string s, ans="";
    ll w, i;
    cin >> s;
    cin >> w;
    for(i = 0;i < s.size(); i+=w){
        ans = ans + s[i];
    }
    cout << ans << endl;
	return 0;
}

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

using namespace std;

int main()
{
    int v;
    cin>>v;
    int a[v];
    int s[v];
    int d[v-1];
    int i=0;
    int sum=0;
    int eq;
    for( i=0;i<v;i++){
        cin>>a[i];
    }
    for( i=0;i<v;i++){
        cin>>s[i];
    }
    for( i=0;i<v-1;i++){
        cin>>d[i];
    }
    for( i=0;i<v-1;i++){
      if(a[i+1]-a[i]==1){
            eq=a[i]-1;
      sum+=d[eq];
      }
    }
    for(int y=0;y<v;y++){
        sum+=s[y];
    }
    cout<<sum;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n;
  cin>>n;
  vector<long long>A(n),pre(n);
  for(int i=0;i<n;i++)
  {
  	cin>>A[i];
  	pre[i]=i==0?A[i]:pre[i-1]+A[i];
  }
  vector<vector<long long>> dp(n,vector<long long>(n,pow(10,18)));
  for(int i=n-1;i>=0;i--)
  {
    for(int j=i;j<n;j++)
    {
      if(i==j)dp[i][j]=0;
      else if(j==i+1)dp[i][j]=pre[j]-pre[i]+A[i];
      else
      {
        for(int k=i;k<j;k++)
          dp[i][j]=min(dp[i][j],dp[i][k]+dp[k+1][j]+pre[j]-pre[i]+A[i]);
      }
    }
  }
  cout<<dp[0][n-1];
}
  

Measured memory_bytes: 4896
#include<stdio.h>
#include<stdlib.h>

int compare(const void *a, const void *b){
	long long int *A = (long long int *)a;
	long long int *B = (long long int *)b;
	if (*A > *B) return 1;
	if (*A < *B) return -1;
	return 0;
}

int main(){
	int N;
	scanf("%d",&N);
	long long A[N],B[N];
	for(int i=0;i<N;i++)scanf("%lld",&A[i]);
	for(int i=0;i<N;i++)scanf("%lld",&B[i]);
	
	long long D[N];
	int ok=0;
	int ng=0;
	for(int i=0;i<N;i++){
		D[i]=A[i]-B[i];
		if(D[i]>=0)ok++;
		else ng++;
	}
	
	qsort(D,N,sizeof(long long),compare);
	
	int ans=ng;
	int used=0;
	int saved=0;
	long long m=0;
	
	while(ng>0){
		if(m<(D[saved])*(-1)){
			if(ok==0){
				printf("-1\n");
				return 0;
			}	
			used++;
			m+=D[N-used];
			ok--;
		}
		
		if(m>=(D[saved])*(-1)){
			m-=(D[saved])*(-1);
			saved++;
			ng--;
		}
		
	}
	
	ans+=used;
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 3324
#include <iostream>
#include <vector>
#include <cstring>
#include <algorithm>
using namespace std;

int d[16];
int v[16],a[16],c[16];

int main(void){
    int n,m,k,l;
    int p;
    while(cin>>n>>m,!(n==0&&m==0)){
        memset(d,0,sizeof(d));
        memset(v,0,sizeof(v));
        memset(a,0,sizeof(a));
        memset(c,0,sizeof(c));
        for(int i=0;i<3;i++){
            cin>>k;
            for(int j=0;j<k;j++){
                cin>>l;
                v[l]=i;
            }
        }
        d[n]=2;
        a[n]=v[n];
        c[n]=2-v[n];
        while(--n>0){
            d[n]=3*d[n+1]+2;
            if(v[n]==0){
                a[n]=a[n+1];
                c[n]=c[n+1]+2*d[n+1]+2;
            }
            if(v[n]==1){
                a[n]=c[n+1]+d[n+1]+1;
                c[n]=a[n+1]+d[n+1]+1;
            }
            if(v[n]==2){
                a[n]=a[n+1]+2*d[n+1]+2;
                c[n]=c[n+1];
            }
        }
        p=min(a[1],c[1]);
        if(p>m)p=-1;
        cout<<p<<endl;
    }
    return 0;
}

Measured memory_bytes: 1160
import numpy as np

input_line = input().split()

a = int(input_line[0])
b = int(input_line[1])

x = a * b

if a < b:
	tmp = a
	a = b
	b = tmp

r = a % b
while r != 0:
	a = b
	b = r
	r = a % b

print(int(x / b))

Measured memory_bytes: 12420
using System;
 
namespace Sample
{
  class Sample
  {
    static void Main(string[] args)
    {
    string[] str=Console.ReadLine().Split(' ');
      int N=int.Parse(str[0]);
      int A=int.Parse(str[1]);
      int B=int.Parse(str[2]);
      string S=Console.ReadLine();
      int count=0;
      int fCount=0;
    for(int i=0;i<N;i++){
      if(S.Substring(i,1)=="c"){
        Console.WriteLine("No");
        continue;
    }else if(S.Substring(i,1)=="a"){
       if( count<(A+B)){
         Console.WriteLine("Yes");
         count++;
       }else{
         Console.WriteLine("No");
        
       }
      }
      else{
         if((count<(A+B))&&(fCount<B)){
           Console.WriteLine("Yes");
           count++;
           fCount++;
         }else{
           Console.WriteLine("No");
         }
         
             
    }
      }
      
    }
    
  }

}

Measured memory_bytes: 32604
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a[100],swap,temp;
    for(int i=0; i<3; i++)
    {
        cin>>a[i];
    }

    for(int i=0; i<3; i++)
    {
        for(int j=0; j<2; j++)
        {
            if(a[j]>a[j+1])
            {
                temp=a[j];
                a[j]=a[j+1];
                a[j+1]=temp;
            }
        }

    }
    for(int i=0; i<3; i++)
    {
        if(i<2)
        {
            cout<<a[i]<<" ";

        }
        else if(i>=2)
        {
            cout<<a[i];
        }
    }
    cout<<endl;


}



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

int main(void)
{
    int W, H, N;
    cin >> W >> H >> N;
    vector<vector<int>> square(W, vector<int>(W, 0));
    for(int i{0}; i<N; ++i){
        int x, y, a;
        cin >> x >> y >> a;
        switch(a){
            case 1:
                for(int j{0}; j<x; ++j){
                    for(int k{0}; k<H; ++k){
                        square[j][k]=1;
                    }
                }
                break;
            case 2:
                for(int j{x}; j<W; ++j){
                    for(int k{0}; k<H; ++k){
                        square[j][k]=1;
                    }
                }
                break;
            case 3:
                for(int j{0}; j<W; ++j){
                    for(int k{0}; k<y; ++k){
                        square[j][k]=1;
                    }
                }
                break;
            case 4:
                for(int j{0}; j<W; ++j){
                    for(int k{y}; k<H; ++k){
                        square[j][k]=1;
                    }
                }
                break;
        }
    }

    int sum{0};

    for(int j{0}; j<W; ++j){
        for(int k{0}; k<H; ++k){
            if(square[j][k]==0)
                ++sum;
        }
    }

    cout << sum << endl;

}


Measured memory_bytes: 256
/*~~~~~~ !! Roopam Mishra !!
 
    " ॐ नमः शिवाय "
    
    जो वास्तविक नहीं है उससे कभी भी मत डरो.
    
    “And don’t you dare call this code pathetic, you foul — you evil little cockroach!!”
    Even I don't understand now what I wrote, yet you are not allowed to call this pathetic..
                                                                                ~~~~~~*/
 
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
#define MOD 1000000007
#define INF 1000000000000000000
#define endll "\n"
#define pb push_back
#define forn(i,n) for(i=0;i<n;i++)
#define forab(i,a,b) for(i=a;i<=b;i++)
#define vpll vector<pair<ll,ll>>
#define pll pair<ll,ll>
#define vll vector<ll>
#define ff first
#define ss second
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define test ll t;cin>>t; while(t--)
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
int main() 
{
	fast_io;
	ll n,i;
	cin>>n;
	ll a[n],b[n],c[n];
	forn(i,n)
	{
	    cin>>a[i]>>b[i]>>c[i];
	    if(i)
	    {
	        a[i]=a[i]+max(b[i-1],c[i-1]);
	        b[i]=b[i]+max(a[i-1],c[i-1]);
	        c[i]=c[i]+max(b[i-1],a[i-1]);
	    }
	}
	cout<<max({a[n-1],b[n-1],c[n-1]})<<endll;
	return 0;
} 

Measured memory_bytes: 2560
#include <iostream>
#include <numeric>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <set>
#include <map>
using namespace std;
using ll=long long;
#define rep(i,a,b) for(ll i=a;i<b;i++)
int main(){
    string s;
    cin>>s;
    int n=s.size();
    int cnt=0;
    rep(i,0,n-1){
        if(s[i]!=s[i+1])cnt++;
    }
    cout<<cnt<<endl;
}

Measured memory_bytes: 512
int main(void)
{
    int a,b;
    scanf("%d %d",&a,&b);
    if(a<b){
        printf("a < b\n");
        }
    else if(a>b){
        printf("a > b\n");
        }
    else{
        printf("a == b\n");
        }
    return 0;
}

Measured memory_bytes: 580
import datetime;

s=input()
y,m,d=s.split('/')
y=int(y)
m=int(m)
d=int(d)

d1= datetime.date(y,m,d)
Heisei=datetime.date(2019,4,30)

if(Heisei>=d1):
    print('Heisei')
else:
    print('TBD')

Measured memory_bytes: 3312
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
using namespace std;
//変数デバッグ
#define DEB(variable) cout << #variable << '=' << variable << endl

//for簡易表記(引数ミス防止)
#define FOR(LoopVariable,numberOFbegin,numberOFend) for (int LoopVariable = (numberOFbegin); (LoopVariable) < (numberOFend); (LoopVariable)++)
#define REP(LoopVariable,numberOFend) for(int LoopVariable = 0;(LoopVariable)<(numberOFend);LoopVariable++)


int main(){

    int d;
    cin >> d;
    cout << "Christmas";
    REP(i,25-d){
        cout << " Eve";
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 888
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
//                       _oo0oo_                         //
//                      o8888888o                        //
//                      88" . "88      ------ hzt1       //
//                      (| -_- |)                        //
//                      0\  =  /0                        //
//                    ___/`---'\___                      //
//                  .' \|     |// '.                     //
//                 / \|||  :  |||// \                    //
//                / _||||| -:- |||||- \                  //
//               |   | \  -  /// |     |                 //
//               | \_|  ''\---/''  |_/ |                 //
//               \  .-\__  '-'  ___/-. /                 //
//             ___'. .'  /--.--\  `. .'___               //
//          ."" '<  `.___\_<|>_/___.' >' "".             //
//         | | :  `- \`.;`\ _ /`;.`/ - ` : | |           //
//         \  \ `_.   \_ __\ /__ _/   .-` /  /           //
//     =====`-.____`.___ \_____/___.-`___.-'=====        //
//                       `=---='                         //
//                                                       //
//                                                       //
//     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~       //
//                                                       //
//                 God-He Bless All.                     //
//           This Code Will Never Explode.               //
//                                                       //
//                                                       //
///////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////
#include<cstdio>
#include<cstring>
#include<cctype>
#include<algorithm>
#include<vector>
#define pb push_back
#define mp make_pair
#define xx first
#define yy second
#define rep(i,a,b) for(int i=(a),i##_end_=(b);i<=i##_end_;i++)
#define dwn(i,a,b) for(int i=(a),i##_end_=(b);i>=i##_end_;i--)
using namespace std;
const int Size=1<<16;
char buffer[Size],*head,*tail;
inline char Getchar() {
    if(head==tail) {
        int l=fread(buffer,1,Size,stdin);
        tail=(head=buffer)+l;
    }
    if(head==tail) return -1;
    return *head++;
}
inline int read() {
    int x=0,f=1;char c=getchar();
    for(;!isdigit(c);c=getchar()) if(c=='-') f=-1;
    for(;isdigit(c);c=getchar()) x=x*10+c-'0';
    return x*f;
}
typedef long long ll;
const int maxn=510;
int n,m,h,w;
int A[maxn][maxn];
int main() {
	n=read();m=read();h=read();w=read();
	if(n%h==0&&m%w==0) puts("No");
	else {
		puts("Yes");
		rep(i,1,n) rep(j,1,m) {
			if(i%h==0&&j%w==0) printf("%d",-(h*w-1)*1000-1);
			else printf("%d",1000);
			putchar(j==m?'\n':' ');
		}
	}
	return 0;
}


Measured memory_bytes: 1536
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define watch(x) cout << (#x) << " is " << (x) << endl

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

const int MOD = 1e9 + 7;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int cnt = 0;
    int n; cin >> n;
    string s; cin >> s;
    string init = "000";
    vector<string> possible;
    for(int i = 0; i < 10; i++)
    {
        for(int j = 0; j < 10; j++)
        {
            for(int k = 0; k < 10; k++)
            {
                string tmp = init;
                tmp[0] += i;
                tmp[1] += j;
                tmp[2] += k;
                possible.push_back(tmp);
            }
        }
    }
    for(int i = 0; i < 1000; i++)
    {
        int j = 0;
        while(j < n && s[j] != possible[i][0]) j++;
        if(j == n) continue;
        if(s[j] == possible[i][0]) j++;
        while(j < n && s[j] != possible[i][1]) j++;
        if(j == n) continue;
        if(s[j] == possible[i][1]) j++;
        while(j < n && s[j] != possible[i][2]) j++;
        if(j == n) continue;
        cnt++;
    }
    cout << cnt;

    return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <cmath>
#include <string>
#include <algorithm>
#include <iomanip>
#include <map>
#include <bitset>
#include <cstdio>
#include <set>
#include <stack>
#include <queue>
#include <cassert>
#include <numeric>
//#include <bits/stdc++.h>
#define rep(i,n) Rep(i,0,n)
#define Rep(i,k,n) for(int i=k ; i<n ; i++)
#define rep1(i,n) for(int i=1 ; i<=n ; i++)
#define vi vector<int>
#define vii vector<vector<int>>
#define mii map<int,int>
#define Sort(v) sort(v.begin(),v.end())
#define Reverse(v) reverse(v.begin(),v.end())
#define ALL(a)  (a).begin(),(a).end()
#define pb push_back
//#define int ll
typedef long long ll;

const int md = 1000000007;
const int INF = 1<<30;
using namespace std;

string yn(bool x){
    return x ? "Yes" : "No";
}

int abs(int x){
    return x >= 0 ? x : -x;
}



int main(){
    
    vi n(3);
    rep(i,3) cin >> n[i];

    Sort(n);

    cout << n[0] * n[1] * 0.5 << endl;

}


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

using namespace std;
typedef long long LL;
typedef pair <LL, int> P;
const int Maxn = 2e5 + 5;
LL a[Maxn], f[Maxn];
int n;
LL k;
P vec[Maxn];
bool check(LL x){
    LL cnt = 0;
    priority_queue <P> pq;
    for (int i = 1; i <= n; i++){
        pq.push(P(f[i] * a[n + 1 - i], f[i]));
    }
    while (!pq.empty()){
        P tmp = pq.top();
        pq.pop();
        if (tmp.first <= x) return true;
        cnt += (tmp.first - x - 1) / tmp.second + 1;
        if (cnt > k) return false;
    }
    return true;
}
int main(){
    scanf("%d%lld", &n, &k);
    for (int i = 1; i <= n; i++)
        scanf("%lld", &a[i]);
    for (int i = 1; i <= n; i++)
        scanf("%lld", &f[i]);
    sort(a + 1, a + n + 1);
    sort(f + 1, f + n + 1);
    for (int i = 1; i <= n; i++){
        vec[i] = P(f[i] * a[n + 1 - i], f[i]);
    }
    sort(vec + 1, vec + n + 1);
    LL l = 0, r = vec[n].first;
    while(l < r){
        LL m = (l + r) >> 1;
        if (check(m))
            r = m;
        else
            l = m + 1;
    }
    cout << l << endl;
}



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

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

    int cnt = 0;
    for (int i = 1; i <= N; i++)
    {
        // 桁数を見る
        std::string s = std::to_string(i);
        if (s.size() % 2 == 1) cnt++;
    }
    std::cout << cnt << std::endl;

    return 0;
}

Measured memory_bytes: 256
#標準入力
i = int(input())
str1 = input()

#まるばつスタンプの数を数えまるばつスタンプを消す
i = str1.count("OX")
line = str1.split("OX")

#リストに残った要素で文字列を作り、ばつまるスタンプの数を数える
str2 = "".join(line)
print(i + str2.count("XO"))


Measured memory_bytes: 6624
#include <bits/stdc++.h>
using namespace std;
 
int main() {
 int N,x,n;
 int a =0;
 cin >> N;
  n = N;
  while(true){
    x = n%10;
    a += x;
    n = n/10;
    if(n == 0){
      break;
    }
  }
  if(N%a == 0){
    cout << "Yes" <<endl;
  }else{
    cout << "No" <<endl;
  }
}

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

#define ALL(v) v.begin(), v.end()
#define V vector
#define P pair
using ll = long long;
using ld = long double;
const int MOD = 1e9+7;
const ll INF = 1LL << 60;


int main() {
    int n; cin >> n;
    string s; cin >> s;
    int k; cin >> k;
    k--;
    for(int i = 0; i < n; i++){
        if(s[i] == s[k]) cout << s[i];
        else cout << '*';
    }
    cout << '\n';

    return 0;
}


Measured memory_bytes: 3492
def get_i() #空白区切の入力を数値(整数)の配列で返す
  return gets.chomp.split(" ").map(&:to_i)
end
def get_f() #空白区切の入力を数値(実数)の配列で返す
  return gets.chomp.split(" ").map(&:to_f)
end
def get() #空白区切の入力を文字列の配列で返す
  return gets.chomp.split(" ")
end
def get_nsp() #入力されたものを一文字ずつに区切った文字列の配列で返す
  return gets.chomp.split("")
end
def yn_judge(bool,y="Yes",n="No") #boolに真偽を投げることで、trueならy、falseならnの値を出力する
  return bool ? y : n 
end
def array(size1,init=nil,size2=1) #size2に二次元配列時の最初の要素数、size1に次の配列の大きさ、initに初期値を投げることでその配列を返す
  if size2==1
    return Array.new(size1){init}
  else
    return Array.new(size2){Array.new(size1){init}}
  end
end

N,M=get_i
ans=array(N,-1)
if M.zero? and N==1
    puts 0
    exit
elsif M.zero?
    N.times do|i|
        if i.zero?
            ans[i]=1
        else
            ans[i]=0
        end
    end
    puts ans.join("")
    exit
end
M.times do|i|
  s,c=get_i
  s-=1
  if ans[s]==-1
      ans[s]=c
  elsif ans[s]!=c
      ans=[-1]
      break
  end
end
if ans==[-1]
    puts "-1"
    exit
end
N.times do|i|
    if i.zero? and i!=N-1 and ans[i].zero?
    ans=[-1]
    break
    elsif i.zero? and ans[i]==-1
      ans[i]=1
  elsif ans[i]==-1
    ans[i]=0 
  end
end
puts ans.join("")

Measured memory_bytes: 1788
import java.util.*;
public class Main
{
    public static void main(String[] args) 
    {
      Scanner s = new Scanner(System.in);
      int h = s.nextInt();
      int k = s.nextInt();
      
      Integer a[] = new Integer[h];
      long sum=0;
      for(int i = 0; i <= h-1 ;i++)
        {
            a[i] = s.nextInt();
        }
      Arrays.sort(a, Collections.reverseOrder()); 
       
      for(int j = k; j<h; j++ )
      {
        sum = sum + a[j];
      }
      System.out.println("" + sum);
    }
      
   
}

Measured memory_bytes: 98680
S = int(input())
h = 0
m = 0
s = 0
 
while True:
    if S >= 3600:
        h += 1
        S -= 3600
    elif S >= 60:
        m += 1
        S -= 60
    else:
        break
 
print(str(h) + ":" + str(m) + ":" + str(S))

Measured memory_bytes: 7652