akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>

using namespace std;

#define FOR(i,k,n) for(int i=(k); i<(int)n; ++i)
#define REP(i,n) FOR(i,0,n)
#define FORIT(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
typedef pair<int,int> P;

int main(){
  int n;
  while(cin>>n){
    vector<int> a(100010);
    vector<int> b(100010);
    REP(i,n){
      int t1,t2;
      cin>>t1>>t2;
      a[t1]++;
      b[t2]++;
    }
    int ans = 0;
    int member = 0;
    for(int i = 0; i <= n; i++){
      member += a[i+1];
      member -= b[i];
      if(member >= i)ans = i;
    }
    cout<<ans<<endl;
  }
  return 0;
}

Measured memory_bytes: 1640
#include <cstdlib>
#include <string>
#include <ctime>
#include <algorithm>
#include <vector>
#include <cstring>
#include <stack>
#include <queue>
#include <utility>
using namespace std;

int n;
int a[100005];

int main(){
	scanf("%d", &n);
	for(int i = 0; i < n; i++){
		scanf("%d", &a[i]);
	}
	sort(a, a+n);
	int cnt[] = {0, 0, 0};
	int bis[3] = {a[0], -100, -100};
	int ans = 0;
	for(int i = 0; i < n;){
		if(bis[0] == a[i]){
			cnt[0]++;
			i++;
		}else{
			int ans1 = cnt[0];
			if(bis[0]-bis[1] == 1){
				ans1 += cnt[1];
				if(bis[1]-bis[2] == 1){
					ans1 += cnt[2];
				}
			}else if(bis[0]-bis[1] == 2){
				ans1 += cnt[1];
			}
			ans = max(ans, ans1);
			bis[2] = bis[1];
			bis[1] = bis[0];
			bis[0] = a[i];
			cnt[2] = cnt[1];
			cnt[1] = cnt[0];
			cnt[0] = 0;
		}
	}
	int ans1 = cnt[0];
	if(bis[0]-bis[1] == 1){
		ans1 += cnt[1];
		if(bis[1]-bis[2] == 1){
			ans1 += cnt[2];
		}
	}else if(bis[0]-bis[1] == 2){
		ans1 += cnt[1];
	}
	ans = max(ans, ans1);
	/*
	int x = 0;
	int y = 0;
	int z = 0;
	int xx = a[0];
	int yy;
	int zz;
	int ans = 0;
	int i = 0;
	for(i = 0; i < n; i++){
		if(a[i] == xx){
			x++;
		}else{
			break;
		}
	}
	yy = a[i];
	for( ; i < n; i++){
		if(a[i] == yy){
			y++;
		}else{
			break;
		}
	}
	zz = a[i];
	for( ; i < n; i++){
		if(a[i] == zz){
			z++;
		}else{
			break;
		}
	}
	ans = x + y + z;
	x = y;
	y = z;
	zz = a[i];
	z = 0;
	for( ; i < n; i++){
		if(zz == a[i]){
			z++;
		}else{
			ans = max(ans, x + y + z);
			x = y;
			y = z;
			z = 1;
			zz = a[i];
		}
	}
	ans = max(ans, x+y+z);
	*/
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 512
#include <stdio.h>

int main (void){
  
  char S[10];
  
  scanf("%s", S);
  
  int a = S[0] - '0';
  int b = S[1] - '0';
  int c = S[2] - '0';
  
  int sum = a+b+c;
  
  printf("%d", sum);
  
  return 0;
}

Measured memory_bytes: 1720
package main

import "fmt"

func main() {
	var N int
	fmt.Scan(&N)
	var S string
	fmt.Scan(&S)
	ans := 0
	// Sは最大30000なので、nC3から判定することは出来ない
	// ラッキーナンバーの候補は000から999までの1000パターンしかないので、これらを全探索出来ないか？
	// つまり、Nから3個取り出して、000から999までを作り出すことはできるか考えればよい？
	for pin := 0; pin <= 999; pin++ {
		pins := fmt.Sprintf("%03d", pin)
		ok1, ok2, ok3 := false, false, false
		t := pins[0]
		for i := 0; i < len(S); i++ {
			if !ok1 && S[i] == t {
				ok1 = true
				t = pins[1]
			} else if ok1 && !ok2 && S[i] == t {
				ok2 = true
				t = pins[2]
			} else if ok1 && ok2 && S[i] == t {
				ok3 = true
			}
		}
		if ok1 && ok2 && ok3 {
			ans++
		}
	}
	fmt.Println(ans)
}


Measured memory_bytes: 896
#include <stdio.h>
int search(int S[],int n,int t){
  int i=0;
  S[n]=t;
  while (S[i]!=t)i++;
  return i!=n;
}


int main(){
  int n,i,ans=0,S[10001],q,t;

  scanf("%d",&n);

  for(i=0;i<n;i++)
        scanf("%d",&S[i]);

  scanf("%d",&q);

   for(i=0;i<q;i++){
          scanf("%d",&t);
          if(search(S,n,t))
              ans++;

     }

printf("%d\n",ans);
  return 0;
}



Measured memory_bytes: 2140
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
template<typename T>inline istream& operator>>(istream&i,v(T)&v)
{rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const v(T)&v)
{stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>inline ostream& operator<<(ostream&o,const v(T)&v)
{if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>inline istream& operator>>(istream&i,pair<T1,T2>&v)
{return i>>v.fi>>v.se;}
template<typename T1,typename T2>inline ostream& operator<<(ostream&o,const pair<T1,T2>&v)
{return o<<v.fi<<","<<v.se;}
template<typename T>inline ll suma(const v(T)& a) { ll res(0); for (auto&& x : a) res += x; return res;}
const double eps = 1e-10;
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define dame { puts("-1"); return 0;}
#define yn {puts("YES");}else{puts("NO");}
const int MX = 200005;

    // 整数スキャン（複数）
    /*
    int x;
    scanf("%d",&x);
    int y;
    scanf("%d",&y);
    int z;
    scanf("%d",&y);

    // n個の整数のスキャン
    /*
    ll a[n] = {};
    rep(i,n){
        scanf("%lld",&a[i]);
    }
    */

    // 文字列スキャン
    /*
    string s;
    cin >> s;
    */


int main() {
    int n;
    scanf("%d",&n);

    int ans = 0;

    while(n>0){
        ans+=n%10;
        n=n/10;
    }

    if(ans==1){
        ans=10;
    }

    cout << ans << endl;
   
    return 0;
}
 
 


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <numeric>
#include <cstring>
#include <ctime>
#include <cstdlib>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <cmath>
#include <bitset>
#include <cassert>
#include <queue>
#include <deque>
#include <cassert>
#include <iomanip>      
#define pb push_back
#define x first
#define y second
#define files(FILENAME) read(FILENAME); write(FILENAME)
#define read(FILENAME) freopen((FILENAME + ".in").c_str(), "r", stdin)
#define write(FILENAME) freopen((FILENAME + ".out").c_str(), "w", stdout)
using namespace std;
  
template<typename T1, typename T2>inline void chkmin(T1 &x, T2 y) { if (x > y) x = y; }
template<typename T1, typename T2>inline void chkmax(T1 &x, T2 y) { if (x < y) x = y; }

const string FILENAME = "input";
const int MAXN = 3e5 + 1;

long long a, b;
long double c;


int main() {
    ios::sync_with_stdio(0);
    //read(FILENAME);
    cin >> a >> b;
    double d = pow(0.5, b);
    c += 1900 * b + ((a - b) * 100);
    long double ans = c / d;
    cout << round(ans) << endl;
}

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

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define REP(i, a, b) for (int i = (int)a; i < (int)b; ++i)
#define each(i,c) for(__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define all(v) v.begin(), v.end()
#define mset(a, n) memset(a, n, sizeof(a))

typedef long long ll;

const int INF = 1000000000;
const int MOD = 1000000007;

int main(int argc, char *argv[]) {
    // cin.tie(0);
    // ios::sync_with_stdio(false);
    int N, x; cin >> N >> x;
    vector<int> a(N);
    ll sum = 0;
    rep(i, N) {
        cin >> a[i];
        sum += a[i];
    }

    if (sum == x) cout << N << endl;
    else if (sum < x) cout << N - 1 << endl;
    else {
        sort(all(a));
        int ans = 0;
        rep(i, N) {
            if (x >= a[i]) ans++, x -= a[i];
            else break;
        }
        cout << ans << endl;
    }

    return 0;
}

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

using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef vector<int> Vec;

#define REP(i, a, b) for(ll i=(a); i<(b); i++)
#define rep(i, n) REP(i, 0, n)
const int INF=1e9;
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl;
#define ALL(v) v.begin(), v.end()
#define dbg(x_) cerr << #x_ << ":" << x_ << endl;
#define pb(x) push_back(x)
#define sum(v) accumulate(ALL(v),0)

template<typename T1, typename T2>
ostream &operator<<(ostream &s, const pair<T1, T2> &p) { return s<<"("<<p.first<<", "<<p.second<<")"; }

// vector
template<typename T>
ostream &operator<<(ostream &s, const vector<T> &v) {
    int len=v.size();
    for(int i=0; i<len; ++i) {
        s<<v[i];
        if(i<len-1) s<<"	";
    }
    return s;
}

// 2 dimentional vector
template<typename T>
ostream &operator<<(ostream &s, const vector<vector<T> > &vv) {
    int len=vv.size();
    for(int i=0; i<len; ++i) {
        s<<vv[i]<<endl;
    }
    return s;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin>>n;
    Vec v(n);
    vector<ll> w;
    ll min=INF;
    rep(i,n){
        int tmp;
        cin>>tmp;
       // dbg(tmp);

        if(min>=tmp){
            w.pb(tmp);
            min = tmp;
        }else{
            rep(j,w.size()){
                if(tmp > w[j]){
                    w[j] = tmp;
                    if(j==w.size()-1){
                        min = tmp;
                    }
                    break;
                }
            }
        }
//        dbg(min);
//        dbg(w);
    }

    cout<<w.size()<<endl;
    return  0;
}


Measured memory_bytes: 1784
{-# OPTIONS_GHC -O2 #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE LambdaCase #-}
module Main where

import           Data.List
import           Control.Monad
import           Debug.Trace
import qualified Data.ByteString.Char8         as BC
import           Data.Maybe                     ( fromJust )
import qualified Data.Set                      as S
import qualified Data.IntMap.Strict            as IM
import qualified Data.IntMap.Lazy            as IML
import qualified Data.Map.Strict               as M
import           Data.Char
import qualified Data.Array.IArray as A
import qualified Data.Array.Unboxed as UA
import Data.Bits
import Control.Monad.State.Strict
import qualified Data.Array.ST as STA
import qualified Data.Array.IO as IOA
import qualified Data.Array.MArray as MA
import Control.Monad.ST
import System.IO (stdin)
import Control.Arrow
import qualified Data.Vector.Unboxed as UV
import qualified Data.Vector.Generic as GV



readTuple2 :: IO (Int, Int)
readTuple2 = do
    [a, b] <- readInts
    return (a, b)

readTuple3 :: IO (Int, Int, Int)
readTuple3 = do
    [a, b, c] <- readInts
    return (a, b, c)

readInt :: IO Int
readInt = fst . fromJust . BC.readInt <$> BC.getLine

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

split :: (a -> Bool) -> [a] -> [[a]]
split f [] = []
split f as =
    let (fo, la) = span f as
        las      = case la of
            [] -> []
            xs -> split f $ tail xs
    in  case fo of
            [] -> las
            xs -> xs : las

newtype MyGraph = MyGraph (A.Array Int [Int])

listToGraph :: Int -> [(Int, Int)] -> Bool -> MyGraph
listToGraph n paths inverse = MyGraph $ STA.runSTArray $ do
    a <- MA.newArray (1, n) []
    forM_ paths $ \(from, to) -> do
        f <- MA.readArray a from
        MA.writeArray a from $ to : f
        when inverse $ do 
            t <- MA.readArray a to
            MA.writeArray a to $ from : t
    pure a

getPaths :: Int -> MyGraph -> [Int]
getPaths i (MyGraph lst) = lst A.! i


solve :: Int -> UV.Vector Int -> [(Int, Int)] -> Int
solve n heights paths = let 
    grp = listToGraph n paths True
    isGood i = case getPaths i grp of
        [] -> True
        paths -> let
            mine = heights GV.! (i - 1)
            in
            all ((mine>) . (heights GV.!) . (subtract 1)) paths
    in 
    length $ filter isGood [1..n]

readIntS :: BC.ByteString -> Maybe (Int, BC.ByteString)
readIntS = fmap (BC.tail <$>) . BC.readInt

readIntsV :: Int -> IO (UV.Vector Int)
readIntsV n = UV.unfoldrN n readIntS <$> BC.getLine

main :: IO ()
main = do
    (n, m) <- readTuple2
    heights <- readIntsV n
    paths <- replicateM m readTuple2
    print $ solve n heights paths





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

int main() {
    int n, d; cin >> n >> d;
    double x[n][d];
    rep(i, n)rep(j, d) cin >> x[i][j];
    int ans = 0;
    rep(i, n-1){
        for(int j = i+1; j < n; j++){
            double dis = 0;
            rep(k, d){
                dis += (x[i][k] - x[j][k])*(x[i][k] - x[j][k]);
            }
            dis = sqrt(dis);
            if(dis == (int)dis) ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

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

using namespace std;

int main() {
    string s;
    cin >> s;
    vector<int> vec(s.length() + 1, 0);
    for (int i = 0; i < s.length(); i++) {
        if (s[i] == '<') vec[i + 1] = vec[i] + 1;
        else{
            int j = i;
            while (j < s.length() && s[j] == '>') j++;
            for (int k = i + 1; k < j; k++) {
                vec[k] = j - k;
            }
            vec[i] = max(j - i, vec[i]);
            i = j - 1;
        }
    }
    long long sum = 0;
    for (int& v: vec) sum += v;
    cout << sum << endl;
}

Measured memory_bytes: 2820
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> vvl;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvec;
typedef vector<vector<bool>> vveb;
typedef vector<vector<string>> vves;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define rep2(i,n) for(int i=2;i<(int)(n);i++)
#define repk(i,k,n) for(int i=k;i<(int)(n);i++)
#define rev(v) reverse(v.begin(), v.end())
#define fs first
#define sc second
#define pb push_back
#define pp pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define maxel(a) *max_element(all(a))
#define minel(a) *min_element(all(a))
#define acc accumulate
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)
typedef long long int64;
//const int64 INF = 1LL << 58;
#define dame { puts("-1"); return 0;}
#define YES { cout << "YES" << endl; return 0; }
#define NO { cout << "NO" << endl; return 0; }
#define Yes { cout << "Yes" << endl; return 0; }
#define No { cout << "No" << endl; return 0; }
#define uniq(a) sort(all(a));(a).resize(unique(all(a)) - a.begin());
#define dab(v) for(auto i:v) cout << i << ' ' << endl;
#define vin(v) for (ll i = 0; i < v.size(); ++i) cin >> v[i];
#define vin2(v, w) for (ll i = 0; i < v.size(); ++i) cin >> v[i] >> w[i];
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 (a > b) { a = b; return 1; } return 0; }
int dx[] = { 0, 0, -1, 1 };
int dy[] = { 1, -1, 0, 0 };
int gcd(int a, int b) { if (a % b == 0) { return(b); } else { return(gcd(b, a % b)); } }


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

	long long int N;
	long long int temp_N;
	cin >> N;

	vi a;
	while (double(N) / double(26) > 0) {
		temp_N = (long long int)((N-1) / 26);
		//cout << N << " " << temp_N << endl;
		a.push_back((N-1) % 26);
		N = temp_N;
	}
	reverse(all(a));
	rep(i, a.size()) {
		cout << char('a' + a.at(i));
	}
	return 0;
}

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

int main() {
  int N, K, h;
  std::cin >> N >> K;
  std::vector<int> heights;
  for (int i = 0; i < N; ++i) {
    std::cin >> h;
    heights.push_back(h);
  }
  std::sort(heights.begin(), heights.end());
  std::vector<int> diff;
  diff.push_back(0);
  for (int i = 1; i < N; ++i) {
    diff.push_back(heights[i] - heights[i-1] + diff[i-1]);
  }

  int min = INT32_MAX;
  for (int i = K-1; i < diff.size(); ++i) {
    if (diff[i] - diff[i-K+1] < min)
      min = diff[i] - diff[i-K+1];
  }
  std::cout << min << std::endl;
}


Measured memory_bytes: 1400
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>
#include <string>
#include <math.h>
using namespace std;

int main(){
	int a = 0;
	string s;

	cin >> s;

	for (int i = 0; i < 4; ++i){
		if (s[i] == '+')
			++a;
		else
			--a;
	}

	cout << a << endl;

	return 0;
}

Measured memory_bytes: 256
N,K=map(int,input().split())

D=[0]*N

for i in range(K):
    r = int(input())
    d = list(map(int,input().split()))
    for j in range(r):
        D[d[j]-1] = 1


cnt = 0
for i in range(N):
    if D[i] == 0:
        cnt += 1

print(cnt)

Measured memory_bytes: 9196
import java.util.*;

public class Main {

  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int p = sc.nextInt();

    int ak = a * 3;
    int pk = ak + p;

    int g = pk / 2;

    System.out.println(g);


  }

}


Measured memory_bytes: 22100
#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
#include <random>
using namespace std;
#define rep(i, a, n) for (int i = a; i < n; i++)
#define per(i, a, n) for (int i = n - 1; i >= a; i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define fi first
#define se second
#define sz(x) ((int)(x).size())
typedef vector<int> vi;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef double db;
mt19937 mrand(random_device{}());
const ll mod = 1000000007;
int rnd(int x) { return mrand() % x; }
ll powmod(ll a, ll b)
{
	ll res = 1;
	a %= mod;
	assert(b >= 0);
	for (; b; b >>= 1)
	{
		if (b & 1)
			res = res * a % mod;
		a = a * a % mod;
	}
	return res;
}
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }

static uint MD = mod;
struct ModInt
{
	using M = ModInt;
	uint v;
	ModInt(ll _v = 0) { set_v(uint(_v % MD + MD)); }
	M &set_v(uint _v)
	{
		v = (_v < MD) ? _v : _v - MD;
		return *this;
	}
	explicit operator bool() const { return v != 0; }
	M operator-() const { return M() - *this; }
	M operator+(const M &r) const { return M().set_v(v + r.v); }
	M operator-(const M &r) const { return M().set_v(v + MD - r.v); }
	M operator*(const M &r) const { return M().set_v(uint(ull(v) * r.v % MD)); }
	M operator/(const M &r) const { return *this * r.inv(); }
	M &operator+=(const M &r) { return *this = *this + r; }
	M &operator-=(const M &r) { return *this = *this - r; }
	M &operator*=(const M &r) { return *this = *this * r; }
	M &operator/=(const M &r) { return *this = *this / r; }
	bool operator==(const M &r) const { return v == r.v; }
	M pow(ll n) const
	{
		M x = *this, r = 1;
		while (n)
		{
			if (n & 1)
				r *= x;
			x *= x;
			n >>= 1;
		}
		return r;
	}
	M inv() const { return pow(MD - 2); }
	friend ostream &operator<<(ostream &os, const M &r) { return os << r.v; }
};
using Mint = ModInt;
//head
// cin >> t;
// for (int cas = 1; cas <= t; ++cas)
// {
// 	cout << "Case #" << cas << ": ";
// }
constexpr long double Pi    = 3.14159265358979323846264338327950288L;
int main()
{
	// freopen("input.txt", "r", stdin);
	// freopen("output.txt", "w", stdout);
	ios::sync_with_stdio(false);
	cin.tie(0);

	double r;
	cin>>r;

	cout<<2*Pi*r<<endl;
	return 0;
}


Measured memory_bytes: 3848
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define int ll
inline ll read(){
	ll res=0,f=1;
	char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-f;ch=getchar();}
	while(ch>='0'&&ch<='9'){res=(res<<3)+(res<<1)+ch-'0';ch=getchar();}
	return res*f;
}
void write(ll x){
	if(x<0) putchar('-'),x=-x;
	if(x>9) write(x/10);
	putchar(x%10|'0');
}
const int mod=1e9+7;
const int N=2005;
int f[N][N];
void init(){
	f[0][0]=1;
	for(int i=1;i<=2000;i++){
		f[i][0]=1,f[i][i]=1;
		for(int j=1;j<=i;j++){
			f[i][j]=f[i-1][j]+f[i-1][j-1];
			f[i][j]%=mod;
		}
	}
}
signed main(){
	//freopen("ball.in","r",stdin);
	//freopen("ball.out","w",stdout);
	init();
	int n=read(),k=read();
	for(int i=1;i<=k;i++)write((f[n-k+1][i]*f[k-1][i-1])%mod),puts("");
}


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

ll sum_form(string &S, int n){
  ll ans = 0;
  rep(i, n){
    ans += sum_form(S,i)+pow(2,i-1<0?0:i-1)*stoll(S.substr(i,n-i));
  }
  return ans;
}

int main(){
  string S;
  cin >> S;
  ll ans = sum_form(S, S.size());
  cout << ans << endl;
}


Measured memory_bytes: 512
#include <stdio.h>
 
int main(){
  int n;
  scanf("%d\n",&n);
  int red = 0, blue = 0;
  char s;
  for(int i = 0; i < n; ++i){
    scanf("%c",&s);
    if(s == 'R') red++;
    else if(s == 'B') blue++;
  }
  //printf("%d %d\n",red,blue);
  if(red > blue) printf("Yes\n");
  else printf("No\n");
  return 0;
}

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

int main() {
  int N; cin >> N;
  int A[200000]; for (int i = 0; i < N; i++) cin >> A[i];
  sort(A, A + N);

  for (int i = 0; i < N - 1; i++) {
    if (A[i] == A[i + 1]) {
      cout << "NO" << endl;
      return 0;
    }
  }

  cout << "YES" << endl;
  return 0;
}

Measured memory_bytes: 1024
#include <stdio.h>
int main (){
	int x,y;
	for (int i=1; ; i++){
		scanf ("%d %d",&x,&y);
		if (x==0 && y==0){
			break;
		}
			if (x<y){
				printf ("%d %d\n",x,y);
			}else {
				printf ("%d %d\n",y,x);
			}
	}
	return 0;
}


Measured memory_bytes: 1920
package main

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

const (
	TooLarge = math.MaxInt64
	TooSmall = math.MinInt64
)

func main() {
	scanner := makeWordScanner()
	n := eGetInt(scanner)
	fmt.Println((n + 1) / 2)
}

////////////////////////////////////////////////////////////////////////////////
// ライブラリ
////////////////////////////////////////////////////////////////////////////////
func makeScanner(maxByte int) *bufio.Scanner {
	scanner := bufio.NewScanner(os.Stdin)
	scanner.Buffer(make([]uint8, 0, 8192), maxByte)
	return scanner
}
func makeCharScanner() *bufio.Scanner {
	scanner := makeScanner(8192)
	scanner.Split(bufio.ScanRunes)
	return scanner
}
func makeWordScanner() *bufio.Scanner {
	scanner := makeScanner(8192)
	scanner.Split(bufio.ScanWords)
	return scanner
}
func eGetLine(r *bufio.Scanner) string {
	if r.Scan() {
		return r.Text()
	}
	err := r.Err()
	if err != nil {
		log.Fatal(err)
	}
	// EOF
	return ""
}
func eGetInt(r *bufio.Scanner) int {
	line := eGetLine(r)
	return eAtoi(line)
}
func eGetInt64(r *bufio.Scanner) int64 {
	line := eGetLine(r)
	return eAtoInt64(line)
}
func eGetFields(r *bufio.Scanner) []string {
	line := eGetLine(r)
	return strings.Fields(line)
}
func eGetInts(r *bufio.Scanner) []int {
	fields := eGetFields(r)
	ints := make([]int, len(fields))
	for i := 0; i < len(ints); i++ {
		ints[i] = eAtoi(fields[i])
	}
	return ints
}
func eGetInt64s(r *bufio.Scanner) []int64 {
	fields := eGetFields(r)
	ints := make([]int64, len(fields))
	for i := 0; i < len(ints); i++ {
		ints[i] = eAtoInt64(fields[i])
	}
	return ints
}
func eGetChars(r *bufio.Scanner) []string {
	line := eGetLine(r)
	return strings.Split(line, "")
}
func eAtoi(s string) int {
	n, err := strconv.Atoi(s)
	if err != nil {
		log.Fatal(err)
	}
	return n
}
func eAtoInt64(s string) int64 {
	n, err := strconv.ParseInt(s, 10, 64)
	if err != nil {
		log.Fatal(err)
	}
	return n
}
func pow(a, n int) int {
	if n == 0 {
		return 1
	}
	if n == 1 {
		return a
	}
	if n%2 == 1 {
		return pow((a*a), n/2) * a
	}
	return pow((a * a), n/2)
}
func powMod(a, n, mod int) int {
	if n == 0 {
		return 1 % mod
	}
	if n == 1 {
		return a % mod
	}
	if n%2 == 1 {
		return powMod((a*a)%mod, n/2, mod) * a % mod
	}
	return powMod((a*a)%mod, n/2, mod)
}

func factoricalMod(n, count, mod int) int {
	if count == 1 {
		return n % mod
	}
	return (n % mod) * (factoricalMod(n-1, count-1, mod)) % mod
}

func combinationMod(n, a, mod int) int {
	x := factoricalMod(n, a, mod)
	y := factoricalMod(a, a, mod)
	y = powMod(y, mod-2, mod)
	return ((x % mod) * (y % mod)) % mod
}
func countBitOfOn(i, numbits int) int {
	count := 0
	var bit uint64
	for bit = 0; bit < uint64(numbits); bit++ {
		t := 1 << bit
		if i&t > 0 {
			count++
		}
	}
	return count
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long
#define UN unsigned int
#define mod 1000000007
#define F first
#define S second
#define mk make_pair
#define B(v) v.begin(), v.end()
#define BS binary_search
vector<int>edge[300005];
int d[300005];

void bfs(int s)
{
	queue<int>q;
	q.push(s);
	while(!q.empty())
	{
		int qq=q.front();
		q.pop();
		for(int i=0;i<edge[qq].size();i++)
		{
			d[edge[qq][i]]=(d[edge[qq][i]]+d[qq]);
			q.push(edge[qq][i]);
		}
	}
}

int main()
{
	int n,m;
	cin>>n>>m;
	for(int i=0;i<n-1;i++)
	{
		int q,w;
		cin>>q>>w;
		edge[q].pb(w);
		//edge[w].pb(q);
	}
	for(int i=0;i<m;i++)
	{
		int q,w;
		cin>>q>>w;
		d[q]=w+d[q];
	}
	bfs(1);
	// for(int i=1;i<=n;i++)
	// {
	// 	cout<<d[i]<<endl;
	// }
	for(int i=1;i<=n;i++) cout<<d[i]<<" ";
}

Measured memory_bytes: 16512
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rrep(i,n) for (int i = (int)(n)-1; i>=0; --i)
#define For(i,a,b) for(auto i=(a);i<=(b);++i)
#define rFor(i,a,b) for(auto i=(b);i>=(a);--i)
#define call(var) cerr<<#var<<"="<<var<<"\n";
#define dup(x,y) (((x)+(y)-1)/(y))
#define all(x) (x).begin(),(x).end()
using ll=long long;
using vi = vector<int>;
using vl = vector<ll>;
using vb = vector<bool>;
using Graph = vector<vi>;
using P = pair<int,int>;
const int MOD=(int)1e9+7;
const int INF=(int)1e9;
const ll LINF=(ll)1e18;
const double pi = acos(-1);
template<class t,class u> inline bool chmax(t&a,u b){if(a<b){a=b;return true;}return false;}
template<class t,class u> inline bool chmin(t&a,u b){if(b<a){a=b;return true;}return false;}
template<class T> istream& operator>>(istream& is, vector<T>& a){rep(i,a.size()) is >> a[i]; return is;}
template<class T> ostream& operator<<(ostream& os, vector<T>& a){rep(i,a.size()) os << a[i] << " "; return os;}
template<class T, class U> istream& operator>>(istream& is, pair<T,U>& p){is >> p.first >> p.second; return is;}
template<class T, class U> ostream& operator<<(ostream& os, const pair<T,U>& p){os << "("<< p.first << "," << p.second << ")"; return os;}
template<class T, class U> ostream& operator<<(ostream& os, const map<T,U>& mp){for(auto& t : mp) os << t.first << " " << t.second << "\n"; return os;}

int main(){
    bool x;cin >> x;
    cout << (1^x) << endl;
}

Measured memory_bytes: 3564
#include <bits/stdc++.h>
#define WHOLE(v) (v).begin(), (v).end()
using i64 = int64_t;
using namespace std;
int main() {
    int N;
    cin >> N;
    vector<i64> A(N);
    for(int i = 0; i < N; i++) {
        cin >> A[i];
    }
    int ans = 0;
    multiset<i64> s;
    for(int i = 0; i < N; i++) {
        auto itor = s.upper_bound(-A[i]);
        if(itor == s.end()) {
            ans++;
            s.insert(-A[i]);
        } else {
            s.erase(itor);
            s.insert(-A[i]);
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 5760
# include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 10, INF = 1e9 + 100;
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int a, b, c, d;
	cin >> a >> b >> c >> d;
	while(true){
		c -= b;
		if(c <= 0){
			cout << "Yes\n";
			return 0;
		}
		a -= d;
		if(a <= 0){
			cout << "No\n";
			return 0;
		}
	}
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
#define int long long int
#define pb push_back
#define MAX 1000005
#define mod 1000000007
#define sp fixed<<setprecision(12)
using namespace std;
/*
vector<int> primes;
int sumprime[MAX];
bool is_prime[MAX];
void sieve(){
    is_prime[0]=is_prime[1]=true;
    for(int i=4;i<MAX;i+=2){
        is_prime[i]=true;
    }
    for(int i=3;i*i<MAX;i+=2){
        if(!is_prime[i]){
            for(int j=i*i;j<MAX;j+=i){
                is_prime[j]=true;
            }
        }
    }
    for(int i=1;i<MAX;i++){
        if(!is_prime[i]){
            sumprime[i]=sumprime[i-1]+i;
        }else{
            sumprime[i]=sumprime[i-1];
        }
    }
}
*/
/*
void lcs(char s1[],char s2[]){
    int n=strlen(s1);
    int m=strlen(s2);
    vector<vector<int>> dp(n+1,vector<int>(m+1,0));
    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            int sum=0;
            if(s1[i-1]==s2[j-1]){
                sum=1+dp[i-1][j-1];
            }
            else{
                sum=max(dp[i-1][j],dp[i][j-1]);
            }
            dp[i][j]=sum;
        }
    }
    
    int index=dp[n][m];
    //cout<<index<<endl;
    char ans[index+1];
    ans[index]='\0';
    index--;
    int x=n;
    int y=m;
    while(x>0 and y>0){
        if(dp[x-1][y]==dp[x][y-1] and dp[x-1][y]!=dp[x][y]){
            ans[index]=s1[x-1];
            index--;
            x--;
            y--;
        }else if(dp[x-1][y]>dp[x][y-1]){
            x--;
        }else{
            y--;
        }

    }
    //reverse(ans.begin(),ans.end());

    cout<<ans;
    return;
}
*/

int dp[3001][3001][2];

int32_t main(){

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    #endif
    //double    pi=3.14159265358979323846;
    //sieve();
    int t=1;
    //sieve();
   // cin>>t;
    
    for(int tc=1;tc<=t;tc++){
        int n,sum=0;
        cin>>n;
        vector<int> v(n);
        for(int& x:v){
            cin>>x;
            sum+=x;
        }
        for(int i=0;i<n;i++){
            dp[i][i][0]=v[i];
            dp[i][i][1]=0;
        }
        for(int r_l=1;r_l<n;r_l++){
            for(int l=0;l+r_l<n;l++){
                int r=l+r_l;
                dp[l][r][0]=max(v[l]+dp[l+1][r][1],v[r]+dp[l][r-1][1]);
                dp[l][r][1]=min(dp[l+1][r][0],dp[l][r-1][0]);
            }
        }
        int x=dp[0][n-1][0];
        int ans=(2*x)-sum;
        cout<<ans<<'\n';

    }
    
    return 0;
    
}

Measured memory_bytes: 85400
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define MOD 1000000007
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
using P = pair<int,int>;
  
int main()
{
  ll a, b, c;
  cin >> a >> b >> c;
  ll x = 0;
  if(c-a-b>=0){
    x=(c-a-b)*(c-a-b)-4*a*b;
    if(x>0){
      cout << "Yes" << endl;
    }else{
      cout << "No" << endl;
    }
  }else{
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
while true
  n, m = gets.chomp.split(" ").map(&:to_i)
  break if n == 0 && m == 0
  asum = 0
  a = []
  n.times do
    x = gets.chomp.to_i
    asum += x
    a << x
  end
  bsum = 0
  b = []
  m.times do
    x = gets.chomp.to_i
    bsum += x
    b << x
  end
  flag = false
  cursum = 500
  retx = 0
  rety = 0
  a.each do |x|
    y = 2 * x - (asum - bsum)
    if !(b.find{|i| 2 * i == y}.nil?) then
    flag = true
    if (2 * x + y) < cursum then
      cursum = 2 * x + y
      retx = x
      rety = y / 2
    end
    end
  end
  if flag then
    puts "#{retx} #{rety}"
  else
    puts -1
  end
end

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

typedef long long ll;

ll N;
vector<ll> A, B;
ll R;

ll kill(ll a, ll b) {
  ll x = min(A[a], B[b]);
  A[a] -= x;
  B[b] -= x;
  return x;
}
int main() {
  cin >> N;
  A.resize(N + 1);
  for (ll i = 0; i < N + 1; ++i) cin >> A[i];
  B.resize(N);
  for (ll i = 0; i < N; ++i) cin >> B[i];
  for (ll i = 0; i < N; ++i) {
    R += kill(i, i);
    R += kill(i + 1, i);
  }
  cout << R << endl;
  return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
typedef long long LL;
#define SORT(c) sort((c).begin(),(c).end())

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

using namespace std;
int si(string s)
{
  return (stoi(string(s.begin(),s.begin()+2))*60+stoi(string(s.begin()+3,s.begin()+5)));
}
int calt(string s,string t)
{
  return si(t)-si(s);
}
int main(void)
{
  for(;;){
    int n;
    cin >> n;
    if(!n) return 0;
    bool g=false;
    map<string,string> from;
    map<string,int> t;
    string d,m,io,id;
    REP(i,n){
      cin >> d >> m >> io >> id;
      if(id=="000"){
	if(g)
	  for(auto x:from)
	    t[x.first]+=calt(x.second,m);
	else
	  for(auto &x:from)
	    x.second=m;
	g=!g;
      }else{
	if(from.count(id)){
	  if(g) t[id]+=calt(from[id],m);
	  from.erase(id);
	}
	else from[id]=m;
      }
    }
    int answer=0;
    for(auto x:t) answer=max(answer,x.second);
    cout << answer << endl;
  }
}

Measured memory_bytes: 3224
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		int w = stdIn.nextInt();
		int h = stdIn.nextInt();
		int x = stdIn.nextInt();
		int y = stdIn.nextInt();
		int r = stdIn.nextInt();
		
		if (x >= r && x <= w - r && y >= r  && y <= h - r) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}

}



Measured memory_bytes: 26308
#include <iostream>
using namespace std;
int main(){
  int a[3],b=0;
  cin>> a[0]>>a[1]>>a[2];
  for(int i=0;i<3;i++){
    if(a[i]==7){
      if(a[(i+1)%3]==5&&a[(i+2)%3]==5){
        b=1;
      }
    }
  }
  if(b==1){
    cout << "YES" <<endl;
  }else{
    cout << "NO" <<endl;
  }
}

Measured memory_bytes: 256
N = int(input())
A = [int(i) for i in input().split(" ")]
B = [int(i) for i in input().split(" ")]
C = [int(i) for i in input().split(" ")]
ans = 0
b = -1
for i in A:
  ans += B[i-1]
  if i == (b+1):
    ans += C[i-2]
  b = i
print(ans)

Measured memory_bytes: 3064
a,b,c,d,e,f = gets.split.map(&:to_i)

water = []
(0..f/100).each do |i|
  (0..f/100).each do |j|
    sum = (a*i + b*j) * 100
    water << sum if f >= sum
  end
end

sugar = []
(0..f/c).each do |i|
  (0..f/c).each do |j|
    sum = c*i + d*j
    sugar << sum if f >= sum
  end
end

m_wat = 0
m_sug = 0
m_con = 0
water.each do |w|
  sugar.each do |s|
    next if f < w + s
    if w != 0 && (w/100)*e >= s
      con = (100.0*s)/(w+s)
      if con > m_con
        m_wat = w
        m_sug = s
        m_con = con
      end
    end
  end
end

if m_wat == 0
  puts "#{100*a} 0"
else
  puts "#{m_wat+m_sug} #{m_sug}"
end


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

int main() {
  int N; 
  cin>>N;
  vector<int> A(N);
  rep(i,N) cin>>A[i];
  
  int ans;
  rep(i,100){
    bool flag=1;
    rep(j,N){
      if(A[j]%2!=0)flag=0;
    }
    if(flag){
      ans++;
      rep(k,N)A[k] /= 2;
    }
    else break;
  }
  cout<<ans<<endl;
  return 0;
}

Measured memory_bytes: 256
import itertools
seq=('0','1')
a=list(itertools.product(seq, repeat=10))
n=int(input())

f=[]
c=[]
p=[]
for i in range(n):
  f.append([int(i) for i in input().split(" ")])
for i in range(n):
  c.append([int(i) for i in input().split(" ")])

flg=0

z  = 0
z1 = -10000000000000
for ai0 in a:
  ai=[int(i) for i in ai0]
  z0=0

  if max(ai) > 0:
    for j in range(n):
      z0 += c[j][sum([x * y for x, y in zip(f[j], ai)])]

    if z0 > 0:
      z  = max(z,z0)
      flg=1
    else:  
      z1 = max(z1,z0)
    
if flg==0:
  print(z1)
else:
  print(z)

Measured memory_bytes: 3316
#include<bits/stdc++.h>
using namespace std;
int main(){
  int64_t x,k,d;
  cin >> x >> k >> d;
  x=llabs(x);
  int64_t steps=min(k,x/d);
  k-=steps;
  x-=d*steps;
  if(k!=0){
    if(k%2==0)cout << x << endl;
    else cout << d-x << endl;
  }else cout << x << endl;
}



Measured memory_bytes: 3580
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define For(i,a,b) for(int i=a;i<=b;i++)
#define F first
#define S second
#define all(x) x.begin(),x.end()
#define sz(x) ((int)x.size())
#define MOD (ll)(1e9+7)
#define INF 1e17
#define int ll
#define EPS (1e-6)
using namespace std;
using ll=long long;
using pii=pair<int,int>;

int gcd(int a,int b) { return b==0?a:gcd(b,a%b); }
int lcm(int a,int b) { return a/gcd(a,b)*b; }

int fpow(int b,int p)
{
	if(p==0) return 1;
	int h=fpow(b,p/2);
	if(p%2) return h*b%MOD*h%MOD;
	return h*h%MOD;
}

int32_t main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	int p; cin>>p;
	int n=fpow(2,p);
	multiset<int> pq;
	For(i,0,n-1){
		int t; cin>>t;
		pq.emplace(-t);
	}
	multiset<int> now;
	now.emplace(*pq.begin());
	pq.erase(pq.begin());
	while(!pq.empty()){
		multiset<int> add;
		for(auto &i:now){
			auto it=pq.upper_bound(i);
			if(it==pq.end()){
				cout<<"No\n";
				return 0;
			}
			add.insert(*it);
			pq.erase(it);
		}
		for(auto &i:add) now.insert(i);
	}
	cout<<"Yes\n";
	return 0;
}





























Measured memory_bytes: 18688
#include <iostream>

using namespace std;

typedef long long ll;
string s;
int n;
int main(){
	cin >> s;
	n = s.size();
	ll ans = 0;
	int now = 0;
	for(int i = n - 1 ; i >= 0 ; -- i){
		if(s[i] == 'A')
			ans += now;
		else if(s[i] == 'C'){
			if(s[i - 1] == 'B'){
				now ++;
				-- i;
			}
			else
				now = 0;
		}
		else
			now = 0;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 640
'use strict'
function Main(input) {
  // inputの切り分け
  let data = input.trim().split("\n");
  let info = data.shift();
  
  // 各数値の切り分けと型変換
  let nums = data[0].split(" ").map(x => x*1);
  // 足し合わせてそれぞれから1ずつ引いたものが答えになるっぽい
  let ans = nums.reduce((n,acc) => acc += n*1) - nums.length;
  console.log(ans);
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));

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

int main(){
    int n ; cin >> n ;
    int cnt = 0 ;
    vector<int> a(n) ;
    for(int i=0;i<n;i++) cin >> a.at(i) ;
    bool flag = true ;
    while(flag){
        flag = false ;
        for(int i=n-1;i>0;i--){
            if(a.at(i)<a.at(i-1)){
                cnt++ ;
                int sub = a.at(i) ;
                a.at(i) = a.at(i-1) ;
                a.at(i-1) = sub ;
                flag = true ;
            }
        }
    }
    for(int i=0;i<n;i++){
        cout << a.at(i) ;
        if(i==n-1) cout << endl ;
        else cout << " " ;
    }
    cout << cnt << endl ;
}


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

#define fr first
#define sc second
#define mk make_pair
#define pb push_back
#define ll long long

using namespace std;

 map<int,int>mp;
int main()
{
    int n, m, i, a, b;
    cin >> n;
    for (i = 0; i < n; i++)
    {
        cin >> a;
       mp[a]++;
    }
    cin >> m;
    for (i = 0; i < m; i++)
    {
        cin >> b;
        mp[b]--;
        if (mp[b] < 0)
        {
            cout << "NO";
            return 0;
        }

    }
    cout << "YES";
   return 0;
}




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

int main()
{
    int A,B,C,D,E,F;
    cin >> A >> B >> C >> D >> E >> F;
    A *= 100;
    B *= 100;

    vector<int> water,suger;
    for(int i=0; A*i <= F; i++){
        for(int j=0; A*i+B*j <= F; j++){
            water.push_back(A*i+B*j);
        }
    }

    for(int i=0; C*i <= F; i++){
        for(int j=0; C*i+D*j <= F; j++){
            suger.push_back(C*i+D*j);
        }
    }
    int ans=0,sug=0;
    double md = -1.0;
    for(auto w : water){
        for(auto s : suger){
            if(w+s <= F && s<= w/100*E){
                double dens = 1.0*s/(w+s);
                if(dens > md){
                    md = dens;
                    ans = w+s;
                    sug = s;
                }
            }
        }
    }
    cout << ans << " " << sug << endl;
    return 0;
}


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

int n, bm, sm;
vector< complex<double> > b;
vector< complex<double> > s;

void rotate(){
  for(int i=0; i<sm; i++){
    double tmp=s[i].real();
    s[i].real()=s[i].imag();
    if(tmp!=0)s[i].imag()=-tmp;
    else s[i].imag()=tmp;
  }
}

bool comp(){
  for(int i=0; i<sm; i++){
    if(b[i].real()-b[0].real() != s[i].real()-s[0].real())return false;
    if(b[i].imag()-b[0].imag() != s[i].imag()-s[0].imag())return false;
  }
  return true;
}

bool solve(){
  if(bm!=sm)return false;
  for(int i=0; i<4; i++){
    if(comp())return true;
    rotate();
  }
  reverse(s.begin(), s.end());
  for(int i=0; i<4; i++){
    if(comp())return true;
    rotate();
  }
  return false;
}

int main(){
  while(cin>>n, n!=0){
    b.clear();
    cin>>bm;
    for(int i=0; i<bm; i++){
      complex<double> tmp;
      cin>>tmp.real()>>tmp.imag();
      b.push_back(tmp);
    }

    for(int i=1; i<=n; i++){
      s.clear();
      cin>>sm;
      for(int j=0; j<sm; j++){
        complex<double> tmp;
        cin>>tmp.real()>>tmp.imag();
        s.push_back(tmp);
      }
      if(solve())cout<<i<<endl;
    }
    cout<<"+++++"<<endl;
  }
  return 0;
}

Measured memory_bytes: 1236
import java.io.*;import java.util.*;class Main { 
  public static void main(String[] args) throws java.lang.Exception { 
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); 

    int[] intArray = Arrays.stream(br.readLine().split(" ")) .mapToInt(Integer::parseInt) .toArray(); 
    int r = intArray[0]; 
    
    int circl = r * r;
    System.out.println(circl);
  }               
}

Measured memory_bytes: 27728
N = int(input())
WN = [int(s) for s in input().split(' ')]
sum_wn = sum(WN)
sum_n = 0
sum_n2 = 0
for w in WN:
    sum_n2 += w
    if sum_n + w > (sum_wn // 2):
        break    
    sum_n = sum_n2
a = sum_wn - 2 * sum_n
b = sum_wn - 2 * sum_n2
print(min(abs(a), abs(b)))


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

//template
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(a);i>(b);i--)
#define ALL(v) (v).begin(),(v).end()
typedef long long int ll;
const int inf = 0x3fffffff; const ll INF = 0x1fffffffffffffff; const double eps=1e-12;
string to_str(ll x){string res; while(x)res+=('0'+(x%10)),x/=10; reverse(ALL(res)); return res;}
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; }
//template end

string s,t; int n;
int ans=inf,lb[3010],rb[3010];
void solve(){
    rep(i,0,n){
        lb[i]=rb[i]=0;
        int idx=i;
        while(t[idx]=='0'){
            rb[i]++; idx++;
            if(idx==n)idx=0;
        } idx=i;
        while(t[idx]=='0'){
            lb[i]++; idx--;
            if(idx==-1)idx=n-1;
        }
    }
    int buf[3010]={};
    rep(d,0,n){
        int add=0;
        rep(i,0,n)if(s[i]!=t[(i+d)%n]){
            add++; chmax(buf[lb[i]],rb[i]);
        }
        int r=d,cur=inf;
        rrep(l,n-1,-1){
            chmax(r,buf[l+1]);
            chmin(cur,2*(r+l)-d);
        }
        chmin(ans,cur+add);
    }
}

int main(){
    cin>>s>>t; n=s.size();
    if(count(ALL(t),'1')==0){
        printf(count(ALL(s),'1')?"-1\n":"0\n");
        return 0;
    }
    solve(); reverse(ALL(s)); reverse(ALL(t)); solve();
    printf("%d\n",ans);
    return 0;
}

Measured memory_bytes: 256
from itertools import combinations

n = int(input())
L =  list(map(int, input().split()))
if n < 3:
    print(0)
    exit(0)
ans = 0
for i, j, k in combinations(L, 3):
    if i != j and j != k and k != i:
        com = sorted([i,j,k])
        if com[0] + com[1] > com[2]:
            ans += 1
print(ans)

Measured memory_bytes: 9192
n = int(input())
d = list(map(int, input().split()))

zero_id = []
for i in range(len(d)):
    if d[i] == 0:
        zero_id.append(i)
if zero_id == [0]:
    from collections import Counter
    c = Counter(d)
    keys = sorted(c.keys())

    ans = 1
    for i in range(keys[-1]):
        ans *= c.get(i, 0) ** c.get(i+1, 0)
    print(ans % 998244353)
else:
    print(0)


Measured memory_bytes: 63924
#include<iostream>
using namespace std;
int main()
{
	int s,a;
	cin>>s>>a;
	string n;
	cin>>n;
	n[a-1]=n[a-1]+32;
	for(int i=0;i<s;i++)
	{
		cout<<n[i];
	 } 
	 cout<<endl;
	 return 0;
}

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


int main(){
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    string s;
    cin >> s;
    int r = 0;
    for (char x: s) 
        r = (r + x - '0') % 9;
    if (r == 0) cout << "Yes";
    else cout << "No";
    return 0;
}


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

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
        ll s;
        cin >> s;
        ll a[100001] = {0};
        a[3] = 1;
  		if(s == 1)
          cout << 0 << endl;
  else{
        for(int i = 4; i <= s; i++){
            for(int j = i - 3; j >= 0 ; j--){
                a[i] += a[j];
                a[i] %= mod;
            }
            a[i] += 1;
            a[i]%= mod;
        }
        cout << a[s]%mod;
  }
    return 0;
}


Measured memory_bytes: 4432
MOD=998244353
N, M, K=map(int, input().split())

UPPERLIMIT=2*10**5+1
MODMUL=[1, 1]+[0]*(UPPERLIMIT-1)
for i in range(2, UPPERLIMIT+1):
  MODMUL[i]=MODMUL[i-1]*i%MOD
MODDIV=[1]*UPPERLIMIT+[pow(MODMUL[-1], MOD-2, MOD)]
for i in range(UPPERLIMIT, 0, -1):
  MODDIV[i-1]=MODDIV[i]*i%MOD
def MODCOMB(n, r):
  return (((MODMUL[n]*MODDIV[r])%MOD)*MODDIV[n-r])%MOD

ans=0
for i in range(K+1):
  ans+=M*pow(M-1, N-1-i, MOD)*MODCOMB(N-1, i)%MOD
  ans%=MOD
  
print(ans)

Measured memory_bytes: 26292