akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define all(x) (x).begin(),(x).end()
template <class T> inline bool chmin(T &a, T b) {if (a > b){a = b;return true;}return false;}
template <class T> inline bool chmax(T &a, T b) {if (a < b){a = b;return true;}return false;}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;cin>>n;
    set<string> ss;
    rep(i, n){
        string s; cin>>s;
        ss.insert(s);
    }
    cout<<ss.size()<<endl;
}

Measured memory_bytes: 19276
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <cassert>
#include <utility>
#include <set>
using namespace std;
using ll = int64_t;
using pll = pair<ll,ll>;

// possible iff for each X, BC[X] <= n-AC[x] i.e. the number of Bs we have to place is <= the number of spots
// where it is legal to place a B i.e. AC[X]+BC[X] <= n
// At each position put the X with the highest AC[X]+BC[X] as long as BC[X]>0?

struct Data {
  Data(vector<ll> COUNT, vector<ll> BC_) {
    BC = vector<ll>(BC_.begin(), BC_.end());
    C = vector<ll>(COUNT.begin(), COUNT.end());
    for(ll i=0; i<C.size(); i++) {
      if(C[i] > 0 && BC[i] > 0) {
        V.insert({C[i], i});
      }
    }
  }
  void subtractA(ll x) {
    V.erase({C[x], x});
    C[x]--;
    if(C[x] > 0) {
      V.insert({C[x], x});
    }
  }
  void subtractB(ll x) {
    BC[x]--;
    if(BC[x] == 0) {
      V.erase({C[x], x});
      C[x] = 0;
    } else {
      subtractA(x);
    }
  }
  ll max(ll neq) {
    /*for(auto [x,y] : V) {
      cerr << x << " " << y << endl;
    }*/
    auto it = V.begin();
    if(it->second != neq) {
      return it->second;
    } else {
      it++;
      assert(it->second != neq);
      return it->second;
    }
  }
  vector<ll> BC;
  vector<ll> C;
  multiset<pll,greater<pll>> V;
};

int main() {
  ll n;
  cin >> n;
  vector<ll> A(n, 0);
  vector<ll> B(n, 0);
  vector<ll> C(n+1, 0);
  vector<ll> BC(n+1, 0);
  for(ll i=0; i<n; i++) {
    cin >> A[i];
    C[A[i]]++;
  }
  for(ll i=0; i<n; i++) {
    cin >> B[i];
    C[B[i]]++;
    BC[B[i]]++;
  }
  for(ll i=0; i<=n; i++) {
    if(C[i]>n) {
      cout << "No" << endl;
      return 0;
    }
  }

  Data d(C, BC);

  vector<ll> ANS(n, 0);
  for(ll i=0; i<n; i++) {
    d.subtractA(A[i]);
    ll x = d.max(A[i]);
    ANS[i] = x;
    d.subtractB(x);
  }
  cout << "Yes" << endl;
  for(ll i=0; i<n; i++) {
    cout << ANS[i];
    if(i+1 < n) {
      cout << " ";
    } else {
      cout << endl;
    }
  }
}


Measured memory_bytes: 27724
#include <iostream>
using namespace std;
 
int main() {

    int a, b, c, big, middle, small;
    
    cin >> a >> b >> c;
    
    if(a > b && a > c){
        big = a;
        if( b > c){
            middle = b;
            small = c;
        } else {
            middle = c;
            small = b;
        }
    }else if (b > a && b > c){
        big = b;
        if( a > c){
            middle = a;
            small = c;
        } else {
            middle = c;
            small = a;
        }
    }else{
         big = c;
        if( a > b){
            middle = a;
            small = b;
        } else {
            middle = b;
            small = a;
        }
    }
        
        cout << small << " " << middle <<" " << big <<endl;
    
}


Measured memory_bytes: 3092
#include <stdio.h>
#include <string.h>
#define S_MAX 100000
char S[S_MAX];
int d[S_MAX]={};
int i,L_cnt=0,R_cnt=0;
int N;

int main(void){
    scanf("%s",S);
    N = strlen(S);
    
    for(i=0;i<N-1;i++){
        if(S[i] == 'R')L_cnt++;
        if(S[i] == 'R' && S[i+1]=='L'){
            d[i] += (L_cnt+1)/2;
            d[i+1] += (L_cnt+2)/2;
            L_cnt =0;
        }
        if(S[N-1-i] == 'L')R_cnt++;
        if(S[N-1-i] == 'L' && S[N-2-i]=='R'){
            d[N-1-i] += (R_cnt+1)/2-1;
            d[N-2-i] += (R_cnt+2)/2-1;
            R_cnt =0;
        }
    }
    for(i=0;i<N-1;i++)printf("%d ",d[i]);
    printf("%d",d[N-1]);
    return 0;
}


Measured memory_bytes: 896
n,m,c=map(int,input().split())
a=list(map(int,input().split()))
p=0
for i in range(n):
    b=list(map(int,input().split()))
    d=c
    for j in range(m):
        d+=a[j]*b[j]
    else:
        if d>0:
            p+=1
print(p)

Measured memory_bytes: 3060
#include <iostream>
#include <sstream>
#include <vector>
#include <cassert>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <utility>
#include <tuple>
#include <regex>
#include <map>

using namespace std;
using ull = unsigned long long;

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

	vector<ull> vec(N);

	for (size_t i = 0; i < N; i++) {
		cin >> vec[i];
	}

	ull ans = N;
	for (size_t i = 0; i < N; i++) {
		for (size_t j = 0; j < i; j++) {
			if (vec[j] > vec[i]) {
				ans--;
				break;
			}
		}
	}

	cout << ans << endl;


	return 0;
}


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

#define REP(i,num) for(int i=0;i<(num);++i)
#define LOOP(i) while(i--)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto pitr=c.begin();pitr!=c.end();++pitr){cout<<*pitr;if(next(pitr,1)!=c.end())cout<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout<<fixed<<setprecision(10);
	
	int H=in(),W=in();
	vector<vector<int>> M(H,vector<int>(W,0));
	int N=in();
	auto C=vecin(N);
	
	auto func = [&](int& u,int& v,int c){
		M[v][u]=c+1;
		if(u<W-1 && !M[v][u+1]){
			u++;
		}
		else if(v<H-1 && !M[v+1][u]){
			v++;
		}
		else if(u>0 && !M[v][u-1]){
			u--;
		}
		else{
			v--;
		}
	};

	int x=0,y=0;
	REP(i,N){
		REP(j,C[i]){
			func(x,y,i);
		}
	}
	REP(i,H){
		PRINTALL(M[i]);
	}
	return 0;
}


