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

#define REP(i,x,y) for(ll i=x; i<=y; i++)
#define BIT(t) ((long long 1) << t)
#define PER(i,y,x) for(ll i=y; i>=x; i--)
#define SIZE(v) ll(v.size())
#define vll vector<ll>
#define vvll vector<vector<ll>>
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
typedef long long ll;

ll gcd(ll x,ll y){
    if(y == 0){
        return x;
    }else{
        return gcd(y, x % y);
    }
}

ll f(ll n, vll& a){
    ll odd = 0;
    ll even = 0;
    ll oddi = -1;
    REP(i,0,n-1){
        if(a[i] % 2){
            odd++;
            oddi = i;
        }else{
            even++;
        }
    }
    if(even % 2 == 1){
        return 0;
    }else if(odd >= 2){
        return 1;
    }else{
        if(a[oddi] == 1){
            return 1;
        }
        a[oddi]--;
        ll tmp = gcd(a[0], a[1]);
        REP(i,2,n-1){
            tmp = gcd(tmp, a[i]);
        }
        REP(i,0,n-1){
            a[i] /= tmp;
        }
        return 1 + f(n, a);
    }
}

int main(){
    ll n;
    cin >> n;
    vll a;
    REP(i,1,n){
        ll tmp; cin >> tmp;
        a.push_back(tmp);
    }
    ll ans = f(n, a);
    if(ans % 2 == 0){
        cout << "First" << endl;
    }else{
        cout << "Second" << endl;
    }
}



Measured memory_bytes: 1528
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<deque>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<iterator>
#include<complex>
#include<stack>
#include "stdio.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)

using ll = long long;
using Pii = pair<int, int>;

const int inf = 1e9 + 7;
const ll longinf = 1LL << 60;
const long long mod_const = 1e9+7;

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

using MIte = multimap<long, long, greater<long> >::iterator;



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

	// long long?
	long long A, B;
	cin >> A >> B;

	if (B % A == 0) {
		cout << A + B << endl;
	}
	else {
		cout << B - A << endl;
	}

	return 0;

}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
//Optimisations
#pragma GCC target ("avx2")
#pragma GCC optimization ("unroll-loops")
#pragma GCC optimize("O2")
//shortcuts for functions
#define pb push_back
#define mp make_pair
#define ff first 
#define ss second
#define all(v) v.begin(),v.end()
#define prec(n) fixed<<setprecision(n)
#define n_l '\n'
// make it python 
#define gcd __gcd
#define append push_back
#define str to_string
// utility functions shortcuts
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define sswap(a,b) {a=a^b;b=a^b;a=a^b;}
#define swap(a,b) {auto temp=a; a=b; b=temp;}
#define init(dp) memset(dp,-1,sizeof(dp));
#define set0(dp) memset(dp,0,sizeof(dp));
#define bits(x) __builtin_popcount(x)
#define SORT(v) sort(all(v))
#define endl "\n"
#define forr(i,n) for(ll i=0;i<n;i++)
// declaration shortcuts
typedef long long int ll;
#define int ll
// Constants
constexpr int dx[] = {-1, 0, 1, 0, 1, 1, -1, -1};
constexpr int dy[] = {0, -1, 0, 1, 1, -1, 1, -1};
constexpr ll INF = 1999999999999999997; 
constexpr int inf= INT_MAX;
constexpr int MAXSIZE = int(1e6)+5;
constexpr auto PI  = 3.14159265358979323846L;
constexpr auto oo  = numeric_limits<int>::max() / 2 - 2;
constexpr auto eps = 1e-6;
constexpr auto mod = 1000000007;
constexpr auto MOD = 1000000007;
constexpr auto MOD9 = 1000000009;
constexpr auto maxn = 100006;
//void IOfile(){
//freopen(file_name, reade_mode, stdin);
//freopen(file_name, write_mode, stdout);
//}
void fastio(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
}
int32_t main(){
	fastio();
	int a,b;
	cin>>a>>b;
	cout<<a*b;
}

Measured memory_bytes: 3652
s = input()

origin = list(set(list(s)))

if len(origin) > 2:
    print("No")
    exit()
a=0
b=0
for i in s:
    if i == origin[0]: a+=1
    elif i == origin[1]: b+=1

if a==2:
    print("Yes")
else:
    print("No")

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

int main(){
    int n, a, min = 999999999;
    cin >> n;

    for(int i;i < n;i++){
        cin >> a;
        int j = 0;
        while(a % 2 == 0){
            a /= 2;
            j++;
        }
        if(min > j) min = j;
    }
    cout << min << endl;
}


Measured memory_bytes: 256
#include<stdio.h>

int main(void)
{
	int H, W, i;
	char c[100][101];

	scanf("%d%d", &H, &W);

	for (i = 0; i < H; i++)
		scanf("%s", c[i]);

	for (i = 0; i < H; i++)
	{
		printf("%s\n", c[i]);
		printf("%s\n", c[i]);
	}

	return 0;
}

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

int main() {
  int n; cin >> n;
  n %= 10;
  if (n == 2 || n == 4 || n == 5 || n == 7 || n == 9) cout << "hon" << endl;
  else if (n == 0 || n == 1 || n == 6 || n == 8) cout << "pon" << endl;
  else if (n == 3) cout << "bon" << endl;
  
  return 0;
}

Measured memory_bytes: 3636
#include <iostream>
#include <fstream>
#include <typeinfo>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <iomanip>
#include <cctype>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<25;
const double pi=acos(-1);
const double eps=1e-10;
const vi emp;

int n,k,ans=0;
vi a(26);

int main(){
	cin>>n>>k;
	string s;
	for(int i=0;i<n;i++){
		cin>>s;
		a[s[0]-'A']--;
	}
	while(1){
		sort(a.begin(),a.end());
		for(int j=0;j<k;j++){
			a[j]++;
			if(a[j]>0){
				cout<<ans<<endl;
				return 0;
			}
		}
		ans++;
	}
}

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

int main()
{
    int h, w, k;
    cin >> h >> w >> k;

    string s[h];
    rep(i, h) cin >> s[i];

    int ans = 0;

    for(int i=0; i < (1<<h+w); i++)
    {
        int cnt = 0;
        bitset<12> b(i);

        for(int j=0; j < h; j++)
        {
            if(b.test(j)) continue;
            
            for(int k=h; k < w+h; k++)
            {
                if(b.test(k)) continue;
                if(s[j].at(k-h) == '#') cnt++;
            }

        }

        if(cnt == k) ans++;
    }

    cout << ans << endl;
}

Measured memory_bytes: 3612
#include<stdio.h>
   
