akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll m(ll a,ll b)
{
   if(a-b>0)
    return a-b;
   return b-a;
}

int main()
{
    ll n;
    cin>>n;
    ll k;
    cin>>k;
    ll ar[100005];
    for(int i=0;i<n;i++)
        cin>>ar[i];
      ll dp[100005];
    dp[n-2]=m(ar[n-1],ar[n-2]);
    dp[n-1]=0;
    for(int i=n-3;i>=0;i--)
    {
        dp[i]=INT_MAX;
        for(int j=i+1;j<n&&j<=k+i;j++)
        {
            dp[i]=min(dp[i],dp[j]+m(ar[j],ar[i]));

        }

    }
   //  for(int i=0;i<n;i++)
    //    cout<<dp[i]<<" ";
    cout<<dp[0];
}


Measured memory_bytes: 1792
package main

import (
	"fmt"
	"sort"
	"strings"
)

func main() {
	var s string
	fmt.Scan(&s)
	chars := strings.Split(s, "")
	subStrs := make([]int, len(chars))
	curIndex := 0
	for _, char := range chars {
		if char == "A" || char == "C" || char == "G" || char == "T" {
			subStrs[curIndex] += 1
		} else {
			curIndex += 1
		}
	}
	sort.Ints(subStrs)
	fmt.Println(subStrs[len(subStrs)-1])
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n;
    cin >> n;
    int c[n];
    int o, e;
    for(int i = 0; i < n; i++)
    {
        cin >> c[i];
        if(c[i] % 2 == 1)
        {
            o = o + 1;
        }
        else
        {
            e = e + 1;
        }
    }
    cout << pow(3, n) - pow(2, e) << endl;




}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define dump(x) cout << x << '\n'

typedef int64_t Int;
const double pi = M_PI;

using namespace std;

int main() {
    string o, e, ans = "";
    cin >> o >> e;

    reverse(o.begin(), o.end());
    reverse(e.begin(), e.end());
    while (!e.empty()) {
        ans.push_back(o.back());
        o.pop_back();
        ans.push_back(e.back());
        e.pop_back();
    }
    if (!o.empty()) {
        ans.push_back(o.back());
        o.pop_back();
    }

    cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>

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

  long long min = 1000000 ;
  long long max = -1000000 ;
  long long sum = 0 ;

  for ( int i = 0 ; i < num ; ++i ) {
    int val ;
    std::cin >> val ;
    if ( min > val )
      min = val ;
    if ( max < val )
      max = val ;
    sum += val ;
  }

  std::cout << min << " " << max << " " << sum << std::endl ;

  return 0 ;
}

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

ll X, K, D;

int main(){
  cin >> X >> K >> D;

  if (X < 0) X *= -1;

  if (X < D && K%2==1) cout << abs(X-D) << endl;
  else if (X < D && K%2==0) cout << X << endl;

  else if ((X/D) < K){
    if ((K-(X/D))%2==0) cout << X%D << endl;
    else cout << abs((X%D)-D) << endl;
  }

  else cout << X - (K * D) << endl;
}


Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define rep(i,n,m) for(int i=n;i<(int)(m);i++)
#define rrep(i,n,m) for(int i=((int)(n)-1);i>=m;i--)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
using namespace std;
int main(){
    int n,h,w;
    cin>>n>>h>>w;
    vector<int> a(n),b(n);
    int ans=0;
    rep(i,0,n){
        int a,b;
        cin>>a>>b;
        if(a>=h && b>=w) ans++;
    }
    
    cout<<ans<<endl;
}


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

int main() {
  int n;
  cin >> n;
  for (int i = 1; i <= 9; i++) {
    for (int j = 1; j <= 9; j++) {
      if (n == i * j) {
        cout << "Yes" << endl;
        return 0;
      }
    }
  }
  cout << "No" << endl;
}


Measured memory_bytes: 256
# coding: utf-8
# Your code here!

n, m, l = map(int,input().split())

A = [list(map(int,input().split())) for i in range(n)]
B = [list(map(int,input().split())) for i in range(m)]
C = [[0]*l for i in range(n)]

for i in range(n):
    for j in range(l):
        for k in range(m):
            C[i][j] += B[k][j]*A[i][k]
            
for i in range(n):
    print(C[i][0], end = "")
    for j in range(1,l):
        print("", C[i][j], end = "")
    print()


Measured memory_bytes: 7140
n = int(input())
a = list(map(int, input().split()))
yen = 1000
stock = 0
an = []
i = 0
while 1:
    while i <= n - 2 and a[i] >= a[i+1]:
        i += 1
    if i == n - 1:
        print(yen)
        exit()
    stock, yen = divmod(yen, a[i])
    while i <= n-2 and a[i] <= a[i+1]:
        i += 1
    stock, yen = 0, yen + a[i] * stock

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

int main()
{
	string a,b;
	while(cin >> a >> b, a!="0" && b!="0")
	{
		int hit=0,blow=0;
		for(int i=0; i<4; i++)
		{
			if(a[i]==b[i])
			{
				hit++;
			}
			else
			{
				for(int j=0; j<4; j++)
				{
					if(a[i]==b[j])
					{
						blow++;
						break;
					}
				}
			}
		}

		cout << hit << " " << blow << endl;
	}
}

Measured memory_bytes: 912
import sys
N = sys.stdin.readline()
N = int(N)

#print(N)
#for i in range(N):
H = sys.stdin.readline().split()
#print(H)

max_H = 0
cnt = 0
for i in range(len(H)):
    if(max_H<=int(H[i])):
#        print(H[i])
        max_H = int(H[i])
        cnt += 1
#    else:
#        print("m",max_H)
    
print(cnt)

Measured memory_bytes: 3064
while True:
    H, W = input().split()
    H = int(H)
    W = int(W)

    if H == 0 and W == 0:
        break
    for a in range(H):
        for b in range(W):
            if a == 0 or a == len(range(H)) - 1:
                print('#', end='')
            else:
                if b == 0 or b == len(range(W)) - 1:
                    print('#', end = '')
                else:
                    print('.',end='')
        print('')
    print('')


