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

using namespace std;
#define all(a)a.begin(),a.end()
using ll=long long;
const int INF = 1<<30;
const ll INFll =1LL<<62;
const int mod= int(1e9)+7;
using P = pair<ll,ll>;
using ld=long double;

int main(){
    int a,b,x;cin >>a>>b>>x;
    x-=a;
    bool flg=true;
    if(x<0)flg=false;
    if(x>b)flg=false;
    if(flg)puts("YES");
    else puts("NO");
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (int)n; i++)
#define ALL(a) (a).begin(), (a).end()
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))
const ll mod = 1e9 + 7;

int main()
{
    string s;
    cin >> s;
    int ans = INT_MAX;
    int w = 0;
    rep(i, s.length() - 1)
    {
        if (s[i] == s[i + 1])
            w++;
    }
    if (w == s.length() - 1)
    {
        cout << 0 << endl;
        return 0;
    }
    for (char c = 'a'; c <= 'z'; c++)
    {
        int count = 0;
        string str = s;
        while (true)
        {
            char t[str.length() - 1];
            rep(i, ARRAY_LENGTH(t))
            {
                if (str[i] == c || str[i + 1] == c)
                    t[i] = c;
                else
                    t[i] = str[i];
            }
            count++;
            int cnt = 0;
            rep(i, ARRAY_LENGTH(t))
            {
                if (t[i] == c)
                    cnt++;
            }
            if (cnt == ARRAY_LENGTH(t))
            {
                ans = min(ans, count);
                break;
            }
            string strx = "";
            rep(i, ARRAY_LENGTH(t))
            {
                strx += t[i];
            }
            str = strx;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <functional>
#include <queue>
#include <set>
#include <map>
#include <numeric>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cctype>

#define rep(i, a) REP(i, 0, a)
#define REP(i, a, b) for(int i = a; i < b; ++i)
#define repll(i, a) REPLL(i, 0, a)
#define REPLL(i, a, b) for(ll i = a; i < b; ++i)

typedef long long ll;
typedef unsigned long long ull;
typedef std::pair<int, int> P;
typedef std::pair<P, int> PP;
const double PI = 3.14159265358979323846;
const double eps = 1e-9;
const int infi = (int)1e+9 + 10;
const ll infll = (ll)1e+17 + 10;

int n;
int a[101];

int main() {
	std::cin >> n;
	rep(i, n)std::cin >> a[i];

	int ans = infi;
	REP(i, -100, 101) {
		int sum = 0;
		rep(j, n) {
			sum += (a[j] - i) * (a[j] - i);
		}
		ans = std::min(ans, sum);
	}

	std::cout << ans << std::endl;

	return 0;
}

Measured memory_bytes: 256
use std::env;
use std::io::*;
use std::str::*;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let s = stdin.bytes().map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect::<String>();
    s.parse::<T>().ok().unwrap()
}

fn main() {
    // main の引数
    /*
        引数なしのときargs.len() = 1;
    */
    let args: Vec<String> = env::args().collect();

    let G1 = vec![1,3,5,7,8,10,12];
    let G2 = vec![4,6,9,11];
    let G3 = vec![2];


    let x = read::<i32>();
    let y = read::<i32>();
    let mut boolean = false;
    match (G1.iter().find(|&&f| f == x), G1.iter().find(|&&f| f == y)) {
        (Some(x), Some(y)) => boolean = true,
        _ => {},
    }
    match (G2.iter().find(|&&f| f == x), G2.iter().find(|&&f| f == y)) {
        (Some(x), Some(y)) => boolean = true,
        _ => {},
    }
    match (G3.iter().find(|&&f| f == x), G3.iter().find(|&&f| f == y)) {
        (Some(x), Some(y)) => boolean = true,
        _ => {},
    }
    if boolean {
        println!("Yes");
    }else {
        println!("No");
    }
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rrep(i, n) for (int i = (n); i >= 0; i--)
#define loop(i, r, n) for (int i = (r); i < (n); i++)
#define pb push_back
#define all(in) in.begin(),in.end()

template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }

using ll = long long;
using ull = unsigned long long;
using namespace std;

int main(){
    string s; cin >> s;
    int ans = 0;
    int count = 0;
    rep(i,3){
        if(s[i] == 'R') count++;
        else{
            chmax(ans,count);
            count = 0;
        }
    }
    chmax(ans,count);
    cout << ans << endl;
}

Measured memory_bytes: 3624
#pragma GCC optimize("Ofast")
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define PI 3.141592
#define MOD7 1000000007
#define LL_INF 9000000000000000000
#define LL_MINF -9000000000000000000
#define INT_INF 2000000000
#define INT_MINF -2000000000
#define all(a) (a).begin(), (a).end()
#define fi first
#define se second
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

int main(){
    ll L, R;
    cin >> L >> R;

    int min_n = 2020;
    if(R - L > 2020) min_n = 0;
    else{
        for(ll i = L; i < R; i++){
            for(ll j = i+1; j <= R; j++){
                min_n = min(min_n, int(i * j % 2019));
            }
        }
    }
    cout << min_n << endl;
}

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

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

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

fn main() {
    let sv = read_parameters::<String>().unwrap();
    let s: &str = &sv[0];
    let pv = read_parameters::<String>().unwrap();
    let p = &pv[0];

    let ring = s.repeat(2);
    if ring.contains(p) {
        println!("Yes");
    } else {
        println!("No");
    }
}



Measured memory_bytes: 5016
#include<bits/stdc++.h>
#define int long long

using namespace std;

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

    int n, mon[100001], her[100000];
    cin >> n;
    for (int i = 0; i <= n; i++)
        cin >> mon[i];
    for (int i = 0; i < n; i++)
        cin >> her[i];

    int cnt = 0, t;
    for (int i = 0; i < n; i++)
    {
        t = min(her[i], mon[i]);
        cnt += t;
        her[i] -= t;
        mon[i] -= t;

        t = min(her[i], mon[i + 1]);
        cnt += t;
        her[i] -= t;
        mon[i + 1] -= t;
    }
    cout << cnt << '\n';

    return 0;
}


Measured memory_bytes: 1792
#include<stdio.h>                                                 
                                                                  
int main(void){                                                   
   int N,R,K;                                                     
   scanf("%d %d",&N,&R);                                          
                                                                  
   if(N < 10){                                                    
      K = 100*(10 - N);                                           
      R += K;                                                     
   }                                                              
   printf("%d\n",R);                                              
   return 0;                                                      
} 

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

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

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define FOR(i,a,b) for(int i=(a); i<=(b); i++)
#define rep(i,n) for(int i = 0; i < (n); i++)
#define chmin(a,b) if((a)>(b)) (a)=(b);
#define chmax(a,b) if((a)<(b)) (a)=(b);
#define vi vector<int>
#define pii pair<int,int>
#define all(v) (v).begin(),(v).end()
#define allr(v) (v).rbegin(),(v).rend()
#define pb push_back
#define pf push_front
int gcd(int a,int b){/*a>=0,b>=0,￢(a=b=0)*/
  while(min(a,b)>0){if(a<b)swap(a,b);a%=b;}return max(a,b);
}
int dx[]={0,1,0,-1,1,-1,-1,1};
int dy[]={1,0,-1,0,1,1,-1,-1};
const int MOD = 1e9+7;
const int INF = 1e18+10;

/*----------------------------------------------*/
signed main(){
  int a,b;
  cin>>a>>b;
  if(b%a==0) cout<<a+b<<endl;
  else cout<<b-a<<endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define inf 1000000000
#define ll long long
using namespace std;
int main()
{
    int n,k,ans=0;
    scanf("%d%d",&n,&k);
    for(int i=1; i<=n; i++)
    {
        int x;
        scanf("%d",&x);
        if(x>=k)
            ans++;
    }
    printf("%d",ans);
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define rep(i,n) for(int i=0; i<(n); ++i)
#define per(i,n) for(int i=n-1;i>=0;++i)
#define rep1(i,n) for(int i=1; i<=n; ++i)
#define per1(i,n) for(int i=n; i>=1; ++i)
#define debug cout << "line : " << __LINE__ << " debug" << endl
#define Dcout(N) cout << setprecision(20) << N << endl
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() ) //被り削除
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define INF 1e8
#define MOD 1000000007
typedef long long ll;

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

      ll n; cin >> n;
      vector<ll> a(n+1);
      ll ans = 0;
      rep1(i,n){
            if(i%3==0 && i%5==0) a[i] = 0;
            else if(i%3==0) a[i] = 0;
            else if(i%5==0) a[i] = 0;
            else a[i] = i;
            ans += a[i];
      }

      cout << ans << endl;


      return 0;
}


Measured memory_bytes: 11084
N = int(input())
A = list(map(int, input().split()))

for i in range(N):
    v = A[i]
    j = i - 1
    while j >= 0 and A[j] > v:
        A[j + 1] = A[j]
        j -= 1
    A[j + 1] = v
    print(" ".join(map(str, A)))


Measured memory_bytes: 5596
using System;
using System.Text;
using System.Linq;
using System.Collections.Generic;


public class my
{
	struct Task {
		public string name;
		public int time;
	}
	
	private static StringBuilder sb = new StringBuilder();
	
	public static void Main()
	{
		var s = Console.ReadLine().Split(' ');
		int n = int.Parse(s[0]);
		int q = int.Parse(s[1]);
		
		var que = new QUEUE<Task>(n);
		for(int i = 0; i < n; i++) {
			var t = Console.ReadLine().Split(' ');
			que.ENQUEUE(new Task { name = t[0], time = int.Parse(t[1]) });
		}
		
		int totalTime = 0;
		while(que.COUNT() != 0)
		{
			Task task = que.DEQUEUE();
			
			if(q < task.time) {
				task.time -= q;
				totalTime += q;
				que.ENQUEUE(task);
			} else {
				totalTime += task.time;
				sb.AppendLine(string.Format("{0} {1}", task.name, totalTime) );
			}
		}
		
		my.Flush();
	}
	
	private static void Flush()
	{
		Console.Write(sb);
		sb.Length = 0;
	}
	
	private static void AppendLine(int v)
	{
		sb.AppendLine(v.ToString());
	}
	
	private static void AppendLine(long v)
	{
		sb.AppendLine(v.ToString());
	}
	
	private static void AppendLine(string[] v)
	{
		sb.AppendLine(string.Join(" ", v));
	}
	
	private static void Swap(ref string a, ref string b) 
	{
		string tmp = a;
		a = b;
		b = tmp;
	}
	
	private static void Swap(ref int a, ref int b) 
	{
		int tmp = a;
		a = b;
		b = tmp;
	}
	
	private static int[] GetIntArray()
	{
		return Array.ConvertAll(Console.ReadLine().Split(' '), int.Parse);
	}
	
	private static void WriteArray(int[] a)
	{
		Console.WriteLine(string.Join(" ", Array.ConvertAll( a, x=>x.ToString() ) ) );
	}
	
	private static void WriteArray(long[] a)
	{
		Console.WriteLine(string.Join(" ", Array.ConvertAll( a, x=>x.ToString() ) ) );
	}
	
	private static int GetInt()
	{
		return int.Parse(Console.ReadLine());
	}
	
	private static long GetLong()
	{
		return long.Parse(Console.ReadLine());
	}
}

public class QUEUE<T>
{
    private int m, s, e, c;
    private T[] q;
    public QUEUE(int max) { m = max; q = new T[m]; CLEAR(); }
    public void CLEAR() { e = 0; s = 0; c = 0; }
    public int COUNT() { return c; }
    public void ENQUEUE(T v) { q[e] = v; e++; e %= m; c++; }
    public T DEQUEUE() { T r = PEEK(); s++; s %= m; c--; return r; }
    public T PEEK() { return q[s]; }
}

Measured memory_bytes: 19772
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define all(c) (c).begin(),(c).end()
#define pb push_back
#define dbg(...) do{cerr<<__LINE__<<": ";dbgprint(#__VA_ARGS__, __VA_ARGS__);}while(0);

using namespace std;

namespace std{template<class S,class T>struct hash<pair<S,T>>{size_t operator()(const pair<S,T>&p)const{return ((size_t)1e9+7)*hash<S>()(p.first)+hash<T>()(p.second);}};template<class T>struct hash<vector<T>>{size_t operator()(const vector<T> &v)const{size_t h=0;for(auto i : v)h=h*((size_t)1e9+7)+hash<T>()(i)+1;return h;}};}
template<class T>ostream& operator<<(ostream &os, const vector<T> &v){os<<"[ ";rep(i,v.size())os<<v[i]<<(i==v.size()-1?" ]":", ");return os;}template<class T>ostream& operator<<(ostream &os,const set<T> &v){os<<"{ "; for(const auto &i:v)os<<i<<", ";return os<<"}";}
template<class T,class U>ostream& operator<<(ostream &os,const map<T,U> &v){os<<"{";for(const auto &i:v)os<<" "<<i.first<<": "<<i.second<<",";return os<<"}";}template<class T,class U>ostream& operator<<(ostream &os,const pair<T,U> &p){return os<<"("<<p.first<<", "<<p.second<<")";}
void dbgprint(const string &fmt){cerr<<endl;}template<class H,class... T>void dbgprint(const string &fmt,const H &h,const T&... r){cerr<<fmt.substr(0,fmt.find(","))<<"= "<<h<<" ";dbgprint(fmt.substr(fmt.find(",")+1),r...);}
typedef long long ll;typedef vector<int> vi;typedef pair<int,int> pi;const int inf = (int)1e9;const double INF = 1e12, EPS = 1e-9;

int main(){
	cin.tie(0); cin.sync_with_stdio(0);
	
	ll a, b;
	cin >> a >> b;
	ll m = min(a, b / 2);
	b -= 2 * m;
	ll s = m;
	s += b / 4;
	cout << s << endl;
	return 0;
}

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

using namespace std;

int main(){
  int vet[32] = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
  int k;
  scanf("%d", &k);
  printf("%d\n", vet[k-1]);
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define rep(i,b) FOR(i,0,b)
#define INF 1e18
#define dump(x) cerr<<#x<<"="<<x<<endl
#define all(a) (a).begin(),(a).end()
#define int  long long
typedef vector<int> V;
typedef vector<V> VV;
typedef vector<VV> VVV;
typedef pair<int,int> P;
template <class T> void chmin(T & a, T const & b) { if (b < a) a = b; }

using ll = long long;
const ll mod = LLONG_MAX;

ll mod_pow(ll a, ll b, ll r) {
  return b <= 0? 1: (b % 2? a: 1) * mod_pow(a * a % r, b / 2, r) % r;
}
signed main(){
  int x,y;
  cin>>x>>y;

  int ub=60,p=-1;
  int lb=0;
  rep(i,100){
    p=(ub+lb)/2;
    int temp=pow(2,p);
    if(temp<=y/x){
      lb=p;
    }else{
      ub=p;
    }
  }
  cout<<p+1<<endl;



}


Measured memory_bytes: 256
import java.util.Scanner;

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

		//?°?????????????
		while(true){
			//H??????????????????
			int H = sc.nextInt();
			//W?¨????????????????
			int W = sc.nextInt();
			//H??¨W???0????????????
			if(H == 0 && W == 0){
				break;
			}
			//??????????????¨???
			for(int i = 0; i < H; i++){
				//??????????????¨???
				for(int j = 0; j < W; j++){
					//?????¶???
					if((i + j) % 2 == 0){
						//??¶??°
						System.out.print("#");
					}else{
						//?\???°
						System.out.print(".");
					}
				}
				System.out.println();
			}
			System.out.println();
		}
	}
}