int main(void){
	int i,j,k,n,x,y,z,num = 0;
	char c[12];
	scanf("%d",&n);
	int a[n];
	for(i=0;i<n;i++){
		scanf("%s %d",c,&k);
		if(c[0]=='i'){
			a[i] = k;
		}else if(c[6]=='F'){
			i-=2;
			n-=2;
		}else if(c[6]=='L'){
			i--;
			n--;
			num++;
		}else{
			i--;
			n--;
			x=0;
			for(j=i;j>=0;j--){
				if(x>0)break;
				if(k==a[j]){
					y=i-j;
					z=0;
					x++;
					while(y!=z){
						z++;
						a[j+z-1]=a[j+1+z-1];
					}
					i--;
					n--;
				}
			}
		}
	}
	for(i=0;i<n-num;i++){
		if(i==n-num-1){
			printf("%d\n",a[n-1-i]);
		}else{
			printf("%d ",a[n-1-i]);
		}
	}
	return 0;
}

Measured memory_bytes: 5708
#include<iostream>

constexpr int MINUS_INF = -1;
constexpr int MAX_SIZE = 2000000;

using namespace std;

void maxHeapify(int*, int index, int n);

void maxHeapAndDelete(int*, int index, int n);

int main() {
	int cnt = 0,tmp;
	int* a = new int[MAX_SIZE + 1];
	string msg;
	cin >> msg;
	while (msg != "end") {
		if (msg[0] == 'i') {
			cin >> tmp;
			cnt++;
			a[cnt] = tmp;
			maxHeapify(a, cnt, cnt);
		}
		else {
			if (cnt > 0) {
				cout << a[1] << endl;
				a[1] = MINUS_INF;
				maxHeapAndDelete(a, 1, cnt);
				cnt--;
			}
		}
		cin >> msg;
	}
}

void maxHeapify(int* a, int index,int n) {
	int l = 2 * index;
	int r = l + 1;
	int largest = index;
	if (l <= n) {
		if (a[l] > a[index]) {
			largest = l;
		}
	}
	if (r <= n) {
		if (a[r] > a[largest]) {
			largest = r;
		}
	}
	if (largest != index) {
		swap(a[index], a[largest]);
		maxHeapify(a, largest, n);
	}
	if (index != 1 && a[index/2]<a[index]) {
		swap(a[index], a[index / 2]);
		maxHeapify(a, index / 2, n);
	}
}

void maxHeapAndDelete(int* a, int index, int n) {
	int l = 2 * index;
	int r = l + 1;
	int largest = index;
	if (l <= n) {
		if (a[l] > a[index]) {
			largest = l;
		}
	}
	if (r <= n) {
		if (a[r] > a[largest]) {
			largest = r;
		}
	}
	if (largest != index) {
		swap(a[index], a[largest]);
		maxHeapAndDelete(a, largest, n);
	}else if (index != 1 && a[index / 2] < a[index]) {
		swap(a[index], a[index / 2]);
		maxHeapAndDelete(a, index / 2, n);
	}
	else if (index * 2 > n) {
		swap(a[index], a[n]);
		maxHeapify(a, index, n);
	}

}


Measured memory_bytes: 7044
#include  <iostream>
#include  <stdio.h>
#include <algorithm>
#include <map>
#include <math.h>

using namespace std;
#include <vector>
#define rep(i,n) for (ll i = 0; i < (n) ; i++)
#define INF 1e9
#define llINF 1e18
#define base10_4 10000      //1e4
#define base10_5 100000     //1e5
#define base10_6 1000000    //1e6
#define base10_7 10000000   //1e7
#define base10_8 100000000  //1e8
#define base10_9 1000000000 //1e9

#define MOD 1000000007
#define pb push_back
#define ll long long
#define ld long double
#define ull unsigned long long
#define vint vector<int>
#define vll vector<ll>

//#include <stack>
//#include <queue>

// #include <iomanip>
//  cout << fixed << setprecision(15) << y << endl;

string ans_Yes = "Yes"; 
string ans_No = "No"; 
string ans_yes = "yes"; 
string ans_no = "no"; 

ll A;
ll B;
ll C;
ll N;
ll M;
ll K;

ll ltmp;
string stmp;
double dtmp;

int main(){

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

    cin >> K;

    rep(ki,K) cout << "ACL";     

}

Measured memory_bytes: 3616
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); ++i)
#define outl(x) cout<< (x) << '\n'
#define fi first
#define se second
using pii = pair<int,int>;
using ll = long long;
using vi = vector<int>;

int main()
{
    cin.tie(0), ios::sync_with_stdio(false);
    int N;
    cin >> N;
    int a[105];
    memset(a, -1, sizeof(a));
    rep(i, N) {
        cin >> a[i];
    }

    int cnt = 1;
    int ans = 0;

    for (int i=1; i<=N; ++i) {
        if (a[i-1] == a[i]) {
            ++cnt;
        } else {
            ans += cnt / 2;
            cnt = 1;
        }
    }

    outl(ans);
}



Measured memory_bytes: 892
#include <cstdio>
typedef long long lint;

lint gcd(lint x,lint y){
    return y==0?x:gcd(y,x%y);
}

int main(){
    int T;
    scanf("%d",&T);
    lint A,B,C,D;
    while(T--){
        scanf("%lld%lld%lld%lld",&A,&B,&C,&D);
        lint g = gcd(B,D);
        if(A>=B && A%B<=C && D>=B && B-g<=C){
            puts("Yes");
        }else{
            puts("No");
        }
    }
    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int> P;
int INF = 1e9+7;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
signed main() {
    int a;
    cin >> a;
    cout << a+a*a+a*a*a << endl;
}


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

ans = 0
for i in range(1, n + 1):
    if i % 2 == 0:
        continue
    cnt = 0
    for j in range(1, n + 1):
        if i % j == 0:
            cnt += 1

    if cnt == 8:
        ans += 1

print(ans)


Measured memory_bytes: 38640
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>

using namespace std;

int main()
{
    char a[3];
    int ans=0;
    scanf("%s",a);
    for(int i=0;i<3;i++){
        if(a[i]=='o'){
            ans++;
        }
    }
    printf("%d\n",700+ans*100);
    return 0;
}

Measured memory_bytes: 256
#![allow(
    non_snake_case,
    unused_variables,
    unused_assignments,
    unused_mut,
    unused_imports,
    dead_code
)]
//use permutohedron::LexicalPermutation as _;
use proconio::input;
use proconio::marker::*;
//use std::collections::HashSet;
//use std::collections::HashMap;
//use std::collections::BTreeMap;
use std::cmp::*;
// use std::num;
fn main() {
    input! {N:usize, UV:[(usize,usize);N-1]}
    let mut ans = 0;
    for i in 0..N {
        ans += (N - i) * (i + 1);
    }
    for (u, v) in UV {
        //pritnln!("{}-{}", ans, u * (N - v + 1));
        ans -= if u < v {
            u * (N - v + 1)
        } else {
            v * (N - u + 1)
        };
    }
    println!("{}", ans);
}