Measured memory_bytes: 7012
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cfloat>
#include <cmath>
#include <functional>
#include <algorithm>
#include <utility>
#include <vector>
using namespace std;
                      
using llong = long long;
                      
llong n;
double x[100000];
double r[100000];
double valid, invalid = 1e6, mid;
                      
int main() {
    auto g = [&](double b, double r, double y) {
                 double x = sqrt((r * r) - (y * y));
                 return pair<double, double>(-x + b, x + b);
             };
    auto f = [&](double y){
                 double lx, rx;
                 lx = -1e15;
                 rx = 1e15;
                          
                 for (llong i = 0; i < n; i++) {
                     if (r[i] < y) return false;
                              
                     pair<double, double>p = g(x[i], r[i], y);
                     lx = max(p.first, lx);
                     rx = min(p.second, rx);
                 }
                 return lx <= rx;
             };
    
    scanf("%lld", &n);
    for (llong i = 0; i < n; i++) {
        scanf("%lf %lf", &x[i], &r[i]);
        if (invalid > r[i]) invalid = r[i];
    }
                      
    // binary search
    for (int k = 0; k < 30; k++) {
        mid = (valid + invalid) / 2;
        if (f(mid)) valid = mid;
        else invalid = mid;
    }
                      
    printf("%.*lf\n", DBL_DIG, valid);
                      
    return 0;
}



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



int main(){
    int n;
    cin >> n;
    vector<int> x(n);
    rep(i,n) cin >> x[i];
    int mean = 0;
    rep(i,n) {
        mean += x[i];
    }
    mean /= n;
    int ans1 = 0;
    int ans2 = 0;
    rep(i,n){
        ans1 += (x[i]-mean)*(x[i]-mean);
        ans2 += (x[i]-mean-1)*(x[i]-mean-1);
    }
    int ans = min(ans1,ans2);

    cout << ans << endl;
    
}

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

// lib/floor_log2.hpp
#ifndef FLOOR_LOG2_HPP
#define FLOOR_LOG2_HPP


namespace tools {
  std::uint32_t floor_log2(std::uint32_t x);
  std::uint64_t floor_log2(std::uint64_t x);
}

#endif

// lib/bitcount.hpp
#ifndef BITCOUNT_HPP
#define BITCOUNT_HPP


namespace tools {
  std::uint32_t bitcount(std::uint32_t x);
  std::uint64_t bitcount(std::uint64_t x);
}

#endif

// lib/floor_log2.cpp

namespace tools {
  std::uint32_t floor_log2(std::uint32_t x) {
    x |= (x >> static_cast<std::uint32_t>(1));
    x |= (x >> static_cast<std::uint32_t>(2));
    x |= (x >> static_cast<std::uint32_t>(4));
    x |= (x >> static_cast<std::uint32_t>(8));
    x |= (x >> static_cast<std::uint32_t>(16));
    return bitcount(x) - static_cast<std::uint32_t>(1);
  }

  std::uint64_t floor_log2(std::uint64_t x) {
    x |= (x >> static_cast<std::uint64_t>(1));
    x |= (x >> static_cast<std::uint64_t>(2));
    x |= (x >> static_cast<std::uint64_t>(4));
    x |= (x >> static_cast<std::uint64_t>(8));
    x |= (x >> static_cast<std::uint64_t>(16));
    x |= (x >> static_cast<std::uint64_t>(32));
    return(bitcount(x) - static_cast<std::uint64_t>(1));
  }
}

// lib/bitcount.cpp

namespace tools {
  std::uint32_t bitcount(std::uint32_t x) {
    x = (x & static_cast<std::uint32_t>(0x55555555ull)) + (x >> static_cast<std::uint32_t>(1) & static_cast<std::uint32_t>(0x55555555ull));
    x = (x & static_cast<std::uint32_t>(0x33333333ull)) + (x >> static_cast<std::uint32_t>(2) & static_cast<std::uint32_t>(0x33333333ull));
    x = (x & static_cast<std::uint32_t>(0x0f0f0f0full)) + (x >> static_cast<std::uint32_t>(4) & static_cast<std::uint32_t>(0x0f0f0f0full));
    x = (x & static_cast<std::uint32_t>(0x00ff00ffull)) + (x >> static_cast<std::uint32_t>(8) & static_cast<std::uint32_t>(0x00ff00ffull));
    return (x & static_cast<std::uint32_t>(0x0000ffffull)) + (x >> static_cast<std::uint32_t>(16) & static_cast<std::uint32_t>(0x0000ffffull));
  }

  std::uint64_t bitcount(std::uint64_t x) {
    x = (x & static_cast<std::uint64_t>(0x5555555555555555ull)) + (x >> static_cast<std::uint64_t>(1) & static_cast<std::uint64_t>(0x5555555555555555ull));
    x = (x & static_cast<std::uint64_t>(0x3333333333333333ull)) + (x >> static_cast<std::uint64_t>(2) & static_cast<std::uint64_t>(0x3333333333333333ull));
    x = (x & static_cast<std::uint64_t>(0x0f0f0f0f0f0f0f0full)) + (x >> static_cast<std::uint64_t>(4) & static_cast<std::uint64_t>(0x0f0f0f0f0f0f0f0full));
    x = (x & static_cast<std::uint64_t>(0x00ff00ff00ff00ffull)) + (x >> static_cast<std::uint64_t>(8) & static_cast<std::uint64_t>(0x00ff00ff00ff00ffull));
    x = (x & static_cast<std::uint64_t>(0x0000ffff0000ffffull)) + (x >> static_cast<std::uint64_t>(16) & static_cast<std::uint64_t>(0x0000ffff0000ffffull));
    return (x & static_cast<std::uint64_t>(0x00000000ffffffffull)) + (x >> static_cast<std::uint64_t>(32) & static_cast<std::uint64_t>(0x00000000ffffffffull));
  }
}

// main.cpp