Measured memory_bytes: 37208
using System;
using System.Collections.Generic;
using System.Linq;

namespace Competitive
{
    internal class Solution
    {
        public void Run()
        {
            int H, W, D;
            {
                Console.ReadLine();
                bool isFour = Console.ReadLine().Split(' ').Any(s => s == "Y");
                Console.WriteLine(isFour ? "Four" : "Three");
            }

           
        }

    }
    
    internal class Program
    {
        public static void Main(string[] args)
        {
            var s = new Solution();
            s.Run();
        }
    }
}

Measured memory_bytes: 13268
#include<iostream>
#include<vector>
#include<algorithm>
#include<climits>
using namespace std;

const int V_MAX=100000;
const int E_MAX=100000;

vector<int> G[V_MAX];
int used[V_MAX]={};
bool flag=false;

void dfs(int s){
	if(used[s]==1){return;}
	used[s]=2;
	for (int i=0;i<G[s].size();i++){
		if(used[G[s][i]]==2){
			flag=true;
		}
		if(used[G[s][i]]==0)
		dfs(G[s][i]);
	}
	used[s]=1;
}

int main(){
	int V,E,s,t;
	cin>> V >> E;
	for (int i=0;i<E;i++){
		cin >> s >> t;
		G[s].push_back(t);
	}
	
	for(int i=0;i<V;i++){
		dfs(i);
	}
	
	flag ? cout << 1 << endl : cout << 0 <<endl;
	
	return 0;
}

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