Measured memory_bytes: 7724
package main

import "fmt"

func main() {
	var a, b int
	fmt.Scan(&a, &b)
	temp := [13]int{0, 1, 3, 1, 2, 1, 2, 1, 1, 2, 1, 2, 1}
	if temp[a] == temp[b] {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


Measured memory_bytes: 512
import java.io.*; 
import java.util.*; 

public class Main{ 
	
	static class FastReader{ 
		BufferedReader br; 
		StringTokenizer st; 

		public FastReader() 
		{ 
			br = new BufferedReader(new
					InputStreamReader(System.in)); 
		} 

		String next() 
		{ 
			while (st == null || !st.hasMoreElements()) 
			{ 
				try
				{ 
					st = new StringTokenizer(br.readLine()); 
				} 
				catch (IOException e) 
				{ 
					e.printStackTrace(); 
				} 
			} 
			return st.nextToken(); 
		} 

		int nextInt() 
		{ 
			return Integer.parseInt(next()); 
		} 

		long nextLong() 
		{ 
			return Long.parseLong(next()); 
		} 

		double nextDouble() 
		{ 
			return Double.parseDouble(next()); 
		} 

		String nextLine() 
		{ 
			String str = ""; 
			try
			{ 
				str = br.readLine(); 
			} 
			catch (IOException e) 
			{ 
				e.printStackTrace(); 
			} 
			return str; 
		} 
	}
     
	public static void main(String[] args) 
	{ 
		FastReader sc = new FastReader(); 
		int n = sc.nextInt();
      	long arr[] = new long[n];
		for(int i=0;i<n;i++)
			arr[i] = sc.nextLong();
      	for(int i=n-2;i>=0;i--){
            if(arr[i]-arr[i+1]>1){
              System.out.println("No");
              return;
            }else{
              if(arr[i]>arr[i+1])
                arr[i] = arr[i]-1;
            }
        }
		System.out.println("Yes"); 
	} 
} 


Measured memory_bytes: 39656
n, m, x = map(int, input().split())
c = [0] * n
a = [[0] * m for i in range(n)]
for i in range(n):
    b = list(map(int, input().split()))
    c[i], a[i] = b[0], b[1::]

ans_money = 1200001

for i in range(2**n):
    b = [0]*m
    sum_money = 0
    for l in range(n):
        if i>>l & 1:
            for k in range(m):
                b[k] += a[l][k]            
            sum_money += c[l]
    if all(elem >= x for elem in b) and sum_money < ans_money:
        ans_money = sum_money
if ans_money == 1200001:
    print(-1)
else:
    print(ans_money)

Measured memory_bytes: 74564
n, m = list(map(int, input().split(" ")))
a = list(map(int, input().split(" ")))
low = sum(a) / (4 * m)
count = 0
for v in a:
    if v >= low:
        count+= 1
if count >= m:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3060
import java.util.Scanner;

public class Main {

public static void main(String args[]) {

Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
int b_in = sc.nextInt();
int b =2 * b_in;
  
int result = 0;
  
  if(b <= a){
    result = a - b;
  }
  
System.out.println(result);
}
}


Measured memory_bytes: 21716
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<sstream>
#include<set>
#include<map>
#include<numeric>
#include<limits>
#include <cstdint>
using namespace std;
#define ll long long int
#define rep(N) for(ll i=0;i<N;i++)
#define rep2(N1,N2) for(ll i=0;i<N1;i++)for(ll j=0;j<N2;j++)
#define rep3(N1,N2,N3)for(ll i=0;i<N1;i++)for(ll j=0;j<N2;j++)for(ll k=0;k<N3;k++)
#define For(i,N) for(ll i=0;i<N;i++)

void yn(bool b) {
	if (b)printf("yes\n");
	else printf("no\n");
}

void Yn(bool b) {
	if (b)printf("Yes\n");
	else printf("No\n");
}

void YN(bool b) {
	if (b)printf("YES\n");
	else printf("NO\n");
}

int ctoi(char c) {
	return c - '0';
}

ll kai(ll x) {
	ll a = 1;
	if (x <= 0)
		return 1;
	else {
		for (ll i = 0; i < x; i++)
			a = a * (i + 1);
		return a;
	}
}

ll rui(ll x, ll y) {
	ll a = 1;
	for (ll i = 0; i < y; i++)
		a = a * x;
	return a;
}
const int nmax = 150;
int cccc[nmax][nmax];
ll comb(ll n, ll k) {
	if (n < k) {
		cout << "error n<k" << endl;
		return -1;
	}
	if (cccc[n][k] > 0)return cccc[n][k];
	if (k == 0 || n == k)return 1;
	return cccc[n][k] = comb(n - 1, k - 1) + comb(n - 1, k);
}

ll keta(ll a) {
	ll i = 1;
	while (1) {
		if (a < pow((ll)10, i))
			return i;
		i++;
	}
}
vector<ll> v;
ll n, m;
//m進数全探索
ll inc(ll a = n - 1) {
	if (a == 0 && v[0] == m) {
		v[0] = -1;
		return v[0];
	}
	if (v[a] == m) {
		v[a] = 0;
		inc(a - 1);
		return v[a];
	}
	else {
		++v[a];
		return v[a];
	}
}

int main() {
	cout.precision(20);
	string S;
	ll K;
	cin >> K >> S;
	if (S.size() <= K)
		cout << S;
	else {
		rep(K)cout << S[i];
		cout << "...";
	}
}




Measured memory_bytes: 3724
#include <iostream>
#include<algorithm>
using namespace std;
int main() {
    int p[1001];
    int n;
    int k;
    int sum = 0;

    cin >> n >> k;

    for(int i = 0; i < 1001; i ++){
        p[i] = 10000;
    }
    for(int i = 0; i < n; i ++){
        cin >> p[i];
    }
    sort(p,p+1001);
    for(int i = 0; i < k; i ++){
        sum += p[i];
    }

    cout << sum;

    return 0;
}

Measured memory_bytes: 3640
#include <bits/stdc++.h>
#define ll long long
using namespace std;
 
ll gcd(ll a, ll b){
  if(b == 0){
    return a;
  }
  else{
    return gcd(b,(a%b));
  }
}
ll lcm(ll a,ll b){
  return a/gcd(a,b)*b;
}
ll mpower(ll a,ll b,ll c){
  int z;
  if(b==0){
    z=1;
    z%=c;
    return z;
  }
  if(b==1){
    z=a;
    z%=c;
    return z;
  }
  else{
    return (((mpower(a,b/2,c))*(mpower(a,b/2,c))%c)*mpower(a,b%2,c)%c);
  }
}

int main() {
  string s;
  cin>>s;
  int a=s.size();
  for(int i=0;i<a;i++){
    if(s.at(i)!=s.at(a-i-1)){
      cout<<"No"<<endl;
      return 0;
    }
  }
  for(int i=0;i<(a-1)/2;i++){
    if(s.at(i)!=s.at((a-1)/2-1-i)){
      cout<<"No"<<endl;
      return 0;
    }
  }
  reverse(s.begin(),s.end());
  for(int i=0;i<(a-1)/2;i++){
    if(s.at(i)!=s.at((a-1)/2-1-i)){
      cout<<"No"<<endl;
      return 0;
    }
  }
  cout<<"Yes"<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,a,n) for(int i=a;i<n;i++)
#define been(ix) (ix).begin(),(ix).end()
using namespace std;
typedef long long ll; 
typedef vector<int> vi;
typedef vector<long long> vl;
const ll INFL = 1e18;
const int INF = 1001001001; 
typedef pair<int,int> P;
#define foreach(ix,i) for(auto& (ix) : (i))
typedef long double ld;
const int mod =1000000007;
int main(){
   int n,k;
   cin>>n>>k;
   k;
   int x[n];
   rep(i,n)cin>>x[i];
   int ans = INF;
   if(k==0){
       rep(i,n)ans=min(ans,abs(x[i]));
   }
   rep(i,n){
       if(i+k-1<n){
       if(x[i+k-1]<0)ans=min(ans,abs(x[i]));
       else if(x[i]>0)ans=min(ans,x[i+k-1]);
       else{
           ans =min(ans,2*abs(x[i])+abs(x[i+k-1]));
           ans =min(ans,abs(x[i])+2*abs(x[i+k-1]));
   }
   }
   }
   cout<<ans<<endl;

}


Measured memory_bytes: 640
#include <iostream>
#include<string>
#include<set>

using namespace std;
int main(void){
    int N;
    cin>>N;
    int d[N];
    set<int>S;
    
    
    for(int i=0;i<N;i++){
        cin>>d[i];
        S.insert(d[i]);
    
    }
    
   int T;
   T=S.size();
   
    
     
    cout<<T<<endl;
    
    return 0;
    
}

Measured memory_bytes: 256
using System;
namespace _1{
    class program
    {
  
        static void Main()
        {
            int s, h, m;
            s = int.Parse(Console.ReadLine());
            h = s / (60 * 60);
            s = s % (60 * 60);
            m = s / 60;
            s = s % 60;
            Console.WriteLine(h + ":" + m + ":" + s);
        }
    }
}



Measured memory_bytes: 17888
package main

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

var N int
var L []int

func main() {
	N = nextInt()
	L = nextInts(N)
	sort.Ints(L)
	longest_edge := L[N-1]
	r := 0
	for i := 0; i < N-1; i++ {
		r += L[i]
	}
	if longest_edge < r {
		fmt.Printf("Yes")
	} else {
		fmt.Printf("No")
	}
}

func nextInt() int {
	v, _ := strconv.Atoi(nextReader())
	return v
}

func nextInts(n int) []int {
	r := make([]int, n)
	for i := 0; i < n; i++ {
		r[i] = nextInt()
	}
	return r
}

var nextReader func() string

func init() {
	nextReader = NewScanner()
}

func NewScanner() func() string {
	r := bufio.NewScanner(os.Stdin)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)
	return func() string {
		r.Scan()
		return r.Text()
	}
}

func Min(a int, b int) int {
	if a > b {
		return b
	}
	return a
}

func MaxIn2Values(a int, b int) int {
	if a > b {
		return a
	}
	return b
}

func MinIn2Values(a int, b int) int {
	if a < b {
		return a
	}
	return b
}

func Abs(a int) int {
	if a < 0 {
		return a * -1
	}
	return a
}


Measured memory_bytes: 640
from itertools import combinations_with_replacement as cwd

N, M, Q = map(int, input().split())
A = list(cwd(range(1, M + 1), N))
ABCD = []

for i in range(Q):
    a, b, c, d = map(int, input().split())
    a, b = a - 1, b - 1
    ABCD.append([a, b, c, d])

res = 0
for i in A:
    tmp = 0
    for j in ABCD:
        if i[j[1]] - i[j[0]] == j[2]:
            tmp += j[3]
    res = max(res, tmp)

print(res)


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

int main(){
  int N, M;
  cin >> N >> M;
  
  //入力の配列
  vector<vector<int>> road(M, vector<int>(2));
  for (int i = 0; i < M; i++){
    for (int j = 0; j < 2; j++){
      cin >> road.at(i).at(j);
    }
  }
  
  //出力
  for(int i = 1; i < N + 1; i++){
    int cnt = 0;
    for (int s = 0; s < M; s++){
      for (int t = 0; t < 2; t++){
        if (road.at(s).at(t) == i){
          cnt++;
        }
      }
    }
    
    cout << cnt << endl;
  }
}
  

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

int main() {
  int N,K;
  cin >> N >> K;
  vector<int>data(N);
  for(int i=0;i<N;i++){
    cin >> data.at(i);
  }
  for(int i=0;i<N-K;i++){
    if(data.at(i)>=data.at(i+K)) cout << "No" << endl;
    else cout << "Yes" << endl;
  }
}

Measured memory_bytes: 4052
#include <bits/stdc++.h>
using namespace std;
constexpr int MAXN = 505;
constexpr int dirX[] = {1, 0, -1, 0}, dirY[] = {0, 1, 0, -1};
int n,P[MAXN * MAXN],dis[MAXN][MAXN];
bool use[MAXN][MAXN];
queue<pair<int, int>> que;
bool inG(int x, int y) { return 1 <= x && x <= n && 1 <= y && y <= n; }
void BFS() {
  while (!que.empty()) {
    auto [x, y] = que.front();
    que.pop();
    for (int i = 0, d = dis[x][y] + use[x][y]; i < 4; ++i) {
      if (int nx = x + dirX[i], ny = y + dirY[i];
          inG(nx, ny) && dis[nx][ny] > d) {
        dis[nx][ny] = d;
        que.emplace(nx, ny);
      }
    }
  }
}
pair<int, int> id_to_pos(int id) {
  return {(id - 1) / n + 1, (id - 1) % n + 1};
}
int calc() {
  for (int i = 1; i <= n; ++i) fill_n(dis[i] + 1, n, n * n);
  for (int i = 1; i <= n; ++i) fill_n(use[i] + 1, n, true);
  for (int i = 1; i <= n; ++i) dis[i][1] = dis[i][n] = 0;
  for (int i = 2; i < n; ++i) dis[1][i] = dis[n][i] = 0;
  for (int i = 1; i <= n; ++i) {
    que.emplace(i, 1);
    que.emplace(i, n);
  }
  for (int i = 2; i < n; ++i) {
    que.emplace(1, i);
    que.emplace(n, i);
  }
  BFS();
  int ret = 0;
  for (int i = 1; i <= n * n; ++i) {
    auto [x, y] = id_to_pos(P[i]);
    ret += dis[x][y];
    use[x][y] = false;
    que.emplace(x, y);
    for (int i = 0; i < 4; ++i) {
      if (int nx = x + dirX[i], ny = y + dirY[i]; inG(nx, ny))
        que.emplace(nx, ny);
    }
    BFS();
  }
  return ret;
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n * n; ++i) scanf("%d", &P[i]);
  printf("%d", calc());
}

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