Measured memory_bytes: 384
a = int(input())
l = list(map(int,input().split()))

b = sum((i % 2 != 0)  for i in l)
bb = sum((i % 2 == 0)  for i in l)
bbbb  = sum((i % 4 == 0)  for i in l)

bb -= bbbb
if bbbb+1 >= b + (bb != 0):print("Yes")
else:print("No") 

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

#define int long long

using pii = pair<int, int>;

int N;
vector<int> A, B;
vector<pii> C; // {A_i + B_i, インデックス}

signed main() {
  cin >> N;
  A.resize(N);
  B.resize(N);
  for (int i = 0; i < N; i++) {
    cin >> A[i] >> B[i];
    C.push_back({A[i] + B[i], i});
  }
  sort(C.begin(), C.end());
  reverse(C.begin(), C.end());

  int tSum = 0, aSum = 0;
  for (int i = 0; i < N; i++) {
    int index = C[i].second;
    if (i % 2 == 0) {
      tSum += A[index];
    } else {
      aSum += B[index];
    }
  }

  cout << tSum - aSum << endl;

  return 0;
}

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

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

  int count = 0;

  rep(i, n) {
    count += i;
  }

  rep(i, m) {
    count += i;
  }

  cout << count << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  char s[10];
  cin >> s;
  if(strcmp(s,"Sunny")==0)cout << "Cloudy" << endl;
  if(strcmp(s,"Cloudy")==0)cout << "Rainy" << endl;
  if(strcmp(s,"Rainy")==0)cout << "Sunny" << endl;
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <array>
#include <queue>
#include <deque>
#include <set>
#include <list>
#include <map>
#include <stack>
#include <utility>
#include <bitset>
#include <complex>
#include <algorithm>
#include <numeric>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <climits>
#include <random>
#include <functional>
#include <sstream>
#include <iomanip>

using namespace std;

#define rep(i, n) for(int i=0; i<(n); i++)
#define FOR(i, m, n) for(int i=(m);i<(n);i++)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define SORT(x) sort((x).begin(),(x).end())
#define REVE(x) reverse((x).begin(),(x).end())
#define mp make_pair
#define pb push_back
#define Cout(x) cout << (x) << endl
#define Cout2(x, y) cout << (x) << " " << (y) << endl
#define dump(x) cout << #x << " = " << (x) << endl;
#define forauto(i, a) for(auto i : a)cout << i << " "; puts("");

typedef long long LL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
typedef pair<double, double> PDD;
typedef complex<double> CD;

int main() {
	int n, q; cin >> n >> q;
	queue<pair<string,int>> que;
	rep(i, n) {
		string name; int time;
		cin >> name >> time;
		que.push(mp(name, time));
	}

	int now = 0;
	while (!que.empty()) {
		string str = que.front().first;
		int tim = que.front().second;
		que.pop();

		if (tim <= q) {
			now += tim;
			Cout2(str, now);
		}
		else {
			que.push(mp(str, tim - q));
			now += q;
		}
	}
}


Measured memory_bytes: 6264
import java.util.Scanner;

public class Main {
    public static void main(String [] args) {
        Scanner scanner = new Scanner(System.in);
        String s = scanner.next();
        int current = 0;
        int max = 0;
        for (int i = 0; i < s.length(); ++i) {
            char c = s.charAt(i);
            if (c == 'A' || c == 'T' || c == 'C' || c == 'G') {
                ++current;
            } else {
                max = Math.max(max, current);
                current = 0;
            }
        }
        max = Math.max(max, current);
        System.out.println(max);
    }
}


Measured memory_bytes: 23380
N, X = map(int, input().split())
distance = [abs(int(i)-X) for i in input().split()]

ans = distance[0]

# ユークリッドの互除法
def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y) 

for i in range(N):
    ans = gcd(ans, distance[i])

print(ans)


Measured memory_bytes: 14248
n = int(input())
mod = 1000000007


def _mod(x, y):
    res = 1
    for i in range(y):
        res = (res * x) % mod
    return res


ans = _mod(10, n) - _mod(9, n) - _mod(9, n) + _mod(8, n)
ans %= mod
ans = (ans + mod) % mod
print(ans)


Measured memory_bytes: 9084
import Foundation

#if swift(>=4.0)
extension String {
    func split(by separator: String) -> [String] {
        return self.components(separatedBy: separator)
    }
    func toArray() -> [String] {
        return self.map{String($0)}
    }
}
func exponentiate(_ lhs: Int, _ rhs: Int) -> Int {
    return (0..<rhs).reduce(1){i,_ in i*lhs}
}
#else
extension String {
    func split(by separator: String) -> [String] {
        return self.componentsSeparatedByString(separator)
    }
    var count: Int {
        return self.characters.count
    }
    func toArray() -> [String] {
        return self.characters.map{String($0)}
    }
    func uppercased() -> String {
        return self.uppercaseString
    }
    func lowercased() -> String {
        return self.lowercaseString
    }
}
//extension Array where Element == String {
//    func joined(separator separator: String) -> String {
//        return self.joinWithSeparator(separator)
//    }
//}
extension Array where Element: Comparable {
    func max() -> Element {
        return self.maxElement()!
    }
    func min() -> Element {
        return self.minElement()!
    }
    func sorted() -> Array {
        return self.sort()
    }
    func reversed() -> Array {
        return self.reverse()
    }
    mutating func sort() {
        self.sortInPlace()
    }
}
extension Array {
    init(repeating: Element, count: Int) {
        self.init(count: count, repeatedValue: repeating)
    }
}
func stride<T: Strideable>(from start: T, to end: T, by stride: T.Stride) -> StrideTo<T> {
    return start.stride(to: end, by: stride)
}
func exponentiate(lhs: Int, _ rhs: Int) -> Int {
    return (0..<rhs).reduce(1){i,_ in i*lhs}
}
#endif
func readInt() -> Int? {
    return Int(readLine()!)
}
func readStringSplit(by separator: String) -> [String] {
    return readLine()!.split(by: separator)
}
func readIntSplit(by separator: String) -> [Int] {
    return readLine()!.split(by: separator).map{Int($0)!}
}

/*************** テストスペース ***************/

//var min, min2, count: Int!
//for i in 1...10 {
//    let x = Int(readLine()!)!
//    if i == 1 {
//        min = x
//        count = 1
//    } else if x < min {
//        min2 = min
//        min = x
//        count = 1
//    } else if x == min && count == 1 {
//        min2 = x
//        count = 2
//    }
//}
//print(min2)