#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/tag_and_trait.hpp>
using namespace __gnu_pbds;

using namespace std;
using ll = long long;

int dfs(int i, vector<vector<int>>& childs){
    //cout<<i<<endl;
    if(childs[i].size() == 1){
        return childs[i].front() / 2 + 1;
    }else{
        vector<int> v;
        for(auto a : childs[i]){
            v.push_back(dfs(a, childs));
        }
        sort(v.begin(), v.end());
        ll ans = accumulate(v.begin(), v.begin() + v.size() / 2 + 1, 0LL);
        return ans;
    }
}

int main(){
    
    int n;cin >> n;
    while(n--){
        string s;cin >> s;
        vector<vector<int>> childs;
        stack<int> sta;
        int idx = 0;

        for(int i = 0;i < s.size();i++){
            //return 0;
            if(s[i] == '['){
                childs.push_back(vector<int>());
                sta.push(idx);
                idx++;
            }else if(s[i] == ']'){
                int now = sta.top();
                sta.pop();
                if(now != 0)childs.at(sta.top()).push_back(now);
            }else{
                int num = s[i] - '0';
                if(childs.at(sta.top()).empty())childs.at(sta.top()).push_back(num);
                else childs.at(sta.top()).back() = childs.at(sta.top()).back() * 10 + num;
            }
        }
        /*
        for(int i = 0;i < childs.size();i++){
            for(auto a : childs[i])cout<<a<<" ";
            cout<<endl;
        }
        */
        //return 0;
        //cout<<"AAA"<<endl;
        cout<<dfs(0, childs)<<endl;
    }
    
}