int main() {
  int H, W;
  char a;
  cin >> H >> W;
  vector<int> height(H);
  vector<int> width(W);
  vector<vector<char>> table(H, vector<char>(W));
  
  for(int i = 0; i < H; i++){
    for(int j = 0; j < W; j++){
      cin >> table.at(i).at(j); 
    }
  }

  for(int i = 0; i < H * W; i++){
    if(table.at(i / W).at(i % W) == '#' && width.at(i % W) == 0){
      width.at(i % W) = 1;
    }
    if(table.at(i / W).at(i % W) == '#' && height.at(i / W) == 0){
      height.at(i / W) = 1;
    }
  }
  
  for(int i = 0; i < H; i++){
    if (height.at(i) == 0) continue;
    for(int j = 0; j < W; j++){
      if (width.at(j) == 0) continue;
      cout << table.at(i).at(j); 
    }
    cout << endl;
  }

}


Measured memory_bytes: 256
#include <cassert>
#include <cstdio>
#include <cmath>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>

const int MOD = 1000000007, INF = 1111111111;
using namespace std;
using lint = long long;

template <class T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
	for (int i = 0; i < vec.size(); i++) {
		os << vec[i] << (i + 1 == vec.size() ? "" : " ");
	}
	return os;
}

#ifdef _DEBUG
template <class Head>
void dump(const char* str, Head &&h) { cerr << str << " = " << h << "\n"; };
template <class Head, class... Tail>
void dump(const char* str, Head &&h, Tail &&... t) {
	while (*str != ',') cerr << *str++; cerr << " = " << h << "\n";
	dump(str + 1, t...);
}
#define DMP(...) dump(#__VA_ARGS__, __VA_ARGS__)
#else 
#define DMP(...) ((void)0)
#endif

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	lint N;
	cin >> N;

	for (lint i = 100000; i >= 0; i--) {
		if (i * i <= N) {
			cout << i * i << "\n";
			break;
		}
	}

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
#define rep(i,n) for (ll i = 0; i < (n); ++i)
const ll mod = 1000000007;
const ll INF = 9223372036854775807;
#define Sort(a) sort(a.begin(), a.end())
#define Bsort(a) sort(a.begin(), a.end(), greater<ll>())
#define Pi acos(-1)

