akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
    #include <set>
    #define REP(i, n) for(int i = 0;i < n;i++)
    #define REPR(i, n) for(int i = n;i >= 0;i--)
    #define FOR(i, m, n) for(int i = m;i < n;i++)
    #define FORR(i, m, n) for(int i = m;i >= n;i--)
    #define SORT(v, n) sort(v, v+n);
    #define VSORT(v) sort(v.begin(), v.end());
    //
    #define llong long long
    #define pb(a) push_back(a)

    #define INF 100000000
    #define MOD 1000000007

    #define writeln(n) cout<<n<<endl

    using namespace std;
    typedef pair<int, int> P;
    typedef pair<llong, llong> LP;
    typedef pair<int, P> PP;
    typedef pair<llong, LP> LPP;
    //vector<tuple<long long, long long, long long>>vec;

    template<class T>
    inline bool chmax(T &a, T b) {
        if (a < b) {
            a = b;
            return true;
        }
        return false;
    }

    template<class T>
    inline bool chmin(T &a, T b) {
        if (a > b) {
            a = b;
            return true;
        }
        return false;
    }

    llong pownew(llong m, llong n) {
        if (n == 0) { return 1; }
        if (n % 2 == 0) { return pow(m*m, n/2); }
        return pow(m, n-1) * m;
    }

    bool isprime(int p) {
        if (p == 1) return false;
        for (int i = 2; i < p; i++) {
            if (p%i == 0) return false;
        }
        return true;
    }

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

    const int inf=100000000;

    long long modpow(long long a, long long n, long long mod) //a^n
    {
        long long res = 1;
        while (n > 0) {
            if (n & 1) res = res * a % mod;
            a = a * a % mod;
            n >>= 1;
        }
        return res;
    }

    int gcd(int a, int b) {
        return b != 0 ? gcd(b, a % b) : a;
    }
    //setprecision(10);

    typedef long long ll;

    ll merge_cnt(vector<int> &a) {
        int n = a.size();
        if (n <= 1) { return 0; }

        ll cnt = 0;
        vector<int> b(a.begin(), a.begin()+n/2);
        vector<int> c(a.begin()+n/2, a.end());

        cnt += merge_cnt(b);
        cnt += merge_cnt(c);

        int ai = 0, bi = 0, ci = 0;
        // merge の処理
        while (ai < n) {
            if ( bi < b.size() && (ci == c.size() || b[bi] <= c[ci]) ) {
                a[ai++] = b[bi++];
            } else {
                cnt += n / 2 - bi;
                a[ai++] = c[ci++];
            }
        }
        return cnt;
    }


    int main() {
        ios::sync_with_stdio(false);
        cin.tie(0);
        int n; cin>>n;
        cout<<n*n*n<<endl;

        return  0;
    }


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repr(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define FORR(i, m, n) for (int i = (m); i >= (n); --i)
#define equals(a, b) (fabs((a) - (b)) < EPS)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const ll mod2 = 998244353;
const ll INF = 1e18;
const long double EPS = 1e-10;

int main() {
  string w;
  cin >> w;

  int n = w.size();
  map<char, int> m;
  rep(i, n) m[w[i]]++;

  rep(i, n) {
    if (m[w[i]] % 2 == 1) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;


  
  return 0;
}

Measured memory_bytes: 256
//Built by Sabuj Jana(greenindia) from Jadavpur University,Kolkata,India 
// God is Great------------/////\\\\\\\--------------------------------
 #include <bits/stdc++.h>
 using namespace std;
 #define crap ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
 #define endl "\n"
 // #define INF LLONG_M
 #define pb push_back
 #define mp make_pair
 const int INF=1e9+5; //billion
 typedef vector<int> vi;
 typedef long long ll;
 
 	 
 int main() {
 	 
    crap;
     
     int n;
     cin>>n;
     
     int arr[n+7][3];
     
     for(int i=1; i<=n; i++){
		 
		 for(int j=0; j<3; j++){
			 
			 cin>>arr[i][j];
			 
		 }
		  
	 }
      
     int dp[n+1][3]={0};
      
      
      for(int i=1; i<=n; i++){
			
		 for(int j=0; j<3; j++){
			  
			 for(int k=0; k<3; k++){
				 
					if(j!=k)
						dp[i][j]=max( arr[i][j]+dp[i-1][k], dp[i][j] );
						
			 }
		 }
		
		  
	 } 
      
    cout<< max( dp[n][0], max( dp[n][1],dp[n][2] ) );
    
    return 0;
    
 }



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

int main(void){
    
    string S;
    cin >> S;
    
    int ans = 0;
    int count = 0;
    for(int i = 0; i < S.size(); i++){
        if(S[i] == 'A' || S[i] == 'C' || S[i] == 'G' || S[i] == 'T'){
            count++;
        }
        else{
            ans = max(ans, count);
            count = 0;
        }
    }
    ans = max(ans, count);
    cout << ans << endl;
}


Measured memory_bytes: 256
/* HARDWORK IS THE KEY TO SUCCESS.
   RATING IS TEMPORARY , KNOWLEDGE IS PERMANENT.!!!*/
 
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define T ll t = 1; cin>>t; while(t--)
#define ain ll n,k,i; cin>>n; ll a[n]; for(i=0; i<n; i++) cin>>a[i]
#define matin ll m,n; cin >> n >> m; ll a[n + 1][m + 1]; for(ll i=1;i<=n;i++) for(ll j=1;j<=m;j++) cin>>a[i][j];
#define all(x) (x).begin(), (x).end()
#define F first
#define S second
#define I insert
#define pb push_back
 
const ll maxs = 1e5+3;
const ll maxs1 = 1e3+4;
const ll mod = 1e9 + 7;
inline ll add(ll a, ll b) { return (mod + a + b) % mod;}
inline ll sub(ll a, ll b) {return (a - b + mod) % mod;}
inline ll mul(ll a, ll b) {return (1ll * a * b) % mod;}
ll fastpow(ll x, ll y) {
    ll res = 1; x = x % mod; while (y > 0) { if(y & 1) res = (res * x) % mod; y = y >> 1;x = (x * x) % mod;}return res;}
ll inv(ll x) {
    return fastpow(x, mod - 2);
}
 
 
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    
    ain;
    for(i = 0;i < n;++i)
    {
        if(a[i] == 0)
        {
            cout << 0;
            return 0;
        }
    }
    
    ll maxx = 1e18;
    ll pro = 1;
    for(i = 0;i < n;++i)
    {
        if(maxx/pro >= a[i])
        {
            pro *= a[i];
        }
        else
        {
            cout << -1;
            return 0;
        }
    }
    
    cout << pro;
 
 
}

Measured memory_bytes: 4412
#include <string>
#include <bits/stdc++.h>
#include <stdio.h>
#include<math.h>
#include <ctype.h>
#include <algorithm> // sort
#include <map> // pair
using namespace std;

int main() {
 int a,b,c;
  cin >> a >> b >> c;
  if(b/a>=c){
    cout << c << endl;
  }
  else{
    cout << b/a << endl;
  }
}

Measured memory_bytes: 256
import java.util.*;
 
class MyStack {
    private Object stack[];
    private int stackSize;
    private int sp;
    private static final int DEFAULT_STACK_SIZE = 300000;
 
    public MyStack(){
        this(DEFAULT_STACK_SIZE);
    }
 
    public MyStack(int size){
        stack = new Object[size];
        stackSize = size;
        sp = 0;
    }
 
    public void clear(){
        Arrays.fill(stack,0,sp,null);
        sp = 0;
    }
 
    public void push(Object x){
        if(sp >= stackSize){
            throw new IllegalStateException("Stack overflow");
        }
        stack[sp++] = x;
    }
 
    public Object pop(){
        if(sp <= 0){
            throw new EmptyStackException();
        }
        Object value = stack[--sp];
        stack[sp] = null;
        return value;
    }
 
    public boolean isEmpty(){
        return sp == 0;
    }
 
    public String toString(){
        String s = "MyStack=[";
        for(int i = 0; i < sp; i++){
            s = s + stack[i];
            if(i < sp - 1){
                s = s + ",";
            }
        }
        s = s + "]";
        return s;
    }
    public int size(){
        return this.sp;
    }
    public String getTopObjectName(){
        String s = stack[--sp].toString();
        sp++;
        return s;
    }
}
public class Main {
    
    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int a = s.nextInt(); 
        List<String> list = new ArrayList<String>();
        MyStack stack = new MyStack();
        
        for(int i = 0; i <= a; i++){
            String x = s.nextLine();
            list.add(x);
        }
        Collections.sort(list);
        stack.push(list.remove(0));
        for(int i = 0; i < list.size(); i++){
            String mo = list.get(i);
            if(mo.length() <= 10 && mo.length() >= 1 && !stack.getTopObjectName().equals(mo)){
                stack.push(mo);
            }
        }
        System.out.println(stack.size()-1);
    }
}