int main() {
  std::uint64_t x, y;
  std::cin >> x >> y;
  std::cout << tools::floor_log2(y / x) + 1 << std::endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define ll long long
#define fw(p) for(int w=0;w<(p);w++)
#define fx(p) for(int x=0;x<(p);x++)
#define fy(p) for(int y=0;y<(p);y++)
#define fz(p) for(int z=0;z<(p);z++)
#define fyg(p,g) for(int y=(g);y<(p);y++)
#define fzg(p,g) for(int z=(g);z<(p);z++)
#define ce(d) cout<<d<<endl;
#define ces(d) cout<<" "<<endl;

int main() {

int N,K,n;
int minus=0;
vector<int> X(100000);
cin>>N>>K;
fx(N){
	cin>>X.at(x);
	if(X.at(x)<0){
		minus++;
	}
	
	if(x-1>=0&&X.at(x-1)<0&&X.at(x)>=0){
		n=x;
	}
	
}

if(minus==0){
ce(X.at(K-1));
}else if(minus==N){
	ce(abs(X.at(N-K)));
}else{

ll ans=400000000;
fx(N){
	int k=K,min=0;
bool a=false;
	if(x<n){
		min+=abs(X.at(x));
		if((k-=(n-x))>0&&n+k-1<N){
			min+=(X.at(n+k-1)-X.at(x));
a=true;
		}
	}else{
		min+=abs(X.at(x));//N-x-1
		if((k-=(x-n+1))>0&&n-k>=0){
			min+=abs(X.at(x)-X.at(n-k));
a=true;
		}
	}
	
	if(a&&min<ans){ans=min;}
	
}

ce(ans);

}

}

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

int main () {
  int N, L;
  cin >> N >> L;
  vector <string> words(N);
  for (int i = 0; i < N; i++) cin >> words.at(i);
  sort (words.begin(),words.end());
  for (int i = 0; i < N; i++) cout << words.at(i);
  cout << endl;
}


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

int main(void){
    int n, t, a[100010];
    cin >> n >> t;
    for (int i = 0; i < n; i++) cin >> a[i];
    
    int pf = 0, tm = 0, mn = 1e9;
    for (int i = 0; i < n; i++) {
        mn = min(mn, a[i]);
        if (a[i] - mn > pf) {
            pf = a[i] - mn;  tm = 1;
        }
        else if (a[i] - mn == pf) tm++;
    }
    
    cout << tm << endl;
    
}


Measured memory_bytes: 640
n = int(input())
S = []
T = []
for i in range(n):
    s, t = input().split()
    t = int(t)
    S.append(s)
    T.append(t)

X = input()

ans = 0

flag = False
for s, t in zip(S, T):
    if flag:
        ans += t
    if s == X:
        flag = True

print(ans)

Measured memory_bytes: 3064
A,B,C,X,Y = map(int,input().split())
minS = float('inf')
for i in range(0,2*max(X,Y)+2,2):
    minS = min(minS,C*i + B*max(0,Y-i/2) + A*max(0,X-i/2))

print(int(minS))

Measured memory_bytes: 3060
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <deque>
using namespace std;
#define rep(i,n) for (ll i=0;i<n;i++)
typedef long long ll;

int N;
double T;
double A;
double H[1100];

double temp(int I) {
	double ans = T - H[I] * 0.006;
	return fabs(A - ans);
}

int main() {
	cin >> N >> T >> A;
	rep(i, N) cin >> H[i];
	int ans;
	double now;
	rep(i, N) {
		if (!i) {
			ans = i;
			now = temp(i);
		}
		else {
			if (temp(i) < now) {
				now = temp(i);
				ans = i;
			}
		}
	}
	cout << ans + 1 << endl;
	return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	//フィールド
	int top = 0; //スタックポインタ
	int[] S = new int[101]; //スタック

	//初期化
	void initialize() {
		top = 0;
	}

	//要素が存在しないかを判定
	boolean isEmpty() {
		return top == 0;
	}

	//要素が満タンかどうか判定
	boolean isFull() {
		return top >= S.length;
	}

	//要素の追加
	void push(int x) {
		if (!isFull()) { //配列に空きがある
			top++;
			S[top] = x;
		} else { //配列に空きがない
			System.err.println("エラー（オーバーフロー）");
		}
	}

	//要素の取り出し
	int pop() {
		if (isEmpty()) { //配列に要素がある
			System.err.println("エラー（アンダーフロー）");
		}
		top--;
		return S[top + 1];
	}

	public static void main(String[] args) {
		Main main = new Main();
		Scanner sc = new Scanner(System.in);
		if (sc.hasNextLine()) {
			String s = sc.nextLine();
			String[] ary = s.split("\\s");
			//操作
			for (int i = 0; i < ary.length; i++) {
				String str = ary[i];
				int a;
				int b;
				switch (str) {
				//演算子だった場合
				case "+":
					a = main.pop();
					b = main.pop();
					main.push(a + b);
					break;
				case "-":
					a = main.pop();
					b = main.pop();
					main.push(b - a);
					break;
				case "*":
					a = main.pop();
					b = main.pop();
					main.push(a * b);
					break;
				//数字だった場合
				default:
					main.push(Integer.parseInt(str));
					break;
				}
			}
		}
		System.out.println(main.S[main.top]);
	}

}



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

typedef long long ll;

int main()
{
    int n;
    cin>>n;
    vector<int>x(n);
    vector<int>y(n);
    rep(i,n){
      cin>>x[i];
      y[i]=x[i];
      }
    sort(x.begin(),x.end());
    int a=x[n/2-1],b=x[n/2];
    rep(i,n){
      if(y[i]<=a)cout<<b<<endl;
      else cout<<a<<endl;
      }
    return 0;
}


Measured memory_bytes: 3712
#include <iostream>
#include <cmath>

using std::cout;
using std::endl;
using std::cin;
using std::abs;

int T[100'010];
int X[100'010];
int Y[100'010];

int main() {
	// Input
	int N;
	cin >> N;
	for(int i = 0; i < N; ++i) {
		cin >> T[i] >> X[i] >> Y[i];
	}
	// Calculation
	bool isPossible = true;
	int curT = 0;
	int curX = 0;
	int curY = 0;
	for(int i = 0; i < N; ++i) {
		int duration = T[i] - curT;
		int distance = abs(X[i] - curX) + abs(Y[i] - curY);
		if(distance > duration || (duration % 2 != distance % 2)) {
			isPossible = false;
			break;
		}
	}
	// Output
	if(isPossible) {
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}
	return 0;
}

Measured memory_bytes: 1408
#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() {
  int x,a,b;
  cin >> x>>a>>b;
  int ans;
  
  if(a+x<b) ans=b-a-x;
  else if(b+x<a) ans=a-b-x;
  else ans=0;
  
  cout << ans << endl;
  
}

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<stack>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
//#define mt make_tuple
//typedef tuple<double,int,double> tp;
//typedef vector<tp> vt;
const double PI=acos(-1);
const double EPS=1e-7;
const int inf=1e9;
const ll INF=2e18;
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};
int dp[110][10010]={0};
int main(){
	int n,W;
	cin>>n>>W;
	vi v(n),w(n);
	rep(i,n)cin>>v[i]>>w[i];
	vi dp(W+1);
	rep(i,n)for(int j=W-w[i];j>=0;j--)dp[j+w[i]]=max(dp[j+w[i]],dp[j]+v[i]);
	cout<<dp[W]<<endl;
}

Measured memory_bytes: 3104
#include<bits/stdc++.h>
using namespace std;
vector<int> uft;
int find(int x){
  return uft[x]==x?x:uft[x]=find(uft[x]);
}
void unite(int x,int y){
  uft[find(x)]=find(y);
}

int main(){
  int n,m,r=0;
  cin>>n>>m;
  vector<int> p(n);
  vector<vector<int>> adj(n);
  uft.resize(n);
  for(int i=0;i<n;++i){
    uft[i]=i;
    cin>>p[i];
    p[i]--;
  }
  for(int i=0;i<m;++i){
    int x,y;
    cin>>x>>y;
    adj[x-1].emplace_back(y-1);
    adj[y-1].emplace_back(x-1);
  }
  
  for(int i=0;i<n;++i)for(auto j:adj[i])unite(i,j);
  for(int i=0;i<n;++i)if(find(p[i])==find(i))r++;
  cout<<r;
  return 0;
}

Measured memory_bytes: 6528
#include<iostream>
#include<iomanip>
#include<string>
#include<vector>
#include<queue>
using namespace std;

int main(){
string s;
cin>>s;
int z=0;
for(int i=0;i<s.size()-1;i++){
  char a=s.at(i),b=s.at(i+1);
  if(a==b){
    z=1;
  }
}
if(z==0)cout<<"Good";
if(z==1)cout<<"Bad";
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;n>i;++i)
using namespace std;
using ll=int64_t;
using vi=vector<int>;
using VI=vector<ll>;
using vis=vector<string>;
using vvi=vector<vi>;
int main(){
    int a,b,c;
    cin>>a>>b>>c;
    if(a==b&&b==c){
        cout<<"Yes"<<endl;
        return 0;
    }
    cout<<"No"<<endl;
}

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

using namespace std;

int main(){

  int num[5];
  char trash;
  vector<int> V;

  while(cin >> num[0] >> trash >> num[1] >> trash >> num[2] >> trash >> num[3] >> trash >> num[4]){
    for(int i = 0; i < 5; i++) V.push_back(num[i]);

    sort(V.begin(), V.end());


    if(V[1] == V[0] && V[2] == V[0] && V[3] == V[0] || V[2] == V[1] && V[3] == V[1] && V[4] == V[1]){
      cout << "four card"<< endl;
    }else if(V[1] == V[0] && V[2] == V[0] && V[3] == V[4] || V[3] == V[2] && V[4] == V[2] && V[1] == V[0]){
      cout << "full house" << endl;
    }else if(V[1] == V[0]+1 && V[2] == V[0]+2 &&V[3] == V[0]+3 && V[4] == V[0]+4 || V[0] == 1 &&  V[1] == 10 && V[2] == 11 && V[3] == 12 && V[4] == 13){
      cout << "straight" << endl;
    }else if(V[1] == V[0] && V[2] == V[0] || V[2] == V[1] && V[3] == V[1] || V[3] == V[2] && V[4] == V[2]){
      cout << "three card" << endl;
    }else if(V[1] == V[0] && V[2] == V[3] || V[2] == V[1] && V[3] == V[4] || V[1] == V[0] && V[3] == V[4]){
      cout << "two pair" << endl;
    }else if(V[1] == V[0] || V[2] == V[1] || V[3] == V[2] || V[4] == V[3]){
      cout << "one pair" << endl;
    }else{
      cout << "null" <<endl;
    }

    V.clear();


  }

  return 0;
}

Measured memory_bytes: 0
#include <cstdio>
#include <vector>
#include <algorithm>
#include <cstring>
#include <string>
#include <cctype>
#include <sstream>
#include <cmath>
#include <climits>
#include <set>
#include <map>
#include <numeric>

using namespace std;

#define reep(i,f,n) for(int i=f; i<int(n); ++i)
#define rep(i,n) reep(i,0,n)

typedef vector<int> vi;

int hai[9];

bool search()
{
	if(accumulate(hai, hai+9, 0)==2 && *max_element(hai, hai+9)==2)
		return true;

	rep(i, 9){
		if(!hai[i]) continue;
		bool res = false;
		if(hai[i]>=3){
			hai[i] -= 3;
			res = search();
			hai[i] += 3;
		}
		if(i<7 && hai[i] && hai[i+1] && hai[i+2]){
			hai[i]--;
			hai[i+1]--;
			hai[i+2]--;
			res = search();
			hai[i]++;
			hai[i+1]++;
			hai[i+2]++;
		}
		if(res) return true;
	}
	return false;
}

int main()
{
	while(1){
		fill(hai, hai+10, 0);
		char c;
		rep(i, 13){
			if(scanf(" %c", &c) == EOF)
				return 0;
			hai[c-'1']++;
		}
		vi ans;
		rep(i, 9){
			if(hai[i]>=4) continue;

			hai[i]++;
			if(search())
				ans.push_back(i+1);
			hai[i]--;
		}

		if(ans.empty())
			puts("0");
		else{
			rep(i, ans.size()){
				printf("%d", ans[i]);
				if(i<(int)ans.size()-1)
					printf(" ");
			}
			puts("");
		}
	}

	return 0;
}

Measured memory_bytes: 0
#include <stdio.h>

#define MAX(x, y) ((x > y) ? x : y)
#define MIN(x, y) ((x < y) ? x : y)

int main(){
  double min = 10000.0, max = 0.0, n;
  while(scanf("%lf",&n) != EOF){
    max = MAX(max, n);
    min = MIN(min, n);
 }
  printf("%.1f\n", max - min);
  return 0;
}

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

using namespace std;
using ll = long long;


int main()
{
    int h, w, x, y;
    cin >> w >> h >> x >> y;
    cout << fixed <<setprecision(12) << (long double)h * w / 2 << endl; 
    if(h % 2 == 0 && w % 2 == 0 && h / 2 == y && w / 2 == x) {
        cout << 1 << endl;
    } else {
        cout << 0 << endl;
    }
}

Measured memory_bytes: 3760
// #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;
using ll = long long int;
using int64 = long long int;
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const int INF = 1LL << 29;
const ll LONGINF = 1LL << 60;
const ll MOD = 1000000007LL;

char board[310][310];
int ans[310][310];
int main() {
    int H, W, K, cnt = 0; cin >> H >> W >> K;
    for(int i=0; i<H; i++) {
        for(int j=0; j<W; j++) {
            cin >> board[i][j];
            if(board[i][j] == '#') ans[i][j] = ++cnt;
        }
    }

    for(int i=0; i<H; i++) {
        for(int j=0; j+1<W; j++) {
            if(ans[i][j] > 0 and ans[i][j+1] == 0) ans[i][j+1] = ans[i][j];
        }
    }

    for(int i=0; i<H; i++) {
        for(int j=W-1; j>0; j--) {
            if(ans[i][j] > 0 and ans[i][j-1] == 0) ans[i][j-1] = ans[i][j];
        }
    }

    for(int j=0; j<W; j++) {
        for(int i=0; i+1<H; i++) {
            if(ans[i][j] > 0 and ans[i+1][j] == 0) ans[i+1][j] = ans[i][j];
        }
    }

    for(int j=0; j<W; j++) {
        for(int i=H-1; i>0; i--) {
            if(ans[i][j] > 0 and ans[i-1][j] == 0) ans[i-1][j] = ans[i][j];
        }
    }

    for(int i=0; i<H; i++) {
        for(int j=0; j<W; j++) {
            assert(ans[i][j] > 0);
            printf("%d%c", ans[i][j], " \n"[j + 1 == W]);
        }
    }
    return 0;
}


Measured memory_bytes: 1280
#include <stdio.h>

int
main (
  int   argc,
  char *argv[ ]
  )
{
  int i, j, k;

  for ( ; ; )
  {
    int n, x;
    int res = 0;

    scanf ( "%d%d", &n, &x );
    if ( n == 0 && x == 0 ) break ;

    for ( i = 1; i <= n - 2; ++i )
    for ( j = i + 1; j <= n - 1; ++j )
    for ( k = j + 1; k <= n; ++k )
    {
      res += !!( i + j + k == x );
    }

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

  return ( 0 );
}

Measured memory_bytes: 0
#include<iostream>
#include<algorithm>
#include<cstdio>
using namespace std;
int n,m;
char map[55][55];
int main()
{
    scanf("%d%d",&n,&m);
    for(int i=1;i<=n;i++)
        scanf("%s",map[i]+1);
    for(int i=1;i<=n;i++)
        for(int j=1;j<=m;j++)
        {
            if(map[i][j]=='#')
            {
                if(map[i-1][j]=='#'||map[i+1][j]=='#'||map[i][j-1]=='#'||map[i][j+1]=='#')continue;
                printf("No\n");return 0;
            }
        }
    printf("Yes\n");
}

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

using namespace std;

#define fst(t) std::get<0>(t)
#define snd(t) std::get<1>(t)
#define thd(t) std::get<2>(t)

using ll = long long;
using P = std::tuple<int,int>;

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

ll sum[200100];
ll A[100100];

int main(){
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);

    int N, M;
    std::cin >> N >> M;

    ll cnt = 0;
    
    for(int i=0;i<N;++i){
        std::cin >> A[i];

        if(i > 0){
            if(A[i-1] <= A[i]){
                cnt += A[i] - A[i-1];
            }else{
                cnt += A[i] + M - A[i-1];
            }
        }
    }

    for(int i=0;i+1<N;++i){
        ll a = A[i], b = A[i+1];
        --a; --b;
        
        if(a == b){

        }else if(a + 1 == b){

        }else if(a < b){
            ll d = b - (a + 1);
            ++sum[a+2];
            sum[b+1] -= d + 1;
            sum[b+2] += d;
        }else{ // a > b
            b += M;
            
            if(b - a <= 1){}
            else{
                ll d = b - (a + 1);
                ++sum[a+2];
                sum[b+1] -= d + 1;
                sum[b+2] += d;
            }
        }
    }

    for(int i=0;i+1<2*M;++i){
        sum[i+1] += sum[i];
    }

    for(int i=0;i+1<2*M;++i){
        sum[i+1] += sum[i];
    }

    // for(int i=0;i<2*M;++i){
    //     printf("%lld%c", sum[i], " \n"[i+1==2*M]);
    // }

    ll res = cnt;
    for(int i=0;i<M;++i){
        res = min(res, cnt - (sum[i] + sum[i+M]));
    }

    std::cout << res << std::endl;
}


Measured memory_bytes: 2560
pub fn read_parameters<T>() -> Result<Vec<T>, String>
where
    T: std::str::FromStr,
{
    let mut line = String::new();

    match std::io::stdin().read_line(&mut line) {
        Ok(0) => return Err("eof".to_string()),
        Ok(_) => (),
        Err(err) => return Err(format!("{:?}", err)),
    }

    line.trim()
        .split_whitespace()
        .map(|x| x.parse::<T>())
        .collect::<Result<Vec<T>, _>>()
        .map_err(|_| format!("{}", "parse error"))
}

fn main() {
    let n = read_parameters::<f64>().unwrap();
    let (a, b, c) = (n[0], n[1], n[2]);

    let rad = c / 180.0 * std::f64::consts::PI;
    let h = b * rad.sin();
    let area = a * h / 2.0;
    let x = (b * b - h * h).sqrt();
    let z = if c <= 90.0 {
        ((a - x) * (a - x) + h * h).sqrt()
    } else {
        ((a + x) * (a + x) + h * h).sqrt()
    };

    println!("{:.13}", area);
    println!("{:.13}", a + b + z);
    println!("{:.13}", h);
}



Measured memory_bytes: 5160
//Robs Code
/***********HEADER***************/
#include <iostream>
#include <bitset>
#include <deque>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <string>
#include <algorithm>
#include <list>
#include <vector>
#include <unordered_set>
#include <unordered_map>
#include <stack>
#include <set>
#include <queue>
#include <map>
/***********MACROS***************/
#define int long long int
#define fri(l,k) for (i=l;i<=k;i++)
#define frj(l,k) for (j=l;j>=k;j--)
#define fij(a,b,l,k) for(i=a;i<=b;i++) for(j=l;j<=k;j++)
#define all(x) x.begin(),x.end()
#define allr(x) x.rbegin(),x.rend()
#define endl "\n"
#define pb push_back
#define _1 first
#define _2 second
#define mxsz 1000000007
#define mxval 1e9 + 7
#define grt [](auto x,auto y){return x>y;}
#define pii pair<int,int>
/*********VARIABLE****************/
using namespace std;
int i,j,n,m,k,l,q,t,a,b,sum[3],tot[3],cnt[3];
/*********FUNCTIONS**************/
int powom(int a,int b) {
    int result = 1;
    while (b > 0) {
        if (b & 1)
            result = result * a;
        a = a * a;
        b >>= 1;
    }
    return result;
}
/***********MAIN**************/
signed main(){
	ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
	cin>>n;
	set<char> st;
	char ch;
	cin>>ch;
	char pre = ch;
	int cnt = 1;
	fri(0,n-2){
		char ch;
		cin>>ch;
		if(ch!=pre){
			pre = ch;
			cnt++;
		}
	}
	cout<<cnt;
	return 0;
}
//.........

Measured memory_bytes: 256
max_n = 100000
I = lambda:list(map(int,input().split()))

s = []
for i in range(1,7):
  s.append(9**i)
  s.append(6**i)
n, = I()
a = [0]*100009
for i in range(1,100007):
  a[i] = a[i-1]+1
  for j in s:
    if i-j >=0:
      a[i] = min(a[i-j]+1,a[i])
print(a[n])

Measured memory_bytes: 3828
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstddef>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>

template <typename T> T gcd(T a, T b) { return b == 0 ? a : gcd(b, a % b); }
template <typename T> T lcm(T a, T b) { return a * b / gcd(a, b); }
template <typename T> T clamp(T val, T min, T max) { return val < min ? min : (max < val ? max : val); }
template <typename T> size_t max_index(T begin, T end) { return distance(begin, max_element(begin, end)); }
template <typename T> size_t min_index(T begin, T end) { return distance(begin, min_element(begin, end)); }

// #define int long long

using namespace std;

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

  int num = 0;
  int a; cin >> a;
  int b; cin >> b;
  int c; cin >> c;

  num = min(b / a, c);

  cout << num << endl;

  return 0;
}


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

using namespace std;

int main(){
	const int N = 1299709 + 1;
	vector<int> primes;
	vector<bool> sieve(N, false);
	sieve[0] = sieve[1] = true;
	for(int i = 2; i < N; ++i){
		if(sieve[i]){ continue; }
		primes.push_back(i);
		for(int j = i + i; j < N; j += i){ sieve[j] = true; }
	}
	while(true){
		int k;
		cin >> k;
		if(k == 0){ break; }
		if(k < 2 || !sieve[k]){
			cout << 0 << endl;
		}else{
			vector<int>::iterator it =
				lower_bound(primes.begin(), primes.end(), k);
			int upper = *it;
			int lower = *--it;
			cout << upper - lower << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 1880
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.OptionalLong;
import java.util.stream.LongStream;
import java.util.StringTokenizer;
import java.io.IOException;
import java.util.InputMismatchException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskD {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int elementCount = in.nextInt();
            int maxWeight = in.nextInt();
            int[] weightList = new int[elementCount];
            int[] valueList = new int[elementCount];
            for (int elementIndex = 0; elementIndex < elementCount; elementIndex++) {
                weightList[elementIndex] = in.nextInt();
                valueList[elementIndex] = in.nextInt();
            }

            long[][] maxValue = new long[elementCount + 1][maxWeight + 1];
            for (int elementIndex = 0; elementIndex < elementCount; elementIndex++) {
                for (int weightIndex = 0; weightIndex <= maxWeight; weightIndex++) {
                    maxValue[elementIndex + 1][weightIndex] = maxValue[elementIndex][weightIndex];
                    if (weightIndex - weightList[elementIndex] >= 0) {
                        maxValue[elementIndex + 1][weightIndex] = Math.max(maxValue[elementIndex + 1][weightIndex],
                                maxValue[elementIndex][weightIndex - weightList[elementIndex]] + valueList[elementIndex]);
                    }
                }
            }

            out.println(LongStream.of(maxValue[elementCount]).max().getAsLong());
        }

    }

    static class InputReader {
        private BufferedReader br;
        private StringTokenizer st;

        public InputReader(InputStream inputStream) {
            br = new BufferedReader(new InputStreamReader(inputStream));
            st = new StringTokenizer("");
        }

        public String nextString() {
            while (!st.hasMoreTokens()) {
                try {
                    st = new StringTokenizer(br.readLine(), " ");
                } catch (IOException e) {
                    throw new InputMismatchException();
                }
            }
            return st.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(nextString());
        }

    }
}



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

vector<pair<ll,int>> factorize(ll n){
	vector<pair<ll,int>> res;
	for (ll i = 2; i*i <= n ; ++i) {
		if(n%i!=0) continue;
		res.emplace_back(i,0);
		while(n % i == 0){
			n /= i;
			res.back().second++;
		}
	}
	if( n != 1){
		res.emplace_back(n,1);
	}
	return res;
}

int main(){
	int n;
	cin >> n;
	auto v = factorize(n);
	
	cout << n << ": ";
	
	for (auto u :v){
		rep(j,u.second){
			if(j == u.second-1 && u == v[v.size()-1]){
				cout << u.first << endl;
			}else{
				cout << u.first << " ";
			}
		}
	}

	return 0;
}




Measured memory_bytes: 3116
#include <stdio.h>
int main()
{
    int n,a,c=1,i;
    scanf("%d",&n);
    int arr[n];
    scanf("%d",&arr[0]);
    a=arr[0];
    for(i=1;i<n;i++)
    {
        scanf("%d",&arr[i]);
        if(arr[i]<a)
        {
            c++;
            a=arr[i];
        }

    }
    printf("%d",c);
    return 0;
}


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

int main(){
    int D, N, c = 1;
    cin >> D >> N;
    int n = pow(100,D);
    int i=n;
    while(c < N){
        i+=n;
        if(!(i % (100 * n))) continue;
        c++; 
    }
    cout<< i <<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <climits>
#include <set>
#include <algorithm>
#include <unordered_map>
#include <queue>
#include <iomanip>
#include <map>
#include <utility>
#include <numeric>
#include <chrono>
#include <ctime>
#include <bitset>
#include <iterator>
#include <cmath>
#include <stack>

#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define debug(x) cerr << #x << ": " << x << ", "
#define debugln(x) cerr << #x << ": " << x << '\n'

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; }

using namespace std;
using ll = long long;
using P = pair<int, int>;

constexpr ll mod = 1e9 + 7;
const double PI = acos(-1.0);

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);

  map<int, int> mp;
  rep(i, 6) {
    int a; cin >> a;
    mp[a]++;
  }

  for(auto e: mp) {
    if (e.second == 3) {
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <algorithm>
#include <string.h>


using namespace std;



int main() {
    int H, W, h, w;
    scanf("%d %d %d %d", &H, &W, &h, &w);
    printf("%d\n", W*H - (w*H + W*h - w*h));

    return 0;
}


Measured memory_bytes: 128
#include<iostream>
#include<iomanip>
//#include<cstdio>
#include<vector>
#include<map>
#include<queue>
#include<algorithm>
#include<cmath>
#include<cassert>
using namespace std;
typedef long long ll;
const int Nmax = 1e5+1;
const ll P = 1000000007;

int main(){
	ll N, M;
	cin >> N >> M;

	vector<ll> fact(Nmax);
	fact[0] = fact[1] = 1;
	for(int i=2; i<Nmax; i++){
		fact[i] = (fact[i-1] * i) % P;
	}

	if(N == M){
		cout << ((2*fact[N])%P)*fact[M]%P << endl;
	}
	else if(abs(N-M)==1){
		cout << (fact[N]*fact[M])%P << endl;
	}
	else{
		cout << 0 << endl;
	}

	return 0;
}


Measured memory_bytes: 1152
import itertools

N = int(input())
P = tuple(map(int, input().split()))
Q = tuple(map(int, input().split()))

n = [i for i in range(1, N + 1)]

p = itertools.permutations(n, N)

ans1 = 0
ans2 = 0
for i, v in enumerate(p):
    if (P == v):
        ans1 = i + 1
    if (Q == v):
        ans2 = i + 1

print(abs(ans1 - ans2))


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

int main() {

	//ifstream cin("INPUT.txt");
	//ofstream cout("OUTPUT.txt");

	char S[10001];
	int joi, ioi, slen, i;

	while(cin >> S) {
		slen = strlen(S);
		joi = 0;
		ioi = 0;
		for(i = 0; i < slen - 2; i++) {
			if(S[i] == 'J' && S[i+1] == 'O' && S[i+2] == 'I') {
				joi++;
			} else if(S[i] == 'I' && S[i+1] == 'O' && S[i+2] == 'I') {
				ioi++;
			}
		}
		cout << joi << "\n" << ioi << endl;
	}

	return 0;

}

Measured memory_bytes: 1148
import java.util.*;
public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    sc.close();
    
    int ans = 1 + 2 + 3 - A - B;
    System.out.println(ans);
  }
}

Measured memory_bytes: 21460
include Math
a,b,h,m = gets.split.map(&:to_i)

ax = a*cos(PI*(h+m/60.0)/6.0)
ay = a*sin(PI*(h+m/60.0)/6.0)
bx = b*cos(PI*m/30.0)
by = b*sin(PI*m/30.0)

puts (((ax-bx).abs)**2 + ((ay-by).abs)**2)**0.5

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

/*long long g(long long a,long long b);

long long l(long long a,long long b);*/

/*int mem[1005][1005];
 
long long s(int a,int b);*/
 
int main(){
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    int n,m;
    while(true){
    cin>>n>>m;
    if(n==0||m==0){
        break;
    }
    for ( int i = 0; i < n; i++ ){
    for ( int j = 0; j < m; j++ ){

        if(i==0||j==0||i==n-1||j==m-1){
            cout<<"#";
        } else {
            cout<<".";
        }
    }
    cout<<"\n";
}
cout<<"\n";
    }
    return(0);
}


Measured memory_bytes: 3148
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
	Scanner scan = new Scanner(System.in);
	int N = scan.nextInt();
	int H = scan.nextInt();
	int W = scan.nextInt();
	int count = 0;

	for (int i = 0; i < N; i++) {
		int A = scan.nextInt();
		int B = scan.nextInt();

		if (A >= H && B >= W) {
			count++;
		}
	}

	System.out.println(count);

	}
}


