akhauriyash/Code-Regression huggingface dataset:
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String {
            bytes
                .by_ref()
                .map(|r| r.unwrap() as char)
                .skip_while(|c| c.is_whitespace())
                .take_while(|c| !c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };

    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, [ $t:tt ]) => {
        {
            let len = read_value!($next, usize);
            (0..len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
        }
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

#[allow(unused_imports)]
use std::cmp::{min, max};

fn main() {
    input!{
        n: usize,
        m: usize,
        mut v: [usize; n],
        xy: [(usize1, usize); m]
    }
    let mut cnt = vec![0; n + 1];
    let mut ds = vec![0; n];
    for &a in &v {
        if cnt[a] < a {
            ds[a - cnt[a] - 1] += 1;
        }
        cnt[a] += 1;
    }
    let mut ans = ds.iter().filter(|&&x| x == 0).count();
    for &(x, y) in &xy {
        cnt[v[x]] -= 1;
        if cnt[v[x]] < v[x] {
            ds[v[x] - cnt[v[x]] - 1] -= 1;
            if ds[v[x] - cnt[v[x]] - 1] == 0 {
                ans += 1;
            }
        }
        if cnt[y] < y {
            if ds[y - cnt[y] - 1] == 0 {
                ans -= 1;
            }
            ds[y - cnt[y] - 1] += 1;
        }
        cnt[y] += 1;
        v[x] = y;
        println!("{}", ans);
    }
}


Measured memory_bytes: 13820
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
using namespace std;

int main() {
  // input: w, h, x, y ,r
  // -100 <= x, y <= 100
  // 0 < w, h , r < 100
  int w, h, x, y, r;
  cin >> w >> h >> x >> y >> r;
  // ??????????????????????????¶
  if (((x - r) < 0) || ((y - r) < 0) || ((x + r) > w) || ((y + r) > h)) cout << "No" << endl;
  else cout << "Yes" << endl;
}

Measured memory_bytes: 1160
#include <iostream>
#include <string>
#include <cmath>
#include <vector>

using namespace std;

int main()

{
    int a,b,k;
    cin>>a>>b>>k;
    for(int i=0;i<k;i++){
        if(i%2==0){
            if(a%2==0){
                b=b+a/2;
                a=a/2;
                
                
            }else{
                b=b+(a-1)/2;
                a=(a-1)/2;
                
            }
        }else{
            if(b%2==0){
                a=a+b/2;
                b=b/2;
            }else{
                a=a+(b-1)/2;
                b=(b-1)/2;
            }
        }
        
    }
    cout<<a<<" "<<b<<endl;
}


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

int main(){
    int a, b;
    while(cin>>a >>b){
        if(a==0 && b==0)break;
        for(int i=0;i<a;i++){
            for(int j=0;j<b;j++){
                cout<<'#';
            }
            cout<<endl;
        }
        cout<<endl;
    }
    return 0;
}



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

using namespace std;




int main(){

    int A,B,C,D;
    int L,R;


    cin >> A >> B >> C >>D;

    L = A+B;
    R = C+D;

    if(L>R) cout << "Left";
    else if(L<R) cout << "Right";
    else   cout << "Balanced";

 
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int a,b,c,d,e;
int main(){
cin>>a;
cin>>b;
cin>>c;
cin>>d;
cin>>e;
if (a==0){
cout<<"1"<<endl;	
}
if (b==0){
cout<<"2"<<endl;	
}
if (c==0){
cout<<"3"<<endl;	
}
if (d==0){
cout<<"4"<<endl;	
}
if (e==0){
cout<<"5"<<endl;	
}
	
} 

Measured memory_bytes: 3636
import java.util.*;

public class Main {
//	private Node root = null;
////	
////	void insert(int n) {
////		if(root == null) {
////			root = new Node(n);
////		}
////		
////		if(root)
////		
////	}
//	
//	void insert(int data) {
//		root = insert(root, data);
//	}
//	
//	Node insert(Node root, int data) {
//		if (root == null) {
//			return new Node(data);
//		} else {
//			Node cur;
//			if (root.left == null) {
//				root.left = new Node(data);
//			} else if(root.right == null){
//				root.right = new Node(data);
//			}
//			else{
//				cur = insert(root.left, data);
//			}
//			return root;
//		}
//	}
	
	public static void main(String args[]) {
		
		Main tree = new Main();
		Scanner s = new Scanner(System.in);
		int total_nodes = s.nextInt();
		int n;
		int[] heap = new int[total_nodes + 1];
		
		
		for(int i = 1; i < total_nodes + 1; i++) {
			n = s.nextInt();
			heap[i] = n;
		}
		
		for(int i = 1; i < heap.length; i++) {
			System.out.print("node " + i + ": " + "key = " + heap[i] + ", ");
			
			if(i / 2 != 0) {
				System.out.print("parent key = " + heap[i/2] + ", ");
			}
			
			if( 2 * i  <= heap.length - 1) {
				System.out.print("left key = " + heap[2*i] + ", ");
			}
			if( 2 * i + 1 <= heap.length - 1) {
				System.out.print("right key = " + heap[2*i+1] + ", ");
			}
			
			System.out.println();
		}
		
	}

}


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

int main()
{
  int N, y=0;
  string s;
  cin >> N;
  for (int i=0; i<N; i++) {
    cin >> s;
    if (s == "Y")
      y++;
  }
  if (y != 0)
    cout << "Four";
  else 
    cout << "Three";
}
    
      
      
  

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
#define pi 3.14159265358979323846264338327950L
using namespace std;

int main() {
  int N, M;
  cin >> N;
  M=N/2;
  if (N%2==0) {
    vector<int64_t> A(M);
    vector<int64_t> B(M);
    for (int i=0; i<M; i++) {
      cin >> A[i] >> B[i];
    }
    if (M==1) {
      cout << B[0] << " " << A[0] << endl;
    }
    else {
      for (int i=M-1; i>=0; i--) {
        cout << B[i] << " ";
      }
      for (int i=0; i<M-1; i++) {
        cout << A[i] << " ";
      }
      cout << A[M-1] << endl;
    }
  }
  else {
    if (M==0) {
      int a;
      cin >> a;
      cout << a << endl;
    }
    else {
      vector<int64_t> A(M+1);
      vector<int64_t> B(M);
      for (int i=0; i<M; i++) {
        cin >> A[i] >> B[i];
      }
      cin >> A[M];
      if (M==1) {
        cout << A[1] << " " << A[0] << " " << B[0] << endl;
      }
      else {
        for (int i=M; i>=0; i--) {
          cout << A[i] << " ";
        }
        for (int i=0; i<M-1; i++) {
          cout << B[i] << " ";
        }
        cout << B[M-1] << endl;
      }
    }
  }
}

Measured memory_bytes: 4740
#include<bits/stdc++.h>
using namespace std;
long long a[111111];
long long big=1000000000000000000;
int main()
{
	int  n;
	cin>>n;
	bool p=0;
	long long res=1;
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
		if(a[i]==0)
		{
			cout<<0;return 0;
		}
		if(big/a[i]<res)
		{
			p=1;
		}
		else
		{
			res*=a[i];
		}
		
	}
	if(res>big||p==1)
		cout<<-1;
	else
		cout<<res;
	return 0;
 } 

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

#define o(output) cout << output << endl
#define priolity_queue pq
#define push p
#define top t

using namespace std;

string s,t;
int a,b,c,d;

int main(){
  cin >> a>>b;
  if((a+b)%3==0 || a%3==0||b%3==0) o("Possible");
  else o("Impossible");
}
  

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

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

    int N;
    cin >> N;

    vector<int> t(N);
    vector<int> x(N);
    vector<int> y(N);

    for(int i = 0; i < N; i++) {
        cin >> t[i] >> x[i] >> y[i];
    }

    int px = 0, py = 0;
    int pt = 0;

    for(int i = 0; i < N; i++) {
        int z = (t[i] - pt) - abs(x[i] - px) - abs(y[i] - py);
        px = x[i];
        py = y[i];
        pt = t[i];

        if(z < 0 || z % 2) {
            cout << "No" << endl;
            return 0;
        }
    }

    cout << "Yes" << endl;
}

Measured memory_bytes: 1408
#include <bits/stdc++.h>
using namespace std;
 
#define DEBUG
#ifndef DEBUG
#define endl "\n"
#define log(args...)
#else
#define log(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); logf(_it, args); }
void logf(istream_iterator<string> it) {
}
template<typename T, typename ... Args>
void logf(istream_iterator<string> it, T a, Args ... args) {
	cout << *it << " = " << a << endl;
	logf(++it, args...);
}
#endif
 
#define forn(i,k,n) for(ll i=(k); i<(n); i++)
 
const double PI = acos(-1);
typedef long long ll;
#define fori(n) for(ll i=0; i<(n); i++)
 
#define cins(s) string s; cin>>s;
#define cini(i) int i; cin>>i;
#define cinll(l) ll l; cin>>l;
#define cind(d) double d; cin>>d;
#define cinai(a, n) vi a(n); fori(n) { cin>>a[i]; }
#define cinall(a, n) vll a(n); fori(n) { cin>>a[i]; }
#define cinas(s, n) vs s(n); fori(n) { cin>>s[i]; }
#define cinad(a, n) vd a(n); fori(n) { cin>>a[i]; }
 
typedef pair<int, int> pii;
typedef pair<double, double> pdd;
typedef vector<double> vd;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<string> vs;
typedef vector<ll> vll;
 
void solve() {
	cini(k);
	cini(n);
	vi a(n);
	ll sum = 0;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		sum += a[i];
	}
 
	int ma = 0;
	int prev = 0;
	for (int i = 0; i < n; i++) {
		ma = max(ma, abs(prev - a[i]));
		prev = a[i];
	}
 
	ma = max(ma, k - a.back() + a[0]);
 
	ll ans = k - ma;
	cout << ans << endl;
 
}
 