/*************** メインプログラム ***************/

let N = readInt()!
let card = readIntSplit(by: " ").sorted().reversed()
var alice = 0
var bob = 0
for i in 0..<N {
    if i % 2 == 0 {
        alice += card[i]
    } else {
        bob += card[i]
    }
}
print(alice - bob)


Measured memory_bytes: 8036
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,n) for(ll i=0;i<n;i++)
#define P pair<ll,ll>
#define Graph vector<vector<ll>>
#define INF (1ll<<60)
#define mod 1000000007
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return true;} return false;}
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return true;} return false;}

int main(){
    ll n,q;cin>>n;
    vector<ll> a(n);
    vector<ll> exist(100010,0);
    rep(i,n) cin>>a[i];

    ll ans=0;
    rep(i,n){
        exist[a[i]]++;
        ans+=a[i];
    }

    cin>>q;
    rep(i,q){
        ll b,c;
        cin>>b>>c;

        ll ins=exist[b];
        exist[b]=0;
        exist[c]+=ins;

        ans-=ins*b;
        ans+=ins*c;

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

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

using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef double db; 
typedef string str;
 
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
 
#define pb push_back
#define f first
#define s second
#define all(x) x.begin(), x.end()
#define endl '\n'
 
const ll MOD = 1000000007;

bool check(vector<int> a, int m, int k) {
   int cuts = 0;
   for (int i : a)
      cuts += (i - 1) / m;
   return cuts <= k;
}

int main() {
   int n, k; scanf("%d%d", &n, &k);
   vector<int> a(n);
   for (int &i : a)
      scanf("%d", &i);
   int ans = -1;
   int l = 1;
   int r = 1;
   for (int i : a)
      r = max(r, i);
   while (l <= r) {
      int m = (l + r) / 2;
      if (check(a, m, k)) {
         ans = m;
         r = m - 1;
      } else {
         l = m + 1;
      }
   }
   printf("%d", ans);
   return 0;
}

Measured memory_bytes: 4900
//FIRST THINK THEN CODE.

#include <bits/stdc++.h>
 
 
using namespace std;
 
typedef long long ll;
 
//#define MOD 998244353
#define rep(i,a,b) for(ll i=a;i<b;++i)
#define rrep(i,a,b) for(ll i=a;i>b;--i)
#define FOR(i,n)  for(ll i=0;i<n;i++)
#define vi vector<int>
#define vl vector<ll>
#define ld long double
#define vvi vector<vector<int>>
#define vvl vector<vector<long long>>
#define pii pair<int,int>
#define pll pair<long,long>
#define vpii vector<pii>
#define vpll vector<pll>
#define ff first
#define ss second
#define pb push_back
#define pf push_front
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define bs binary_search
#define d1(x) cout<<(x)<<endl
#define d2(x,y) cout<<(x)<<" "<<(y)<<endl
#define d3(x,y,z) cout<<(x)<<" "<<(y)<<" "<<(z)<<endl
#define d4(a,b,c,d) cout<<(a)<<" "<<(b)<<" "<<(c)<<" "<<(d)<<endl
#define PI 3.1415926535897932384626433832795
#define fix(f,n) fixed<<setprecision(n)<<f
#define all(x) x.begin(),x.end()
#define rev(p) reverse(p.begin(),p.end());
#define endl "\n"
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define popcount(x) __builtin_popcountll(x)
#define sz(x) ((ll)x.size())
const ll M=1000000007;
const ll MM=998244353;
ll begtime = clock();
#define end_routine() cout << "\n\nTime elapsed: " << (clock() - begtime)*1000/CLOCKS_PER_SEC << " ms\n\n";

 
ll newmod(ll a,ll b)
 {
  return ((a%b)+b)%b;
}
 
 
ll powM(ll a,ll b,ll m )
{ 
  if(a<=0)return 0;
  a%=m;
  if(!b)return 1;
  ll ans=1LL;
  while(b)
  {
    if(b&1)ans=ans*a%m;
    a=a*a%m;
    b>>=1;
  }
 
return ans;
}


 
ll poww(ll a,ll b)
{ 
  
  ll ans=1;
  while(b)
  {
    if(b&1)ans=ans*a;
    a=a*a;
    b>>=1;
  }
 
return ans;

}

template<typename T,typename F>
void chmax( T &a,F b){
  if(b>a)a=b;
}

template<typename T,typename F>
void chmin( T &a,F b){
  if(b<a)a=b;
}



const ll N=2e5+5;




int main()
{ 

IOS;

ll a,b;
cin>>a>>b;

for(int i=b-a+1;i<=b+a-1;i++)cout<<i<<" ";

//end_routine();

return 0;
 
 }

Measured memory_bytes: 3600
def main():
    N = int(input())
    a = list(map(int, input().split()))
    num_dict = {}
    a.sort()
    a_max = a[N-1]
    temp = a[0]
    sum = 1

    for i in range(1,N):
        if temp == a[i]:
            sum += 1
        else:
            num_dict[temp] = sum
            sum = 1
            temp = a[i]
    num_dict[a[N-1]] = sum

    ans = 0
    judge = 0
    for j in range(1, a_max):
        #j=1のときは特別
        if j == 1 and j in num_dict:
            if j+1 in num_dict:
                judge = num_dict[j] + num_dict[j+1]
                ans = judge
                continue
            else:
                judge = num_dict[j]
                ans = judge
                continue

        if (j in num_dict) and (j-1 in num_dict) and (j+1 in num_dict):
            if judge <= (num_dict[j-1] + num_dict[j] + num_dict[j+1]):
                judge = num_dict[j-1] + num_dict[j] + num_dict[j+1]
                ans = judge
                continue
            else:
                continue

        elif (j in num_dict) and (j-1 in num_dict):
            if judge <= (num_dict[j-1] + num_dict[j]):
                judge = num_dict[j-1] + num_dict[j]
                ans = judge
                continue
            else:
                continue

        elif (j in num_dict) and (j+1 in num_dict):
            if judge <= (num_dict[j+1] + num_dict[j]):
                judge = num_dict[j+1] + num_dict[j]
                ans = judge
                continue
            else:
                continue

        elif (j-1 in num_dict) and (j+1 in num_dict):
            if judge <= (num_dict[j+1] + num_dict[j-1]):
                judge = num_dict[j+1] + num_dict[j-1]
                ans = judge
                continue
            else:
                continue

        elif j in num_dict:
            if judge <= (num_dict[j]):
                judge = num_dict[j]
                ans = judge
                continue
            else:
                continue

        else:
            continue

    if a_max-1 in num_dict:
        if judge <= num_dict[a_max-1] + num_dict[a_max]:
            ans = num_dict[a_max-1] + num_dict[a_max]
    else:
        if judge <= num_dict[a_max]:
            ans = num_dict[a_max]
    return ans

print(main())


Measured memory_bytes: 14008
#[allow(unused_imports)]
use {
   proconio::{fastout, input, marker::*},
   std::cmp::*,
   std::collections::*,
};

#[fastout]
fn main() {
   input! {
      x: i64,
   }
   if x >= 30 {
      println!("Yes");
   }else {
      println!("No");
   }
}


Measured memory_bytes: 2196
time = [int(input()) for _ in range(5)] 

extra = [0]*5

for i in range(5):
	extra[i] = (0 if time[i] % 10 == 0 else 10 - (time[i] % 10) )

ex = sum(extra) - max(extra) # 商品が届いてからの余剰時間を最小化したいので、最大の余剰時間を引く
print(sum(time) + ex)


Measured memory_bytes: 2940
#include<bits/stdc++.h>
using namespace std;
const int N=2e5+5;
int n,m,a[N],c[N],b[N],hs[N],tot,head[N],nex[N<<1],to[N<<1],wi[N<<1];
void add(int u,int v,int w){to[++tot]=v;nex[tot]=head[u];head[u]=tot;wi[tot]=w;}
bool vis[N],use[N];
int lowb(int x)
{
    return lower_bound(hs+1,hs+1+n,x)-hs;
}
int uppb(int x)
{
    return upper_bound(hs+1,hs+1+n,x)-hs;
}
bool dfs(int u)
{
    vis[u]=true;
    int x=c[u];
    for(int i=head[u];i;i=nex[i])
    {
        int v=to[i];
        if(!vis[v]&&dfs(v))
        {
            x^=1;use[wi[i]]=true;
        }
    }
    return x;
}
int main()
{
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++)
        scanf("%d%d",&a[i],&b[i]),hs[i]=a[i];
    sort(hs+1,hs+1+n);
    for(int i=1;i<=n;i++)
        a[i]=lowb(a[i]),c[a[i]]=b[i];
    for(int i=n+1;i>=1;i--)
        c[i]^=c[i-1];
    for(int i=1;i<=m;i++)
    {
        int l,r;scanf("%d%d",&l,&r);
        l=lowb(l);
        r=uppb(r)-1;
        if(l<=r)
            add(l,r+1,i),add(r+1,l,i);
    }
    for(int i=1;i<=n+1;i++)
        if(!vis[i]&&dfs(i))
    {
        printf("-1\n");return 0;
    }
    int ans=0;
    for(int i=1;i<=m;i++)
        if(use[i]) ans++;
    printf("%d\n",ans);
    for(int i=1;i<=m;i++)
    if(use[i])
        printf("%d ",i);
}


Measured memory_bytes: 11008
n, m = map(int, input().split())
x = list(map(int, input().split()))

dis = []
if m <= n:
    print(0)
else:
    x.sort()
    for i in range(m - 1):
        dis.append(abs(x[i] - x[i + 1]))
    dis.sort()
    sum(dis[- n + 1:])
    print(sum(dis[:m - n]))


Measured memory_bytes: 20500
#include <iostream>
#include <vector>
#include <array>
#include <list>
#include <queue>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <string>
#include <sstream>
#include <algorithm>
#include <random>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
#include <cassert>
#include <climits>
#include <bitset>

#define FOR_LT(i, beg, end) for (int i = beg; i < end; i++)
#define FOR_LE(i, beg, end) for (int i = beg; i <= end; i++)
#define FOR_DW(i, beg, end) for (int i = beg; end <= i; i--)

using namespace std;

unordered_multimap<int, int> tree;
int num[200001] = { 0 };

pair<int, int> most_distant(int p, unordered_multimap<int, int>& trees)
{
	FOR_LE(i, 0, 200000) {
		num[i] = -1;
	}
	queue<int> search;
	search.push(p);
	num[p] = 1;

	while (!search.empty()) {
		int p2 = search.front();
		search.pop();

		auto it = trees.find(p2);
		while (it != trees.end() && it->first == p2) {
			if (num[it->second] != -1) {
				it++;
				continue;
			}

			num[it->second] = num[it->first] + 1;
			search.push(it->second);
			it++;
		}
	}

	pair<int, int> ans = { 0, 0 };
	FOR_LE(i, 1, 200000) {
		if (ans.second < num[i]) {
			ans.first = i;
			ans.second = num[i];
		}
	}

	return ans;
}

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

	FOR_LT(i, 0, n - 1) {
		int a, b; cin >> a >> b;
		tree.insert(make_pair(a, b));
		tree.insert(make_pair(b, a));
	}

	// 末端の数
	auto s = most_distant(1, tree);
	auto u = most_distant(s.first, tree);
	
	if ((u.second + 1) % 3 != 0) {
		cout << "First" << endl;
	}
	else {
		cout << "Second" << endl;
	}

	return 0;
}