Measured memory_bytes: 39828
data=[]
for i in range(5):
    data.append(int(input()))

if sum(data)%10==0:
    print(sum(data))
else:
    cnt=1000
    index=0
    for ind,j in enumerate(data):
        if j%10 < cnt and j%10 != 0:
            index=ind
            cnt=j%10
    ans=0
    for k in data:
        if k % 10 == 0:
            ans += k
        else:
            ans+=(k//10+1)*10
    ans=ans+(data[index]%10)-10
    print(ans)

Measured memory_bytes: 3064
import re
import sys

if __name__ == '__main__':
    l = map(int, raw_input().split())
    l.sort()
    count = 0
    while l[2] != l[1] or l[1] != l[0]:
        while l[0] == l[1]:
            count += 1
            l[0] += 1
            l[1] += 1
            if l[2] == l[1] and l[1] == l[0]:
                break
        l.sort()
        while l[2] - l[0] > 1:
            count += 1
            l[0] += 2
        if l[2] == l[1] and l[1] == l[0]:
            break
        while l[2] - l[1] > 1:
            count += 1
            l[1] += 2
        if l[2] == l[1] and l[1] == l[0]:
            break
        l.sort()
        if l[1] == l[2]:
            count += 1
            l[0] += 2

    print count


Measured memory_bytes: 2696
#include<stdio.h>
#define N 100

int main(){
  int M[N][N];
  int n, u, k, v, i, j;

  scanf("%d", &n);

  for(i = 0; i < n; i++){
    for(j = 0; j < n; j++){
      M[i][j] = 0;
    }
  }
  for(i = 0; i < n; i++){
    scanf("%d %d", &u, &k);
    u--;
    for(j = 0; j < k; j++){
      scanf("%d", &v);
      v--;
      M[u][v] = 1;
    }
  }

  for(i = 0; i < n; i++){
    for(j = 0; j < n; j++){
      printf("%d", M[i][j]);
      if(j < n-1) printf(" ");
    }
    printf("\n");
  }
}



Measured memory_bytes: 2112
n, m, k = map(int,input().split())
a = [0] + list(map(int,input().split()))
b = [0] + list(map(int,input().split()))

for i in range(1, n+1):
    a[i] += a[i-1]
    
for j in range(1, m+1):
    b[j] += b[j-1]
    
ans = 0
bc = m

for ac in range(n+1):
    if a[ac] > k:
        continue
    
    while a[ac] + b[bc] > k:
        bc -= 1
        
    ans  = max(ans, ac+bc)

print(ans)
    


Measured memory_bytes: 39872
#include <bits/stdc++.h>
using namespace std;
int main()
{
  vector<int> n(3);
  cin >> n[0] >> n[1] >> n[2];

  sort(n.begin(), n.end());

  int a;
  a = n[0] + n[1] + n[2] * 10;

  cout << a << endl;

  return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int size = 9;

        int[][] path = new int[size][size];
        for (int i = 0; i < size; i++) {
            String S = sc.next();

            if (i % 2 == 0) {
                Arrays.fill(path[i], 1);

                for (int j = 0; j < 4; j++) {
                    int c = Integer.parseInt(S.split("")[j]);

                    path[i][j * 2 + 1] = c;
                }
            } else {
                for (int j = 0; j < 5; j++) {
                    int c = Integer.parseInt(S.split("")[j]);
                    path[i][j * 2] = c;
                }
            }
        }

        int[] vx = {-1, 0, 1, 0};
        int[] vy = {0, -1, 0, 1};
        List<String> to = new ArrayList<>(Arrays.asList("L", "U", "R", "D"));

        int nx = 0;
        int ny = 0;

        int dir = 2;
        StringBuilder move = new StringBuilder();

        while (true) {
            for (int i = 3; i < 7; i++) {
                int x = nx + vx[(i + dir) % 4];
                int y = ny + vy[(i + dir) % 4];
                int xx = x + vx[(i + dir) % 4];
                int yy = y + vy[(i + dir) % 4];

                if (!judge(x, y, size)) continue;
                if (!judge(xx, yy, size)) continue;
                if (path[y][x] == 0) continue;
                if (path[yy][xx] == 0) continue;

                nx = xx;
                ny = yy;

                dir = (i + dir) % 4;

                move.append(to.get(dir));
                break;
            }
            if (nx == 0 && ny == 0) {
                break;
            }
        }
        System.out.println(move.toString());
    }

    private static boolean judge(int x, int y, int size) {
        return 0 <= x && x < size && 0 <= y && y < size;
    }
}