Measured memory_bytes: 76184
use proconio::{input, fastout};
use proconio::marker::{Chars};
use proconio::marker::Usize1;
use std::cmp::*;

macro_rules! debug {
      ($($a:expr),*) => {
          eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

#[fastout]
fn main() {
    input!{
        n: usize,
        k: usize,
    }

    println!("{}", (k as u32)*((k-1) as u32).pow((n-1) as u32))

}


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

xy_arr = [[] for _ in range(n)]
for i in range(n):
    a = int(input())
    for _ in range(a):
        x, y = map(int, input().split())
        xy_arr[i].append((x, y))

max_res = 0
for i in range(2 ** n):           
    ok_flg = True
    bin_i = format(i, "015b")[::-1] 
                                    
    for j in range(n):
        for x, y in xy_arr[j]: 
            if bin_i[j] == "1" and y != int(bin_i[x - 1]):
                ok_flg = False
                break
        else:
            continue
        break
        
    if ok_flg:
        res = sum(int(x) for x in bin_i)
        max_res = max(max_res, res)
        
print(max_res)

Measured memory_bytes: 3064
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <algorithm>
#include <random>
#include <chrono>
#include <iomanip>
#define lint unsigned long long int
#define FOR(x, to) for(int x=0; x<(int)(to); x++)
#define DUMP(ar) for(auto itd=begin(ar); itd != end(ar); itd++) cout << "["s << itd - begin(ar) << "]:"s << *itd << endl
#define DUMPL(ar) for(auto itd=begin(ar); itd != end(ar); itd++) { cout << *itd; if(end(ar)-itd > 1) cout << ' '; } cout << endl
#define COUT(x) cout << (x) << endl
#define VCIN(ar) for(auto &vcin: (ar)) cin >> vcin
#define ALL(ar) ar.begin(), ar.end()
#define LOOPD(i) cout << "ループ["s << i << "]回目---------------"s << endl
using namespace std;
// lint:64ビット 10^19

struct prob{
    int num;
    string state;
};

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

    int n, m;
    cin >> n >> m;
    vector<prob> p(m);
    for(int i=0; i<m; i++){
        cin >> p[i].num >> p[i].state;
    }

    vector<pair<bool, int>> attack(n, make_pair(false, 0));
    int s_cnt = 0;
    int p_cnt = 0;

    for(int i=0; i<m; i++){
        if(p[i].state == "AC"s){
            if(!attack[p[i].num-1].first){
                s_cnt++;
                p_cnt += attack[p[i].num-1].second;
                attack[p[i].num-1].first = true;
            }
        }else{
            if(!attack[p[i].num-1].first){
                attack[p[i].num-1].second++;
            }
        }
    }

    cout << s_cnt << ' ' << p_cnt << endl;

    return 0;
}

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

int main() {
  long long n, m, d;
  cin>>n>>m>>d;
  long long a;
  if (d > 0) {
    a = (n - 2 * d) * 2 + 2 * d;
  } else {
    a = n;
  }
  double ans = 1.0 * (m - 1) * a / (n * n);
  printf("%.9lf\n", ans);
}

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

typedef long long ll;
const ll MOD = 1e9 + 7;
const long long INF = 1LL<<60;
const double PI=3.14159265358979323846;
const int NMAX=100005;
using namespace std;



int main(){
    int n,m,q;
    cin >> n >> m >> q;
    vector<int> a(q),b(q),c(q),d(q);
    for(int i = 0; i < q; i++){
        cin >> a[i] >> b[i] >> c[i] >> d[i];
    }

    vector<int> l(n, m);
    ll ans = 0;
    while(true){
        ll p = 0;
        // for(int i = 0; i < n; i++){
        //     cout << l[i] << ",";
        // }
        // cout << endl;
        for(int i = 0; i < q; i++){
            if(l[b[i]-1]-l[a[i]-1] == c[i]) p += d[i];
        }
        ans = max(ans, p);

        int z = n;
        for(int i = 0; i < n; i++){
            if(l[i] != 1){
                z = i;
                break;
            }
        }
        if(z == n) break;
        l[z] -= 1;
        for(int i = z-1; i >= 0; i--){
            l[i] = l[i+1];
        }
    }

    cout << ans << endl;

    return 0;
}

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

bool judge(string x){
    string y;
    y = x;
    reverse(x.begin(), x.end());
    if(x == y){
        return true;
    }
    else{
        return false;
    }
}

int main(){

    string S, S_1, S_2;
    cin >> S;

    int div_1, div_2;
    div_1 = (S.size() - 1) / 2;
    div_2 = (S.size() + 1) / 2;

    S_1 = S.substr(0, div_1);
    S_2 = S.substr(div_2);
    

    if(judge(S) && judge(S_1) && judge(S_2)){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#define MD 1000000007
#define MAXN 3005
using namespace std;
int read(){
	char c;int x;while(c=getchar(),c<'0'||c>'9');x=c-'0';
	while(c=getchar(),c>='0'&&c<='9') x=x*10+c-'0';return x;
}
int n,m,f[MAXN][MAXN][2],ans;
int main()
{
	n=read();m=read();
	f[0][0][1]=1;
	for(int i=1;i<=n;i++) f[0][i][0]=1;
	for(int i=0;i<=m-1;i++)
	 for(int j=0;j<=n;j++)
	  for(int k=0;k<=1;k++){
	  	if(j) f[i+1][j][k|(j==1)]=(f[i+1][j][k|(j==1)]+f[i][j][k])%MD;
		if(j) f[i+1][j-1][k|(j==1)]=(f[i+1][j-1][k|(j==1)]+f[i][j][k])%MD;
		if(n-j) f[i+1][j][k]=(f[i+1][j][k]+f[i][j][k])%MD;
		if(n-j) f[i+1][j+1][k]=(f[i+1][j+1][k]+f[i][j][k])%MD;
	  }
	for(int i=0;i<=n;i++) ans=(ans+f[m][i][1])%MD;
	printf("%d",ans);
	return 0;
}

Measured memory_bytes: 70656
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <array>
#include <vector>
#include <functional>
#include <unordered_map> 
#include <map> 
#include <numeric>
#include <limits>
#include <utility>
#include <queue>
#include <random>
#include <bitset>
#include <memory>
#include <complex>
using namespace std;
typedef long long LL;

int main() {
    int n, a;
    cin >> n;
    cin >> a;
    n *= n;
    cout << n - a << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <cmath>
#include <cstring>
using namespace std;

#define fi first
#define se second
typedef long long LL;
typedef long double LD;


bool ask(LL x){
    cout << "? " << x << "\n";
    cout.flush();

    char ans;
    cin >> ans;
    return (ans=='Y');
}

void print_ans(LL x){
    cout << "! " << x << "\n";
    cout.flush();
}

int main(){


    int len=1,i; LL val=1;
    for (i=1; i<=12; i++){
        if (ask(val)) len=i;
        else break;
        val*=10;
    }

    if (len==12){
        val=9;
        while (!ask(val))
            val*=10;

        print_ans(val/9);
        return 0;
    }

    val=0;
    for (i=1; i<len; i++){
        int l=(i==1 ? 1 : 0),r=9,mid;

        val*=10;
        while (l<r){
            mid=(l+r+1)/2;
            if (ask(val+mid)) l=mid;
            else r=mid-1;
        }

        val+=r;
    }

    int l=(len==1 ? 1 : 0),r=9,mid;
    while (l<r){
        mid=(l+r)/2;
        if (ask(val*100+mid*10+1)) r=mid;
        else l=mid+1;
    }

    val=val*10+r;

    print_ans(val);
    return 0;
}


Measured memory_bytes: 668
#include <stdio.h>
#define SWAP(type,a,b) { type temp = a; a = b; b = temp; }
#define N 36

typedef struct element{
  char mark;
  int num;
}card;
 

int main(){
  int i, j, n, minj, judge=0;
  card ca[N], cb[N];
  char s;

  scanf("%d%c",&n,&s);
  for(i=0;i<n;i++){
    scanf("%c%d%c",&ca[i].mark,&ca[i].num,&s);
    cb[i] = ca[i];
  }

  for(i=0;i<n-1;i++){
    for(j=n-1;j>i;j--){
      if(ca[j].num < ca[j-1].num){
	SWAP(card,ca[j],ca[j-1]);
      }
    }
  }


  for(i=0;i<n;i++){
    minj = i;
    for(j=i;j<n;j++){
      if(cb[minj].num > cb[j].num){
	minj = j;
      }
    }
    SWAP(card,cb[minj],cb[i]);
  }

  for(i=0;i<n;i++){
    if(i==n-1) printf("%c%d\n",ca[i].mark,ca[i].num);
    else printf("%c%d ",ca[i].mark,ca[i].num);
  }

  
  printf("Stable\n");

  
  for(i=0;i<n;i++){
    if(i==n-1) printf("%c%d\n",cb[i].mark,cb[i].num);
    else printf("%c%d ",cb[i].mark,cb[i].num);
  }


  
  for(i=0;i<n;i++){
    if(ca[i].mark != cb[i].mark) judge=1;
  }
  if(judge==1) printf("Not stable\n");
  else printf("Stable\n");


  
  return 0;
}



Measured memory_bytes: 2144
#ifdef DEBUG

#else

#    pragma GCC optimize("O3,no-stack-protector")
#    pragma GCC optimize("unroll-loops")

#    if __cplusplus < 201703L
#        pragma GCC target("avx")
#    else
#        pragma GCC target("avx2")
#    endif

#endif
// 実数の場合
// #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define dump(x) cout << x << endl
typedef int64_t Int;
typedef long double Ld;

using namespace std;
using Graph = vector<vector<Int>>;

const double pi = M_PI;
const Int MOD = 1000000007;

template <typename T>
inline T Abs(T a) {
    if (0 <= a) {
        return a;
    } else {
        return -a;
    }
}

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

    int n;
    cin >> n;
    vector<Int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }

    vector<Int> s(n);
    s[0] = a[0];
    for (int i = 1; i < n; i++) {
        s[i] = a[i] + s[i - 1];
    }
    Int all = s.back();

    Int ans = 10e15;
    for (int i = 0; i < n - 1; i++) {
        Int su, ar;
        su = s[i];
        ar = all - s[i];
        ans = min(ans, Abs(su - ar));
    }

    cout << ans << endl;

    return 0;
}


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

typedef long long int ll;
ll dp[105][100005];

ll K[105][100005];

int main()
{
	ll n,W;
	cin>>n>>W;
	ll wt[n],v[n],sum=0;
	for(ll i=0;i<n;i++)
	{
		cin>>wt[i]>>v[i];
		sum+=v[i];
	}
	for(ll i=0;i<105;i++)
		for(ll j=0;j<100005;j++)
			K[i][j]=INT_MAX;
//	K[0][0]=0;
	for (ll i = 0; i <= n; i++) 
	{
		for (ll w = 0; w <=sum; w++) 
		{
			if(i==0 && w==0)
				K[i][w]=0;
			else if(i==0)
				K[i][w]=INT_MAX;
			else if(w==0)
				K[i][w]=0;
			else if (v[i - 1] <= w)
				K[i][w] = min(wt[i - 1] + K[i-1][w - v[i - 1]],K[i-1][w]);
			else
				K[i][w] = K[i-1][w];
		}
	}
	ll ans=0;
	for(ll j=0;j<=sum;j++)
		if(K[n][j]<=W)
		{
			ans=j;
//			cout<<K[n][j]<<endl;
		}
	cout<<ans<<endl;
}


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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define INF 1e9
typedef long long ll;

int c[3][3];

void solve(){
  int x, y, z, xx, yy, zz;
  x = c[0][0] + c[1][1] + c[2][2];
  y = c[0][1] + c[1][2] + c[2][0];
  z = c[0][2] + c[1][0] + c[2][1];
  xx = c[0][0] + c[1][2] + c[2][1];
  yy = c[0][1] + c[1][0] + c[2][2];
  zz = c[0][2] + c[1][1] + c[2][0];
  if (x == y && y == z && z == xx && xx == yy && yy == zz){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}

int main(){
  rep(i, 3){
    rep(j, 3){
      cin >> c[i][j];
    }
  }
  solve();
}

Measured memory_bytes: 256
#include <stdio.h>
#include<math.h>
int main(void) {
    int a[3],b[3];
    int i;
    int k,l,m,n;
    k=0;
    l=0;
    m=0;
    n=0;
    for(i=0;i<3;i++){
    scanf("%d %d",&a[i],&b[i]);
    if(a[i]==1){
    	k++;
    }
    if(a[i]==2){
    	l++;
    
    }if(a[i]==3){
    	m++;
    }if(a[i]==4){
    	n++;
    }
    
     if(b[i]==1){
    	k++;
    }
    if(b[i]==2){
    	l++;
    
    }if(b[i]==3){
    	m++;
    }if(b[i]==4){
    	n++;
    }
    
    }
    if((k==l&&m==n&&m==2)||(k==l&&m==n&&m==1)||(k==m&&l==n&&m==2)||(k==m&&l==n&&m==1)||(k==n&&l==m&&m==2)||(k==n&&l==m&&m==1)){
    	printf("YES\n");
    }else{
    	printf("NO\n");
    }
}

Measured memory_bytes: 128
#include<iostream>
#include<stdio.h>
#include<math.h>
using namespace std;
int main(){
    double r,s,R;
    
    cin >>r;
    
    s = r * r * M_PI;
    R = 2 * r * M_PI;
    
    printf("%.5f %.5f\n",s,R);
    
    return 0;

}



Measured memory_bytes: 3204
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <iomanip>
#include <limits>
#include <list>
#include <queue>
#include <tuple>
#include <map>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define INF (int)(1123456789)
#define LINF (long long int)(112345678901234567)
#define chmax(a, b) a = (((a)<(b)) ? (b) : (a))
#define chmin(a, b) a = (((a)>(b)) ? (b) : (a))
#define all(v) v.begin(), v.end()
ll p;

ll mpow(ll a, ll b){
	if(b==0) return 1;
	else if(b%2==0){ll memo = mpow(a,b/2); return memo*memo%p;}
	else return mpow(a,b-1) * a % p;
}
ll gcd(ll a, ll b){
	if(b==0) return a;
	else return gcd(b, a%b);
}
vector<ll> kaijo_memo;
ll kaijo(ll n){
	if(kaijo_memo.size() > n) return kaijo_memo[n];
	if(kaijo_memo.size() == 0) kaijo_memo.push_back(1);
	while(kaijo_memo.size() <= n) kaijo_memo.push_back(kaijo_memo[kaijo_memo.size()-1] * kaijo_memo.size() % p);
	return kaijo_memo[n];
}
ll nCr(ll n, ll r){
	if(n < r || r < 0) return 0;
	ll ret = 1;
	ret *= kaijo(n); ret %= MOD;
	ret *= mpow(kaijo(r), MOD-2); ret %= MOD;
	ret *= mpow(kaijo(n-r), MOD-2); ret %= MOD;
	return ret;
}

int main(void){
	cin>>p;
	vector<ll> A;
	rep(i,p){
		ll a;
		cin>>a;
		A.push_back(a);
	}
	vector<vector<ll>> dp;
	rep(i,p){
		dp.push_back(vector<ll>());
		rep(j,i+1){
			dp[i].push_back(0);
		}
	}
	dp[0][0] = 1;
	reps(i, p-1){
		rep(j, i+1){
			if(j != i){
				dp[i][j] += dp[i-1][j] * (p-i+1);
			}	
			if(j-1 >= 0){
				dp[i][j] += dp[i-1][j-1];
			}
			dp[i][j] %= p;
		}
	}
	//cout<<"hoge"<<dp[0][0]<<endl;
	vector<ll> B,C;
	rep(i,p){
		B.push_back(0);
		C.push_back(0);
	}

	rep(ai, p){//a_aiに対処
		ll sum = 0;
		rep(j, ai){
			sum += C[j] * kaijo(ai) % p *mpow(kaijo(ai-j), p-2) % p;
			sum %= p;
		}

		sum += (p - A[ai])%p;//ほんと?
		rep(j, p){
			if((j * kaijo(ai) + sum) % p == 0){
				C[ai] = j;
				break;
			}
		}


		rep(j, ai+1){//x^jの項を求める
			if(j == 0){
				//cout<<ai<<" "<<dp[ai][j]<<" "<<C[ai]<<endl;
			}
			B[j] += dp[ai][j] * C[ai];
			B[j] %= p;
		}
		//cout<<B[0]<<endl;
	}
	/*rep(i, dp.size()){
		rep(j, dp[i].size()){
			cout<<dp[i][j]<<" ";
		}
		cout<<endl;
	}*/
	//cout<<dp[1][0]<<endl;
	rep(i,B.size()){
		cout<<B[i];
		if(i != B.size()-1){
			cout<<" ";
		}
	}
	cout<<endl;
	return 0;
}


Measured memory_bytes: 46980
from collections import deque
INF = float('inf')
N, M = map(int, input().split())
graph = [[] for _ in range(N+1)]
for i in range(M):
  a, b = map(int, input().split())
  graph[a].append(b)
  graph[b].append(a)
dist = [INF] * (N+1)
dist[1] = 0
flag = [-1] * (N+1)
check = 1
q = deque([1])
while q:
  x = q.popleft()
  for nextx in graph[x]:
    if(dist[nextx] != INF):
      continue
    flag[nextx] = x
    dist[nextx] = dist[x] + 1
    q.append(nextx)
print('Yes')
for i in range(2, N+1):
  print(flag[i])

Measured memory_bytes: 34972
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define ll long long
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define sz(a) int((a).size())
#define all(a) (a).begin(), (a).end()
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPD(i,n) for(int i=(n)-1;i>=0;--i)
#define FOR(i,a,b) for(int i=(a);i<=(b);++i)
#define FORD(i,a,b) for(int i=(a);i>=(b);--i)
#define TLE() cerr<<"\nTime elapsed: "<<1000*clock()/CLOCKS_PER_SEC<<"ms.\n";
const ll MOD = 1E9+7;
const ll IINF = 1E18;
const int INF = 1e9;
const double EPS = 1E-9;
const double PI = atan(1.0) * 4.0;
template<class T> T getbit(T s, int i) {return s>>i&1;}
template<class T> void flipbit(T& s, int i) {s^=(1LL<<i);}
constexpr int cntbit(ll x) {return __builtin_popcountll(x);}
constexpr int lg2(ll x) {return __lg(x);} // return int(log2(x))
// mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
mt19937 rng((uint32_t)chrono::steady_clock::now().time_since_epoch().count()); 
ll fpow(ll a,ll p){ll res=1LL;while(p){if(p&1LL) res=res*a%MOD;a=a*a%MOD;p>>=1LL;} return res;}

const int N=1e5+5;

struct DSU{
	vector<int> r,p;
	DSU(int n){
		r.resize(n,1);
		p.resize(n);
		iota(p.begin(),p.end(),0);
	}
	int getroot(int u){
		return p[u]==u?u:p[u]=getroot(p[u]);
	}
	bool merge(int u,int v){
		u=getroot(u);
		v=getroot(v);
		if(u==v) return false;
		if(r[u]>r[v]) r[u]+=r[v],p[v]=u;
		else r[v]+=r[u],p[u]=v;
		return true;
	}
};

int n;
ll cntx[2*N+5],cnty[2*N+5];
DSU g(2*N+5);

int main() {
	ios_base::sync_with_stdio(0);cin.tie(0);
	cin>>n;
	REP(i,n){
		int x,y;
		cin>>x>>y;
		y+=N;
		g.merge(x,y);
	}
	FOR(i,1,1e5){
		cntx[g.getroot(i)]++;
		cnty[g.getroot(i+N)]++;
	}
	ll res=0;
	REP(i,2*N+5) res+=cntx[i]*cnty[i];
   	cout<<res-n<<'\n';	
}
// the forth point will form a rectangle with other three
// if point (X, Y) exists, there's an edge between X and Y
// the resulted graph contains multiple connected components, each should form an uncompleted bipartite
// after finite number of operations, we have all CC become completed bipartite
// so, let's use DSU to maintain this connectivity


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

int main() {
    int n, k; cin >> n >> k;
    vector <int> v(n, 0);

    for(int i = 0; i < k; i++) {
        int x; cin >> x;
        for(int i = 0; i < x; i++) {
            int y; cin >> y;
            v[y - 1] ++;
        }
    }

    int ans = 0;
    for(int i = 0; i < n; i++) {
        if(v[i] == 0) ans ++; 
    }

    cout << ans;
}

Measured memory_bytes: 3620
import java.util.*;

class Main {
    public static void main(String[] args) {
        new Solver().run();
    }
}

class Solver {

    private long calc(long h, long area) {
        if (h % 2 == 0) return 0;
        else return area;
    }

    public void run() {
        Scanner sc = new Scanner(System.in);
        long A = sc.nextLong();
        long B = sc.nextLong();
        long C = sc.nextLong();

        long min = Long.MAX_VALUE;
        min = Math.min(calc(A, B * C), min);
        min = Math.min(calc(B, C * A), min);
        min = Math.min(calc(C, A * B), min);
        System.out.println(min);

        return;
    }

}

Measured memory_bytes: 23124
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep1(i, n) for(int i = 1; i < n+1; i++)
#define sort(A) sort(A.begin(),A.end())
#define reverse(A) reverse(A.begin(),A.end());
#define vecmin(A) *min_element(A.begin(),A.end());
#define vecmax(A) *max_element(A.begin(),A.end());
typedef long long ll;

int main(){
  int n,x;
  cin >> n >> x;
  vector<int> l(n);
  int d = 0;
  int ans = 1;
  rep(i,n){
    int tmp;
    cin >> tmp;
    d += tmp;
    if(d > x) break;
    ans ++;
  }
  cout << ans << endl;
}

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

#define fs first
#define sc second
#define mp make_pair
#define pb emplace_back
#define sz(s) ((int) s.size ())
#define all(s) s.begin (), s.end ()

using namespace std;

typedef long long ll;
typedef pair<int, int> ii;
typedef unsigned long long ull;

const ll linf = (ll) 1e18;

const int pw = 997;
const int N = 100009;
const int inf = (int) 1e9;
const int mod = (int) 1e9 + 7;

const double eps = 1e-10;
const double pi = 3.1415926535897932384626433832795;

inline void prepare () {

}
inline void solve () {
        ll n, m; cin >> n >> m;
        ll ans = -1;
        ll l = 0;
        ll r = 100000000000000LL;
        while (l <= r) {
                ll mid = (l + r) >> 1LL;
                ll s = n;
                ll c = m;
                if (s < mid) {
                        c -= (mid - s) << 1LL;
                        s = mid;
                }
                if (c < (mid << 1LL)) {
                        r = mid - 1;
                } else {
                        ans = mid;
                        l = mid + 1;
                }
        }
        cout << ans;
}
int main () {
        #ifdef FSTREAM
                #define name ""
                freopen (name".in", "r", stdin);
                freopen (name".out", "w", stdout);
        #endif // FSTREAM
        int tests = 1;
        prepare ();
	while (tests--) {
                solve ();
        }
}


Measured memory_bytes: 256
/* Author: $%U%$
 * Time: $%Y%$-$%M%$-$%D%$ $%h%$:$%m%$:$%s%$
**/
#include <bits/stdc++.h>
using namespace std;
#define fore(i, a, b) for (int i = a, to = b; i < to; i++)
#define all(v) v.begin(), v.end()
#define SZ(v) (int)v.size()
#define pb push_back
typedef long long Long;
typedef pair<int, int> Pair;
void solve() {
  int a, b;
  cin >> a >> b;
  cout << a * b << endl;
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  int t = 1;
  //cin >> t;
  while (t--) solve();

  return 0;
}

Measured memory_bytes: 3652
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define PB push_back
#define MP make_pair
#define F first
#define S second
#define EPS 1e-9
#define MOD 1000000007
#define int long long
using namespace __gnu_pbds;
using namespace std;
typedef pair<int, int> pii;
typedef tree<int, null_type, less<int>, rb_tree_tag,tree_order_statistics_node_update> ost;
#define INF 10000000000


int32_t main(){
	int n, w;
	cin >> n >> w;
	vector<int> wt(n,0), val(n,0);
	int sumi = 0;
	for(int i = 0; i < n; i++){
		cin >> wt[i] >> val[i];
		sumi += val[i];
	}
	vector<int> dp(sumi+1,1e18);
	dp[0] = 0;
	for(int i = 0; i < n; i++){
		for(int j = sumi - val[i]; j >= 0; j--){
			dp[j+val[i]] = min(dp[j+val[i]], dp[j]+wt[i]);
		}
	}
	int ans = 0;
	for(int i = 0; i <= sumi; i++){
		if(dp[i] <= w)
			ans = max(ans,i);
	}
	cout << ans;
	return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
#define pii pair<int,int>
#define fi first 
#define se second 
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define pb push_back
#define faster ios_base::sync_with_stdio(0);cin.tie(0);
#define mem(a,v) memset(a,v,sizeof(a))
const ll INF=1e18;
const int mod=1e9+7;
const int iinf=1e9+10;
const int xd[4]={1,0,-1,0},yd[4]={0,1,0,-1};
ll pp(ll a,ll n){
	ll res=1;
	while(n){
		if(n&1)
			res=(res*a)%mod;
		a=a*a%mod;
		n/=2;
	}
	return res;
}
int main()
{
	faster
	ll n;
	cin>>n;
	cout<<(pp(10,n)-(pp(9,n)*2%mod-pp(8,n))+mod)%mod;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N, K, s=0;
  cin >> N >> K;
  for (int i=0; i<N; i++){
    int x;
    cin >> x;
    if (x<K-x){
      s+=2*x;
    }
    else {
      s+=2*(K-x);
    }
  }
  cout << s <<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define va first
#define vb second
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int MN = 2e5+5;
bool ch[MN];
int A,B,M,a[MN],b[MN],c[MN],mina,minb,ans;
int main()
{
    ios_base::sync_with_stdio(0),cin.tie(0);
    ans = mina = minb = 1e9;
    cin >> A >> B >> M;
    for(int i=1; i<=A; i++){
        cin >> a[i];
        mina = min(mina,a[i]);
    }
    for(int i=1; i<=B; i++){
        cin >> b[i];
        minb = min(minb,b[i]);
    }
    int x,y,c;
    for(int i=0; i<M; i++){
        cin >> x >> y >> c;
        ans = min(ans,a[x]+b[y]-c);
    }
    ans = min(ans,mina+minb);
    cout << ans;
}


Measured memory_bytes: 1024
H,W,h,w=gets.split.map(&:to_i)
m=(1..H).map{(1..W).map{0}}

if(H%h==0 && W%w==0)
  puts "No"
else
  0.step(H-1,h){|th|
    0.step(W-1,w){|tw|
      m[th][tw]=10000
      uh=th+h-1
      uw=tw+w-1
      if uh<H && uw<W
        m[uh][uw]=-10001
      end
    }
  }
  puts "Yes"
  puts m.map{|a|a.join(" ")}.join("\n")
end

Measured memory_bytes: 10492
import std.stdio, std.algorithm, std.conv, std.array, std.string, std.math, std.typecons, std.numeric;

void main()
{
    auto N = readln.chomp.to!int;
    auto PS = readln.split.to!(double[]);

    double[][] MEMO;
    MEMO.length = N;
    foreach (ref m; MEMO) m.length = N+1;

    double zero = 0.0, one = 1.0;

    foreach (i; 0..N) {
        if (!i) {
            MEMO[i][0] = one - PS[i];
            MEMO[i][1] = PS[i];
            continue;
        }
        foreach (j; 0..i+2) {
            MEMO[i][j] = (MEMO[i-1][j].isNaN ? zero : MEMO[i-1][j] * (one - PS[i])) + (j ? MEMO[i-1][j-1] * PS[i] : zero);
        }
    }

    double ret = 0.0;
    foreach (c; N/2+1..N+1) {
        ret += MEMO[N-1][c];
    }
    writefln("%1.10f", ret);
}

Measured memory_bytes: 74236
#白黒白・・か黒白黒・・か
S = input()
N = len(S)
A = 0
B = 0
for i in range(0,N,2):
    if S[i] == "0":
        A += 1
    if i+1==N:
        break
    if S[i+1] == "1":
        B += 1
if A + B <= N//2:
    print(A + B)
else:
    print(N-(A+B))

Measured memory_bytes: 3188
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using static System.Console;
using static System.Math;

class program
{
    static public int mod = 1000000007;
    static void Main()
    {
        var nxy = inta();
        int n = nxy[0], x = nxy[1], y = nxy[2];
        var ans = new int[n - 1];
        for (int i = 0; i < n; i++)
        {
            for (int j = i + 1; j < n; j++)
            {
                int dis = Min(j - i, Abs(x - i - 1) + Abs(y - j - 1) + 1);
                ans[--dis]++;
            }
        }
        for (int i = 0; i < n - 1; i++)
        {
            WriteLine(ans[i]);
        }
    }

    static int pow(int a, int b) { string binary = Convert.ToString(b, 2); int bileng = binary.Length; long a_power = a; long value = 1; for (int i = bileng - 1; i >= 0; i--) { if (binary[i] == '1') { value = value * a_power % mod; } a_power = a_power * a_power % mod; } return (int)value; }
    static string rstr() { return ReadLine(); }
    static int rint() { return int.Parse(ReadLine()); }
    static long rlong() { return long.Parse(ReadLine()); }
    static string[] stra() { return ReadLine().Split(' '); }
    static char[] chara() { string[] a = stra(); string b = ""; for (int i = 0; i < a.Length; i++) { b += a[i]; } return b.ToCharArray(); }
    static int[] inta() { string[] read_str_array = ReadLine().Split(' '); int[] return_int_array = new int[read_str_array.Length]; for (int countup_i = 0; countup_i < read_str_array.Length; countup_i++) { return_int_array[countup_i] = int.Parse(read_str_array[countup_i]); } return return_int_array; }
    static long[] longa() { string[] read_str_array = ReadLine().Split(' '); long[] return_long_array = new long[read_str_array.Length]; for (long countup_i = 0; countup_i < read_str_array.Length; countup_i++) { return_long_array[countup_i] = long.Parse(read_str_array[countup_i]); } return return_long_array; }
    static double[] doublea() { string[] read_str_array = ReadLine().Split(' '); double[] return_double_array = new double[read_str_array.Length]; for (long countup_i = 0; countup_i < read_str_array.Length; countup_i++) { return_double_array[countup_i] = double.Parse(read_str_array[countup_i]); } return return_double_array; }
    static long GCD(long a, long b) { if (a < b) { long temp = a; a = b; b = temp; } if (a % b == 0) { return b; } else { long temp = b; b = a % b; a = temp; return GCD(a, b); } }
    static long LCM(long a, long b) { return a * b / GCD(a, b); }
    static void WriteArray2(int[,] a, int b, int c) { for (int i = 0; i < b; i++) { for (int j = 0; j < c; j++) { if (j != 0) Write(" "); Write(a[i, j]); } WriteLine(); } }
    static void WriteArray(int[] a, int b) { for (int i = 0; i < b; i++) { Write(" "); Write(a[i]); } WriteLine(); }
}


Measured memory_bytes: 27596
/*´íÎó´ð°¸ 
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cmath>
using namespace std;

int f[4], a[4];

int task(int i, int j, int cnt) {
	if (f[j] == false && f[i] == false) {
		cnt += abs(a[j]-a[i]);
		f[j] = true;
		cnt += task(j, 3, cnt);
		cnt += task(j, 2, cnt);
		cnt += task(j, 1, cnt);
		return cnt;
	}
	return 0;
}

int main() {
	cin >> a[1] >> a[2] >> a[3];
	
	memset(f, false, sizeof(false));
	f[1] == false;
	int ans = task(1, 2, 0);
	cout << ans << endl;
	return 0;
}
-----------------------------------------*/
#include <iostream>
#include <algorithm>
using namespace std;

int a[4] = {0, 0, 0, 0};
int main() {
	cin >> a[1] >> a[2] >> a[3];
	cout << max(max(a[1], a[2]), a[3]) - min(min(a[1], a[2]), a[3]) << endl; 
	return 0;
}

Measured memory_bytes: 256
# recieve |V| and |E|
V, E = map(int, input().split())
es = [[] for i in range(V)]

for i in range(E):

	# recieve edges
	a, b, c = map(int, input().split())
	a, b = a-1, b-1
	es[a].append((b,c))
	es[b].append((a,c))

T = int(input())

# recieve info
for i in range(T):
	Nnew = int(input())
	for j in range(Nnew):
		new_id, dst = map(int, input().split())

# insert your code here to get more meaningful output
# all stay
for i in range(T) :
	print (-1)


Measured memory_bytes: 3748
{-# LANGUAGE BangPatterns, OverloadedStrings #-}

import Control.Monad
import Data.List
import Data.Bits
import Debug.Trace
import Data.Maybe
import qualified Data.ByteString.Char8 as C
import Data.Ratio

main :: IO ()
main = do
  [a, b] <- readIntegers
  print $ solve a b

-- a + 1

solve a b = if mina <= x && x <= maxa && minb <= x && x <= maxb
  then x
  else
    if mina <= y && y <= maxa && minb <= y && y <= maxb
      then y
      else -1
  where
    x = min mina minb
    y = max mina minb
    mina = ceiling $ fromRational $ (a % 1) * (100 % 8)
    maxa = (ceiling $ fromRational $ ((a + 1) % 1) * (100 % 8)) - 1
    minb = ceiling $ fromRational $ (b % 1) * (100 % 10)
    maxb = (ceiling $ fromRational $ ((b + 1) % 1) * (100 % 10)) - 1

-- 以下ライブラリ

readInts :: IO [Int]
readInts = map (fst . fromJust . C.readInt) . C.words <$> C.getLine

readNInts :: Int -> IO [[Int]]
readNInts = flip replicateM readInts

readIntegers :: IO [Integer]
readIntegers = map (fst . fromJust . C.readInteger) . C.words <$> C.getLine

readNIntegers :: Int -> IO [[Integer]]
readNIntegers = flip replicateM readIntegers

getNLns :: Int -> IO [String]
getNLns = flip replicateM getLine

Measured memory_bytes: 380
#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <cctype>
#include <ctime>
#include <set>
#include <algorithm>
#include <vector>
#include <cmath>

namespace LegitStream
{
char bufdatum[BUFSIZ];
char *buf = bufdatum, *endbuf = bufdatum;

inline bool eof(void)
{
    if (endbuf == buf)
    {
        endbuf = (buf = bufdatum) + fread(bufdatum, 1, BUFSIZ, stdin);
        return endbuf == buf;
    }
    else
        return false;
}

inline int nextch(void)
{
    return eof() ? EOF : *buf++;
}

void legit(void) {}

template<typename Car, typename ...Cdr>
void legit(Car &var, Cdr &...Rest)
{
    int peek;
    while (!isdigit(peek = nextch())
#ifdef LEGIT_NEGI
        && peek != '-'
#endif  // LEGIT_NEGI
        )
        ;
#ifdef LEGIT_NEGI
    bool negi;
    if (peek == '-')
        negi = true;
    else
        negi = false;
#endif  // LEGIT_NEGI
    var = 0;
    do
        var = (((var << 2) + var) << 1) + (peek ^ '0');
    while (isdigit(peek = nextch()));
#ifdef LEGIT_NEGI
    if (negi)
        var = -var;
#endif  // LEGIT_NEGI
    legit(Rest...);
}
}
using LegitStream::nextch;
using LegitStream::eof;
using LegitStream::legit;

void solve(void);

int main(void)
{
#ifdef redirect
    freopen("check/data.in", "r", stdin);
    freopen("check/prog.out", "w", stdout);
    freopen("check/log.out", "w", stderr);
#endif  // redirect
#ifdef chrono
    auto begtm = clock();
#endif  // chrono
    solve();
#ifdef chrono
    auto endtm = clock();
    printf("%f\n", static_cast<float>(endtm - begtm) / CLOCKS_PER_SEC);
#endif  // chrono
    return 0;
}

std::vector<int> table = { 
1000,961,900,841,784,729,676,625,576,529,512,484,441,400,361,324,289,256,243,225,216,196,169,144,128,125,121,100,81,64,49,36,32,27,25,16,9,8,4,1
};

void solve(void)
{
    int x;
    legit(x);
    int index = -1;
    while (table[++index] > x)
        ;
    printf("%d\n", table[index]);
}



Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <chrono>
#include <random>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <iomanip>
#include<string>
using namespace std;

#define ll long long
typedef pair<ll , ll > pii;
const int MOD = 998244353;
const int N=500004;

vector<int> BIT;

void update(int i, int add)
{
    while (i > 0 && i < BIT.size())
    {
        BIT[i] += add;
        i = i + (i & (-i));
    }
}

int sum(int i)
{
    int ans = 0;
    while (i > 0)
    {
        ans += BIT[i];
        i = i - (i & (-i));
    }

    return ans;
}
int findKthSmallest(int k)
{
    int l = 0;
    int h = BIT.size();
    while (l < h)
    {
        int mid = (l + h) / 2;
        if (k <= sum(mid))
            h = mid;
        else
            l = mid+1;
    }

    return l;
}

void insertElement(int x)
{
    update(x, 1);
}

void deleteElement(int x)
{
    update(x, -1);
}

int findRank(int x)
{
    return sum(x);
}

///


void min_self(int &a , int b){
    a=min(a,b);
}

int add(int x, int y)
{
    return (x + y) % MOD;
}

int sub(int x, int y)
{
    return add(x, MOD - y);
}

int mul(int x, int y)
{
    return (x * 1ll * y) % MOD;
}

int binpow(int x, int y)
{
    int z = 1;
    while(y > 0)
    {
        if(y % 2 == 1)
            z = mul(z, x);
        x = mul(x, x);
        y /= 2;
    }
    return z;
}

int inv(int x)
{
    return binpow(x, MOD - 2);
}

int fact[N];

int C(int n, int k)
{
    return mul(fact[n], inv(mul(fact[k], fact[n - k])));
}
/////-----//////





int  main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
  // freopen("input.txt", "r", stdin);
   ll a; long double b;
   cin>>a>>b;
   ll ans=floor(a*b);
   cout<<ans;
   return 0;
}


Measured memory_bytes: 3748
import collections
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a
def main():
  N = int(input())
  dic = collections.Counter(prime_factorize(N))
  ans = 0
  for pri, num in dic.items():
    total = 0
    e = 1
    while True:
      total = total + e
      if total > num:
        ans += e-1
        break
      e+=1
  print(ans)
if __name__ == "__main__":
  main()

Measured memory_bytes: 9464
import collections
N = int(input())
A = list(map(int,input().split()))
B = collections.Counter(A)
C = [0,0]
for i in set(A):
    if B[i] >= 4:
        C.append(i)
    if B[i] >= 2:
        C.append(i)
C.sort(reverse=True)
print(C[0]*C[1])

Measured memory_bytes: 25164
#include <cstdio>
#include <queue>
#include <vector>
#include <algorithm>
#include<cstring>
#include<cstdlib>
#include<iostream>
#include<string>
#include<map>
#include<set>
#include<math.h>

using namespace std;
#define ll long long
#define ull unsigned long long
#define INF 1e9
#define eps 1e-6
#define PI acos(-1.0)
#define M 10010
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
typedef pair<int, int>P;
const int mod = 1e9 + 7;
const int maxn = 1e5 + 10;

int h , w;
int a[550][550];
int sum[550];


int main() {
    IOS;
  //freopen("in.txt", "r", stdin);
  //freopen("out.txt","w",stdout);
  cin >> h >> w;
  for(int i = 1 ; i <=h; ++i){
    for(int j = 1 ; j <=w; ++j)
      {
          cin  >>  a[i][j];
          a[i][j] %= 2;
          sum[i] += a[i][j];
      }
      sum[i] %= 2;
  }
  int tot = 0;
  for(int i = 1; i <= h; i++){
    for(int j = 1; j <= w; j++){
        if(a[i][j]){
            for(int k = j; k < w; k++){
                if(!a[i][k+1]){
               //cout << i <<" " << k << " " << i << " " << k+1 <<endl;
                    tot ++;
                }
                else{
                 //out << i <<" " << k << " " << i << " " << k+1 <<endl;
                    tot ++;
                    j = k + 1;
                    break;
                }
            }
        }
    }
  }
  for(int i = 1 ; i <=h ; ++i){
    if(sum[i]){
      for(int k = i ; k < h ; ++k){
            if(!sum[k+1]){
              // cout << k <<" " << w << " " << k+1 << " " << w << endl;
                    tot ++;
            }
            else{
                // cout << k <<" " << w << " " << k+1 << " " << w << endl;
                    tot ++;
                    i = k + 1;
                    break;
            }
        }
    }
  }
  cout << tot <<endl;
  for(int i = 1; i <= h; i++){
    for(int j = 1; j <= w; j++){
        if(a[i][j]){
            for(int k = j; k < w; k++){
                if(!a[i][k+1]){
                  cout << i <<" " << k << " " << i << " " << k+1 <<endl;
                    tot ++;
                }
                else{
                  cout << i <<" " << k << " " << i << " " << k+1 <<endl;
                    tot ++;
                    j = k + 1;
                    break;
                }
            }
        }
    }
  }
  for(int i = 1 ; i <=h ; ++i){
    if(sum[i]){
      for(int k = i ; k < h ; ++k){
            if(!sum[k+1]){
                 cout << k <<" " << w << " " << k+1 << " " << w << endl;
                    tot ++;
            }
            else{
                   cout << k <<" " << w << " " << k+1 << " " << w << endl;
                    tot ++;
                    i = k + 1;
                    break;
            }
        }
    }
  }
  return 0;
}


Measured memory_bytes: 3200
#include <iostream>
#include <vector>
#include <set>
#include <algorithm>
#include <math.h>
#include <string.h>
#include <map>
#include <numeric>
using namespace std;

int main()
{
  int N;
  cin>>N;
  string ans="No";
  for(int i=0;i*4<=N;i++){
    for(int j=0;j*7<=N;j++){
      if(i*4+j*7==N)ans="Yes";
    }
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 256