Measured memory_bytes: 3292
#include <bits/stdc++.h>
using namespace std;
struct Edge {
    int to;     // 辺の行き先
    int weight; // 辺の重み
    Edge(int t, int w) : to(t), weight(w) { }
};
using Graph = vector<vector<Edge>>;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define reprep(i,j,h,w) rep(i,h)rep(j,w)
#define rrep(i,m, n) for(int i = m; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define aall(x,n) (x).begin(),(x).begin()+(n)
#define VEC(type,name,n) std::vector<type> a(n);rep(i,n)std::cin >> a[i];
#define pb push_back
#define pf push_front
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define sum accumulate
#define keta fixed<<setprecision
#define vvector(name,typ,m,n,a)vector<vector<typ> > name(m,vector<typ> (n,a))
#define vvvector(name,t,l,m,n,a) vector<vector<vector<t> > > name(l, vector<vector<t> >(m, vector<int>(n,a)));
typedef long long ll;
const int INF = 2000000000;
const long INF64 = 1000000000000000ll;
const ll MOD = 1000000007LL;
typedef unsigned int uint;
long ggd(long a, long b) {//最小公倍数，最大公約数
	if(a<b)swap(a,b);
	if (b == 0) {
		return a;			
	}
	return ggd(b, a % b);
}
int main(){
  int h,w;
  std::cin >> h>>w;
  vvector(a,int,h,w,0);
  reprep(i,j,h,w)std::cin >> a[i][j];
  std::vector<int> q,ww,e,r;
  rep(i,h){
    rep(j,w-1){
      if(a[i][j]%2==1){
        a[i][j+1]++;
        q.pb(i+1);
        ww.pb(j+1);
        e.pb(i+1);
        r.pb(j+2);
      }
    }
  }
  rep(i,h-1){
    if(a[i][w-1]%2==1){
      a[i+1][w-1]++;
      q.pb(i+1);
        ww.pb(w);
        e.pb(i+2);
        r.pb(w);
    }
  }
  std::cout << q.size() << std::endl;
  rep(i,q.size()){
    std::cout << q[i]<<' '<<ww[i]<<' '<<e[i]<<' '<<r[i] << std::endl;
  }
}


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

int main()
{
	int k, z, cnt = 0;
	cin >> k >> z;
	for (int a = 0; a <= k; a++) {
		for (int b = 0; b <= k; b++) {
			int c = z - a - b;
			if (0 <= c && c <= k) {
				cnt++;
			}
		}
	}
	cout << cnt << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll p = 1e9 +7;
const ll h = 1e5+1;
ll R, k, f[h];

void rf()
{
    ios_base::sync_with_stdio(0); cin.tie(0), cout.tie(0);
    cin >> R;
}

void xuli()
{
    cout << R * 2 * 3.14;
}

int main()
{
    rf(); xuli();
}

Measured memory_bytes: 3808
#include<iostream>
#include<sstream>
#include<fstream>
#include<string>
#include<vector>
#include<deque>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<algorithm>
#include<functional>
#include<utility>
#include<bitset>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<cstdio>

using namespace std;

#define REP(i,n) for(int i=0;i<int(n);i++)
#define foreach(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
typedef long long ll;
typedef pair<int,int> P;

int main(void){
	          int i;

	          int N;
	          cin >> N;
	          vector<int> s(N);
	          int sum=0;
	          for(i=0;i<N;i++){
	        	  cin >> s[i];
	        	  sum+=s[i];
	          }

	          if(sum%10!=0){
	        	  cout << sum << endl;
	        	  return 0;
	          }

	          sort(s.begin(),s.end());
	          bool f=false;
	          for(i=0;i<N;i++){
	        	  if(s[i]%10!=0){
	        		  f=true;
	        		  sum-=s[i];
	        		  break;
	        	  }
	          }

	          if(f) cout << sum << endl;
	          else cout << 0 << endl;

	          return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define INF 0x3f3f3f3f
const int N = 100010;
using namespace std;
typedef long long ll;
int mod = 1e9 + 7;

int main()
{

    int w, a, b;
    while (~scanf("%d%d%d", &w, &a, &b))
    {
        int l = a, r = a + w;
        int l1 = b, r1 = b + w;
        if (a < b)
        {
            if (b >= a && b <= r)
                puts("0");
            else
                printf("%d\n", b - r);   
        }else
        {
            if (a >= b && a <= r1)
                puts("0");
            else
                printf("%d\n", a - r1);
        }

    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
using namespace std;
int main(void){
    int n,a[2][100];
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>a[0][i];
    }
    for(int i=0;i<n;i++){
        cin>>a[1][i];
    }
    int mx,now=a[0][0];
    for(int i=0;i<n;i++){
        now+=a[1][i];
    }
    mx=now;
    for(int i=1;i<n;i++){
        now+=a[0][i]-a[1][i-1];
        mx=max(now,mx);
    }
    cout<<mx;
    return 0;
}


Measured memory_bytes: 256
from heapq import *
import sys

sys.setrecursionlimit(10 ** 6)
int1 = lambda x: int(x) - 1
p2D = lambda x: print(*x, sep="\n")
def II(): return int(sys.stdin.readline())
def MI(): return map(int, sys.stdin.readline().split())
def LI(): return list(map(int, sys.stdin.readline().split()))
def LLI(rows_number): return [LI() for _ in range(rows_number)]
def SI(): return sys.stdin.readline()[:-1]

def main():

    inf=10**16
    n,m,s=MI()
    to=[[] for _ in range(n)]
    for _ in range(m):
        u,v,a,b=MI()
        to[u-1].append((v-1,a,b))
        to[v-1].append((u-1,a,b))
    cd=LLI(n)

    dp=[[inf]*3005 for _ in range(n)]
    hp=[]
    heappush(hp,(0,min(s,3000),0))
    dp[0][min(s,3000)]=0

    while hp:
        t,g,u=heappop(hp)
        if dp[u][g]<t:continue
        c,d=cd[u]
        if g+c<3000:
            if dp[u][g + c] > t + d:
                dp[u][g + c] = t + d
                heappush(hp, (t + d, g + c, u))
        else:
            if dp[u][3000] > t + d:
                dp[u][3000] = t + d
                heappush(hp, (t + d, 3000, u))
        for v,a,b in to[u]:
            if g-a<0:continue
            if dp[v][g-a]<=t+b:continue
            dp[v][g - a] = t + b
            heappush(hp,(t+b,g-a,v))
    for u in range(1,n):
        print(min(dp[u]))

main()

Measured memory_bytes: 29808
#include<stdio.h>
#define pow(a) ((a)*(a))
int b[25005],n,d;
int a[15][15];
int main(){
	scanf("%d%d",&n,&d);
	for (int i=1;i<=n;i++)
		for (int j=1;j<=d;j++)
			scanf("%d",&a[i][j]);
	for (int i=0;i<=150;i++)
		b[pow(i)]=1;
	int ans=0;
	for (int i=1;i<n;i++)
		for (int j=i+1;j<=n;j++){
			int sum=0;
				for (int z=1;z<=d;z++)
					sum+=pow(a[i][z]-a[j][z]);
			if (b[sum]) ans++;
		}
	printf("%d",ans);
}

Measured memory_bytes: 256
using System;
using System.Linq;

namespace _2_D
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] X = Console.ReadLine().Split().Select(int.Parse).ToArray();
            int W = X[0];
            int H = X[1];
            int x = X[2];
            int y = X[3];
            int r = X[4];
            if (x >= r && x + r <= W && y >= r && y + r <= H)
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }
        }
    }
}