vector<long long> divisor(long long n) {
  vector<long long> ret;
  for (long long i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.push_back(i);
    if (i * i != n) ret.push_back(n / i);
    }
  }
  sort(ret.begin(), ret.end());
  return ret;
}

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << setprecision(15) << fixed;
  ll n;
  cin >> n;
  ll cnt = 0;
  rep(i,n) {
    if ((i+1)%2 == 1) {
      auto a = divisor(i+1);
      if (a.size() == 8) {
        cnt++;
      }
    }
  }
  cout << cnt << '\n';
}

Measured memory_bytes: 3644
from collections import deque
N = int(input())
K = list(sorted(map(int, input().split()), reverse=True))

max1 = K[0]
max2 = K[1]
if N == 2:
    print(max1)
else:
    max3 = K[2]
    count = max1 + max2
    cands = deque([max2, max3, max3])
    for k in K[3:]:
        cand = cands.popleft()
        count += cand
        cands.append(k)
        cands.append(k)
    print(count)


Measured memory_bytes: 33332
e = [i for i in input().split()]



for i in e:
    if i == "A":
        i = 10
    elif i == "B":
        i = 11
    elif i == "C":
        i = 12
    elif i == "D":
        i = 13
    elif i == "E":
        i = 14
    elif i == "F":
        i = 15

if e[0] < e[1]:
    print("<")
elif e[0] == e[1]:
    print("=")
else :
    print(">")

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

void solve() {
	int n; cin >> n;
	vector<ll> v(n + 1, 0);
	for (int i = 1; i <= n; i++) {
		for (int j = i; j <= n; j += i)v[j]++;
	}
//	for (int i : v)cout << i << ' '; cout << endl;
	cout << accumulate(v.begin(), v.begin() + n , 0ll) << endl;
}

int main() {
	ios_base::sync_with_stdio(false); cin.tie(NULL);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	// int t; cin >> t;
	// while (t--)
	solve();

}

Measured memory_bytes: 11100
import sys

N = int(input())
S = input()
cw = [] # count W
cw.append(0)
for i, s in enumerate(S):
    i += 1
    if s == "W":
        cw.append(cw[i-1]+1)
    else:
        cw.append(cw[i-1])
#print(cw)

ans = 100000*3
for i in range(N):
    left = cw[i] # num of W
    right = (N-i-1)-(cw[N]-cw[i+1]) # num of E
    #print("left: %d, rw: %d, right: %d, %s, %s" % (left,cw[N]-cw[i+1],right,S[0:i],S[i+1:N]))
    tmp = left+right
    if ans>tmp:
        ans = tmp
print(ans)

Measured memory_bytes: 15400
#include <stdio.h>
long long p = 1000000007;
long long y;
int n, a, f;
int x[100000];
int main() {
	scanf("%d", &n);
	for (int i = 0; i < n; i++) {
		scanf("%d", &a);
		x[a]++;
	}
	if (n % 2) {
		if (x[0] != 1)f = 1;
		for (int i = 1; i <= n / 2; i++) {
			if (x[i * 2] != 2)f = 1;
		}
	}
	else {
		for (int i = 0; i < n / 2; i++) {
			if (x[i * 2 + 1] != 2)f = 1;
		}
	}
	if (f)printf("0\n");
	else {
		y = 1;
		for (int i = 0; i < n / 2; i++) {
			y *= 2;
			y %= p;
		}
		printf("%lld\n", y);
	}
}

Measured memory_bytes: 512
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

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

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())

n, m = map(int, input().split())
uf = UnionFind(n)
for _ in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    uf.union(a, b)
print(uf.group_count()-1)
    