Measured memory_bytes: 18420
public class Main {
  private static void solve() {
    int n = ni();
    long l = nl();
    long[] a = nal(n);
    
    
    for (int i = 0; i < n - 1; i ++) {
      if (a[i] + a[i + 1] >= l) {
        System.out.println("Possible"); 
        for (int j = 1; j <= i; j ++) {
          System.out.println(j);
        }
        for (int j = n - 1; j > i + 1; j --) {
          System.out.println(j);
        }
        System.out.println(i + 1);
        return;
      }
    }
    System.out.println("Impossible");
  }

  public static void main(String[] args) {
    new Thread(null, new Runnable() {
      @Override
      public void run() {
        long start = System.currentTimeMillis();
        String debug = args.length > 0 ? args[0] : null;
        if (debug != null) {
          try {
            is = java.nio.file.Files.newInputStream(java.nio.file.Paths.get(debug));
          } catch (Exception e) {
            throw new RuntimeException(e);
          }
        }
        reader = new java.io.BufferedReader(new java.io.InputStreamReader(is), 32768);
        solve();
        out.flush();
        tr((System.currentTimeMillis() - start) + "ms");
      }
    }, "", 64000000).start();
  }

  private static java.io.InputStream is = System.in;
  private static java.io.PrintWriter out = new java.io.PrintWriter(System.out);
  private static java.util.StringTokenizer tokenizer = null;
  private static java.io.BufferedReader reader;