Measured memory_bytes: 9476
#include <bits/stdc++.h>
#define base 1000000007LL
#define ll long long
#define X first
#define Y second
#define pb push_back
#define Scan(a) scanf("%I64d", &a);
#define CLR(a) memset(a,0,sizeof(a))
#define FOR(i,a,b) for(int i=(a),_b=(b); i<=_b; i++)
#define FORE(i,a,b) for(int i=(a),_b=(b); i>=_b; i--)

using namespace std;

typedef pair<int, int> II;
typedef vector<II> vi;

int main()
{
    ios::sync_with_stdio(0);
    //freopen("inp.txt", "r", stdin);
    string s;
    cin >> s;
    int res = 0;
    FOR(i,1,s.length()-1)
        if (s[i] != s[i-1]) res++;
    cout << res;
    return 0;
}


Measured memory_bytes: 512
//http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=1135&lang=jp

#include <algorithm>
#include <iostream>
#include <vector>

#include <stdio.h>
#include <stdlib.h>
#include <string.h>

using namespace std;

//テ」ツδ榲」ツつッテ」ツδュテ・ツョツ堙ァツセツゥ
#define ALL(v) (v).begin(),(v).end()
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))
#define REP(i,a,b) for(int i=(int)(a); i<(int)(b); ++i)
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define SORT(x) sort(begin(x),end(x))
#define SELECT_SORT(x, n) sort(begin(x),begin(x)+n)
#define SWAP(type, a, b) do {type tmp = a; a = b; b = tmp;} while (0)
#define rep_split(tok,a_str,re) for(char *tok = strtok((char *)a_str.c_str(),re); tok != NULL; tok = strtok(NULL,re))

//テ・ツョツ堙ヲツ閉ー
#define INF 2000000000000
#define MAX 10

//DEBUGテァツ板ィ
#define BAR() cout << "----------------------------" << endl;
#define DUMP(v) (cerr << #v << ": " << v << endl)
#define PRINT(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl;


int main()
{
	int m,money,y,n;
	int a,c;
	long double risi;
	cin >> m;
	while(m)
	{
		cin >> money;
		cin >> y;
		cin >> n;

		int ans=0;

		int moneytmp = money;
		rep(i,n){
			cin >> a >> risi >> c;
			int tmpRisi=0;
			int anstmp=0;
			
			moneytmp = money;	
			if(!a){
				//テ・ツ債佚・ツ按ゥ
				rep(i,y)
				{
					tmpRisi += moneytmp*risi;
					moneytmp -= c;	
				}
				anstmp = moneytmp + tmpRisi;
			}else{
				//テァツヲツ湘・ツ按ゥ
				rep(i,y)
				{
					moneytmp +=moneytmp*risi-c;
				}
				anstmp=moneytmp;
			}
			ans = max(ans, anstmp);
		}
		cout << ans << endl;
		m--;
	}
	return 0;
}

Measured memory_bytes: 1240
#include<iostream>
#include<string>
#include<queue>
#include<vector>
#include<set>
#include<map>
#include<cassert>
using namespace std;

#define REP(i,a,b) for(i=a; i<b; ++i)
#define rep(i,n) REP(i,0,n)

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

inline char atc(string s,int i,int j) { return s.at(i*n+j); }

bool iseliminate(string mp) {
    int i,j;
    rep(i,mp.length()) if(mp[i] == '#') return false;
    return true;
}

pair<int,int> getPos(string mp) {
    int i,j;
    rep(i,mp.length()) if(mp[i] == '@') return make_pair(i/n,i%n);
}


string update(string &mp) {
    int i,j,k;
    string tmp = mp;

    rep(i,n) rep(j,n) {
        int adj = 0;
        if(mp.at(i*n+j) == '@') continue;
        rep(k,8) {
            if(i+dy[k] < 0 || i+dy[k] >= n) continue;
            if(j+dx[k] < 0 || j+dx[k] >= n) continue;
            if(mp.at((i+dy[k])*n+(j+dx[k])) == '#'
               || mp.at((i+dy[k])*n+(j+dx[k])) == '@') adj++;
        }
        if(mp.at(i*n+j) == '#') {
            if(adj == 2 || adj == 3) continue;
            else tmp.at(i*n+j) = '.';
            //cout<<"eliminated !!"<<endl;
        }else{
            if(adj == 3) tmp.at(i*n+j) = '#';
        }
    }
    return tmp;
}

int bfs(string bmap) {
    int i,j;
    queue<pair<int,string > >Q;
    set<string> memo;
    memo.insert(bmap);
    Q.push(make_pair(0,bmap));
    while(!Q.empty()) {
        string nmap = Q.front().second;
        int ii = Q.front().first;
        Q.pop();


        // cout<<ii<<endl;
        // rep(i,n) cout<<nmap.substr(i*n,n)<<endl;
        // cout<<endl;

        if(iseliminate(nmap)) return ii;

        pair<int,int> pos = getPos(nmap);
        for(int i=0; i<8; ++i) {
            if(pos.first+dy[i] < 0 || pos.first+dy[i] >= n) continue;
            if(pos.second+dx[i] < 0 || pos.second+dx[i] >= n) continue;
            if(nmap.at((pos.first+dy[i])*n+(pos.second+dx[i])) == '#') continue;
            string next = string(nmap);
            next.at((pos.first+dy[i])*n+pos.second+dx[i]) = '@';
            next.at((pos.first)*n+pos.second) = '.';
            next = update(next);
            if(memo.find(next) != memo.end()) continue;
            memo.insert(next);
            Q.push(make_pair(ii+1, next));
        }
    }
    return -1;
    assert(false);
}

int main() {
    while(cin>>n, n) {
        string imap = "",tmp;
        for(int i=0; i<n; ++i) {
            cin>>tmp;
            imap += tmp;
        }
        cout<<bfs(imap)<<endl;
    }
}

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

