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

int main() {
    vector<bool> is_prime(50000, true);
    vector<int> prime;
    is_prime[0] = is_prime[1] = false;
    for(int i=2; i<is_prime.size(); ++i) {
        if(is_prime[i]) {
            prime.push_back(i);
            for(int j=i+i; j<is_prime.size(); j+=i) {
                is_prime[j] = false;
            }
        }
    }
    vector<int> res(50001);
    for(int i=0; i<prime.size(); ++i) {
        for(int j=0; j<=i; ++j) {
            if(prime[i] + prime[j] > 50000) {
                break;
            }
            res[prime[i] + prime[j]] += 1;
        }
    }
    int n;
    while(cin >> n, n) {
        cout << res[n] << endl;
    }
}


Measured memory_bytes: 3200
#include <bits/stdc++.h> 
using namespace std; 
void solve(); 
int main() 
{ 
    ios_base::sync_with_stdio(false); 
    cin.tie(NULL); 
  
#ifndef ONLINE_JUDGE 
    freopen("input.txt", "r", stdin); 
    freopen("error.txt", "w", stderr); 
    freopen("output.txt", "w", stdout); 
#endif 
  
    int t = 1; 
   // /*is Single Test case?*/ cin >> t; 
    while (t--) { 
        solve(); 
        cout << "\n"; 
    } 
  
    cerr << "time taken : " << (float)clock() / CLOCKS_PER_SEC << " secs" << endl; 
    return 0; 
} 
void solve() 
{ 
	int a,b ;
	cin>>a>>b;
	cout<<a*b;
} 

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