  public static String next() {
    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
      try {
        tokenizer = new java.util.StringTokenizer(reader.readLine());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return tokenizer.nextToken();
  }

  private static double nd() {
    return Double.parseDouble(next());
  }

  private static long nl() {
    return Long.parseLong(next());
  }

  private static int[] na(int n) {
    int[] a = new int[n];
    for (int i = 0; i < n; i++)
      a[i] = ni();
    return a;
  }

  private static char[] ns() {
    return next().toCharArray();
  }

  private static long[] nal(int n) {
    long[] a = new long[n];
    for (int i = 0; i < n; i++)
      a[i] = nl();
    return a;
  }

  private static int[][] ntable(int n, int m) {
    int[][] table = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        table[i][j] = ni();
      }
    }
    return table;
  }

  private static int[][] nlist(int n, int m) {
    int[][] table = new int[m][n];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        table[j][i] = ni();
      }
    }
    return table;
  }

  private static int ni() {
    return Integer.parseInt(next());
  }

  private static void tr(Object... o) {
    if (is != System.in)
      System.out.println(java.util.Arrays.deepToString(o));
  }
}




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

int main() {
	//code
   ll n;
   cin>>n;
   ll a[n];
   for(int i=0;i<n;i++)
    cin>>a[i];
   sort(a,a+n,greater<int>());
   ll sum=a[0]; ll k=1;
   for(int i=2;i<n;){
    sum+=a[k]; i++;
    if(i<n){sum+=a[k++]; i++;}}
   cout<<sum;
	return 0;
}


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

int main(void) {
  int n;
  cin >> n;
  
  int p[n];
  for(int i = 0; i < n; i++) {
  	cin >> p[i];
  }
  
  int count = 0;
  int array[3];
  for(int i = 1; i < n - 1; i++) {
  	int p1 = p[i-1];
    int p2 = p[i];
    int p3 = p[i+1];
    array[0] = p1;
    array[1] = p2;
    array[2] = p3;
    
    sort(array, array + 3);
    
    if(array[1] == p2 && (array[1] != array[0] && array[1] != array[2])) {
      count++;
    }
  }
  
  cout << count << endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
  	cin>>n;
  	long long* a = new long long[n];
  for(int i=0; i<n; i++)
    cin>>a[i];
  if(n<3){
    cout<<0;
  }
  else{
  int count = 0;
  for(int i=0; i<n; i++){
    long long n1 = a[i];
    for(int j=i+1; j<n; j++){
      long long n2 = a[j];
      for(int k=j+1; k<n; k++){
        long long n3 = a[k];
        if(n3<(n1+n2) && n2<(n1+n3) && n1<(n2+n3) && n1!=n2 && n2!=n3 && n3!=n1){
          ++count;
        }
      }
    }
  }
    cout<<count;
  }
  return 0;
}

Measured memory_bytes: 3632
N = int(input())

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    return divisors

divisors = make_divisors(N)

ans = 0
for divisor in divisors:
	if divisor != 1:
		shou = N // (divisor-1)
		amari = N % (divisor-1)
		if shou == amari and divisor-1 > amari:
				ans += divisor-1

print(ans)

Measured memory_bytes: 3316
a, b = map(int, input().split())
c = list(map(int, input().split()))
sa = 0
for i in range(b):
    if i == 0:
        sa = c[0] - (c[b-1] - a)
    elif c[i] - c[i-1] >= sa + 1:
        sa = c[i] - c[i-1]
print(a-sa)

Measured memory_bytes: 26444
#include <iostream>
#include <algorithm>
#include <math.h>
#include <string>
using namespace std;
int main(){
  int A, B, C, D ,E ,F;
  string S,Sa,Sb,Sc;
  cin >> S >> Sa;
  if(S == "A")A = 1;
  if(S == "B")A = 2;
  if(S == "C")A = 3;
  if(S == "D")A = 4;
  if(S == "E")A = 5;
  if(S == "F")A = 6;
  if(Sa == "A")B = 1;
  if(Sa == "B")B = 2;
  if(Sa == "C")B = 3;
  if(Sa == "D")B = 4;
  if(Sa == "E")B = 5;
  if(Sa == "F")B = 6;
  bool ec = false;
  bool bi = false;
if(A == B)ec = true;
if(A > B)bi = true;
if(ec)cout << "=" << endl;
else if(bi)cout << ">" << endl;
else cout << "<" << endl;
        return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>

static void printOut(int A[], int N) {
    int i;

    for ( i = 0; i < N; i++ ) {
        printf("%u%s", A[i], i == N -1 ? "" : " ");
    }
    printf("\n");

    return;
}

static int bubbleSort(int A[], int N) {
    int i, j;
    int swap=0;

    for ( i = 0; i < N; i++) {
        for ( j = N - 1; j > i; j-- ) {
            if ( A[j] < A[j-1] ) {
                int t;
                t      = A[j];
                A[j]   = A[j-1];
                A[j-1] = t;
                swap++;
            }
        }
    }

    return swap;
}

int main(int argc, char* argv[]) {
    int ret;
    int i;
    int N;
    int *A;
    int c;

    ret = scanf("%d\n", &N);
    assert( ret == 1 );
    assert( (1 <= N) && N <= 100 );

    A = malloc(sizeof(int) * N);
    assert( A != NULL );

    memset(A, 0x00, sizeof(int) * N);
    i = 0;
    while ( ((ret = fgetc(stdin)) != EOF) && (i < N) ) {
        if ( ret == ' ' ) {
            assert( (0 <= A[i]) && (A[i] <= 1000) );
            i++;
            continue;
        }
        if ( isdigit(ret) ) {
            A[i] = A[i] * 10 + (ret - '0');
            continue;
        }
        break;
    }
    
    c = bubbleSort(A, N);

    printOut(A, N);

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

    free(A);

    return 0;
}
    



Measured memory_bytes: 2056
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using VI = vector<int>;
using VL = vector<ll>;
using VS = vector<string>;
template<class T> using PQ = priority_queue<T, vector<T>, greater<T>>;
#define FOR(i,a,n) for(int i=(a);i<(n);++i)
#define eFOR(i,a,n) for(int i=(a);i<=(n);++i)
#define rFOR(i,a,n) for(int i=(n)-1;i>=(a);--i)
#define erFOR(i,a,n) for(int i=(n);i>=(a);--i)
#define each(i, a) for(auto &i : a)
#define SORT(a) sort(a.begin(),a.end())
#define rSORT(a) sort(a.rbegin(),a.rend())
#define fSORT(a,f) sort(a.begin(),a.end(),f)
#define all(a) a.begin(),a.end()
#define out(y,x) ((y)<0||h<=(y)||(x)<0||w<=(x))
#define tp(a,i) get<i>(a)
#define line cout << "-----------------------------\n" 
#define ENDL(i,n) ((i) == (n) - 1 ? "\n" : " ")
#define stop system("pause")
constexpr ll INF = 1000000000;
constexpr ll LLINF = 1LL << 60;
constexpr ll mod = 1000000007;
constexpr ll MOD = 998244353;
constexpr ld eps = 1e-10;
constexpr ld pi = 3.1415926535897932;
template<class T>inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; }return false; }
template<class T>inline bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; }return false; }
inline void init() { cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); }
template<class T>inline istream& operator>>(istream& is, vector<T>& v) { for (auto& a : v)is >> a; return is; }
template<class T>inline istream& operator>>(istream& is, deque<T>& v) { for (auto& a : v)is >> a; return is; }
template<class T, class U>inline istream& operator>>(istream& is, pair<T, U>& p) { is >> p.first >> p.second; return is; }
template<class T>inline vector<T> vec(size_t a) { return vector<T>(a); }
template<class T>inline vector<T> defvec(T def, size_t a) { return vector<T>(a, def); }
template<class T, class... Ts>inline auto vec(size_t a, Ts... ts) { return vector<decltype(vec<T>(ts...))>(a, vec<T>(ts...)); }
template<class T, class... Ts>inline auto defvec(T def, size_t a, Ts... ts) { return vector<decltype(defvec<T>(def, ts...))>(a, defvec<T>(def, ts...)); }
template<class T>inline void print(const T& a) { cout << a << "\n"; }
template<class T, class... Ts>inline void print(const T& a, const Ts&... ts) { cout << a << " "; print(ts...); }
template<class T>inline void print(const vector<T>& v) { for (int i = 0; i < v.size(); ++i)cout << v[i] << (i == v.size() - 1 ? "\n" : " "); }
template<class T>inline void print(const vector<vector<T>>& v) { for (auto& a : v)print(a); }
inline string reversed(const string& s) { string t = s; reverse(all(t)); return t; }