int main() {
	cin.tie(nullptr);
	std::ios::sync_with_stdio(false);
	solve();
}

Measured memory_bytes: 1024
#include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<stack>
#include<set>
#include<map>
#include<vector>
#include<queue>
#define N 1010
typedef long long ll;
using namespace std;
int a[N];
int cmp(int a,int b)
{
     return a>b;
}
int main()
{
    int n;
    cin>>n;
    for (int i=0;i<n;i++)
      cin>>a[i];
    sort(a,a+n,cmp);
    int sum1=0,sum2=0;
    for (int i=0;i<n;i++)
      if (i%2==0)
          sum1+=a[i];
      else
          sum2+=a[i];
          cout << sum1-sum2 << endl;
    return 0;
}


Measured memory_bytes: 256
// In The Name Of The Queen
#include<bits/stdc++.h>
using namespace std;
const int N = 1e6 + 19, Mod = 1e9 + 7;
int n, m, q, k, A[20];
void Solve(int len, int now = 0)
{
    if (now == len)
    {
        k --;
        if (k == 0)
        {
            for (int i = 0; i < len; i ++)
                printf("%d", A[i]);
            printf("\n");
            exit(0);
        }
        return ;
    }
    for (int i = 0; i < 10; i ++)
        if ((now == 0 || abs(A[now - 1] - i) <= 1) && !(now == 0 && i == 0))
        {
            A[now] = i;
            Solve(len, now + 1);
        }
}
int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    cin >> k;
    for (int len = 1; len <= 10; len ++)
        Solve(len);
    return 0;
}

Measured memory_bytes: 256
N = int(input())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
out = "No"
SBA = sum(B)-sum(A)
if SBA>=0:
    cnt = 0
    for i in range(N):
        if A[i]<B[i]:
            cnt += (B[i]-A[i]+1)//2
    if cnt<=SBA:
        out = "Yes"
print(out)

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

int main() {
  string s;
  cin >> s;
  for (int i = 0; i < s.size() - 1; ++i) {
    if (s[i] == 'A' && s[i + 1] == 'C') {
      cout << "Yes\n";
      return 0;
    }
  }
  cout << "No\n";
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define F first
#define S second
#define pii pair<int, int>
#define eb emplace_back
#define all(v) v.begin(), v.end()
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rep3(i, l, n) for (int i = l; i < (n); ++i)
#define sz(v) (int)v.size()
const int inf = 1e9 + 7;
const ll INF = 1e18;
int mod = 1000000007;
#define abs(x) (x >= 0 ? x : -(x))
#define lb(v, x) (int)(lower_bound(all(v), x) - v.begin())
#define ub(v, x) (int)(upper_bound(all(v), x) - v.begin())
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return 1; } return 0; }
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }
template<typename T> T pow(T a, int b) { return b ? pow(a * a, b / 2) * (b % 2 ? a : 1) : 1; }
ll modpow(ll a, ll b, ll _mod) { return b ? modpow(a * a % _mod, b / 2, _mod) * (b % 2 ? a : 1) % _mod : 1; }
template<class T> ostream& operator << (ostream& os, const vector<T>& vec) { for (auto &vi: vec) os << vi << " "; return os; }
template<class T, class U> ostream& operator << (ostream& os, const pair<T, U>& p) { os << p.F << " " << p.S; return os; }
template<typename T >inline istream& operator >> (istream& is, vector<T>& v) { rep(j, sz(v)) is >> v[j]; return is; }
template<class T> inline void add(T &a, int b) { a += b; if (a >= mod) a -= mod; }