int main() {
	int N;
	cin >> N;
	vector<int> A(N);
	rep(i, N) cin >> A[i];
	sort(A.begin(), A.end());
	string ans;
	rep(i, N-1) {
		if (A[i] == A[i+1]) {
			ans = "NO";
			break;
		} else ans = "YES";
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 1024
# input
N = int(input())

a = 0
ans = 1

for i in range(N + 1):
    j = i
    temp = 0
    while j:
        if j % 2 == 0:
            temp += 1
            j = j // 2
        else:
            break
    if temp > a:
        a = temp
        ans = i

print(ans)     

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

int main(){
	int ch[5];
	for( int i = 0; i < 5; i++ ){
		cin >> ch[i];
	}
	sort(ch, ch+5, greater<int>());
	for( int i = 0; i < 4; i++ ){
		cout << ch[i] << " ";
	}
	cout << ch[4] << endl;
}

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

int main()
{
  int m,ans=0;
  cin >> m;
  cout << (24-m)+24 << endl;
  return 0;
}


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

int main(){
	int N, Q;
	while(cin >> N >> Q, N+Q){
		vector<tuple<int,int,string>> t;
		for(int i = 0; i < N; ++i){
			int by, wy;
			string s;
			cin >> s >> by >> wy;
			t.push_back(make_tuple(wy,by,s));
		}
		sort(t.begin(), t.end());
		for (int i = 0; i < Q; ++i){
			int q;
			cin >> q;
			string ans = "Unknown";
			for(int j = 0; j < t.size(); ++j){
				int wy = get<0>(t[j]);
				int by = get<1>(t[j]);
				string s = get<2>(t[j]);
				if(q > wy) continue;
				if(wy-q < by){
					ans = "";
					cout << s << " " << by-(wy-q);
				}
			}
			cout << ans << endl;
		}
	}
	return 0;
}


Measured memory_bytes: 3296
#include <stdio.h>
using namespace std;

int main(){
int N;
int M;
int C;
int B[20]={};
int count=0;

scanf("%d %d %d",&N,&M,&C);

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

for(int i=0;i<N;i++)
{
	int A[20]={};
	for(int j=0;j<M;j++){
	scanf("%d",&A[j]);
	
	}
	int sum=0;
	for(int j=0;j<M;j++)
	{
		
		sum+=A[j]*B[j];
	}
	sum+=C;
	if(sum>0)
	{
		count++;
	}
}

printf("%d\n",count);
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;
int main(){
    double w,h,x,y;
    cin>>w>>h>>x>>y;
    cout<<w*h/2<<" ";
    int W=w,H=h;
    if(W%2==0&&H%2==0&&w/2==x&&h/2==y) cout<<1;
    else cout<<0;
}

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

int main(){
  long long n,h,w,a[10000],b[10000],v=0;
  cin >> n >> h >> w;
  for(int i=0;i<n;i++){
    cin >> a[i] >> b[i];
  }

  for(int i=0;i<n;i++){
    if(a[i]>=h && b[i]>=w){
      v++;
    }
  }
  cout << v << endl;
}


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

int main()
{
    int n;
    cin >> n;
    int sum = 0;
    int prev = 0;
    for(int i=0; i<n-1; i++){
        int a;
        cin >> a;
        if(i == 0){
            sum += a;
            prev = a;
        }else{
            sum += min(a,prev);
            prev = a;
        }
        if(i == n-2) sum += a;
    }
    cout << sum << endl;
    return 0;
}


Measured memory_bytes: 256
package main

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

var sc = bufio.NewScanner(os.Stdin)

func main() {
	list := getStdinIntArr()
	A := list[0]
	B := list[1]
	C := list[2]
	K := list[3]

	if A >= K {
		fmt.Printf("%d", K)
		return
	}
	K = K - A

	if B >= K {
		fmt.Printf("%d", A)
		return
	}
	K = K - B

	if C >= K {
		fmt.Printf("%d", A-K)
		return
	}
	fmt.Printf("%d\n", A-C)
}

func getStdin() string {
	sc.Scan()
	return sc.Text()
}
func getStdinInt() int {
	sc.Scan()
	rtn, _ := strconv.Atoi(sc.Text())
	return rtn
}
func getStdinInt64() int64 {
	sc.Scan()
	rtn, _ := strconv.ParseInt(sc.Text(), 10, 64)
	return rtn
}
func getStdinIntArr() []int {
	sc.Scan()
	str := sc.Text()
	list := strings.Split(str, " ")
	rtn := make([]int, len(list))
	for idx, val := range list {
		rtn[idx], _ = strconv.Atoi(val)
	}
	return rtn
}
func getStdinIntArr64() []int64 {
	sc.Scan()
	str := sc.Text()
	list := strings.Split(str, " ")
	rtn := make([]int64, len(list))
	for idx, val := range list {
		rtn[idx], _ = strconv.ParseInt(val, 10, 64)
	}
	return rtn
}


Measured memory_bytes: 1728
#include<stdio.h>
int main()
{
    int a,b,c,d,s,s1;
    scanf("%d%d%d%d",&a,&b,&c,&d);
    if(a<b)
        s=a;
    else
        s=b;
        if(c<d)
            s1=c;
            else
            s1=d;
        printf("%d\n",(s+s1));

}

Measured memory_bytes: 1712
#include <stdio.h>
#include <string.h>
#include <ctype.h>
#ifndef LL
#define LL long long
#endif
#ifndef uLL
#define uLL unsigned long long
#endif
#ifndef uL
#define uL unsigned int
#endif
#ifndef iL
#define iL int
#endif
#ifndef iS
#define iS short
#endif
#ifndef uS
#define uS unsigned short
#endif
#ifndef uC
#define uC unsigned char
#endif
#define max(a,b) (((a)>(b))?(a):(b))
#define min(a,b) (((a)<(b))?(a):(b))
#define abs(a) (((a)<0)?(-(a)):(a))
#define sgn(a) (((a)<0)?(1):(0))
#define movs(a,b,l) (memmove((a),(b),sizeof(*(b))*(l)))
#define stosb(a,b,l) (memset((a),(b),sizeof(*(a))*(l)))
LL map[1007][1007];
LL di[][2]={{1,0},{0,1},{(LL)0-1,0},{0,(LL)0-1}};
int legal(char ch)
{
	if (ch=='#') {return 1;}
	if (ch=='.') {return 0;}
	return 2;
}
LL que[2000000];
int main()
{
	//freopen("in.in","r",stdin);
	char ch;
	LL i,j,k,a,b,c,d,n,m,ans;
	*que=0;
	scanf("%lld%lld",&n,&m);
	for (i=1;i<=n;i++)
	{
		for (j=1;j<=m;j++)
		{
			RE:scanf("%c",&ch);
			if (legal(ch)==2) {goto RE;}
			map[i][j]=legal(ch);
			if (map[i][j]==1) {que[++(*que)]=(i<<20)|j;}
		}
	}
	for (i=1;i<=*que;i++)
	{
		a=que[i]>>20;
		b=que[i]&0xFFFFF;
		//printf("%lld %lld\n",a,b);
		for (j=0;j<4;j++)
		{
			c=a+di[j][0];
			d=b+di[j][1];
			//printf("%lld %lld*\n",c,d);
			if ((c>=1)&&(c<=n)&&(d>=1)&&(d<=m)&&(map[c][d]==0))
			{
				map[c][d]=map[a][b]+1;
				que[++(*que)]=(c<<20)|d;
			}
		}
	}
	ans=0;
	for (i=1;i<=n;i++)
	{
		for (j=1;j<=m;j++)
		{
			ans=max(ans,map[i][j]);
		}
	}
	printf("%lld\n",ans-1);
	return 0;
}

Measured memory_bytes: 17536
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int main()
{
    ll n,i,j,c=0,ans=0;
   ll a,b,k;
    cin>>a>>b>>k;
    c=b;
    b-=k-a;
    if(a<k)
     cout<<0<<" "<<max(0ll,b);
     else{
          cout<<a-k<<" "<<c;
     }
}


Measured memory_bytes: 3624
#include<bits/stdc++.h>
#define int long long
#define d lld
#define pii pair<int,int>
#define fst first
#define sec second
#define ULTRA 2134567890
#define de(x) if(x!=0 && MODE==x)
#define MODE 0
using namespace std;

int a[17][17] = {};
int dp[1<<16] = {};
int d[1<<16] = {};

void prepare(int N) {
    for (int i=0; i < 1<<N; i++) {
        for (int j=0; j<N; j++) {
            for (int k=j+1; k<N; k++) {
                if (i&(1<<j) && i&(1<<k)) {
                    d[i] += a[j][k];
                }
            }
        }
    }
}

main() {
    int i,j;
    int N;

    cin >> N;
    for (i=0; i<N; i++) {
        for (j=0; j<N; j++) {
            cin >> a[i][j];
        }
    }
    prepare(N);

    for (i=1; i < 1<<N; i++) {
        j = i;
        while(j) {
            dp[i] = max( dp[i], dp[i^j] + d[j]);
            j = (j-1) & i;
        }
        de(1) printf(">>> %lld\n", dp[i]);
    }

    printf("%lld\n", dp[(1<<N) - 1]);

    return 0;
}

//
//          ___ ___  __________  __________
//         /////\  \/\   ______\/\\\\\\\\\\\  Code by ~Ice Tea~ of
//        //// \ \  \ \  \_____/\ \\\\_____/      New Empire of CHSH ...
//       ////   \ \  \ \  \      \ \\\\\\\\\\\
//      ////__   \ \  \ \  \      \ \\\\_____/
//     ///////\   \ \  \ \  \______\ \\\\_______   ________
//    ////____/    \ \__\ \___   ___\ \\\\\\\\\\\ _\  ___  \_
//   /__/           \/__/\/__/\  \__/\ \\\\_____//\  .\_/\_  \
//                           \ \  \   \ \\\\\\\\\\\\  \_\/_\  \
// ... with the AC Power of   \ \  \   \ \\\\_____/ \   _____  \
//   The Great Tsundere Doggy. \ \  \   \ \\\\     \ \  \  \ \  \
//                              \ \__\   \ \\\\\\\\\\ \__\  \ \__\
//                               \/__/    \/________/\/__/   \/__/
//


Measured memory_bytes: 4788
import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc=new Scanner(System.in);
    int n=sc.nextInt();
    int max=0;
    int min=101;
    for(int i=0;i<n;i++){
      int s=sc.nextInt();
      max+=s;
      if(s%10!=0){
        min=Math.min(s,min);
      }
    }
    if((max%10)!=0){
      System.out.println(max);
    }else if(min==101){
      System.out.println(0);
    }else{
      System.out.println(max-min);
    }
  }
}

Measured memory_bytes: 21972
#include <iostream>

using namespace std;
  
int main(){
  string s;
  cin >> s;
  
  if (s == "Sunny") {
    cout << "Cloudy" << '\n';
  } else if (s == "Cloudy") {
    cout << "Rainy" << '\n';
  } else if (s == "Rainy") {
    cout << "Sunny" << '\n';
  }
  return 0;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
# 整数の入力
s = input()
# 計算
ans = 0
for i in range(2**(len(s)-1)):
    A = s[0]
    for j in range(len(s)-1):
        if (i >> j) & 1:
            A += '+'
        A += s[j+1]
    ans += eval(A)
print(ans)

Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iomanip>
#include <numeric>
#include <queue>
#include <cmath>
using namespace std;

int main() { 
    int m;
    cin >> m;
    cout << 48 - m << endl;
}




Measured memory_bytes: 3620
#include <bits/stdc++.h>
#define rep(i, n) for (int i=0; i<(n); ++i)
#define repr(i, a, b) for (int i=a; i<(b); ++i)
#define reprev(i, n) for (int i=n-1; i>=0; --i)
#define reprrev(i, a, b) for (int i=b-1; i>=(a); --i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
    cout << fixed << setprecision(10);
    
    int R; cin >> R;
    double pi = 3.14159265;
    cout << 2* R * pi << endl;
    return 0;
}

Measured memory_bytes: 3776
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include<stdio.h>
#include <map>
bool p;
using namespace std;
vector<int> st[120];
int h[1010];
bool hu[1010];
void loop(int a){
	h[a]=1;
for(int q=0;q<st[a].size();q++){

	if(h[st[a][q]]==1){
		h[a]=10;
	}
	else{if(hu[st[a][q]]==0){
		hu[st[a][q]]=1;
	loop(st[a][q]);
}


}

}
h[a]=h[a]-1;

if(h[a]>2){
	p=true;
}	
}


int main() {
p=false;
int e,v;
cin>>v>>e;
for(int u=0;u<v;u++){
	h[u]=0;
	hu[u]=0;
}
for(int y=0;y<e;y++){
	int s,g;
	cin>>s>>g;
	st[s].push_back(g);
}
for(int n=0;n<v;n++){
	if(hu[n]==0){
loop(n);
}
}
if(p==true){
	cout<<"1"<<endl;
}
else{
	cout<<"0"<<endl;
}

	return 0;
	
}

Measured memory_bytes: 1216
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
#define trace6(a, b, c, d, e, f) cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<" | "<<#f<<": "<<f<<endl
#define int long long
#define endl '\n'
#define pi 3.14159265
int mod=1e9+7;
int ncr[5000][5000];    
void compute()
{  
    for(int i=0;i<4500;i++) 
    { 
        for(int j=0;j<=i;j++) 
        { 
            if (j==0||j==i) 
                ncr[i][j]=1; 
            else
            {
                ncr[i][j]=ncr[i-1][j-1]+ncr[i-1][j]; 
                ncr[i][j]%=mod;
            }
        } 
    } 
}
int f1(int i,int x)
{
    int n=x-i;
    int k=i;
    return ncr[n+k-1][k-1];
}
int f2(int i,int x)
{
    int left=x-(i-1);
    int n=left;
    int k=i+1;
    return ncr[n+k-1][k-1];
}
int32_t main()
{
    IOS;
    compute();
    int n,k;
    cin>>n>>k;
    for(int i=1;i<=k;i++)
        cout<<(f1(i,k)*f2(i,n-k))%mod<<endl;
}   

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

using namespace std;
typedef long long ll;
typedef long double lb;
#define rep(i,j,n) for (ll i = j; i < (n); i++)
#define repr(i,j,n) for(ll i = j; i >= (n); i--)
#define each(i,mp) for(auto& i:mp)
#define all(x) (x).begin(),(x).end()
#define CLR(mat,f) memset(mat, f, sizeof(mat))
#define IN(a, b, x) (a<=x&&x<b)
#define out(ans) cout << ans << endl
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
typedef pair<ll,ll>P;
const lb pi=acos(-1);
const ll mod=1e9+7;
const ll INF = 1LL<<60;
const ll m=1LL<<32;

int main(){

  ll x,y;cin>>x>>y;

  bool e=false;
  for(int i=0;x-i>=0;i++){
    if(i*2+(x-i)*4==y){
      e=true;
    }
  }

  if(e)out("Yes");
  else out("No");

  return 0;
}


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

int main() {
  int n, t;
  int ct[1100][2] = {0};
  cin >> n >> t;
  for (int i = 0; i < n; i++) {
    cin >> ct[i][0] >> ct[i][1];
  }
  int ans = 9999;
  for (int i = 0; i < n; i++) {
    if (ans > ct[i][0] && ct[i][1] <= t) {
      ans = ct[i][0];
    }
  }
  if (ans != 9999) {
    cout << ans << endl;
  }
  else {
    cout << "TLE" << endl;
  }
  return 0;
}

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

using namespace std;

#define INF 0x3f3f3f3f
#define endl "\n"
#define MAXN 100010
#define F first
#define S second
#define abs(a, b) ((a > b) ? a-b : b-a)
#define rep(i, a, b) for(int i = (a); i <= (b); i++)

typedef long long int ll;

bool is(string s) {
	string t = s;
	reverse(t.begin(), t.end());
	return (s == t);
}

int main() {
	cin.tie(NULL);
	ios_base::sync_with_stdio(false);
	
	string s; cin >> s;

	if (is(s) && 
	    is(s.substr(0, (s.size()-1)/2)) && 
            is(s.substr((s.size()+3)/2, s.size() - (s.size()+3)/2 - 1)))
		cout << "Yes\n";
	else cout << "No\n";

	return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
 
using namespace std;
 
int main()
{
	int tris = 0;
	int right_tris = 0;
	int acute_tris = 0;
	int obtuse_tris = 0;
	for( int i = 0; i < 100; i ++)
	{
		int a, b, c;
		if( !(cin >> a) )
		{
			break;
		}

		cin >> b >> c;


		if( (a + b > c) && (b + c > a) && (c + a > b) )
		{
			tris ++;

			bool is_acute = false;
			int d = b * b + c * c;
			int aa = a * a;

			if( d == aa )
			{
				right_tris ++;
				continue;
			}
			else if ( d > aa )
			{
				is_acute = true;
			}
			else
			{
				obtuse_tris ++;
				continue;
			}
			d = c * c + a * a;
			aa = b * b;

			if( d == aa )
			{
				right_tris ++;
				continue;
			}
			else if ( d > aa )
			{
				is_acute = true;
			}
			else
			{
				obtuse_tris ++;
				continue;
			}
			d = a * a + b * b;
			aa = c * c;

			if( d == aa )
			{
				right_tris ++;
				continue;
			}
			else if ( d > aa )
			{
				is_acute = true;
			}
			else
			{
				obtuse_tris ++;
				continue;
			}
			if( is_acute )
			{
				acute_tris++;
			}
		}
		else
		{
			break;
		}
	}

	cout << tris << " " << right_tris << " " << acute_tris << " " << obtuse_tris << endl;
	return 0;
}


Measured memory_bytes: 3048
#include <iostream>

using namespace std;

class A {
	string S;
public:
	void solve()
	{
		cin >> S;

		int ans{ 0 };

		if (S[0] == '1') ++ans;
		if (S[1] == '1') ++ans;
		if (S[2] == '1') ++ans;

		cout << ans << endl;
	}
};


int main()
{
	A solution;
	solution.solve();

	return 0;
}

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

int main() {
  string a,b;
  cin >> a >> b;
  int x=a.length();
  string c= a+a;
  rep(i,x){
    if(b==c.substr(i,x)){
      cout << "Yes" << endl;
      break;
    }
    if(i==x-1) cout << "No" << endl;
  }
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.LinkedHashMap;
import java.util.Map;

public class Main {

	public static void main(String[] args) throws Exception {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int dataNum; 
		while((dataNum = Integer.parseInt(br.readLine())) != 0){
			Map<String,Integer> employeeInfo = new LinkedHashMap<>();
			for(int i = 0 ; i < dataNum ; i++){
				String line = br.readLine();
				String[] dividedLine = line.split(" ");
				Integer result;
				if(employeeInfo.containsKey(dividedLine[0])){
					result = employeeInfo.get(dividedLine[0]) + Integer.parseInt(dividedLine[1]) * Integer.parseInt(dividedLine[2]);
					employeeInfo.put(dividedLine[0],result);
				}else{
					result = Integer.parseInt(dividedLine[1]) * Integer.parseInt(dividedLine[2]);
					employeeInfo.put(dividedLine[0],result);
				}
			}
			
			boolean isDispNA = true;
			for(String key : employeeInfo.keySet()){
				 if(employeeInfo.get(key) >= 1000000){
					 System.out.println(key);
					 isDispNA = false;
				 }
			}
			if(isDispNA){
				 System.out.println("NA");
			}
		}
	}
}

Measured memory_bytes: 25996
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll mod=1e9+7;

int main() {
    int A, B, C;
    cin >> A >> B >> C;
    if(A-B>=C){
        cout << 0;
    }else{
        cout << C-(A-B);
    }
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <regex>
#include <numeric>
using namespace std;

/*--- Macro ---*/
#define rep(i, n) for(int i=0; i<(int)n; i++)
#define rep1(i, n) for(int i=1; i<(int)n; i++)
#define mp make_pair
#define pb push_back
#define all(a) a.begin(), a.end()

/*---  Type ---*/
typedef long long ll;

/*--- Constants ---*/
template <typename T> const T INF = numeric_limits<T>::max() / 10;
const int MOD = (int)1e9 + 7;

// Floating
const double EPS = 1e-11;
#define EQ0(x) (abs(x) < EPS)
#define EQ(x, y) (abs(a-b) < EPS)

// Util
int max(int a, int b, int c) {return max(a, max(b, c));}
int min(int a, int b, int c) {return min(a, min(b, c));}
ll max(ll x, ll y) {return x > y ? x : y;}
ll min(ll x, ll y) {return x < y ? x : y;}
ll max(ll a, ll b, ll c) {return max(a, max(b, c));}
ll min(ll a, ll b, ll c) {return min(a, min(b, c));}

// -------------------------------------------------------------------------------------



int main() {
  int a, b;
  cin >> a >> b;

  cout << max(a + b, a - b, a * b) << endl;

  return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cmath>
#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <algorithm>
#include <queue>
using namespace std;
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define REP(i,n) for(ll i=0;i<n;i++)
#define REPR(i,n) for(ll i=n-1;i>=0;i--)

typedef long long ll;
#define INF 1e18
#define MOD ((ll)(1e9+7))

int main(){
	ll N;
	cin>>N;
	vector<ll> a(N);
	REP(i, N) cin >> a[i];
	vector<ll> l(60,0);
	REP(i,N){
		REP(j,60){
			if(((a[i]>>j)&1)==1){
				l[j]++;
			}
		}
	}
	ll ans=0;
	ll power=1;
	REP(j,60){
		ll tmp;
		tmp=(l[j]*(N-l[j]))%MOD;
		tmp=(tmp*power)%MOD;
		ans=(ans+tmp)%MOD;
		power*=2;
		power%=MOD;
	}
	cout<<ans<<endl;
	return 0;
}


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

int n,m,a[100005],b[100005];
void solve() {
    cin >> n;
    for(int i = 0; i < n; i++) cin >> a[i];
    cin >> m;
    for(int i = 0; i < m; i++) cin >> b[i];
    sort(a, a + n);
    sort(b, b + m);
    int i = 0, j = 0, cnt = 0;
    while (i < n && j < m) {
        if (a[i] == b[j]) {
            cnt++;
            while (a[i] == b[j] && i < n)
                i++;
        }
        else
            if (a[i] < b[j]) i++;
            else j++;
    }
    cout << cnt << '\n';
}

int main() {
  
    solve();
}



Measured memory_bytes: 3172
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <iomanip> // 文字幅の指定 setw(int), 詰めたい文字の指定 setfill(char)
#include <algorithm> // sort
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
#define p(x) cout << (x) << endl
#define FOR(i,r,n) for(ll i=(ll)(r); i < (ll)(n); i++)
#define RFOR(i,r,n) for(ll i=(ll)(n); i>=r; i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) REP(i,0,n)
#define ALL(x) (x).begin(), (x).end()
#define RALL(x) (x).rbegin(), (x).rend()
#define pb push_back

// 定義する？→左揃えで0埋め
// cout << setfill('0') << left << setw(4) << 12; // "0012"
// http://marycore.jp/prog/cpp/padding-left-right-zero/

const int inf = (int)1e9;
const ll INF = (ll)1e18;

// vectorの中身をcout << vs;で表示
template <class T>
ostream &operator<<(ostream &o, const vector<T> &v)
{
    o << "{";
    for (int i = 0; i < (int)v.size(); i++) o << (i > 0 ? ", " : "") << v[i];
    o << "}";
    return o;
}

ll gcd (ll a, ll b) {
	while (b > 0) {
		ll t = a % b;
		a = b, b = t;
	}
	return a;
}

ll lcm (ll a, ll b) {
	return (a / gcd (a, b)) * b;
}

bool is_prime (ll n) {
		if (n < 2) return false;
		else if (n == 2) return true;
		else if (n % 2) return false;
		
		double sqrtn = sqrt(n);
		for (ll i = 3; i < sqrtn; i += 2) {
			if (n % i == 0) return false; 
		}
		return true;
}

ll ctoi(char c) {
	return (ll)(c - 48);
}

ll n, k, cnt=0, ans=0;
string s,t;

// ==================== template ============================

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

	int a, b; cin >> n >> a >> b;
	vi vs;
	int cnt1 = 0, cnt2 = 0, cnt3 = 0;
	REP(i, n) {
		int p; cin >> p;
		if (p <= a) {
			cnt1+=1;
			continue;
		} else if (a < p && p <= b) {
			cnt2+=1;
			continue;
		} else if (b < p) {
			cnt3+=1;
			continue;
		}
	}
	cout << min(min(cnt1, cnt2), cnt3) << endl;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long LL;
typedef pair<LL,LL> P;
const LL mod=998244353;
const LL LINF=1LL<<62;



int main(){
    double n,m,d;
    cin >> n >> m >> d;
    if(d==0) cout << fixed << setprecision(10) << (m-1)/n << endl;
    else cout <<fixed << setprecision(10) << (m-1)*2*(n-d)/(n*n) << endl;
    return 0;
}


Measured memory_bytes: 256
// #define _CRT_SECURE_NO_WARNINGS
// #define _USE_MATH_DEFINES	// M_PI=3.1415...
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <locale>
#include <cctype>
#include <sstream>
#include <iomanip>	// 20桁出力 cout << setprecision(20) << double;
#include <queue>
#include <bitset>	// bitset<8> bs1(131uL); // 10000011 bs1[0]は1 01stringからビット集合生成可
#include <numeric>
#include <random>
#include <climits>  // A/Bを計算するときA==LLONG_MIN && B==-1のみ(1ull<<63)で代用
using namespace std;

typedef long long LL;
typedef pair<LL, LL> P;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<LL> VL;
typedef vector<VL> VVL;				// VVL v(100,VL(100,0));
typedef vector<pair<LL, LL> > VP;
typedef vector<string> VS;
typedef map<int, int> MAPII;
typedef multimap<int, char, greater<int> > MuMAPIC;
typedef multimap<int, string, greater<int> > MuMIS;
typedef pair<LL, pair<P, P> > PP;

#define INF 999999999999999997		// 少し加算したらオーバーフローする
#define MP make_pair
#define FAST_IO  cin.tie(0); ios::sync_with_stdio(false);
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define FORL(i,a,b) for(LL i=(a);i<(b);i++)
#define FOR_REV(i,a,b) for(int i=(a);i>=(b);i--)
#define foreach_it(type,it,c) for(type::iterator it=c.begin(),c_end=c.end();it!=c_end;++it)
#define FOR_ITR(d) for(auto itr=d.begin(),d_end=d.end();itr!=d_end;++itr)	// C++11
#define O(s) cout<<s<<endl;

#define DUMP_VVI(b) if(dbgF){FOR(i,0,b.size()){FOR(j,0,b[i].size())printf("%d ",b[i][j]);puts("");}}
#define D_OUT(str,value) if(dbgF){cout<<str<<" : "<<value<<endl;}

template<class T>T IN() { T d; cin >> d; return d; }

LL gcd(LL a, LL b) { return (b > 0) ? gcd(b, a%b) : a; } // 最大公約数（Greatest Common Divisor）
LL lcm(LL a, LL b) { return a / gcd(a, b) * b; } // 最小公倍数（Least Common Multiple）
bool uruu(LL Y) { return (((Y % 4 == 0 && Y % 100 != 0) || Y % 400 == 0) ? true : false); } // うるう年判定
string Replace(string S, string from, string to) { auto p = S.find(from); while (p != string::npos) { S.replace(p, from.size(), to); p = S.find(from, p + to.size()); }return S; }

//二項係数 nCk mod pを求める
const LL MAX = 510000, p = 998244353; LL fac[MAX], finv[MAX], inv[MAX];
/* 前処理 */void COM_init() { fac[0] = fac[1] = 1; finv[0] = finv[1] = 1; inv[1] = 1; FOR(i, 2, MAX) { fac[i] = fac[i - 1] * i % p; inv[i] = p - inv[p%i] * (p / i) % p; finv[i] = finv[i - 1] * inv[i] % p; } }
/* 主処理 */LL COM(int n, int k) { if (n < k) return 0; if (n < 0 || k < 0) return 0; return fac[n] * (finv[k] * finv[n - k] % p) % p; }

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

// -------------------------------------------------------------------------------

int main() {
	FAST_IO;
	bool dbgF = true; // for D_OUT(str, value)  ... cout<< str <<" : "<< value <<endl;

	LL a, b, c, d;
	string s1, s2, s3, s4;
	cin >> s1;
	LL asn = 0;
	FOR(i, 0, s1.length()) {
		if (s1[i] == '+')asn++;
		else asn--;
	}
	O(asn);

	return 0;
}

Measured memory_bytes: 256
using System;

using System .Linq;


namespace ConsoleApplication2
{
    using System;

    public class Dice
    {

        public static void Main( String[] args )
        {

            string yesNo = "No";
             string dataA = Console .ReadLine();
             string dataB = Console .ReadLine();
         //   string dataA = "1 2 3 4 5 6";
          string[] diceA = dataA .Split();
            // string dataB = "4 5 6 1 2 3";
         //   string dataB = "6 4 5 2 3 1";
              string[] diceB = dataB .Split();

            //test??¨
             //string[] diceA = { "1" , "2" , "3" , "4" , "5" , "6" };
            //string[] diceB = { "6" , "2" , "4" , "3" , "5" , "1" };

           

            int i = 0;
            int j = 0;
            do
            {
                do
                {
                    //??????
                    for ( int k = 0 ; k < diceA .Length ; k++ )
                    {
                        if ( !diceA[k] .Equals( diceB[k] ) )
                        {
                            yesNo = "No";
                            break;

                        }
                        if ( k == diceA .Length - 1 )
                        {
                            yesNo = "Yes";

                        }
                    }
                    if ( yesNo == "Yes" )
                    {
                        break;
                    }
                    //?????????????¨??????¢???east??¨??????

                   turn( 3 , 5 , 2 , 0 , diceB );
                   
                    j++;
                } while ( j < 4 );

                if ( yesNo == "Yes" )
                {
                    break;
                }
                j = 0;
                //??????????????????????????¢ south??¨???


                
                 if ( i == 3 )
                {
                    //east???south
                    diceB =  dataB .Split();
                    turn( 2 , 5 , 3 , 0 , diceB );

                    
                }
                else if ( i == 4 )
                {
                    //west ???south
                    diceB = dataB .Split();
                  turn( 3 , 5 , 2 , 0 , diceB );
                    
                    
                }

               turn( 4 , 5 , 1 , 0 , diceB );
         
                i++;
            } while ( i < 6 );



            Console .WriteLine( yesNo );
           


        }

        public static void turn( int a , int b , int c , int d , string[] dice )
        {
            string temp = dice[a];
            dice[a] = dice[b];
            dice[b] = dice[c];
            dice[c] = dice[d];
            dice[d] = temp;
            
        }
    }


}

Measured memory_bytes: 8940
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<iostream>
#include<string>
#include<stack>
#include<queue>
#include<vector>
#include<map>
#include<set>
#include<algorithm>

#define rep(n) for(int i=0;i<n;i++)
#define repp(j, n) for(int j=0;j<n;j++)
#define reppp(i, m, n) for(int i=m;i<=n;i++)
#define all(c) c.begin(), c.end()
#define rall(c) c.rbegin(), c.rend()
#define MOD 1000000007
#define MAX 1000000001
#define INF 1410065408
#define EPS 1e-9
 
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
struct edge{int from, to; ll cost;};

signed main(){
	ll n, m;
	cin >> n >> m;
    ll xx = 0LL, yy = 0LL;
	rep(n){
		ll  x;
		cin >> x;
		xx += (x * (i - (n-1-i)));
		xx %= MOD;
	}
	rep(m){
	    ll y;
		cin >> y;
		yy += (y * (i - (m-1-i)));
		yy %= MOD;
	}
	
	ll ans = (xx * yy);
	cout << ans%MOD;
}


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

int main() {
  cin.tie(nullptr); ios::sync_with_stdio(false);
  int N;
  string S;
  cin >> N >> S;
  vector<array<int, 10>> table(N + 1);
  for (auto& v : table)v.fill(N);
  for (int i = N - 1; i >= 0; --i) {
    table[i] = table[i + 1];
    table[i][S[i] - '0'] = i;
  }
  set<tuple<int, int, int>> s;
  for (int i = 0; i < N; ++i) {
    for (int j = 0; j < 10; ++j) {
      for (int k = 0; k < 10; ++k) {
        if (table[i + 1][j] == N)continue;
        if (table[table[i + 1][j] + 1][k]!=N)
          s.insert(make_tuple(S[i] - '0', j, k));
      }
    }
  }
  int ans = s.size();
  cout << ans << endl;
}


Measured memory_bytes: 1536
#include <bits/stdc++.h>
#define Mod 1000000007
#define N 4005
using namespace std;
int n,C,a[N],b[N],dp[N][N],sum[N][N];
inline int ksm(int x,int y){
	int ans1=1;while (y){
		if (y&1) ans1=1ll*ans1*x%Mod;
		y>>=1;x=1ll*x*x%Mod;
	}return ans1;
}
int main(){
	for (int i=1;i<=400;i++)
		for (int j=0;j<=400;j++) sum[i][j]=1ll*(sum[i-1][j]+ksm(i,j))%Mod;
	scanf("%d%d",&n,&C);
	for (int i=1;i<=n;i++) scanf("%d",&a[i]);
	for (int i=1;i<=n;i++) scanf("%d",&b[i]);
	memset(dp,0,sizeof(dp));dp[0][0]=1;
	for (int i=1;i<=n;i++){
		for (int j=0;j<=C;j++){
			for (int k=0;k<=j;k++){
				int t=(sum[b[i]][j-k]-sum[a[i]-1][j-k]+Mod)%Mod;
				dp[i][j]=(dp[i][j]+1ll*dp[i-1][k]*t%Mod)%Mod;
			}
		}
	}
	printf("%d\n",dp[n][C]);	
	return 0;
}

Measured memory_bytes: 71040
#include <stdio.h>
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <time.h>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#pragma warning(disable:4996)
#pragma comment(linker, "/STACK:336777216")
using namespace std;

#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define ldb ldouble

typedef tuple<int, int, int> t3;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair <ll, int> pli;
typedef pair <db, db> pdd;

int IT_MAX = 1 << 17;
int MOD = 1000000007;
const int INF = 0x3f3f3f3f;
const ll LL_INF = 0x3f3f3f3f3f3f3f3f;
const db PI = acos(-1);
const db ERR = 1e-10;
#define szz(x) (int)(x).size()
#define Se second
#define Fi first

int nxt[15][2];

char in[300050];
ll dp[8];
ll tdp[8];

int main() {
	nxt[0][0] = 1, nxt[0][1] = 4;
	nxt[1][0] = 2, nxt[1][1] = 3;
	nxt[2][0] = 1, nxt[2][1] = 1;
	nxt[3][0] = 1, nxt[3][1] = 4;
	nxt[4][0] = 5, nxt[4][1] = 7;
	nxt[5][0] = 6, nxt[5][1] = 4;
	nxt[6][0] = 5, nxt[6][1] = 5;
	nxt[7][0] = 7, nxt[7][1] = 7;

	scanf("%s", in + 1);
	int N = strlen(in + 1), i, j, k;
	dp[0] = 1;
	for (i = 1; i <= N; i++) {
		int st = 0, en = 1;
		if (in[i] == '0') en = 0;
		if (in[i] == '1') st = 1;

		memset(tdp, 0, sizeof(tdp));
		for (j = 0; j < 8; j++) {
			for (k = st; k <= en; k++) {
				int nx = nxt[j][k];
				tdp[nx] += dp[j];
			}
		}
		for (j = 0; j < 8; j++) dp[j] = tdp[j] % MOD;
	}
	return !printf("%d\n", (dp[4] + dp[7]) % MOD);
}

Measured memory_bytes: 512
import java.lang.reflect.Array;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
	    Scanner sin=new Scanner(System.in);
	    int n= sin.nextInt();
	    int k= sin.nextInt();
	    int[] a=new int[n];
		for (int i = 0; i < n; i++) {
			a[i]= sin.nextInt();
		}
		int sum=0;
		for (int i = 0; i < k; i++) {
			sum+=a[i];
		}
		int sumb=sum;
		int fi=0;
		for (int i = k; i <n ; i++) {
			sumb=sumb-a[i-k]+a[i];
			if(sumb>sum) {
				sum=sumb;
				fi=i-k+1;
			}
		}
		double ans=0;
		for (int i = fi; i <fi+k ; i++) {
			double div=a[i]*(a[i]+1)*1.0/2/a[i];
			ans+=div;
		}
		System.out.printf("%.12f",ans);
    }
}


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

#define ll long long
#define ull unsigned long long

using namespace std;

int main() {
	int A, B;
	cin >> A >> B;

	int num = A * B;

	bool ok = (num==1) || (num==3) || (num==9);


	if (ok){
	cout << "Yes" << "\n";
	} else {
	cout << "No" << "\n";		
	}

	return 0;
}


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

using namespace std;

#define FOR(i,l,r) for(int i = l; i <= r; ++i)
#define REP(i,l,r) for(int i = l; i < r; ++i)
#define pi pair<int,int>
#define mp make_pair
#define fi first
#define se second
#define LL long long 

const LL MOD = 1e9 + 7;

int n;
int C[60];

int main(){
    cin >> n;
    LL res = 0;
    FOR(i,1,n){
        LL x;
        cin >> x;
        FOR(j,0,59){
            int k = (x >> j) & 1 ? i - 1 - C[j] : C[j];
            res += (((1LL << j) % MOD) * k) % MOD;
            res %= MOD;
        }
        FOR(j,0,59){
            if((x >> j) & 1) ++C[j];
        }
    }
    cout << res;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define loop(n) for (int ngtkana_is_genius = 0; ngtkana_is_genius < int(n); ngtkana_is_genius++)
#define rep(i, begin, end) for(int i = int(begin); i < int(end); i++)
#define all(v) v.begin(), v.end()
#define rand(l, r) std::uniform_int_distribution<>(l, r)(mt)
using lint = long long;
auto mt = std::mt19937_64(std::random_device{}());
auto cmn = [](auto& a, auto b){if (a > b) {a = b; return true;} return false;};
auto cmx = [](auto& a, auto b){if (a < b) {a = b; return true;} return false;};
void debug_impl() { std::cerr << std::endl; }
template <typename Head, typename... Tail>
void debug_impl(Head head, Tail... tail){
  std::cerr << " " << head;
  debug_impl(tail...);
}
#ifdef STOPIT
#define debug(...) 0
#else
#define debug(...)\
do {\
  std::cerr << std::boolalpha << "[" << #__VA_ARGS__ << "]:";\
  debug_impl(__VA_ARGS__);\
  std::cerr << std::noboolalpha;\
} while (false)
#endif

template < typename Container, typename Value = typename Container::value_type, std::enable_if_t<!std::is_same< Container, std::string >::value, std::nullptr_t> = nullptr>
std::istream& operator>> (std::istream& is, Container& v)
  { for (auto & x : v) { is >> x; } return is; }

template < typename Container, typename Value = typename Container::value_type, std::enable_if_t<!std::is_same< Container, std::string >::value, std::nullptr_t> = nullptr >
std::ostream& operator<< (std::ostream& os, Container const& v) {
 os << "{";
  for (auto it = v.begin(); it != v.end(); it++)
    {os << (it != v.begin() ? "," : "") << *it;}
  return os << "}";
}

int main() {
  std::cin.tie(0); std::cin.sync_with_stdio(false);
  lint n, k; std::cin >> n >> k;
  std::vector< lint > a(n), b(n);
  std::cin >> a >> b;
  std::sort(all(a));
  std::sort(all(b));
  std::reverse(all(a));

  auto cost = [&] (lint time) {
    std::vector< lint > c(n);
    std::transform(all(b), c.begin(), [time](auto x){ return time / x; });
    lint ret = 0;
    rep(i, 0, n) {
      ret += std::max(0LL, a.at(i) - c.at(i));
    }
    return ret;
  };

  lint ok = 1e18, ng = -1, md;
  while (abs(ok - ng) > 1) {
    md = (ok + ng) >> 1;
    if (cost(md) <= k) ok = md;
    else ng = md;
  }
  std::cout << ok << std::endl;
  return 0;
}


Measured memory_bytes: 4992
import sys
if sys.platform =='ios':
	sys.stdin=open('Untitled.txt')
input = sys.stdin.readline

week = ["SUN\n","MON\n","TUE\n","WED\n","THU\n","FRI\n","SAT\n"]
S = input()

print(abs(week.index(S)-7))

Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for (int i = 0; i < (n); i++)
#define REP2(i, x, n) for (int i = x; i < (n); i++)
#define ALL(n) begin(n), end(n)
int main()
{
    // long double pi = 3.14159265358979323846264338327950288419716939937510582097494459230781640628620899862803482534211706798214808651328230664709384460955058223172535940812848111745028410270193852110555964462294895493038196442881097566593344612847564823378678316527120190914564856692;
    double pi = acos(-1);
    int A, B, H, M;
    cin >> A >> B >> H >> M;

    double rm;
    rm = double(M * 6);
    double rh;
    rh = double(H * 60 + M) / 2;
    // cout << rh << endl;
    // cout << rm << endl;

    double angle;
    angle = abs(rm - rh);
    // cout << angle << endl;
    // cout << fixed << setprecision(20) << sqrt(pow(A, 2) + pow(B, 2) - 2 * A * B * cos(pi * angle / 180)) << endl;
    // cout << fixed << setprecision(20) << static_cast<long double>(sqrt(pow(A, 2) + pow(B, 2) - 2 * A * B * cos(pi * angle / 180))) << endl;
    // printf("%.10f\n", double(A));
    // printf("%.10f\n", double(A * A + B * B));
    // printf("%.10f\n", double(2 * A * B) * cos(pi * angle / 180));
    // printf("%.20f\n", double(sqrt(double(A * A + B * B) - double(2 * A * B) * cos(double(pi * angle) / 180))));
    // printf("%.20f\n", double(sqrt(double(A * A + B * B) - double(2 * A * B) * cos(double(pi * angle) / 180))));
    cout << fixed << setprecision(20) << double(sqrt(double(A * A + B * B) - double(2 * A * B) * cos(double(pi * angle) / 180))) << endl;
    // cout << fixed << setprecision(20) << sqrt(A * A + B * B - 2 * A * B * cos(pi * angle / 180)) << endl;
    // long double rad = (pi * angle) / 180;
    // double c = cos(rad);
    // double x = A * A + B * B - 2 * A * B * c;
    // // cout << fixed << setprecision(20) << static_cast<long double>(rad) << endl;
    // // cout << fixed << setprecision(20) << c << endl;
    // // cout << fixed << setprecision(20) << x << endl;
    // // cout << fixed << setprecision(20) << sqrt(x) << endl;
    // cout << fixed << setprecision(20) << static_cast<double>(sqrt(x)) << endl;
    return 0;
}

Measured memory_bytes: 4156
#include <stdio.h>
#include <math.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <numeric>
#include <string>
#include <map>
using namespace std;
typedef long long int lli;
#define urept(soeji, start, n) for (int soeji = start; soeji < n; soeji++)
#define drept(soeji, start, n) for (int soeji = start; soeji > n; soeji--)
typedef vector<int> vi;
typedef vector<vector<int>> vi2;
int main(void)
{
    string o, e;
    cin >> o >> e;
    for (int i = 0; i < e.length(); i++)
    {
        cout << o[i] << e[i];
    }
    if (o.length() - e.length() == 1)
    {
        cout << o[o.length() - 1];
    }
    return 0;
}

Measured memory_bytes: 256
//Relive your past life.
//Face your demons.
//The past is never dead,it is not even past.
//The memories are not only the key to the past but...also to the future.
//coded in Rusty Lake
#include<cmath>
#include<math.h>
#include<ctype.h>
#include<algorithm>
#include<bitset>
#include<cassert>
#include<cctype>
#include<cerrno>
#include<cfloat>
#include<ciso646>
#include<climits>
#include<clocale>
#include<complex>
#include<csetjmp>
#include<csignal>
#include<cstdarg>
#include<cstddef>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<cwchar>
#include<cwctype>
#include<deque>
#include<exception>
#include<fstream>
#include<functional>
#include<iomanip>
#include<ios>
#include<iosfwd>
#include<iostream>
#include<istream>
#include<iterator>
#include<limits>
#include<list>
#include<locale>
#include<map>
#include<memory>
#include<new>
#include<numeric>
#include<ostream>
#include<queue>
#include<set>
#include<sstream>
#include<stack>
#include<stdexcept>
#include<streambuf>
#include<string>
#include<typeinfo>
#include<utility>
#include<valarray>
#include<vector>
#include<string.h>
#include<stdlib.h>
#include<stdio.h>
#define ll   long long
#define pb   push_back
#define mp   make_pair
#define orz  1000000007
using namespace std;
int n,A[3][100005],a[100005],b[2],t[100005];
bool ok=1;
void add(int x){while(x<=n)t[x]^=1,x+=(x&-x);}
int get(int x){int s=0;while(x)s^=t[x],x-=(x&-x);return s;}
int main(){
    scanf("%d",&n);
    for(int i=0;i<3;++i){
        for(int j=1;j<=n;++j)scanf("%d",A[i]+j);
    }
    for(int i=1;i<=n;++i){
        if(A[1][i]%3!=2)ok=0;
        if(abs(A[0][i]-A[1][i])!=1||abs(A[2][i]-A[1][i])!=1)ok=0;
        a[i]=A[1][i]/3+1;
        if((i^a[i])&1)ok=0;
        if(A[0][i]>A[1][i])b[i&1]^=1;
    }
    if(!ok){
        puts("No");
        return 0;
    }
    for(int i=1;i<=n;i+=2)b[0]^=i/2-get(a[i]),add(a[i]);
    if(b[0]&1){
        puts("No");
        return 0;
    }
    memset(t,0,sizeof(t));
    for(int i=2;i<=n;i+=2)b[1]^=i/2-1-get(a[i]),add(a[i]);
    if(b[1]&1)puts("No");
    else puts("Yes");
    //system("pause");
    return 0;
}


Measured memory_bytes: 2176
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int a,b;
  cin>>a>>b;
  int c = max(a,b);
  if(c==a){a=a-1;}else{b=b-1;}
  int d = max(a,b);
  cout << c+d << endl;
}

Measured memory_bytes: 256
n, k = map(int, input().split())
L = list(sorted(map(int, input().split())))
out = 0
if k >= n:
  print(0)
elif k == 0:
  for i in L:
    out += i
  print(out)
else:
  for i in L[0:-k]:
    out += i
  print(out)

Measured memory_bytes: 26764
#include <iostream>
using namespace std;
int main(void){
  int a, b, c;
  cin >> a >> b >> c;
  if(a != b && b == c) cout << a << endl;
  else if(a != b && b != c) cout << b << endl;
  else if(a == b && b != c) cout << c << endl;
  return 0;
}

Measured memory_bytes: 256
n = gets.chomp.to_i
l = gets.chomp.split(' ').map(&:to_i)

answer = 0
(0...n).each do |i|
  ((i + 1)...n).each do |j|
    ((j + 1)...n).each do |k|
      a = [l[i], l[j], l[k]].sort
      answer += 1if a[0] != a[1] && a[1] != a[2] && a[0] + a[1] > a[2]
    end
  end
end
puts answer

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

int main(void) {
  int n; cin >> n;
  vector<int> a(n);
  for (int i=0; i<n; i++) cin >> a[i];
  sort(a.begin(), a.end());
  cout << a[n-1] - a[0] << endl;
  return 0;
}

Measured memory_bytes: 3620
#include<bits/stdc++.h>
#define rep(i, n) for(int i = 0;i < (int)n;i++)
#define repb(i, n) for(int i = (int)n;i >= 0;i--)
#define reps(i, m, n) for(int i = (int)m;i < (int)n;i++)
#define repsb(i, m, n) for(int i = (int)m;i >= (int)n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define pb(a) push_back(a)
#define INF 999999999999999999
using namespace std;
int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};
using namespace std;
int main(int argc, char const *argv[]) {
    int n,s,c=0;
    cin>>n;
    vector<int> v(n);
    rep(i,n){
      cin>>v[i];
    }
    cin>>s;
    int temp;
    rep(i,s){
      cin>>temp;
      rep(j,n){
        if(v[j]==temp){
          c++;
          break;
        }
      }
    }
    cout<<c<<endl;
    return 0;
}



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

using namespace std;

#define REP1(i,n) for(int i=1, i##_len=(n); i<i##_len; ++i)
#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define pow(x) x*x
#define ll long long
static const ll MAX = 1000000;
static const ll INFTY = 1e12;
static const ll MOD = 1000000007;

template < typename T > inline string toString( const T &a ) { ostringstream oss; oss << a; return oss.str(); };

struct edge {
    ll to, cost;
};

using Graph = vector<vector<int>>;
using _Graph = vector<vector<edge>>;


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

// 深さ優先探索
vector<bool> seen;
vector<int> colors;

int H, W, N;
int sx, sy, gx, gy; 
vector<vector<char>> field;
vector<vector<int>> dist;
//vector<pair<int, int>> gx, gy;
deque<pair<int, int>> que;

typedef vector<vector<int> > Matrix;

const int INF = 100000000;


int main() {

  int A, B, C, D;
  cin >> A >> B >> C >> D;
  int count = 0;

  while(1){
    if(count % 2 != 0){
      A -= D;
      if(A <= 0){
        cout << "No" << endl;
        return 0;
      }
    }else{
      C -= B;
      if(C <= 0){
        cout << "Yes" << endl;
        return 0;
      }
    }
    count++;

    
  }

  
}


/*
                   _ooOoo_
                  o8888888o
                  88" . "88
                  (| -_- |)
                  O\  =  /O
               ____/`---'\____
             .'  \\|     |//  `.
            /  \\|||  :  |||//  \
           /  _||||| -:- |||||-  \
           |   | \\\  -  /// |   |
           | \_|  ''\---/''  |   |
           \  .-\__  `-`  ___/-. /
         ___`. .'  /--.--\  `. . __
      ."" '<  `.___\_<|>_/___.'  >'"".
     | | :  `- \`.;`\ _ /`;.`/ - ` : | |
     \  \ `-.   \_ __\ /__ _/   .-` /  /
======`-.____`-.___\_____/___.-`____.-'======
                   `=---='
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
         pass System Test!
*/


Measured memory_bytes: 3632
s=input()
n=len(s)
for i in range(1,n//2-1):
    m=n//2-i

    x=s[0] 
    for j in range(m-1):
        x=x+s[j+1]
    y=s[m]
    for j in range(m-1):
        y=y+s[m+1+j]

    if x==y:
        print(2*m)
        exit()
print(2)
        
    
    


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

int main() {
  int n, i, s, ans = 0;
  cin >> n;
  map<int, int> mp1, mp2;
  for (i = 0; i < n; i++) {
    cin >> s;
    ans += s;
    if (s % 10 == 0) {
      mp1[s]++;
    } else {
      mp2[s]++;
    }
  }
  if (mp2.size() == 0) {
    ans = 0;
  } else {
    if (ans % 10 == 0) {
      auto p = mp2.begin();
      ans -= p->first;
    }
  }
  cout << ans << "\n";
  return 0;
}

Measured memory_bytes: 256
// clang-format

#include <bits/stdc++.h>
#define rep(i, n) for (lli i = 0; i < (n); i++)
#define rrep(i, n) for (lli i = (n)-1; i >= 0; i--)
using namespace std;

using lli = long long int;

void solve(long long H, long long W, long long N) {
  lli ma = max(H, W);
  cout << (N % ma == 0 ? N / ma : (N / ma) + 1) << endl;
}

int main() {
  long long H;
  scanf("%lld", &H);
  long long W;
  scanf("%lld", &W);
  long long N;
  scanf("%lld", &N);
  solve(H, W, N);
  return 0;
}


Measured memory_bytes: 256
c = [list(map(int, input().split())) for _ in range(3)]

if c[0][0] + c[1][1] + c[2][2] == c[1][0] + c[2][1] + c[0][2] == c[2][0] + c[0][1] + c[1][2]:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 3060