int main() {
  int A,B,K;
  cin >> A >> B >> K;
  if(B-A+1>=2*K) {
    for(int i=A; i<A+K; i++) {
      cout << i << endl;
    }
    for(int i=B-K+1; i<=B; i++) {
      cout << i << endl;
    }
  }
  else {
    for(int i=A; i<=B; i++) {
      cout << i << endl;
    }
}
}


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

string a, b;

int main() {

	ll i, j, k, l, test, n;
	cin >> a >> b;
	ll p, q;
	cin >> p >> q;
	string c;
	cin >> c;
	if (c == a) {
		cout << p - 1 << " " << q;
	}
	else if (c == b) {
		cout << p << " " << q - 1;
	}
}

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

using namespace std;

const long double EPS = 1e-13;

int main()
{
    long long a, b, c;
    cin >> a >> b >> c;
    if(c - a - b < 0)
    {
        cout << "No";
    }
    else
    {
        if((c - a - b) * (c - a - b) > 4 * a * b)
        {
            cout << "Yes";
        }
        else
        {
            cout << "No";
        }
    }
    return 0;
}


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

int main() {
	int N, K;
	string S;
	cin >> N >> S >> K;
	char flag = S.at(K - 1);
	rep(i, N) {
		if (S.at(i) != flag) S.at(i) = '*';
	}
	cout << S << endl;
	return 0;
}

Measured memory_bytes: 256
import math
power_6 = [6 ** i for i in range(int(math.log(100000, 6)) + 1)]
power_9 = [9 ** i for i in range(int(math.log(100000, 9)) + 1)]
p = list(set(power_6 + power_9))
p.sort()
p.append(100001)

N = int(input())
 
idx = 0
cnt = [0]
i = 1
while i < N + 1:
  if p[idx] <= i < p[idx + 1]:
    c = 0
    if idx == 0:
      cnt.append(i)
    else:
      c = [cnt[i - p[j]] + 1 for j in range(idx + 1)]
      cnt.append(min(c))
    i += 1
  else:
    idx += 1

print(cnt[N])

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

#define int long long 
#define pb push_back
#define x first
#define y second
#define sz(a) ((int)a.size())
#define all(a) (a).begin(), (a).end()
typedef pair<int, int> pii;
typedef long double ld;

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    string s;
    cin >> s;
    int l = 1, r = sz(s) + 1;
    while(r - l > 1) {
        int mid = (l + r) / 2;
        int cnt0 = 0, cnt1 = 0;
        for(int i = 0; i < sz(s); i++){
            if(i < mid && sz(s) - i - 1 < mid) if(s[i] == '0') cnt0++; else cnt1++;
        }
        if(cnt0 == 0 || cnt1 == 0) l = mid; else r = mid;
    }
    cout << l;
    return 0;
}


Measured memory_bytes: 3784
#include<bits/stdc++.h>
// #include <boost/lexical_cast.hpp>
using namespace std;


#define ll long long int
#define vll vector<ll>
#define vllv vector<vector<ll>> 
#define sz size()
#define pb push_back
#define ff first
#define ss second
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()
#define fast ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)

ll ceil1(ll n,ll m){if(n%m==0){return n/m;}return n/m +1;}
vll factor(ll n){
    vll ans;
    if(n>0)ans.pb(1);if(n==2)ans.pb(2);
    for(ll i=2;i*i<=n;i++){if(n%i==0){ans.pb(i);if(n/i!=i)ans.pb(n/i);}}if(n>2)ans.pb(n);
    return ans;
}
ll fact(ll n){
	
    ll res = 1; 
    for (ll i = 2; i <= n; i++) 
        res = res * i; 
    return res; 
} 
  
int nCr(ll n, ll r) 
{ 
    return fact(n) / (fact(r) * fact(n - r)); 
} 
  
void dfs(vllv &v,ll k,vll &par,vll &dis,ll p)
{
 
    par[k]=p;
    dis[k]=dis[p]+1;
    for(ll i=0;i<v[k].sz;i++){
        if(v[k][i]!=p){
            dfs(v,v[k][i],par,dis,k);
        }
    }
}
bool sortbysec(const pair<string,int> &a,const pair<string,int> &b){return (a.second<b.second);} 


ll ston(string s) 
{ 
    stringstream geek(s); 
    ll x = 0; 
    geek >> x; 
    
  
    return x; 
}
ll pow2(ll n,ll k){ll ans=1;
    while(k>0){
        if(k%2==1)ans=ans*n;n=n*n;k/=2;
    }return ans;}
bool prime(int n){
    int i,j;
    for(i=2;i<=sqrt(n);i++){
        if(n%i==0){
            return false;
        }
    }
    return true;
}
bool bserch(vector<string> a, string s){
	
	ll l=0,r=a.sz-1,mid;
	while(l<=r){
		mid=(l+r)/2;
		if(a[mid]==s)return true;
		if(a[mid]<s){
			l=mid+1;
		}else{
			r=mid-1;
		}
	}
	return false;
}

bool sortcol( const vector<int>& v1, 
               const vector<int>& v2 ) { 
 return v1[0] < v2[0]; 
} 

 ll degit(ll n)
 {
 	ll t=0;
 	while(n>0)
 	{
 		t++;
 		n/=10; 	}
 		return t;
 }
 

void solve()
{
int n, curr1 = 0, curr2 = 0;
	long long t1 = 0ll, t2 = 0ll;
	cin >> n;
	vector<int> a(n);
	for(int i = 0; i <n ; ++i){
	    cin >> a[i];
	    curr1 += a[i];
	    if(i%2==0 && curr1>=0){
	        t1+=curr1+1;
	        curr1=-1;
	    }
	    else if(i%2==1 && curr1<=0){
	        t1+=-curr1+1;
	        curr1 = 1;
	    }
	    curr2+=a[i];
	    if(i%2==0 && curr2<=0){
	        t2+=-curr2+1;
	        curr2=1;
	    }
	    else if(i%2==1 && curr2>=0){
	        t2+=curr2+1;
	        curr2 = -1;
	    }
	}
	cout << min(t1,t2);	return;	
}
	

int main()
{
	fast;
    ll q;
    q=1;
    // cin>>q;
    while(q--)
    {
        solve();
    }
    return 0;
}

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

// aを常に小さい値にする　大きい値にする
template<class T> bool chmin(T &a, T b){
    if(a>b) {
        a = b;
        return true;
    }
    return false;

}
template<class T> void chmax(T &a, T b){ if(a<b) a = b; }