int main() {
    init();

    int n, x, t; cin >> n >> x >> t;
    print((n + x - 1) / x * t);

    return 0;
}

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

using namespace std;

#define pb push_back
#define fs first
#define sc second
#define sz size
#define forn(i, n) for (ll i = 0; i < (ll) (n); ++i)
#define forni(i, n) for (ll i = 1; i <= (ll) (n); ++i)
#define IO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)

using ll = long long;
const ll inf = 1e9+7; 

const double PI =  3.141592653589793;

int main(){
	IO;
	ll k;
	string s;
	cin>>k>>s;
	(s.length()>k)?cout<<s.substr(0,k)<<"...\n":cout<<s<<"\n";
	return 0;
}

// _   .-')                .-. .-')                 .-')                                               
//( '.( OO )_              \  ( OO )               ( OO ).                                             
// ,--.   ,--.).-'),-----. ,--. ,--.  .-'),-----. (_)---\_) ,--. ,--.     .-----.  ,-.-')  .-'),-----. 
// |   `.'   |( OO'  .-.  '|  .'   / ( OO'  .-.  '/    _ |  |  | |  |    '  .--./  |  |OO)( OO'  .-.  '
// |         |/   |  | |  ||      /, /   |  | |  |\  :` `.  |  | | .-')  |  |('-.  |  |  \/   |  | |  |
// |  |'.'|  |\_) |  |\|  ||     ' _)\_) |  |\|  | '..`''.) |  |_|( OO )/_) |OO  ) |  |(_/\_) |  |\|  |
// |  |   |  |  \ |  | |  ||  .   \    \ |  | |  |.-._)   \ |  | | `-' /||  |`-'| ,|  |_.'  \ |  | |  |
// |  |   |  |   `'  '-'  '|  |\   \    `'  '-'  '\       /('  '-'(_.-'(_'  '--'\(_|  |      `'  '-'  '
// """    """     """""""" """  """"      """""""  """""""  """"""""      """"""   """         """""""


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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
const ull mod = 1e9 + 7;
#define REP(i,n) for(int i=0;i<(int)n;++i)

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

template < typename T >
void vprint(T &v){
	REP(i, v.size()){
		cout << v[i] << " ";
	}
	cout << endl;
}