Measured memory_bytes: 75128
#include <bits/stdc++.h>
using namespace std;
#define x first
#define y second
#define dbg(x) cout << #x << '=' << x << '\n';
#define ll long long
#define pi pair<int,int>
#define pl pair<long long,long long>
#define lg length()
#define pb push_back
ifstream in("file.in");
ofstream out("file.out");
#define MAXN 100005
#define INF 1000000005
#define LINF 1000000000000000005

int n,k,x,g,t;

int32_t main(){
    ios_base :: sync_with_stdio(0);
    cin >> n >> k >> x;
    t=g=x;
    for(int i=2;i<=n;i++){
        cin >> x;
        t=max(t,x);
        g=__gcd(g,x);
    }
    if(k<=t && !(k%g)) cout << "POSSIBLE";
    else cout << "IMPOSSIBLE";
}


Measured memory_bytes: 256
N = int(input())
S = input()
l = []
for i in range(len(S)-1):
  X = S[:i+1] 
  Y = S[i+1:]
  X_and_Y_count = len(set(X) & set(Y))
  l.append(X_and_Y_count)
  if i == len(S)-2:
    print(max(l))
    

Measured memory_bytes: 2940
#include<stdio.h>
int main(){
  int h,n;
  int sum = 0;
  scanf("%d %d\n",&h,&n);
  for(int i=0;i<n;i++){
    int temp;
    scanf("%d ",&temp);
    sum+=temp;
  }
  if(sum>=h)printf("Yes");
  else printf("No");
  return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
#define eps (1e-10)
using namespace std;
class Point
{
	public:
	double x,y;
	Point(double _x=0,double _y=0):x(_x),y(_y){}
	Point operator + (Point p){ return Point(x+p.x,y+p.y);} 
	Point operator - (Point p){ return Point(x-p.x,y-p.y);}
	Point operator * (double a){return Point(a*x,a*y);} 
	Point operator / (double a){return Point(x/a,y/a);}
	double norm(){return x*x+y*y;}
	double ABS(){return sqrt(norm());} 
};
struct Segment
{
	Point p1,p2;	
};
//判断是否正交 向量内积：a*b=|a||b|*cos(Y) 当cos为0时正交(90,-90垂直) 
//a*b=a.x*b.x+a.y*b.y;
bool solve1(Point a,Point b)
{
	double f=a.x*b.x+a.y*b.y; 
	if(fabs(f-0.0)<eps) return true;
	else return false;
}
//判断是否平行  向量外积：|a*b|=|a||b|sin(Y) 当sin为0时平行(180,0平行)
//|a*b|=|a|*|b|*sin(Y) 
bool solve2(Point a,Point b)
{
	double f=a.x*b.y-a.y*b.x;
	if(fabs(f-0.0)<eps) return true;
	else return false;
}
double dot(Point a,Point b)
{
	return a.x*b.x+a.y*b.y;
}
Point solve3(Segment s,Point p)
{
	Point base=s.p2-s.p1;
	double r=dot(p-s.p1,base)/base.norm();
	return s.p1+base*r; 
}
int main()
{
	double x1,y1,x2,y2;
	scanf("%lf %lf %lf %lf",&x1,&y1,&x2,&y2);
	Point p1(x1,y1),p2(x2,y2);
	Segment s;
	s.p1=p1,s.p2=p2;
	int T;scanf("%d",&T);
	while(T--){
		double x,y;scanf("%lf %lf",&x,&y);
		Point p(x,y);
		Point w=solve3(s,p);
		printf("%.10f %.10f\n",w.x,w.y);
		
	}
	return 0;
}



Measured memory_bytes: 3236
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<map>
#include<iomanip>
#include<queue>
#include<stack>
#include<time.h>
#define rep(i,n)for(ll i=0;i<n;i++)
#define ll long long
#define double long double
using namespace std;
ll n, k, ans = 0; ll a[114];
signed main() {
	cin >> n >> k;
	rep(i, n)cin >> a[i];
	rep(i, n)ans += min(abs(k - a[i]), a[i]) * 2;
	cout << ans << endl;
	getchar(); getchar(); return 0;
}


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

using namespace std;

int main(){
int a , b , c , answer1 , answer2;
	cin >> a;
	cin >> b;
	cin >> c;
	answer1 = a * b;
	if (c > answer1)
		{cout << answer1;}
	else
		{cout << c;}
}

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

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repc(i, n) for (int i = 0; i <= int(n); i++)
#define rrepc(i, n) for (int i = int(n); i >= 0; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define repic(i, a, b) for (int i = int(a); i <= int(b); i++)
#define each(x, y) for (auto &x : y)
#define all(a) (a).begin(), (a).end()
#define bit(b) (1ll << (b))

using namespace std;

using i32 = int;
using i64 = long long;
using u64 = unsigned long long;
using f80 = long double;
using vi32 = vector<i32>;
using vi64 = vector<i64>;
using vu64 = vector<u64>;
using vf80 = vector<f80>;
using vstr = vector<string>;

inline void yes() { cout << "Yes" << '\n'; exit(0); }
inline void no() { cout << "No" << '\n'; exit(0); }
inline i64 gcd(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); if (a % b == 0) return b; return gcd(b, a % b); }
inline i64 lcm(i64 a, i64 b) { return a / gcd(a, b) * b; }
inline u64 xorshift() { static u64 x = 88172645463325252ull; x = x ^ (x << 7); return x = x ^ (x >> 9); }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }
template <typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template <typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template <typename T> inline void amax(T &x, T y) { if (x < y) x = y; }
template <typename T> inline void amin(T &x, T y) { if (x > y) x = y; }
template <typename T> inline T power(T x, i64 n, T e = 1) { T r = e; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template <typename T> istream& operator>>(istream &is, vector<T> &v) { each(x, v) is >> x; return is; }
template <typename T> ostream& operator<<(ostream &os, vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }
template <typename T, typename S> istream& operator>>(istream &is, pair<T, S> &p) { is >> p.first >> p.second; return is; }
template <typename T, typename S> ostream& operator<<(ostream &os, pair<T, S> &p) { os << p.first << ' ' << p.second; return os; }

void solve() {
  int a, b, c;
  cin >> a >> b >> c;
  cout << max(b + c - a, 0) << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main(){
	ll a,b,c;
	ll x;
	cin>>a>>b>>c>>x;
	ll count=0;
	while(a>=b){
		count++;
		b=b*2;
	}
	while(b>=c){
		count++;
		c=c*2;
	}
	if(count<=x){
		cout<<"Yes";
	}
	else{
		cout<<"No";
	}
}

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

int N;
int A[101];

void print() {
  for(int i = 1; i <= N; ++i)
    cout << (i!=1?" ":"") << A[i];
  cout << endl;
}

int main() {
  cin >> N;
  for(int i = 1; i <= N; ++i) cin >> A[i];

  print();
  for(int j = 2; j <= N; ++j) {
    int key = A[j];
    /* insert A[j] into the sorted sequence A[1,....,j-1] */
    int i = j - 1;
    while(i > 0 && A[i] > key) {
      A[i+1] = A[i];
      i = i - 1;
    }
    A[i+1] = key;
    print();
  }
  return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll,ll> l_l;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
#define pb push_back
#define sz(x) (int)(x).size()
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
const int INF=1001001000;
const int mINF=-1001001000;
const ll LINF=1010010010010010000;
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;
}
//グリッド：（典型）dp,dfs,bfs,最短経路,その他
int main(){
    ll a,b;cin>>a>>b;
    if(a-b==0){
        cout<<0<<endl;
    }
    else if((a+b)%2==0){
        cout<<(a+b)/2<<endl;
    }
    else{
        cout<<"IMPOSSIBLE"<<endl;
    }
    return 0;
}

Measured memory_bytes: 256
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repo(i,n) for(int i = 1; i < (int)(n); i++)
#define pb push_back
#define mp make_pair
#define np next_permutation
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
//#define num 1000000007
#define pi acos(-1.0)
//cout << fixed << setprecision (20);   小数点以下2０桁まで
//intの最大値2147483647 ≒ 2×10^9
//long longの最大値9223372036854775807 ≒ 9×10^18
//'0'+=16;        で大文字に
//'大文字'+=32;    で小文字に
//s[i]-'0'でchar文字→int数に;
//string s = to_string(int数);
//int n = stoi(string文字列)
//実行時間制約2秒では２×10^8回くらいまで計算できる



int main() {
  ll a,b;
  cin >> a>>b;
  
  vector<ll> p(a);
  vector<ll> q(a);
  vector<ll> r(b);
  vector<ll> s(b);
  
  rep(i,a){
  cin >> p[i] >> q[i];
  }
  
  rep(i,b){
  cin >> r[i] >> s[i];
  }
  
  rep(i,a){
    ll man = 900000000;
    rep(j,b){
      man=min(man,abs(p[i]-r[j])+abs(q[i]-s[j]));
    }
    rep(j,b){
      if(man==abs(p[i]-r[j])+abs(q[i]-s[j])) {
      cout << j+1 << endl;
      break;
      }
    }
  }
  
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdio>
using namespace std;

int main()
{
    int Alice = 0, Bob = 0;
    int n;
    cin >> n;

    vector<int> v(n);

    for (int i = 0; i < n; i++)
    {
        cin >> v[i];
    }
    sort(v.begin(), v.end(), greater<int>());

    for (int i = 0; i < n; i++)
    {
        if (i % 2 == 0)
        {
            Alice += v[i];
        }
        else
        {
            Bob += v[i];
        }
    }

    cout << Alice - Bob << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll n;
ll sum_xay_max;
ll sum_xsy_min;
ll sum_xay_min;
ll sum_xsy_max; 
int main()
{
    sum_xay_max=-1e12;
    sum_xsy_min=1e12;
    sum_xay_min=1e12;
    sum_xsy_max=-1e12; 
    cin>>n;
    while(n--)
    {
        ll x,y;
        cin>>x>>y;
        sum_xsy_max=max(sum_xsy_max,(x-y));
        sum_xsy_min=min(sum_xsy_min,(x-y));
        sum_xay_max=max(sum_xay_max,(x+y));
        sum_xay_min=min(sum_xay_min,(x+y));
    } 
    ll ans1=sum_xay_max- sum_xay_min;
    ll ans2=sum_xsy_max- sum_xsy_min;
    cout<<max(ans1,ans2);      
        
}

Measured memory_bytes: 3520
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <string>
#include <queue>
#include <list>
#include <cmath>
#include <stack>
#include <iomanip>

using namespace std;
typedef long long ll;
using Pll = pair<ll,ll>;

const ll INF = 1LL<<60;
const ll MOD = 1000000007;

//cout << fixed << setprecision(10);

template<class T>
vector<T> make_vec(size_t a){
    return vector<T>(a);
}
template<class T, class... Ts>
auto make_vec(size_t a, Ts... ts){
  return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}

template<typename T,typename V>
typename enable_if<is_class<T>::value==0>::type
fill_v(T &t,const V &v){t=v;}

template<typename T,typename V>
typename enable_if<is_class<T>::value!=0>::type
fill_v(T &t,const V &v){
  for(auto &e:t) fill_v(e,v);
}


int main() {
    ll N;
    cin >> N;
    auto dp = make_vec<ll>(N+1,5,5,5);
    fill_v(dp,0);
    dp[0][0][0][0] = 1;

    for(int n=0;n<N;n++){
        for(int i=0;i<5;i++){
            for(int j=0;j<5;j++){
                for(int l=0;l<5;l++){
                    for(int k=1;k<5;k++){
                        if(j==1 && l==2 && k==3) continue;
                        if(j==1 && l==3 && k==2) continue;
                        if(j==2 && l==1 && k==3) continue;
                        if(i==1 && l==2 && k==3) continue;
                        if(i==1 && j==2 && k==3) continue;

                        dp[n+1][j][l][k] += dp[n][i][j][l];
                        dp[n+1][j][l][k] %= MOD;
                    }
                }
            }
        }
    }
    ll ans=0;
    for(int i=1;i<5;i++){
        for(int j=1;j<5;j++){
            for(int k=1;k<5;k++){
                ans+=dp[N][i][j][k];
                ans%=MOD;
            }
        }
    }
    cout << ans << endl;


    return 0;
}

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

bool isTriangle(ll a, ll b, ll c) {
    return a + b > c && b + c > a && c + a > b;
}

bool isAllDifferent(ll a, ll b, ll c) {
    return a != b && b != c && c != a;
}

int main() {
  int n;
  cin >> n;
  vector<ll> L(n);
  rep(i, n) cin >> L[i];
  int ans = 0;

  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      for (int k = j + 1; k < n; k++) {
        if (isTriangle(L[i], L[j], L[k]) && isAllDifferent(L[i], L[j], L[k])) {
          ans++;
        }
      }
    }
  }

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


Measured memory_bytes: 3632
def resolve():
    import sys
    input = sys.stdin.readline
    from decimal import Decimal
    # 整数 1 つ
    # n = int(input())
    # 整数複数個
#    a = int(input().split())
    a, b = map(str, input().split())
    a = Decimal(a)
    b = Decimal(b)
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    # N = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    # A = [list(map(int, input().split())) for i in range(H)]

    print(int(a*b))


resolve()

Measured memory_bytes: 71268
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define rrep(i,n) for(int i=1;i<(n);++i)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define maxs(a, b) a = max(a, b)
#define mins(a, b) a = min(a, b)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const ll linf = (1ll << 61);
const int inf = 1001001001;
const int mod = 1000000007;

bool used[405][405];
const int dx[] = { 0,1,0,-1 };
const int dy[] = { -1,0,1,0 };

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int h, w;
	cin >> h >> w;
	vector<string> s(h);
	rep(i, h) cin >> s[i];
	ll cnt_0, cnt_1;
	function<void(int, int, int)> Dfs = [&](int a, int b, int p) {
		used[a][b] = true;
		if (p) cnt_1++;
		else cnt_0++;
		rep(i, 4) {
			int nx = a + dx[i], ny = b + dy[i];
			if (nx < 0 || ny < 0 || nx >= h || ny >= w) continue;
			if (used[nx][ny]) continue;
			if (p && s[nx][ny] == '#') continue;
			if (!p && s[nx][ny] == '.') continue;
			Dfs(nx, ny, p ^ 1);
		}
	};
	ll ans = 0;
	rep(i, h) {
		rep(j, w) {
			if (!used[i][j]) {
				cnt_0 = 0, cnt_1 = 0;
				Dfs(i, j, (s[i][j] == '#'));
				ans += cnt_0 * cnt_1;
			}
		}
	}
	printf("%lld\n", ans);
	return 0;
}


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

AC=0
WA=0
TLE=0
RE=0

for i in range(N):
  str = input()
  if str == "AC":
    AC += 1
  elif str == "WA":
    WA += 1
  elif str == "TLE":
    TLE += 1
  elif str == "RE":
    RE += 1
    
print(f'AC x {AC}')
print(f'WA x {WA}')
print(f'TLE x {TLE}')
print(f'RE x {RE}')

Measured memory_bytes: 9200
#include<bits/stdc++.h>
using namespace std;
#define optimizar_io ios_base::sync_with_stdio(0); cin.tie(0);
#define fore(i, a, b) for(int i = a; i < b; i++)
#define fori(i, a, b) for(int i = a; i <= b; i++)
#define all(v) v.begin(), v.end()
#define pb push_back
#define popb pop_back
#define mk make_pair
#define fi first
#define se second
#define endl '\n'
#define MAX 60
typedef long long int lli;
typedef long double ld;
const double PI = acos(-1.0);
ld eps = 1e-9;

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

Measured memory_bytes: 3780
#include <bits/stdc++.h> 
using namespace std;
typedef long long ll;
typedef vector<long long> vll;
typedef vector<bool> vb;
#define MOD 1000000007

int main() {
	int n; 
	cin >> n;
	vector<double> dp(n+1, 0);
	dp[0] = 1;
	for (int coin = 0; coin < n; ++coin) {
		double phead;
		cin >> phead;
		for (int head = coin+1; head >= 0; --head) {
			dp[head] = (head == 0 ? 0 : dp[head-1]*phead) + dp[head]*(1-phead);
		}
	}
	double ans = 0;
	for (int head = 0; head <= n; ++head) {
		int tail = n-head;
		if (tail < head) {
			ans += dp[head];
		}
	}
	printf("%.10lf\n", ans);
	return 0;
}

Measured memory_bytes: 3784
// inputに入力データ全体が入る
function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
	input = input.split("\n");
    tmp = input[0].split(" ");
    var N = Number(tmp[0])
    var L = Number(tmp[1])

    var ans=0

    // -しかないとき: L<0 && L+N-1<0
    // +しかないとき: L>0
    // 0を含むとき：L<=0 && L+N-1>=0

    if(L<0 && (L+N-1)<0){
        for(i=1; i<N; i++){
            ans += L+i-1
        }
    }else if(L>0){
        for(i=2; i<=N; i++){
            ans += L+i-1
        }
    }else if(L<=0 && (L+N-1)>=0){
        for(i=1; i<=N; i++){
            ans += L+i-1
        }    
    }
    console.log(ans)
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

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

int main(){
  
  int n,m;
  cin>>n>>m;
  int d[n][m];
  for(int i=0;i<n;i++){
    for(int j=0;j<m;j++){
      d[i][j]=0;
    }
  }
  int k[m];
  for(int i=0;i<m;i++){
    cin>>k[i];
    int s[k[i]]={0};
    for(int j=0;j<k[i];j++){
      cin>>s[j];
      d[s[j]-1][i]=1;
    }
  }
  int p[m];
  for(int i=0;i<m;i++) cin>>p[i];
  
  int ans=0;
  bool flg;
  for(int bit=0;bit<(1<<n);bit++){
    int match[m]={0};
    flg=1;
    for(int i=0;i<n;i++){
      if(bit&(1<<i)){
        for(int j=0;j<m;j++){
          if(d[i][j]==1) match[j]++;
        }
      }
    }
    
    for(int i=0;i<m;i++){
      if(match[i]%2!=p[i]) flg=0;
    }
    if(flg) ans++;
  }
  
  cout<<ans<<endl;
  
}

Measured memory_bytes: 384
#include<cstdio>
#include<algorithm>
using namespace std;
const int MAXN = 100000;
const int INF = int(1E9);
int arr[MAXN + 5], sum[MAXN + 5], temp[MAXN + 5];
long long tot1 = 0, tot2 = 0;
int N;
void MergeSort(int le, int ri) {
	if( le == ri ) return ;
	int mid = (le + ri) >> 1;
	MergeSort(le, mid);
	MergeSort(mid+1, ri);
	int p = le, q = mid+1, r = le;
	while( p <= mid && q <= ri ) {
		if( sum[p] < sum[q] ) {
			temp[r++] = sum[p++];
		}
		else {
			tot1 += (p-le);
			temp[r++] = sum[q++];
		}
	}
	while( p <= mid ) {
		temp[r++] = sum[p++];
	}
	while( q <= ri ) {
		tot1 += (p-le);
		temp[r++] = sum[q++];
	}
	for(int i=le;i<=ri;i++)
		sum[i] = temp[i];
}
bool Check(int x) {
	tot1 = 0;
	for(int i=1;i<=N;i++)
		sum[i] = (arr[i] <= x ? 1 : -1);
	for(int i=1;i<=N;i++)
		sum[i] += sum[i-1];
	MergeSort(0, N);
	return tot1 >= (tot2/2 + 1);
}
int main() {
	int le = INF, ri = -INF;
	scanf("%d", &N);
	for(int i=1;i<=N;i++) { 
		scanf("%d", &arr[i]);
		le = min(le, arr[i]);
		ri = max(ri, arr[i]);
		tot2 += i;
	}
	while( le < ri ) {
		int mid = (le + ri) >> 1;
		if( Check(mid) ) ri = mid;
		else le = mid + 1;
	}
	printf("%d\n", ri);
}

Measured memory_bytes: 1280