// 二分探索 前方のindexを返すもの（自分自身を含む） 前方: -INF側のこと
template<class T> int former(const vector<T> &v, T x){
    return upper_bound(v.begin(), v.end(), x) - v.begin() -1; // upper_bound : keyより大きい要素の内の一番左側のイテレータを返す
}
// 二分探索 後方のindexを返すもの（自分自身を含む）後方: INF側のこと
template<class T> int latter(const vector<T> &v, T x){
    return lower_bound(v.begin(), v.end(), x) - v.begin(); // lower_bound : key以上の要素の内の一番左側のイテレータを返す
}

/*
 *
 * */

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

    int A[M];
    rep(i,M) cin >> A[i];

    int res=0, sum=0;
    rep(i,M){
        sum += A[i];
    }
    if(sum > N){
        res = -1;
    }else{
        res = N -sum;
    }
    cout << res << endl;
}

Measured memory_bytes: 3632
#include <iostream>
using namespace std;
int gcd(int a,int b)
{
    int t;
    if(b>a)
    {
        t=b;
        b=a;
        a=t;
    }
    while(t=a%b)
    {
        a=b;
        b=t;
    }
    return b;
}

int main(int argc, const char * argv[])
{

    int k,sum=0;
    cin>>k;
    for(int x=1;x<=k;x++)
    {
        for(int y=1;y<=k;y++)
        {
            int t=gcd(x,y);
            for(int z=1;z<=k;z++)
            {
                sum+=gcd(t,z);
            }
        }
    }
    cout<<sum<<endl;
    return 0;
}


Measured memory_bytes: 3648
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define all(x) (x).begin(),(x).end()
using namespace std;
const int INF=1145141919,MOD=1e9+7;
const int64_t LINF=8931145141919364364,LMOD=998244353;
// const int dy[]={0,-1,0,1,1,-1,-1,1};
// const int dx[]={1,0,-1,0,1,1,-1,-1};

int main() {
	int64_t n, m, k; cin >> n >> m >> k;
	int64_t a[n + 1] = {}; rep(i,n) cin >> a[i + 1];
	vector<int64_t> b(m + 1); rep(i,m) cin >> b[i + 1];
	rep(i,m) {
		b[i + 1] += b[i];
	}
	int64_t sum = 0;
	int64_t ans = 0;
	for(int64_t i = 0; i <= n; ++i) {
		sum += a[i];
		if(sum > k) break;
		ans = max(ans, i);
		int64_t mo = k - sum;
		int64_t idx = upper_bound(all(b), mo) - b.begin() - 1;
		// cerr << mo <<" " << idx << '\n';
		ans = max(ans, i + idx);
	}
	cout << ans << '\n';
	return 0;
}


Measured memory_bytes: 6372
#include <bits/stdc++.h>
using namespace std;
#define ll	    long long
#define vi      vector <int>
#define vii     vector <pair<int,int>>
#define ii      pair<int,int>
#define loop(n)	for(int i=0;i<n;i++)
ll mod=1e9+7;
bool is_prime(int n)
{
    if(n==2)
        return true;
    if(n%2==0||n<2)
        return false;
    for(int i=3; i<=sqrt(n); i+=2)
    {
        if(n%i==0)
            return false;
    }
    return true;
}
long long power(ll n, ll k){
    if(k==0) return 1;
    ll sq=(power(n,k/2))%mod;
    sq=(sq*sq)%mod;
    if(k%2==1)
        sq=(sq*n)%mod;
    return sq%mod;
}
void low(char &c){
c=tolower(c);
}
void primeFactors(int n)
{
    while (n % 2 == 0)
    {
        cout << 2 << " ";
        n = n/2;
    }

    for (int i = 3; i <= sqrt(n); i = i + 2)
    {
        while (n % i == 0)
        {
            cout << i << " ";
            n = n/i;
        }
    }

    if (n > 2)
        cout << n << " ";
}

#include <iostream>
using namespace std;
void fast();
int arr[105];
map <int,int> M;
int main() {
//fast();
int n;
cin >> n;
loop(n){
    cin >> arr[i];
}
int mn=99999999;
int sm=0;
loop(101){
  for(int j=0;j<n;j++){
    sm+=power(abs(arr[j]-i),2);
  }
  mn=min(sm,mn);
  sm=0;
}
cout << mn;
}





void fast(){
std::ios_base::sync_with_stdio(0);
    cin.tie(NULL);
    cout.tie(NULL);

}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cmath>
#include<algorithm>/*toupperとかが入っている*/
#include<vector>/*可変長配列vectorのインクルード*/

const int MOD=1000000007;/* 1,000,000,007 で割った余りを出力する　のとき使う*/
using namespace std;/*標準名前空間を利用する。cinやcoutはこれによって利用可能になる*/

string S;

int main(void) {
  cin >> S;
  
  if(S[0]!=S[1] && S[1]!=S[2] && S[2]!=S[3])
  cout << "Good" << endl;
  
  else cout << "Bad" << endl;
  
  return 0;
}


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

int store[107];
int n;

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

    int cnt = store[1];

    for (int i = 2; i <= n; i++) {

        //cnt += store[i];

        if (store[i] >= store[i-1]) cnt = (cnt + store[i]) - store[i-1];

    }

    cout << cnt << endl;
}


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

int main()
{
    int n, k;
    cin >> n >> k;

    int a;
    int ans = 0;
    for(int i = 0; i < n; i++){
        cin >> a;

        if(a >= k){
            ans++;
        }
    }

    cout << ans << "\n";

}


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

int main() {
  int n, k;
  cin >> n >> k;
  
  int h[n-1];
  for (int i = 0; i < n; i++) {
    cin >> h[i];
  }
  sort(h, h + n);
  
  long long ans = 0;
  for (int i = 0; i < n - k; i++) ans += h[i];
  
  cout << ans << endl;
}