int main(){
	ll H, W, K;
	cin >> H >> W >> K;
	if(W==1){
		cout << 1 << endl;
		return 0;
	}
	ll DP[H+1][W];
	ll comb = (1<<(W-1));
	memset(DP, 0, sizeof(DP));
	DP[0][0] = 1;
	REP(h, H){
		REP(k, comb){
			vector<bool> brid(W-1);
			REP(l, W-1){
				brid[l] = (k>>l & 1);
			}
			bool flag = true;
			REP(l, W-2) if(brid[l] && brid[l+1]) flag = false;

			REP(w, W){
				if(flag){
					if(w==0){
						DP[h+1][0] += DP[h][0] * !brid[0];
						DP[h+1][0] %= mod;
						DP[h+1][1] += DP[h][0] * brid[0];
						DP[h+1][1] %= mod;
					}else if(w==W-1){
						DP[h+1][W-1] += DP[h][W-1] * !brid[W-2];
						DP[h+1][W-1] %= mod;
						DP[h+1][W-2] += DP[h][W-1] * brid[W-2];
						DP[h+1][W-2] %= mod;
					}else{
						DP[h+1][w] += DP[h][w] * !brid[w-1] * !brid[w];
						DP[h+1][w] %= mod;
						DP[h+1][w-1] += DP[h][w] * brid[w-1] * !brid[w];
						DP[h+1][w-1] %= mod;
						DP[h+1][w+1] += DP[h][w] * !brid[w-1] * brid[w];
						DP[h+1][w+1] %= mod;
					}
				}
			}
		}
	}
	cout << DP[H][K-1] << endl;
    return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0161

"""
import sys
from sys import stdin
input = stdin.readline
from collections import defaultdict


def main(args):
    while True:
        n = int(input())
        if n == 0:
            break

        data = []
        for _ in range(n):
            id, m1, s1, m2, s2, m3, s3, m4, s4 = [int(x) for x in input().split()]
            total_time = (m1 + m2 + m3 + m4) * 60 + (s1 + s2 + s3 + s4)
            data.append([total_time, id])
        data.sort()

        print(data[0][1])
        print(data[1][1])
        print(data[-2][1])


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

Measured memory_bytes: 8740
import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as BS
import Data.List

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

main = do
    n <- getInt
    xys <- replicateM n getIntList
    print $ sum [dist xi yi xj yj | [xi, yi] <- xys, [xj, yj] <- xys] / (fromIntegral n)

dist xi yi xj yj = sqrt . fromIntegral $ (xi - xj) ^ 2 + (yi - yj) ^ 2

Measured memory_bytes: 508
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vb = vector<bool>;
using vl = vector<long>;
using vs = vector<string>;
using vvi = vector<vector<int>>;
using vvb = vector<vector<bool>>;
using vvc = vector<vector<char>>;
using vvl = vector<vector<long>>;
using pii = pair<int, int>;
using pil = pair<int, long>;
using pll = pair<long, long>;
#define fix20 cout << fixed << setprecision(20)
#define YES cout << "Yes" << endl
#define NO cout << "No" << endl
#define rep(i,n) for(int i=0; i<(int)(n);i++)
#define REP(i,s,t) for(int i=s; i<t; i++)
#define RNG(i,s,t,u) for(int i=s; i<t; i+=u)
#define MOD 1000000007
#define all(vec) vec.begin(), vec.end()
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

int main(){
  string s,t;
  cin >> s >> t;
  int cnt = 0;
  rep(i,s.size()){
    if(s[i] != t[i]) cnt++;
  }
  cout << cnt << endl;
}

Measured memory_bytes: 3856
#include <bits/stdc++.h>
#define ll long long
using namespace std;
template <typename T> void read(T &x) {
	x = 0; int f = 1; char c = getchar();
	while (!isdigit(c)) {if (c == '-') f = -1; c = getchar();}
	while (isdigit(c)) x = x * 10 + c - '0', c = getchar(); x *= f;
}
const int N = 200010;
struct Node {
	int x, y;
	bool operator < (const Node &a) const {return y < a.y;}
} a[N];
int main() {
	int T = 1;
	while (T--) {
		int n; read(n);
		for (int i = 1; i <= n; i++) read(a[i].x), read(a[i].y);
		sort(a + 1, a + n + 1); ll tim = 0, fl = 1;
		for (int i = 1; i <= n; i++) {
			tim += a[i].x;
			if (tim > a[i].y) fl = 0;
		}
		puts(fl ? "Yes" : "No");
	}
	return 0;
}


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

using namespace std;
#define FOR(i,o,n) for(long long i = o;i<n;i++)
#define oneforall ios::sync_with_stdio(false);cin.tie(0);
#define all(v) (v).begin(),(v).end()
#define ini(...) int __VA_ARGS__; in(__VA_ARGS__)
#define inl(...) long long __VA_ARGS__; in(__VA_ARGS__)
#define ins(...) string __VA_ARGS__; in(__VA_ARGS__)
#define int long long
const long long INF=1e18;
void in(){} template <typename T,class... U> void in(T &t,U &...u){ cin >> t; in(u...);}
void out(){cout << "\n";} template <typename T,class... U> void out(const T &t,const U &...u){ cout << t; if(sizeof...(u)) cout << " "; out(u...);}
typedef vector<int> vi;
typedef vector<long long> vl;
typedef long long ll;
typedef vector<pair<long, long > > vpll;
typedef vector<pair<int, int > > vpii;


int32_t main() {
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    oneforall
    
    
    ini(n);
    ini(n1);
    int x[430000];
    int v[430000];
    x[0] = 0;
    v[0] = 0;
    x[n+1] = n1;
    v[n+1] = 0;
    FOR(i,1,n+1){in(x[i]);in(v[i]);}
    int tmpll [430000];
    int tmprr [430000];
    tmpll[0] = 0;
    tmprr[0] = 0;
    tmprr[n+1] = 0;
    FOR(i,1,n+1)tmpll[i] = tmpll[i-1]+v[i]-(x[i]-x[i-1]);
    FOR(i,1,n+1)tmpll[i] = max(tmpll[i-1],tmpll[i]);
    for(int i = n;i>=1;i--)tmprr[i] = tmprr[i+1]+v[i]-(x[i+1]-x[i]);
    for(int i = n;i>=1;i--)tmprr[i] = max(tmprr[i+1],tmprr[i]);
    
    int tmp = 0;
    FOR(i,1,n+1){
        tmp = max(tmp,tmpll[i]);
        tmp = max(tmp,tmpll[i]-x[i]+tmprr[i+1]);
        tmp = max(tmp,tmprr[i]);
        tmp = max(tmp,tmprr[i]-(n1-x[i])+tmpll[i-1]);
    }
    
    out(tmp);
  
    
    
    
    
    
    
    
    return 0;
}


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

int main() {
	int n; cin >> n;
	int ans = 0;
	rep(i, n) if (to_string(i + 1).size() % 2 == 1) ans++;
	cout << ans << endl;
}

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

void fastio()
{
	 ios_base::sync_with_stdio(false);
	 cin.tie(NULL);
	 cout.tie(NULL);
}

# define MOD 1000000007

int main()
{
	fastio();
	
	int ab,bc,ca;
	cin>>ab>>bc>>ca;
	
	cout<<((ab*bc)/2)<<endl;
	
	return 0;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, b) for (int i = a; i < (b); i++)
#define rrep(i, a, b) for (int i = a; i >= b; i--)
#define all(x) (x).begin(), (x).end()
using namespace std;
using ll = long long;
using P = pair<int, int>;

const int INF = 2e9;
const int MOD = 1e9 + 7;

int main() {
   int x, a;
   cin >> x >> a;
   if (x < a)
      cout << 0 << endl;
   else
      cout << 10 << endl;
   return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<math.h>
#include<cmath>
#include<vector>
#include<stack>
#include<queue>
#include<functional>
#include<map>
#include<set>
#include <string>
#include <numeric>

using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
map<int, int> mp;
map<int, int>mm;
#define ll long long
#define ld long double
#define PI 3.14159265358979l

int gcd(int a, int b) {
	if (a < b) {
		int tmp = a;
		a = b;
		b = tmp;
	}
	int r = a % b;
	while (r != 0) {
		a = b;
		b = r;
		r = a % b;
	}
	return b;
}


int main() {
	int n;
	cin >> n;
	int cntr = 0, cntb = 0;
	rep(i, n) {
		char s;
		cin >> s;
		if (s == 'R')cntr++;
		else cntb++;
	}
	if (cntr > cntb)cout << "Yes" << endl;
	else cout << "No" << endl;
	
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
#include<stdio.h>
#include <cstdint>
#include <stdlib.h> 
#include <time.h>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define all(a) a.begin(), a.end()
#define fi first
#define se second
#define RNG(x, a, n) &((x)[a]), &((x)[n])
typedef pair<int, int> PII;
typedef long long ll;
template<typename T> bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; } return false; }
template<typename T> bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; } return false; }
const int inf = 1e9 + 7;
const ll longinf = 1LL << 60;
const ll mod = 1e9 + 7;
const long double PI = (acos(-1));
const long double EPS = 0.0000000001;


ll a, b, c;

int main() {

	cin >> a >> b >> c;

	if (c - b - a > 0 && 4 * a * b < (c - b - a) * (c - b - a))cout << "Yes" << endl;
	else cout << "No" << endl;

	return 0;
}


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

int max(int a,int b){
  return a>b ? a : b;
}

int main(){
  int a,b;
  
  scanf("%d%d",&a,&b);
  
  printf("%d\n",max(a-2*b,0));
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rrep(i,n) for (int i = (n)-1; i >= 0; i--)
#define rep2(i,s,n) for (int i = (s); i < (n); ++i)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define pb push_back
#define eb emplace_back
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vd vector<double>
#define vs vector<string>
#define vc vector<char>
#define vb vector<bool>
#define vp vector<P>
using namespace std;
using ll = long long;
using P = pair<int,int>;
using LP = pair<ll,ll>;
template<class S,class T> istream& operator>>(istream &is,pair<S,T> &p) { return is >> p.first >> p.second; }
template<class S,class T> ostream& operator<<(ostream &os,const pair<S,T> &p) { return os<<'{'<<p.first<<","<<p.second<<'}'; }
template<class T> istream& operator>>(istream &is,vector<T> &v) { for(T &t:v){is>>t;} return is; }
template<class T> ostream& operator<<(ostream &os,const vector<T> &v) { os<<'[';rep(i,v.size())os<<v[i]<<(i==v.size()-1?']':','); return os; }
void Yes(bool b) { cout << (b ? "Yes" : "No") << endl; }
void YES(bool b) { cout << (b ? "YES" : "NO") << endl; }
template<class T> bool chmin(T& a,T b) {if(a > b){a = b; return true;} return false;}
template<class T> bool chmax(T& a,T b) {if(a < b){a = b; return true;} return false;}
const int inf = 1001001001;
const ll linf = 1001001001001001001;

int dp[200010];

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
    int n;
    string x;
    cin >> n >> x;
    dp[0] = 0;
    rep2(i,1,200010) {
        int cnt = __builtin_popcount(i);
        dp[i] = dp[i%cnt]+1;
    }
    int cnt = 0;
    rep(i,n) if(x[i] == '1') cnt++;
    int ppl = 1,pdis = 1;
    int pl = 0,dis = 0;
    rrep(i,n) {
        if(cnt < n) {
            if(x[i] == '1') (pl += ppl) %= cnt+1;
            (ppl *= 2) %= cnt+1;
        }
        if(cnt > 1) {
            if(x[i] == '1') (dis += pdis) %= cnt-1;
            (pdis *= 2) %= cnt-1;
        }
    }
    ppl = 1;
    pdis = 1;
    vi ans(n);
    rrep(i,n) {
        if(x[i] == '1') {
            if(cnt == 1) {
                ans[i] = 0;
                continue;
            }
            int nsum = dis-pdis;
            nsum %= cnt-1;
            nsum += cnt-1;
            nsum %= cnt-1;
            ans[i] = dp[nsum]+1;
        } else {
            int nsum = pl+ppl;
            nsum %= cnt+1;
            ans[i] = dp[nsum]+1;
        }
        if(cnt < n) {
            (ppl *= 2) %= cnt+1;
        }
        if(cnt > 1) {
            (pdis *= 2) %= cnt-1;
        }
    }
    rep(i,n) cout << ans[i] << endl;
}

Measured memory_bytes: 5176
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,bill,i,j,sum=0;
    cin>>n>>bill;
    for(i=0;i<=n;i++)
    {
        for(j=i;j<=n;j++)
        {
            sum=i*10000+(j-i)*5000+(n-j)*1000;
            if(sum==bill)break;
        }
        if(sum==bill)break;
    }
    if(i>n)cout<<"-1 "<<"-1 "<<"-1"<<endl;
    else cout<<i<<" "<<j-i<<" "<<n-j<<endl;
    return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
using ll = long long; using ull = unsigned long long;
using vb = vector<bool>;
using vi = vector<int>; using vvi = vector<vector<int>>;
using vl = vector<ll>; using vvl = vector<vector<ll>>;
using pii = pair<int,int>; using pll = pair<ll,ll>;
#define FOR(i,a,b) for(ll i = (a); i < (ll)(b); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define eb(val) emplace_back(val)
const double PI = acos(-1);
const double EPS = 1e-10;
const ll MOD = 1e9+7;
//#define int ll
void cioacc(){//accelerate cin/cout
  cin.tie(0);
  ios::sync_with_stdio(false);
}
signed main(){
  ll n,m;
  cin >> n >> m;
  if(n>=m){
    cout << 0 << endl;
    return 0;
  }
  vl x(m);
  REP(i,m) cin >> x[i];
  sort(ALL(x));
  vl sa(m-1);
  REP(i,m-1) sa[i] = x[i+1]-x[i];
  sort(ALL(sa));
  REP(i,n-1) sa.pop_back();
  ll sum = accumulate(ALL(sa),0);
  cout << sum << endl;
}

Measured memory_bytes: 1792
#include<cstdio>
#include<algorithm>
using namespace std;
long long n, a, b;
int main() {
	scanf("%lld%lld%lld", &n, &a, &b);
	if (a > b)swap(a, b);
	if (a % 2 == b % 2) {
		printf("%lld\n", (b - a) / 2);
		return 0;
	}

	printf("%lld\n", min((a + b - 1) / 2, (n - a + n - b + 1) / 2));

}

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

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

  int i = 1;
  while(1) {
    int x = i;

    if(x % 3 == 0){
      cout<<" "<<i;
    }
    else {
      while(1){
	if(x % 10 == 3){
	  cout<<" "<<i;
	  break;
	}
	x /= 10;
	if(x == 0) break;
      }
    }

    if (++i > n) break;
  }
  cout<<endl;

  return 0;
}



Measured memory_bytes: 3104