Measured memory_bytes: 26224
K, S = [int(n) for n in input().split()]

count = 0

for x in range(min(S, K)+1):
    for y in range(x+1):
        z = S - x - y
        if z <= y and z >= 0:
            num_distinct = len({x,y,z})
            if num_distinct == 1:
                count += 1
            if num_distinct == 2:
                count += 3
            if num_distinct == 3:
                count += 6

print(count)

Measured memory_bytes: 3064
'''
Accepted    　:No
difficult   　: 
ペナルティ　  　:5分
実際の回答時間  :分
WAの回数　     :回
合計時間　　  　:分
'''
import itertools


def myAnswer(N:int,M:int,A:list) -> int:
   safe_stairs =[True] * (N + 1)
   mod = 10**9 + 7
   for a in A:
      safe_stairs[a] = False

   DP = [0] * (N+1)
   DP[0] = 1
   if safe_stairs[1]:DP[1] = 1

   for n in range(2,N + 1):
      if safe_stairs[n - 1]:
         DP[n] += DP[n - 1]
      if safe_stairs[n - 2]:
         DP[n] += DP[n - 2]
      DP[n] %= mod

   return DP[N]
      



def modelAnswer():
   return
def main():
   N,M = map(int,input().split())
   A = [int(input()) for _ in range(M)]
   print(myAnswer(N,M,A))

if __name__ == '__main__':
   main()



Measured memory_bytes: 9604