Measured memory_bytes: 1152
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define in freopen("input.txt", "r", stdin)
#define out freopen("output.txt", "w", stdout)  
#define rep(i,n) for(int (i)=0;(i)<(n);++(i))
#define ref(i,a,b) for (int (i)=(a); (i)<=(b); ++(i))
#define INF 0xFFFFFF
#define endl '\n'
#define pp printf("Case %d: \n",t)
const unsigned int mod = 1e9+7;
const int mx=1000005;
const int maxInt = 2147483647;
int main(){
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    int n,m;
    cin >> n >> m;
    int u[m],v[m];
    rep(i,m){
        cin >> u[i] >> v[i];
        --u[i];--v[i];
    }
    int s,t;
    cin >> s >> t;
    --s;
    --t;
    vector <int> adj[n];
    for(int i=0;i<m;++i){
        adj[u[i]].push_back(v[i]);
    }
    deque<int> q;
    q.pb(s);
    int d[n];
    memset(d,INF,sizeof(d));
    d[s]=0;
    int vis[n]={0};
    vis[s]=1;
    int cnt=0;
    int vis1[n]={0};
    int vis2[n]={0};
    while(!q.empty()){
            int t=q.front();
            q.pop_front();
            for(int i : adj[t]){
                if(vis1[i]==1)continue;
                vis1[i]=1;
                for(int j : adj[i]){
                    if(vis2[j]==1)continue;
                    vis2[j]=1;
                    for(int k : adj[j]){
                        if(vis[k]==0){
                            vis[k]=1;
                            d[k]=d[t]+1;
                            q.push_back(k);
                        }
                    }
                }
            }
    }
    if(d[t]!=INF)cout << d[t] << endl;
    else cout << -1 << endl;
    return 0;
}

















Measured memory_bytes: 8064
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pll pair<ll,ll>
#define pq priority_queue
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define lb(c,x) distance(c.begin(),lower_bound(all(c),x))
#define ub(c,x) distance(c.begin(),upper_bound(all(c),x))

using namespace std;

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

const ll INF=1e9+7;

int main()
{
    string s;
    cin >> s;
    ll n=s.length();
    stack<char> t;
    rep(i,n){
        if(s[i]=='B'){
            if(!t.empty()){
                t.pop();
            }
        }
        else{
            t.push(s[i]);
        }
    }
    string ans="";
    while(!t.empty()){
        ans+=t.top();
        t.pop();
    }
    ll m=ans.length();
    for(ll i=m-1;i>=0;i--){
        cout << ans[i];
    }
    cout << endl;
    return 0;
} 

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

using namespace std;

typedef vector<int> Vec;
typedef vector<Vec> Mat;

Mat a(5, Vec(5));
int score[5];

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

bool inField(int x, int y)
{
    return (0 <= x && x < 5 && 0 <= y && y < 5);
}

int erase(Mat &m)
{
    bool e[5][5] = {{}};
    for (int i = 0; i < 5; i++) {
        for (int j = 0; j < 5; j++) {                        
            if (m[i][j] == 0) {
                continue;
            }
            int cnt[2] = {1, 1};
            for (int k = 0; k < 4; k++) {
                int ni = i + dy[k];
                int nj = j + dx[k];
                while (inField(ni, nj) &&
                       m[i][j] == m[ni][nj]) {
                    ni += dy[k];
                    nj += dx[k];
                    ++cnt[k&1];
                }
            }
            if (cnt[0] >= 3 || cnt[1] >= 3) {
                e[i][j] = 1;
            }
        }
    }
    int point = 0;
    for (int i = 0; i < 5; i++) {
        for (int j = 0; j < 5; j++) {
            if (e[i][j]) {
                point += score[m[i][j]-1];
                m[i][j] = 0;
            }
        }
    }
    return point;
}

void fall(Mat &m)
{
    for (int j = 0; j < 5; j++) {
        for (int i = 4; i >= 1; i--) {
            if (m[i][j] == 0) {                
                for (int k = i-1; k >= 0; k--) {
                    if (m[k][j] != 0) {
                        swap(m[i][j], m[k][j]);
                        break;
                    }
                }
            }
        }
    }
}

int calc(Mat &m, int bp)
{
    int point = erase(m) * bp;
    fall(m);
    return point;
}

int get_point()
{
    Mat b = a;
    int point = 0, bp = 1;
    bool update = 1;
    
    while (update) {
        update = 0;        
        Mat nb = b;
        point += calc(nb, bp++);;
        if (nb != b) {
        
            update = 1;
            b = nb;
        }
    }
    return point;
}

int dfs(int y, int x, int n)    
{
    int point = get_point();
    if (n > 0) {
        for (int i = 0; i < 4; i++) {
            int nx = x + dx[i];
            int ny = y + dy[i];
            if (inField(nx, ny)) {
                swap(a[ny][nx], a[y][x]);
                point = max(point, dfs(ny, nx, n-1));
                swap(a[ny][nx], a[y][x]);
            }        
        }
    }
    return point;
}

int main()
{
    int n;
    while (cin >> n, n != -1) {
        for (int i = 0; i < 5; i++) {
            for (int j = 0; j < 5; j++) {
                cin >> a[i][j];
            }
        }
    
        for (int i = 0; i < 5; i++) {
            cin >> score[i];
        }

        int max_point = 0;
        for (int i = 0; i < 5; i++) {
            for (int j = 0; j < 5; j++) {
                max_point = max(max_point, dfs(i, j, n));
            }
        }   
        cout << max_point << endl;
    }
    return 0;
}

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

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

Measured memory_bytes: 3576
import copy
import math
import sys

sys.setrecursionlimit(10 ** 7)

N = int(input())
s_list = [input() for i in range(N)]


def split(word):
    return [char for char in word]


normalized_s_list = sorted([''.join(sorted(split(s))) for s in s_list])

uniqued_s_list = sorted(list(set(normalized_s_list)))

j = 0
counter = 0
result = 0
for s in normalized_s_list:
    if s == uniqued_s_list[j]:
        counter += 1
    else:
        result += (1 / 2) * counter * (counter - 1)
        j += 1
        counter = 1  # このとき s と uniqued_s_list[j] は同じはずなので

result += (1 / 2) * counter * (counter - 1)
print(int(result))


Measured memory_bytes: 24544
#include <bits/stdc++.h> 
using namespace std; 
typedef long long ll;
int main()
{
    ll n,m,p,q;
    cin>>n>>m;
    p=n/m;
    q=n%m;
    if(q==0)
    {
        cout<<p<<endl;
    }
    else
    {
        p=p+1;
        cout<<p<<endl;
    }
}

Measured memory_bytes: 256
from fractions import gcd
A,B,C,D=map(int,input().split())


def lcm(x, y):
    return (x * y) // gcd(x, y)

size=B

cd=lcm(C,D)
allC=size//C
allD=size//D
allcd=size//cd
ALL=size-(allC+allD-allcd)

size=A-1
cd=lcm(C,D)
pC=size//C
pD=size//D
pcd=size//cd
P=size-(pC+pD-pcd)

print(ALL-P)


Measured memory_bytes: 5116