void solve();

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cout << fixed << setprecision(10);

  int T;
  // cin >> T;
  T = 1;

  while (T--) {
    solve();
  }
}

void solve() {
  int a, b, c;
  cin >> a >> b >> c;
  cout << c << " " << a << " " << b << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include<cmath>
using namespace std;
int main(void){
    
   long int n,k,x[110],ans=0;;
   cin>>n>>k;
   for(int i=0;i<n;i++)cin>>x[i];
   for(int i=0;i<n;i++){
       ans+=min(x[i]*2,abs(k-x[i])*2);
    }
    cout<<ans<<endl;
   return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int maxx = 1e5 + 7;
map <int, int> mp;
map <int, bool> vis;
int n;
int a[maxx];
int ans;

int main() {
	mp.clear();
	vis.clear();
	scanf("%d", &n);
	for(int i = 1; i <= n; i++) {
		scanf("%d", &a[i]);
		mp[a[i]]++;
	}
	for(int i = 1; i <= n; i++) {
		if(vis[a[i]]) continue;
		if(mp[a[i]] < a[i]) {
			ans += mp[a[i]];
			vis[a[i]] = 1;
		}
		else {
			ans += mp[a[i]] - a[i];
			vis[a[i]] = 1;
		}
	}
	printf("%d\n", ans);
}

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

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> ii;
typedef tuple<ll, ll, ll> iii;
typedef vector<ll> vi;
typedef vector<ii> vii;
typedef vector<iii> viii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
#define REP(i,n) for (ll i = 0; i < n; ++i)
#define REPR(i,n) for (ll i = n-1; i >= 0; --i)
#define FOR(i,m,n) for (ll i = m; i < n; ++i)
#define FORR(i,m,n) for (ll i = n-1; i >= m; --i)
#define FORE(x,xs) for (const auto& x : xs)
#define FORI(i,v) for (auto i = v.begin(); i != v.end(); i++)
#define ALL(v) v.begin(), v.end()
#define CHMIN(x,y) x = min(x, y)
#define CHMAX(x,y) x = max(x, y)
#define YES(b) cout << ((b) ? "YES" : "NO") << endl
#define Yes(b) cout << ((b) ? "Yes" : "No") << endl

const int MAX = 1e5+10;

int N, M;
vi adj[MAX];

void solve() {
    cout << "Yes" << endl;
    vi parent(N, -1);
    parent[0] = 0;
    queue<int> q;
    q.push(0);
    while (!q.empty()) {
        int n = q.front(); q.pop();
        FORE (x, adj[n]) if (parent[x] == -1) {
            parent[x] = n;
            q.push(x);
        }
    }
    FOR (i, 1, N) cout << parent[i]+1 << endl;
}

int main() {
    cout << fixed << setprecision(15);
    cin >> N >> M;
    REP (i, M) {
        int a, b;
        cin >> a >> b; a--; b--;
        adj[a].push_back(b);
        adj[b].push_back(a);
    }
    solve();
}

Measured memory_bytes: 12592
#include <iostream>

using namespace std;

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

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

#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 ALL(obj) (obj).begin(), (obj).end()
#define INF 1e9
typedef long long ll;


int main() {
    vector<vector<int>> c(3, vector<int>(3));
    REP(i,3){
        REP(j,3){
            cin >> c[i][j];
        }
    }
    if(c[0][0]-c[0][1]==c[1][0]-c[1][1] && c[0][0]-c[0][1]==c[2][0]-c[2][1]){
        if(c[0][1]-c[0][2]==c[1][1]-c[1][2] && c[0][1]-c[0][2]==c[2][1]-c[2][2]){
            if(c[0][0]-c[1][0]==c[0][1]-c[1][1] && c[0][0]-c[1][0]==c[0][2]-c[1][2]){
                if(c[1][0]-c[2][0]==c[1][1]-c[2][1] && c[1][0]-c[2][0]==c[1][2]-c[2][2]){
                    cout << "Yes" << endl;
                    return 0;
                }
            }
        }
    }
    cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 3608
N,M,L = map(int,input().split())

A = [list(map(int,input().split())) for i in range(N)] #N*M配列の取得
B = [list(map(int,input().split())) for i in range(M)] #M*L配列の取得
ANS = [[0]*L for i in range(N)] #N*L


for x in range(N):
    for y in range(L):
        for z in range(M):
            ANS[x][y] += B[z][y]*A[x][z]

for row in range(N):
    print("%d"%ANS[row][0],end = "")
    for col in range(1,L):
        print(" %d"%(ANS[row][col]),end = "")
    print()




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

int main() {
	int n, h, ma = 0, ans = 0;
	cin >> n;
	for (int i = 0; i < n; ++i) {
		cin >> h;
		if (ma <= h) ma = h;
		else if (ma > h && i != n - 1) {
			ans += ma - h;
			ma = h;
		}
	}
	ans += ma;
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int main()
{
    int a,b,k;

    cin>>k>>a>>b;

    for (int i=a; i<=b; ++i)
    {
        if (i%k==0)
        {
            cout<<"OK";
            return 0;
        }
    }
    cout<<"NG";







}


Measured memory_bytes: 3644
#include<stdio.h>

int main()
{
 int N;
 int K;
 long x[100005];
 long dist;
 long mindist=200000005;
 long distp;
 long distm;
 int i;

 scanf("%d %d",&N,&K);
 for(i=0;i<N;i++) scanf("%ld",&x[i]);
 mindist=2*(x[N-1]-x[0]);

 for(i=0;i<N-K+1;i++)
 {
  distp=abs(x[i+K-1])+abs(x[i+K-1]-x[i]);
  distm=abs(x[i+K-1]-x[i]) + abs(x[i]);
  if(distp<distm)
  {
   dist=distp;
  }else{
   dist=distm;
  }
  if(mindist>dist) mindist=dist;
 }
 printf("%ld\n",mindist);
 return 0;
}

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

int main(){
  long long n, t;
  cin>>n >>t;
  long long x=t;
  vector<long long> s(n);
  for(int i=0;i<n;i++)cin>>s[i];
  
  for(int i=0;i<n-1;i++){
    x+=min(s[i+1]-s[i], t);
  }
  
  cout<<x<<endl;
  return 0;
}

Measured memory_bytes: 1792
l = [int(input()) for x in range(5)]
l_kiriage = []

for i in l:
    while i%10!=0:
        i += 1
    l_kiriage.append(i)

l_sa = [l_kiriage[x]-l[x] for x in range(5)]

print(sum(l_kiriage) - max(l_sa))

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

inline long long read(){
    long long s = 0, w = 1;
    char ch = getchar();
    while (ch < '0' || ch > '9'){
        if (ch == '-') w = -1;
        ch = getchar();
    }
    while (ch >= '0' && ch <= '9'){
        s = s * 10 + ch - '0';
        ch = getchar();
    }
    return s * w;
}
unsigned long long d;
long long n, ans, x, y;
int main(){
    n = read(), d = read();
    d = d * d;
    for (int i = 1; i <= n; i++){
        x = read(), y = read();
        unsigned long long a = x * x + y * y;
        if (d >= a)
            ans++;
    }
    printf("%lld\n", ans);
    return 0;
}

Measured memory_bytes: 3764
s=input()
a=sorted(set(s))
E="abcdefghijklmnopqrstuvwxyz"
if len(set(a))==26:
  print("None")
else:
  count=0
  for i in range(len(a)):
    if a[i]==E[i]:
      count+=1
    else:
      break
  print(E[count])

Measured memory_bytes: 3188
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
typedef vector<long long> vlong;
#define vpush(a,x) a.push_back(x);
#define rep(i, n) REP(i, 0, n)
#define all(v) v.begin(), v.end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define INF 2e9
signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
 	int n;
  cin>>n;
  REP(i,1,1000000){
    if((int)(i*1.08)==n){
      cout<<i<<'\n';
      return(0);
    }
  }
  cout<<":("<<'\n';
    return(0);
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
using namespace std;
int main(){
	char ch[26],some;
	int count=0,cha[26],ans=0,ans2=0;
	string s;
	cin>>s;
	some='a';
	for(int i=0;i<26;i++){
		cha[i]=0;
		ch[i]=some;
		some++;
	}
	for(int i=0;i<s.size();i++){
		for(int j=0;j<26;j++){
			if(ch[j]==s[i]){
				cha[j]++;
			}
		}
	}
	for(int i=0;i<26;i++){
		if(cha[i]!=0 && cha[i]%2==0){
			ans=ans+cha[i];
		}
		else if(cha[i]!=0 && cha[i]%2!=0){
			ans2=ans+cha[i];
		}
	}
	if(ans>0 && (ans+ans2)%2==0){
		cout<<"Yes"<<endl;
	}
	else{
		cout<<"No"<<endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N=1e5+50;
int gi(){
    char ch=getchar(); int x=0,q=0;
    while(ch<'0'||ch>'9') q=ch=='-'?1:q,ch=getchar();
    while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
    return q?-x:x;
}
#define l(a,b) (l){a,b}
#define r(a,b) (r){a,b}
struct l{
    int x,y;
    bool operator < (const l &c)const{
	if (x!=c.x) return x>c.x;
	return y<c.y;
    }
}f[N];
struct r{
    int x,y;
    bool operator < (const r &c)const{
	if (y!=c.y) return y<c.y;
	return x<c.x;
    }
}g[N];
multiset<l>L;
multiset<l>::iterator lt;
multiset<r>R;
multiset<r>::iterator rt;
int n;
ll calc(int t){
    int las=0; ll ans=0;
    for (int i=1; i<=n; ++i)
	L.insert(f[i]),R.insert(g[i]);
    for (int i=1; i<=n; ++i){
	if (t){
	    lt=L.begin();
	    if (lt->x-las>0)
		ans+=lt->x-las,las=lt->x;
	    R.erase(R.find(r(lt->x,lt->y))),L.erase(lt);
	}
	else{
	    rt=R.begin();
	    if (las-rt->y>0)
		ans+=las-rt->y,las=rt->y;
	    L.erase(L.find(l(rt->x,rt->y))),R.erase(rt);
	}
	t^=1;
    }
    return ans+abs(las);
}
int main(){
    cin>>n; int x,y;
    for (int i=1; i<=n; ++i)
	x=gi(),y=gi(),f[i]=l(x,y),g[i]=r(x,y);
    ll ans=max(calc(0),calc(1));
    cout<<ans;
    return 0;
}


Measured memory_bytes: 11264
// ConsoleApplication73.cpp : 此文件包含 "main" 函数。程序执行将在此处开始并结束。
//

#include<algorithm>
#include<iomanip>
#include<iostream>
#include<cstring>
#include<string>
#include<cmath>
#include<set>
using namespace std;
int a[100500];
int main()
{
    int n, m,l,r,lala=0;
    cin >> n >> m;
    int min = 0, max=200000;

    for (int i = 0; i < m; i++)
    {
        cin >> l >> r;
        if (l >min)
            min = l;
        if (r < max)
        {
            max=r;
        }
    }
    if (max < min)
    {
        lala = 0;
    }
    else
    {
        if (max < n)
        {
            lala = max - min+1;
        }
        else if (max >= n && min <= n)
        {
            lala = n - min + 1;
        }
        else if (max >= n && min > n)
        {
            lala = 0;
        }
    }
    cout << lala << "\n";

}


Measured memory_bytes: 256
# encoding:utf-8
import copy
import random
import bisect #bisect_left　これで二部探索の大小検索が行える
import fractions #最小公倍数などはこっち
import math
import sys
import bisect

mod = 10**9+7
sys.setrecursionlimit(mod) # 再帰回数上限はでdefault1000

def LI(): return list(map(int, sys.stdin.readline().split()))

C = str(input())
alpha = "abcdefghijklmnopqrstuvwxyz"
print(alpha[alpha.find(C) + 1])


Measured memory_bytes: 6980
from collections import deque
import sys


def bfs(xs, ys, d):
    queue = deque()
    queue.append((xs, ys, d))
    M[xs][ys] = d
    while queue:
        # queueには訪れた地点が入っている。そこから、4方向に移動できるか考え、queueから消す。
        x1, y1, d = queue.popleft()  # queueに入っていたものを消す。
        if [x1, y1] == [xg, yg]:  # もしゴールについていたならば、そのときの手数を出す。
            return

        for dx, dy in ((1, 0), (-1, 0), (0, 1), (0, -1)):
            for k in range(1, K + 1):
                x2 = x1 + dx * k
                y2 = y1 + dy * k

                if (0 <= x2 < H) and (0 <= y2 < W):
                    if m[x2][y2] == "@":
                        break
                    elif M[x2][y2] == -1:  # まだ来たことない点だったという条件
                        M[x2][y2] = d + 1
                        queue.append((x2, y2, d + 1))  # 新しい点を足す。
                    elif M[x2][y2] < d + 1:
                        break
                else:
                    break


H, W, K = map(int, input().split())
# K = min(K, max(H, W))
xs, ys, xg, yg = map(int, input().split())
xs, ys, xg, yg = xs - 1, ys - 1, xg - 1, yg - 1

m = []
for i in range(H):
    m.append(list(map(str, sys.stdin.readline().strip())))

M = [[-1] * W for i in range(H)]

bfs(xs, ys, 0)

print(M[xg][yg])


Measured memory_bytes: 44976
main = do
  li <- getLine
  let n = read li
  li <- getLine
  let as = map read $ words li
  let ans = compute n as
  print ans

{-
整数列に対して、似た整数列は、それぞれの要素が-1,+-0,+1の3バリエーションがある。
長さNならば、全部で3^N個ある。
積は、全てが奇数のとき奇数、どれか一つでも偶数があると偶数になる。
aiが奇数のとき、奇数はそれだけ。1つ。aiが偶数のとき、a-1とa+1が奇数。可能性2つ。
それの積が、奇数な似た整数列の個数。これを引けばよい。
-}

compute :: Int -> [Int] -> Int
compute n as = 3^n - product (map f as)

f n
  | even n = 2
  | True   = 1


Measured memory_bytes: 508
package main

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

var sc = bufio.NewScanner(os.Stdin)

func scanInt() int {
	sc.Scan()
	a, err := strconv.Atoi(sc.Text())
	if err != nil {
		f.Println(err)
	}
	return a
}

func scanSlice(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = scanInt()
	}
	return a
}

func main() {

	sc.Split(bufio.ScanWords)

	var hp, n int
	f.Scan(&hp, &n)

	skill_powers := scanSlice(n)
	sort.Ints(skill_powers)

	damage := 0

	for i := 0; i < n; i++ {
		damage += skill_powers[len(skill_powers)-1-i]
		num := i
		if damage >= hp {
			f.Println("Yes")
			break
		} else if num == n-1 && damage < hp {
			f.Println("No")
			break
		}
	}

}


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


Measured memory_bytes: 9984
#include <iostream>

using namespace std;

bool kt(int x)
{
  for(int i=3; i*i<=x; ++i)
    if (x%i==0) return false;
  return true;
}

int main()
{
  int n;
  cin >> n;
  if (n==2) cout << n; else
  {
  	if (n%2==0) n++;
 	while (!kt(n))
  	n+=2;
    cout << n;
  }
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define sync ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define MOD  1000000007 
int powm(int base,int exp,int mod=MOD) {int ans=1;while(exp){if(exp&1) ans=(ans*base)%mod;exp>>=1,base=(base*base)%mod;}return ans;}
int32_t main()
{
	sync
	int n;
	cin>>n;
	int ans = 0;
	int k=10;
	if(n%2!=0)
		cout<<"0"<<endl;
	else
	{
		while(k<=n)
		{
			ans+=n/k;
			k*=5;
		}
		cout<<ans<<endl;
	}
}

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

int main() {
	int a = 0, b = 0 , sum, product, reminder;
	cin >> a >> b;
	sum = a + b;
	product = a * b;
	reminder = a - b;
	if (sum > product) {
		if (sum > reminder) {
			cout << sum << endl;
		}
		else {
			cout << reminder << endl;
		}
	}
	else if (product > reminder) {
		cout << product << endl;
	}
	else{
		cout << reminder << endl;
	}
	return 0;
}

Measured memory_bytes: 256
n, a, b = map(int, input().split())
p = 10**9+7
m = max(a,b)
A = [1] + [None] * m
invA = [None] * (m+1)

for i in range(1,m+1):
  A[i] = i * A[i-1] % p

invA[m] = pow(A[m], p-2, p)
for i in range(m):
  invA[m-i-1] = invA[m-i] * (m-i) % p

# n!/(n-a)!は個別に計算しよう幸いa,bの2計算すればいいので
na = 1
for i in range(a):
  na *= n-i
  na %= p
  
nb = 1
for i in range(b):
  nb *= n-i
  nb %= p

ca = na * invA[a] % p
cb = nb * invA[b] % p
ans = (pow(2,n,p) - 1 - ca - cb) % p
print(ans)

Measured memory_bytes: 18776
fun main(args: Array<String>) {
    var (N, K) = listOfInt()
    val A = mutableListOf<Int>()
    A.addAll(listOf(0, K))
    listOfInt().forEach { a -> if (a < K) A.add(a) }
    A.sort(); N = A.size
    var l = 0
    var r = N + 1
    while (Math.abs(r - l) > 1 ) {
        val mid = (l + r) / 2
        val dp = BooleanArray(K + 1)
        dp[0] = true
        for (j in 0 until N) {
            if (j == mid) continue
            for (k in K downTo A[j]){
                dp[k] = dp[k] or dp[k - A[j]]
            }
        }
        var need = false
        for (k in K - A[mid] until K) need = need or dp[k]
        if (!need) l = mid else r = mid
    }
    println(l)
}

fun next() = readLine()!!
fun nextInt(delta: Int = 0) = Integer.parseInt(next()) + delta
fun nextLong() = next().toLong()
fun listOfString() = next().split(" ")
fun listOfInt() = listOfString().map(String::toInt)
fun listOfLong() = listOfString().map(String::toLong)


Measured memory_bytes: 41856
#print#!/usr/bin/env python3
#%% for atcoder uniittest use
import sys
input= lambda: sys.stdin.readline().rstrip()
sys.setrecursionlimit(10**9)
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
def lispin(t=int):return list(pin(t))
#%%code
def resolve():
    N,=pin()
    A=[i-1 for i in pin()]
    cnt=0
    for j in range(N):
        if A[A[j]]==j:cnt+=1
    print(cnt//2)
    
#%%submit!
resolve()


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

using ll = long long;
using ull = unsigned long long;
using ld = long double;

#define REP(i,n) for(int i=0; i<int(n); i++)
#define REREP(i,n) for(int i=int(n-1); i>=0; i--)
#define FOR(i,m,n) for(int i=int(m); i<int(n); i++)
#define REFOR(i,m,n) for(int i=int(n-1); i>=int(m); i--)
#define ALL(obj) (obj).begin(),(obj).end()
 
#define VI vector<int>
#define VVI vector<vector<int>>
#define VVVI vector<vector<vector<int>>>
#define VD vector<double>
#define VVD vector<vector<double>>
#define VVVD vector<vector<vector<double>>>
#define VL vector<ll>
#define VVL vector<vector<ll>>
#define VVVL vector<vector<vector<ll>>>
#define VB vector<bool>
#define VVB vector<vector<bool>>
#define VVVB vector<vector<vector<bool>>>
#define VS vector<string>
#define VVS vector<vector<string>>
#define VVVS vector<vector<vector<string>>>
 
#define PII pair<int,int>
#define PDD pair<double,double>
#define PLL pair<ll,ll>
#define VPII vector<pair<int,int>>
#define VVPII vector<vector<pair<int,int>>>
#define VVVPII vector<vector<vector<pair<int,int>>>>
#define VPLL vector<pair<ll,ll>>
#define VVPLL vector<vector<pair<ll,ll>>>
#define VVVPLL vector<vector<vector<pair<ll,ll>>>>
 
#define SUMI(obj) accumulate((obj).begin(), (obj).end(), 0)
#define SUMD(obj) accumulate((obj).begin(), (obj).end(), 0.)
#define SUML(obj) accumulate((obj).begin(), (obj).end(), 0LL)
#define SORT(obj) sort((obj).begin(), (obj).end()) // 1,2,3,4,5...
#define RESORT(obj) sort((obj).begin(), (obj).end(), greater<int>()) // 5,4,3,2,1...
#define UB(obj,n) upper_bound((obj).begin(), (obj).end(), n) //itr > n
#define LB(obj,n) lower_bound((obj).begin(), (obj).end(), n) //itr>= n

#define PB push_back
#define Cout(str) cout << str << endl

const ll MOD = (ll)1e9 + 7;
const ll HINF = (ll)1e18;
const ll LINF = (ll)1e9;
const ll EPS = (ll)1e-8;

int main(){
	int n,m;
	int a,b,c,d;
	int sum;
	string str;
	string s,t;
	char ch;
	VI vi;
	vector<char> vc;
	VS vs;
	int reserve_vi = 100;
	map<int, int> table; 
	string str2, str3;
	map<char, string> vowel;
	vector<char> vowel_vec = {'a', 'e', 'i', 'o', 'u'};

	//cin >> n >> m;
	//cin >> a >> b;
	//cin >> a >> b >> c;
	//cin >> a >> b >> c >> d;
	//cin >> str;
	//cin >> str >> str2 >> str3;
	//cin >> n;
	
	cin >> s >> t;
	//cin >> ch;
	//cin >> a >> ch >> b;
	

	if(s == t)Cout("H");
	else Cout("D");
	//cout << accumulate(vi.begin(), vi.begin()+n, 0) << endl;
	//replace(ALL(str), ',', ' ');

	//swap(a, b);
	//vi.resize(N);
	//fill(vi.begin(), vi.end(), 1);
	//vi.reserve(reserve_vi);
	//vi.PB(n);

	//vc.resize(5);
	//vc[i] = (str[i]);

	//sort(vc.begin(), vc.end(), greater<char>());
	//sort(vc.begin(), vc.end());

	//for(auto itr = table.begin(); itr != table.end(); ++itr) {
	return 0;
}



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

using namespace std;

int main() {
    size_t a, b, c;
    cin >> a >> b >> c;
    if (a == b && a != c || a == c && b != c || b == c && a != b)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
    return 0;
}



Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
    int b=0,n,i,minj,j,minv,swap;
    int a[100];
    cin>>n;
    for(i=0;i<n;i++){
        cin>>a[i];
    }
    if(n>1){
        for(i=0;i<n-1;i++){
            minv=a[i+1];
            minj=i+1;
            for(j=i+1;j<n;j++){
                if(minv>a[j]){
                    minv=a[j];
                    minj=j;
                }
            }
            if(minv<a[i]){
                swap=a[i];
                a[i]=a[minj];
                a[minj]=swap;
                b++;
            }
            /*for(int k=0;k<n-1;k++){
                cout<<a[k]<<" "<<flush;
            }
            cout<<a[n-1]<<endl;*/
        }
    }
    else{
        cout<<a[0]<<endl;
        cout<<0<<endl;
        return 0;
    }
    for(i=0;i<n-1;i++){
        cout<<a[i]<<" "<<flush;
    }
    cout<<a[n-1]<<endl;
    cout<<b<<endl;
    return 0;
}

Measured memory_bytes: 3092
#include <iostream>
using namespace std;
int ans = 0;
void test(int n, int m, int k[], int s[][11], int p[], int x, bool used[])
{
    if(x == n)
    {
        bool correct = true;
        for(int i = 0; i < m; i++)
        {
            int sub = 0;
            for(int j = 0; j < k[i]; j++)
            {
                if(used[s[i][j] - 1])
                {
                    sub++;
                }
            }
            if(sub % 2 != p[i])
            {
                correct = false;
                break;
            }
        }
        if(correct)
        {
            ans++;
        }
        return;
    }
    x++;
    test(n, m, k, s, p, x, used);
    x--;
    used[x] = true;
    x++;
    test(n, m, k, s, p, x, used);
    x--;
    used[x] = false;
}
int main()
{
    int n, m;
    cin >> n >> m;
    bool used[n];
    for(int i = 0; i < n; i++)
    {
        used[i] = false;
    }
    int k[m], s[11][11], p[m];
    for(int i = 0; i < m; i++)
    {
        cin >> k[i];
        for(int j = 0; j < k[i]; j++)
        {
            cin >> s[i][j];
        }
    }
    for(int i = 0; i < m; i++)
    {
        cin >> p[i];
    }
    test(n, m, k, s, p, 0, used);
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3632
#!/usr/bin/env python3
import sys
import numpy as np


def solve(N: int, K: int, p: "List[int]"):
    pp = sorted(p)
    ans = sum(pp[:K])
    print(ans)
    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    p = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, K, p)

if __name__ == '__main__':
    main()


Measured memory_bytes: 27212
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int X = sc.nextInt();
        int Y = sc.nextInt();
        sc.close();

        Map<Integer, Integer> numCntMap = new HashMap<>();
        for (int i = 1; i < N; i++) {
            numCntMap.put(i, 0);
        }

        for (int i = 1; i < N; i++) {
            for (int j = 2; j <= N; j++) {
                if (i >= j) {
                    continue;
                }
                int distance = getMinDistance(i, j, X, Y);
                Integer cnt = numCntMap.get(distance);
                if (Objects.isNull(cnt)) {
                    numCntMap.put(distance, 1);
                } else {
                    cnt += 1;
                    numCntMap.put(distance, cnt);
                }
            }
        }

        for (int i = 1; i < N; i++) {
            System.out.println(numCntMap.get(i));
        }

        System.out.println();
    }

    public static int getMinDistance(int i, int j, int X, int Y) {
        return Math.min(Math.abs(j - i),
                Math.min(Math.abs(X - i) + 1 + Math.abs(j - Y), Math.abs(Y - i) + 1 + Math.abs(j - X)));
    }

}


Measured memory_bytes: 51076
#include <iostream>
#include <queue>
using namespace std;
#define rep(i, n)for(int i=0; i<n; i++)

int main(){
  string Sa, Sb, Sc;
  cin >> Sa >> Sb >> Sc;
  
  queue<char> game[3];
  rep(i, Sa.size() )
    game[0].push(Sa[i]);
  rep(i, Sb.size() )
    game[1].push(Sb[i]);
  rep(i, Sc.size() )
    game[2].push(Sc[i]);

  int now = 0; char next_p;
  while(1){
    if(game[now].empty() == 1)
      break;
    next_p = game[now].front();
    game[now].pop();
    if(next_p == 'a')
      now = 0;
    else if(next_p == 'b')
      now = 1;
    else if(next_p == 'c')
      now = 2;
  }
  
  cout << (char)(now+'A') <<endl;
  
  return 0;
}


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

void Main() {
  long long A;
  string B;
  cin >> A >> B;
  int b = 0;
  b += (B[0] - '0') * 100;
  b += (B[2] - '0') * 10;
  b += (B[3] - '0');


  cout << ((A * b) / 100) << endl;
}

int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(15);
  Main();
  return 0;
}



Measured memory_bytes: 3664
#include<bits/stdc++.h>
using namespace std;
int main (){
  string s,t;cin>>s;cin>>t;
  for(int i=0;i<s.size();i++) {
    if(s[i]!=t[i]){
      cout<<"No";
      return 0;
    }
  }
  cout<<"Yes";
}

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

using namespace std;

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

#define MAX 100000
#define INF (1ll<<60)

struct edge{
	int to;
	ll cost;
};

int n, m;
vector<edge> yen[MAX+1], snk[MAX+1];
ll cost_y[MAX+1], cost_s[MAX+1];

void dijkstra(int s, vector<edge> g[], ll d[]){
	priority_queue<pr, vector<pr>, greater<pr>> que;
	fill(d, d+n+1, INF);
	d[s]=0;
	que.push(pr(0, s));

	while(!que.empty()){
		pr p=que.top();
		que.pop();
		int v=p.second;
		if(d[v]<p.first) continue;
		for(int i=0; i<g[v].size(); i++){
			edge e=g[v][i];
			if(d[e.to]>d[v]+e.cost){
				d[e.to]=d[v]+e.cost;
				que.push(pr(d[e.to], e.to));
			}
		}
	}
	return;
}

int main(){
	int s, t;
	cin >> n >> m >> s >> t;
	for(int i=0; i<m; i++){
		int u, v;
		ll a, b;
		cin >> u >> v >> a >> b;
		yen[u].push_back(edge{v, a});
		yen[v].push_back(edge{u, a});
		snk[u].push_back(edge{v, b});
		snk[v].push_back(edge{u, b});
	}

	dijkstra(s, yen, cost_y);
	dijkstra(t, snk, cost_s);

	vector<ll> ans(n+1);
	ll m_cost=INF;
	for(int i=n; i>0; i--){
		m_cost=min(m_cost, cost_y[i]+cost_s[i]);
		ans[i]=m_cost;
	}
	for(int i=1; i<=n; i++) cout << 1000000000000000-ans[i] << endl;
	return 0;
}

Measured memory_bytes: 19140
N = int(input())
S = input()
Edirect = [0]
numE = 0
ans = N

for i in range(N):
    if S[i] == "E":
        numE += 1
    Edirect.append(numE)

for i in range(1, N+1):
    tmp = ((i-1)-Edirect[i-1]) + (Edirect[N]-Edirect[i])
    if tmp < ans:
        ans = tmp

print(ans)

Measured memory_bytes: 15388
integer N,A
integer,allocatable,dimension(:)::X
integer(16),allocatable,dimension(:,:,:)::DP
integer(16) ans
read*,N,A
allocate(X(N))
read*,X
allocate(DP(0:N,0:N,0:50*N))
DP=0
DP(0,0,0)=1
do i=1,N
  do j=0,i
    do k=0,50*i
      if(k<x(i).or.j==0)then
        DP(i,j,k)=DP(i-1,j,k)
      else
        DP(i,j,k)=DP(i-1,j,k)+DP(i-1,j-1,k-x(i))
      end if
    end do
  end do
end do

ans=0
do i=1,N
  ans=ans+DP(N,i,i*A)
end do

print"(i0)",ans

end

Measured memory_bytes: 101888
n,m=map(int, input().split())
a=[list(map(int, input().split())) for i in range(m)]
a.sort()
end=n
ans=0
for i in range(m):
    if a[i][0]>=end:
        ans+=1
        end=n
    end=min(a[i][1],end)
print(ans+1)

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

int main() {
  
  int N, A, B, x;
  cin >> N >> A >> B;
  
  x = N * A;
  if (x < B) {
    cout << x << endl;
  }
  else if (x > B) {
    cout << B << endl;
  }
  else if (x == B) {
    cout << x << endl;
  }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
template<class T> inline bool chmin(T&a, T b){if(a > b){a = b; return true;}else{return false;}}
template<class T> inline bool chmax(T&a, T b){if(a < b){a = b; return true;}else{return false;}}
#define ll long long
#define double long double
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
#define mod (ll)(1e9+7)
#define inf (ll)(3e18+7)
#define pi (double) acos(-1.0)
#define P pair<int,int>
#define PiP pair<int,pair<int,int>>
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
using namespace std;

int d, score;
vector<int> c(26);
vector<vector<int>> s(400, vector<int>(26)), pos(26);

int get_score(vector<int> t){
    int ans = 0;
    vector<int> last(26, 0);
    rep(i, t.size()){
        ans += s[i][t[i]];
        rep(j, 26){
            if(t[i] == j)last[j] = i+1;
            ans -= c[j] * ((i+1)-last[j]);
        }
    }
    return ans;
}

int main() {
    cin >> d;
    rep(i, 26)cin >> c[i];
    rep(i, d)rep(j, 26)cin >> s[i][j];
    //-----code------// 
    vector<int> t, pos(26, 0);
    rep(i, d){
        int max_score = -mod;
        int best_j = -1;
        rep(j, 26){
            t.push_back(j);
            int score = get_score(t);
            if(max_score < score){
                best_j = j;
                max_score = score;
            }
            t.pop_back();
        }
        t.push_back(best_j);
    }
    /*while(clock() < 1950000){
        int D = rand() % d, q = rand() % 26;
        int old = t[D], olds = get_score(t);
        t[D] = q;
        if(get_score(t) < olds)t[D] = old;
    }*/
    rep(i, d)cout << t[i]+1 << endl;
}


Measured memory_bytes: 3704
def main():
    s = input()
    for i in range(-1, -len(s) - 1, -1):
        now = s[:i]
        if len(now) % 2:
            continue
        else:
            if now[:len(now) // 2] == now[len(now) // 2:]:
                print(len(now))
                break


if __name__ == '__main__':
    main()



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

int main()
{
  int n ; 
  cin >> n ;
  std::vector<int64_t> data(n) ;
  for(int i = 0 ; i < n ; i++)
  {
    cin >> data.at(i) ;
  }
  sort(data.begin(), data.end()) ;

  int answer = 0 ;
  int count = 1;
  for(int i = 0 ; i < n ; i++)
  {
    if(i == n - 1)
    {
      if(count % 2 == 0)
      {
        break ;
      }
      else
      {
        answer++ ;
        break ;
      }
      
    }

    if(data.at(i) == data.at(i + 1))
    {
      count++ ;
      continue ;
    }

    if(data.at(i) != data.at(i + 1))
    {
      if(count % 2 == 0)
      {
        count = 1 ;
      }
      else
      {
        answer++ ;
        count = 1 ;
      }
    }
  }

  cout << answer << endl ;
}


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

using namespace std;
using ll = long long;

namespace mod {

template <class T, int M>
class MInt;

template <class T, int M>
MInt<T, M> Pow(const MInt<T, M> &base, T exp);

template <class T, int M>
MInt<T, M> Inv(const MInt<T, M> &n);

template <class T, int M>
class MInt {
  T n_;

 public:
  MInt() : n_(0) {}
  MInt(T n) : n_((n % M + M) % M) {}

  MInt &operator+=(const MInt &rhs) {
    n_ += rhs.n_;
    if (n_ >= M) {
      n_ -= M;
    }

    return *this;
  }

  MInt &operator-=(const MInt &rhs) {
    n_ += M - rhs.n_;
    if (n_ >= M) {
      n_ -= M;
    }

    return *this;
  }

  MInt &operator*=(const MInt &rhs) {
    n_ = n_ * rhs.n_ % M;
    return *this;
  }

  MInt &operator/=(const MInt &rhs) { return (*this) *= Inv(rhs); }

  T Get() { return n_; }
};

template <class T, int M>
MInt<T, M> operator-(const MInt<T, M> &lhs, const MInt<T, M> &rhs) {
  MInt<T, M> res(lhs);
  return res -= rhs;
}

template <class T, int M>
MInt<T, M> operator+(const MInt<T, M> &lhs, const MInt<T, M> &rhs) {
  MInt<T, M> res(lhs);
  return res += rhs;
}

template <class T, int M>
MInt<T, M> operator*(const MInt<T, M> &lhs, const MInt<T, M> &rhs) {
  MInt<T, M> res(lhs);
  return res *= rhs;
}

template <class T, int M>
MInt<T, M> operator/(const MInt<T, M> &lhs, const MInt<T, M> &rhs) {
  MInt<T, M> res(lhs);
  return res /= rhs;
}

template <class T, int M>
MInt<T, M> Pow(const MInt<T, M> &base, T exp) {
  if (exp == 0) {
    return 1;
  }

  auto a = Pow(base, exp / 2);
  a *= a;
  if (exp % 2 == 1) {
    a *= base;
  }

  return a;
}

template <class T, int M>
MInt<T, M> Inv(const MInt<T, M> &n) {
  return Pow(n, static_cast<T>(M - 2));
}
}  // namespace mod

const int md = 1e9 + 7;
using MInt = mod::MInt<long long, md>;

int main(int argc, const char *argv[]) {
  ll n, m;
  cin >> n >> m;

  vector<ll> vx(n), vy(m);
  for (int i = 0; i < n; ++i) {
    cin >> vx[i];
  }

  for (int i = 0; i < m; ++i) {
    cin >> vy[i];
  }

  MInt s1(0), s2(0);
  for (int i = 0; i < n - 1; ++i) {
    s1 += MInt(i + 1) * MInt(n - i - 1) * MInt(vx[i + 1] - vx[i]);
  }

  for (int i = 0; i < m - 1; ++i) {
    s2 += MInt(i + 1) * MInt(m - i - 1) * MInt(vy[i + 1] - vy[i]);
  }

  cout << (s1 * s2).Get() << '\n';

  return 0;
}

Measured memory_bytes: 4792