akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
 
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define Eunique(v) v.erase(unique(all(v)),v.end())
#define pvec(v) rep(i,v.size()){cout << v[i] << " ";};cout<<endl;
#define pb push_back
#define pf push_front
#define mod 1e9+7
#define m_p make_pair
#define DOUBLE fixed << setprecision(15)
 
typedef vector<int> vi;
typedef vector<string> vs;
typedef long long ll;
typedef vector<ll> vll;
typedef pair<int,int> pii;
typedef vector<pii> vpii;
typedef pair<ll,ll> pll;
typedef vector<pll> vpll;
typedef vector<vector<int>> vvi;
typedef vector<vector<ll>> vvll;
const double pi = acos(-1.0);
 
ll gcd(ll x, ll y) { return (y == 0) ? x : gcd(y, x % y); }
ll lcm(ll x, ll y) { return x * y / gcd(x, y); }

bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false;

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return false;
        }
    }
    return true;
}

void solve(){
    ll a,b,c;
    cin >> a >> b >> c;
    if(a%2==0 || b%2==0 || c%2==0) cout << 0 << endl;
    else{
        ll tmp1=abs(a*b*(c/2)-a*b*((c+1)/2));
        ll tmp2=abs(b*c*(a/2)-b*c*((a+1)/2));
        ll tmp3=abs(a*c*(b/2)-a*c*((b+1)/2));
        ll ans=min({tmp1,tmp2,tmp3});
        cout << ans << endl;
    }
}

int main()
{
    solve();
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;++i)
#define rrep(i,n) for(int i=n-1;i>=0;--i)
#define fi first
#define se second
#define sz(x) (int)(x).size()
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
using namespace std;
using ll = long long;
using P = pair<int, int>;
template<typename T> inline bool chmax(T &a,T b){if(a<b){a=b;return 1;}return 0;}
template<typename T> inline bool chmin(T &a,T b){if(b<a){a=b;return 1;}return 0;}
template<typename T> vector<T> make_vec(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>
auto make_vec(size_t a,Ts... ts){return vector<decltype(make_vec<T>(ts...))>(a,make_vec<T>(ts...));}
template<typename T,typename U,typename... V>
typename enable_if<is_same<T,U>::value>::type fill_v(U &u,const V... v){u=U(v...);}
template<typename T,typename U,typename... V>
typename enable_if<!is_same<T,U>::value>::type fill_v(U &u,const V... v){for(auto &e:u)fill_v<T>(e,v...);}

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

    int n, y;
    cin >> n >> y;
    for (int i = 0; i <= n; ++i) {
        for (int j = 0; i + j <= n; ++j) {
            int k = n - i - j;
            int now = 10000 * i + 5000 * j + 1000 * k;
            if (now == y) {
                printf("%d %d %d\n", i, j, k);
                return 0;
            }
        }
    }
    printf("%d %d %d\n", -1, -1, -1);
}


Measured memory_bytes: 3772
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <algorithm>
#include <cctype>
#include <cmath>
#include <queue>
#include <map>
#include <numeric>
#include <unordered_map>
#include <iomanip>

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define all(x) (x).begin(),(x).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; }

typedef long long ll;

using namespace std;




int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  //cout<<setprecision(10);
  int k;
  cin>>k;
  while(k%2==0)k/=2;
  while(k%5==0)k/=5;
  int loop=0;
  int m=1;
  vector<int>edge;
  vector<int>f(k,0);
  do {
    edge.push_back(m);
    if(f[m]==0)f[m]=1;
    else break;
    m*=10;
    m%=k;
    loop++;
  }while(m!=1);
  //cout<<loop<<endl;
  //  cout<<k<<endl;
  if(k==1){cout<<1<<endl;return 0;}
  if(loop==k-1){cout<<2<<endl;return 0;}
  vector<int>dist(k,0);

  queue<int>que;
  que.push(1);
  while(!que.empty())
  {
    int now=que.front();que.pop();
    for(int i:edge)
    {
      int tmp=(i+now);
      if(tmp>=k)tmp-=k;
      if(dist[tmp]>0)continue;
      dist[tmp]=dist[now]+1;
      if(tmp==0)
      {
        cout<<dist[tmp]+1<<endl;
        return 0;
      }
      que.push(tmp);
    }
  }



  return 0;

}


Measured memory_bytes: 1660
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

struct node{
  unsigned int key;
  struct node *next;
  struct node *prev;
};

typedef struct node * NodePointer;

NodePointer nil;

NodePointer listSearch(int key){
  NodePointer cur = nil->next;
  while( cur != nil && cur->key != key ){
    cur = cur->next;
  }
  return cur;
}

void init(){
  nil = malloc(sizeof(struct node));
  nil->next = nil;
  nil->prev = nil;
}

void printList(){
  NodePointer cur = nil->next;
  int isf = 1;
  while(1){
    if ( cur == nil ) break;
    if ( isf == 0)  printf(" ");
    printf("%d", cur->key);
    cur = cur->next;
    isf = 0;
  }
  printf("\n");
}

void deleteNode(NodePointer t){
  t->prev->next = t->next;
  t->next->prev = t->prev;
}

void deleteFirst(){
  NodePointer t = nil->next;
  if ( t == nil ) return;
  deleteNode(t);
}

void deleteLast(){
  NodePointer t = nil->prev;
  if( t == nil ){
    return;
  }
  deleteNode(t);
}

void delete(int key){
  NodePointer t = listSearch(key);
  if( t == nil ){
    return;
  }
  deleteNode(t);
}


void insert(int key){
  NodePointer x;
  x = malloc(sizeof(struct node));
  x->key = key;
  x->next = nil->next;
  nil->next->prev = x;
  nil->next = x;
  x->prev = nil;
}

int main(){
  int key, n, i;
  int size = 0;
  char com[20];
  int np = 0, nd = 0;
  scanf("%d", &n);
  init();
  for ( i = 0; i < n; i++ ){
    scanf("%s%d", com, &key);
    if ( com[0] == 'i' ) {
      insert(key);
      np++;
      size++;
    }
    else if ( com[0] == 'd' ) {
      if (strlen(com) > 6){
	if ( com[6] == 'F' ){
	  deleteFirst();
	}
	else if ( com[6] == 'L' ){
	  deleteLast();
	}
      }
      else{
	delete(key); nd++; 
      }
      size--;
    }
  }

  printList();
  return 0;
}



Measured memory_bytes: 36076
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template <class T, class U> using Pa = pair<T, U>;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string S;
    cin >> S;
    cout << S[0] << (S[1]=='B'? 'R':'B') << S[2] << "\n";
}

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

int main(){
  vector<int> x(3);
  
  for (int i = 0; i < 3; i++){
    cin >> x.at(i);
  }
  
  cout << x.at(2) << " " << x.at(0) << " " << x.at(1) << endl;
}


Measured memory_bytes: 256
#include<stdio.h>

int main(){
	int W,H,x,y,r;
	scanf("%d %d %d %d %d",&W,&H,&x,&y,&r);
	if(x-r >= 0 && x+r <= W && y-r >= 0 && y+r <= H){
		printf("Yes\n");
	}
	else{
		printf("No\n");
	}
	return 0;
}

Measured memory_bytes: 584
import copy 

n,a,b,c=map(int,input().split())
l=[int(input()) for i in range(n)]
table=[]
for i in range(4**n):
    lis=[]
    x=copy.deepcopy(i)
    for j in range(n):
        lis.append(x%4)
        x=x//4
    table.append(lis)
ans=float('inf')
for i in table:
    check=set(i)
    w=0
    for k in check:
        w+=k
    if w!=6:
        continue
    x,y,z=0,0,0
    ans_sub=0
    cnt=-3
    for j in range(n):
        if i[j]==1:
            x+=l[j]
            cnt+=1
        elif i[j]==2:
            y+=l[j]
            cnt+=1
        elif i[j]==3:
            z+=l[j]
            cnt+=1
    ans_sub+=abs(a-x)+abs(b-y)+abs(c-z)+max(cnt,0)*10
    ans=min(ans,ans_sub)
print(ans)

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

/********************************************************************/
#define M1 1000000007
#define M3 1000000009
#define M2 998244353
#define ll long long
#define pll pair<ll,ll>
#define REP(i,a,b) for(ll i=a;i<b;i++)
#define REPR(i,a,b) for(ll i=b-1;i>=a;i--)
#define forr(i,n) for(ll i=0;i<n;i++)
#define F first
#define S second
#define pb push_back
#define DB pop_back
#define mp make_pair
#define MT make_tuple
#define V(a) vector<a>
#define vi vector<ll>
#define endl '\n'
#define ce(ele) cout<<ele<<' '
#define cs(ele) cout<<ele<<'\n'
#define CASE(t) ll t; cin>>t; while(t--)
#define sor(v) sort(v.begin(),v.end())
#define rev(v) reverse(v.begin(),v.end())

/********************************************************************/
const double pi = 3.1415926535;
ll n, m;
const int mx = 69;
char grid[mx][mx];
ll blocked[mx][mx];
ll vis[mx][mx];
/********************************************************************/
//FAST IO//
void FAST() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
}

/********************************************************************/

ll power(ll a, ll b)
{
	ll res = 1;
	for (int i = 1; i <= b; ++i)
		res *= a;

	return res;
}
ll sum(ll x) {
	ll ans = 0;
	while (x > 0) {
		ans += (x % 10);
		x /= 10;
	}
	return ans;
}

bool opp(int x, int y)
{
    return ((x ^ y) < 0);
}

int main()
{
  FAST();
  ll n;
  cin>>n;
  double p[n+1];
  for(ll i=1;i<=n;i++)
  {
  	cin>>p[i];
  }
  double dp[n+1][n+1];
  for(ll i=0;i<=n;i++)
  {
  	for(ll j=0;j<=n;j++)
  	{
  		dp[i][j]=0;
  	}
  }
  dp[1][0]=1.0-p[1];
  for(ll i=2;i<=n;i++)
  {
  	dp[i][0]=dp[i-1][0]*(1.0-p[i]);
  }
  dp[1][1]=p[1];
  for(ll i=2;i<=n;i++)
  {
  	dp[i][i]=dp[i-1][i-1]*p[i];
  }
  for(ll i=1;i<=n;i++)
  {
  	for(ll j=1;j<i;j++)
  	{
  		dp[i][j]=dp[i-1][j-1]*p[i]+dp[i-1][j]*(1-p[i]);
  	}
  }
  double res=0;
  for(ll i=n/2+1;i<=n;i++)
        res += dp[n][i];
    
    cout << fixed << setprecision(10) << res;
  
}

Measured memory_bytes: 70656
var
N,MM,i,j:Longint;
m:int64=1000000007;
a:Array[1..100000]of Longint;
dp:Array[0..100002]of int64;
begin
read(N,MM);
for i:=1 to MM do read(a[i]);
dp[0]:=1;
j:=1;
for i:=0 to N do begin
while(j<=MM)and(a[j]<i)do inc(j);
if(j<=MM)and(a[j]=i)then dp[i]:=0;
dp[i]:=dp[i]mod m;
inc(dp[i+1],dp[i]);
inc(dp[i+2],dp[i]);
end;
writeln(dp[N]);
end.


Measured memory_bytes: 1280
//ヘッダー
#include<bits/stdc++.h>
using namespace std;

//型定義
typedef long long ll;

//定数
const int INF=1e+9;
const int MOD=1e+9+7;

//REPマクロ
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define REP2(i,a,b) for(ll i=a;i<(ll)(b);i++)
#define REPD2(i,a,b) for(ll i=a;i>(ll)(b);i--)

// 多次元 vector 生成
template<class T>
vector<T> make_vec(size_t a){
    return vector<T>(a);
}
template<class T, class... Ts>
auto make_vec(size_t a, Ts... ts){
  return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));
}

//vectorの扱い
#define ALL(x) (x).begin(),(x).end() //sortなどの引数省略
#define SIZE(x) ((ll)(x).size()) //size
#define MAX(x) *max_element(ALL(x)) //最大値
#define MIN(x) *min_element(ALL(x)) //最小値
struct LazySegmentTree {
private:
    int n;
    vector<ll> node, lazy;

public:
    LazySegmentTree(vector<ll> v) {
        int sz = (int)v.size();
        n = 1; while(n < sz) n *= 2;
        node.resize(2*n-1);
        lazy.resize(2*n-1, 0);

        for(int i=0; i<sz; i++) node[i+n-1] = v[i];
        for(int i=n-2; i>=0; i--) node[i] = node[i*2+1] + node[i*2+2];
    }

    void eval(int k, int l, int r) {
        if(lazy[k] != 0) {
            node[k] += lazy[k];
            if(r - l > 1) {
                lazy[2*k+1] += lazy[k] / 2;
                lazy[2*k+2] += lazy[k] / 2;
            }
            lazy[k] = 0;
        }
    }

    void add(int a, int b, ll x, int k=0, int l=0, int r=-1) {
        if(r < 0) r = n;
        eval(k, l, r);
        if(b <= l || r <= a) return;
        if(a <= l && r <= b) {
            lazy[k] += (r - l) * x;
            eval(k, l, r);
        }
        else {
            add(a, b, x, 2*k+1, l, (l+r)/2);
            add(a, b, x, 2*k+2, (l+r)/2, r);
            node[k] = node[2*k+1] + node[2*k+2];
        }
    }

    ll getsum(int a, int b, int k=0, int l=0, int r=-1) {
        if(r < 0) r = n;
        eval(k, l, r);
        if(b <= l || r <= a) return 0;
        if(a <= l && r <= b) return node[k];
        ll vl = getsum(a, b, 2*k+1, l, (l+r)/2);
        ll vr = getsum(a, b, 2*k+2, (l+r)/2, r);
        return vl + vr;
    }

    ll get(int n){
        return node[n];
    }

};

int main(){
    ll N,K;
    cin>>N>>K;
    vector<ll> A(N,0);
    REP(i,N) cin>>A[i];
    
    REP(i,K){
        vector<ll> table(N+1,0);
        REP(j,N){
            table[max((ll)0,j-A[j])]++;
            table[min(j+A[j]+1,N)]--;
        }
        REP2(j,1,N) table[j]+=table[j-1];

        ll ans=INF;
        REP(j,N){
            A[j]=table[j];
            ans=min(ans,A[j]);
        }
        if(ans==N) break;
        
    }

    REP(i,N){
        cout<<A[i]<<" ";
    }
    cout<<endl;
}

Measured memory_bytes: 6348
#include <iostream>
#include <vector>

using namespace std;

int main()
{
    int n, a, b, c, x;
    while( cin >> n >> a >> b >> c >> x ) {
        if ( n == 0 && a == 0 && b == 0 && c == 0 && x == 0 )
            break;

        auto const res =
            [&]() -> int {
                vector<int> ys(n);
                for( int i=0; i<n; ++i ) 
                    cin >> ys[i];

                int current = x, next = x;
                int count = 0;
                for( int i=0; i<n; ++i ) {
                    for(;;) {
                        if ( count > 10000 )
                            return -1;

                        current = next;
                        next = ( a * current + b ) % c;                    

                        ++count;
                        if ( current == ys[i] )
                            break;
                    }
                }

                return count - 1;
            }();

        cout << res << endl;
    }
}

Measured memory_bytes: 1192
#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
#include <bitset>
using namespace std;
typedef long long ll;
#define rep(i,s,n)for(ll i = s;i<n;i++)
#define repe(i,s,n)for(ll i = s;i<=n;i++)

int calc(int i, int j) {
	int v = 1;
	rep(k, 0, j) {
		v = v * i;
	}
	return v;
}
int main() {
	int x; cin >> x;
	int sum = 0;
	int ans = 0;
	rep(i, 1, 250) {
		rep(j, 2, 250) {
			sum = calc(i, j);
			if (x >= sum) {
				ans = max(sum, ans);
			}
		}
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
	int S, h, m, s;
	scanf("%d", &S);

	h = S / 3600;
	S = S % 3600;

	m = S / 60;
	S = S % 60;

	s = S;

	printf("%d:%d:%d\n", h, m, s);

	return 0;
}

Measured memory_bytes: 592
#%%
import sys
def input():
    return sys.stdin.readline().rstrip()

def main():
    N=int(input())
    S=input()

    d=ord('Z')-ord('A') + 1

    for c in S:
        o = (ord(c)-ord('A')+N)%d + ord('A') 
        print(chr(o), end="")


# %%
if __name__ == '__main__':
    main()

# %%
# from atcoder_test import doTest
# doTest("abc146","b",main)


Measured memory_bytes: 4468
process.stdin.resume();
process.stdin.setEncoding('utf8');
// Here your code !
process.stdin.on('data', function(chunk){
    var lines = chunk.toString().split("\n");
    var N = parseInt(lines[0]);
    var a = lines[1];
    var A =a.split(" "); 
    
    var min = A[0];
    var max = A[0];
    
    
    for(i=0; i<N; i++){
        min = Math.min(min,A[i]);
    }

    for(i=0; i<N; i++){
        max = Math.max(max,A[i]);
    }

/*
    console.log(min);
    console.log(max);
*/
    var ans = max-min;  
    console.log(ans);
});

Measured memory_bytes: 21192
A,B,C,D,E,F=gets.split.map(&:to_i)
max=[A*100,0]
a=0
while a*A*100<=F
    b=0
    while (a*A+b*B)*100<=F
        c=0
        w=(a*A+b*B)*100
        while w+c*C<=F
            break if E*w<c*C*100
            d=0
            while w+c*C+d*D<=F
                s=c*C+d*D
                break if E*w<s*100
                #warn [a,b,c,d,w,s,s.to_f/(w+s)].inspect
                if max[1]*(w+s)<s*max[0]
                    max=[w+s, s]
                    warn max.inspect
                end
                d+=1
            end
            c+=1
        end
        b+=1
    end
    a+=1
end
puts "%d %d" % max


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

int main() {
	int n ;
	cin >> n ; 
	int a = n/100 , b = n%100 ;
	if(a > 0 && a <= 12 && b > 0 && b <= 12){
		cout << "AMBIGUOUS";
	}else if(a > 0 && a <= 12){
		cout << "MMYY" ;
	}else if(b > 0 && b <= 12 ){
		cout << "YYMM" ;
	}else{
		cout << "NA" ;
	}
	return 0;
}

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

int len;
int K;
int ans;
char str[MAX];
char N[MAX];

void dfs(int k, int start)
{
	if (K == k)
	{
		int flag = 1;
		for (int i = 0; i < len; i++)
		{
			if (N[i] > str[i]) flag = 0;
			else if (N[i] < str[i]) break;
		}
		ans += flag;
		return;
	}
	int flag = 1;
	for (int i = 0; i < start; i++)
	{
		if (N[i] > str[i])
		{
			flag = 0;
			break;
		}
		else if (N[i] < str[i])
		{
			flag = 2;
			break;
		}
	}

	if (flag == 0)
	{
		return;
	}
	if (flag == 2)
	{
		if (K - k == 2)
		{
			ans += 1LL * (len - start) * (len - start - 1) / 2 * 81;
			return;
		}
		if (K - k == 1)
		{
			ans += (len - start) * 9;
			return;
		}
	}
	for (int i = start; i < len; i++)
	{
		if (N[i] != '0') continue;
		for (int j = 1; j < 10; j++)
		{
			N[i] = '0' + j;
			dfs(k + 1, i + 1);
			N[i] = '0';
		}
	}
}

int main(void)
{
	cin >> str >> K;
	len = strlen(str);
	for (int i = 0; i < len; i++) N[i] = '0';
	dfs(0, 0);
	cout << ans << endl;
	return 0;
}


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

struct RMQ {
	using type = ll;
	static type id() { return (ll)1e18; }
	static type op(const type& l, const type & r) { return min(l, r); }
};

template <typename M>
class starry_sky_tree {
	using T = typename M::type;
	const int n;
	vector<T> data, lazy;
	int size(int x) {
		int res = 1;
		while (res < x) res <<= 1;
		return res;
	}
	T sub(int l, int r, int node, int lb, int ub) {
		if (r <= lb || ub <= l) return M::id();
		if (l <= lb && ub <= r) return data[node];
		return M::op(sub(l, r, node << 1, lb, (lb + ub) >> 1)
			, sub(l, r, (node << 1) | 1, (lb + ub) >> 1, ub)) + lazy[node];
	}
	void suc(int l, int r, int node, int lb, int ub, T val) {
		if (ub <= l || r <= lb) return;
		if (l <= lb && ub <= r) {
			data[node] += val;
			lazy[node] += val;
			return;
		}
		suc(l, r, node << 1, lb, (lb + ub) >> 1, val);
		suc(l, r, (node << 1) | 1, (lb + ub) >> 1, ub, val);
		data[node] = M::op(data[node << 1], data[(node << 1) | 1]) + lazy[node];
	}
public:
	starry_sky_tree(int n_) : n(size(n_)), data(n << 1), lazy(n << 1) {}
	void add(int l, int r, T val) {
		suc(l, r, 1, 0, n, val);
	}
	T find(int l, int r) {
		return sub(l, r, 1, 0, n);
	}
};

int main()
{
	int N, M;
	cin >> N >> M;
	assert(1 <= N && N <= 2e5);
	assert(1 <= M && M <= 2e5);
	vector<vector<pair<int, ll>>> es(N + 1);
	ll sum = 0;
	for (int i = 0; i < M; i++) {
		int l, r;
		ll a;
		cin >> l >> r >> a; --l;
		assert(-1e9 <= a && a <= 1e9);
		assert(0 <= l && l < r && r <= N);
		es[r].emplace_back(l, a);
		sum += a;
	}
	starry_sky_tree<RMQ> dp(N + 2);
	ll res = 0LL;
	for (int i = 1; i <= N; i++) {
		for (auto p : es[i]) {
			dp.add(0, p.first + 1, p.second);
		}
		dp.add(i + 1, i + 2, dp.find(0, i + 1));
		res = min(res, dp.find(0, i + 2));
	}
	cout << sum - res << endl;
	return 0;
}


Measured memory_bytes: 19328
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;
int main(){
  ll N;
  cin >> N;
  ll A[N];
  bool flag = false;
  for(int i=0;i<N;++i) cin >> A[i];
  sort(A,A+N);
  for(int j=0;j<(N-1);++j) {
    if(A[j]==A[j+1]) {
      flag = true;
      break;
    }
  }
  if(flag==true) cout << "NO";
  if(flag==false) cout << "YES";
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
//#include "Local_Debug.h"
using namespace std;
#define Endl endl
#define debug(x) cout << #x << " = " << (x) << endl;
typedef long long ll;
const int MOD = (int)1e9 + 7;
const int MAXN = (int)2e5 + 5;
double n, m;
int main()
{
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	while (cin >> n >> m)
	{
		n--, m--;
		cout << ll(ceil(m / n)) << endl;
	}
}
/*
4 10

8 9

8 8
*/

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef  long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pii> vii;
typedef vector<vector<int> > vvi;
#define clr(a, b) memset(a, b, sizeof(a))
#define pb push_back
#define mkp make_pair
#define forn(i, n) for(int i=0; i<(int)n; ++i)
#define forab(i, a, b) for(int i=(int)a; i<(int)b; ++i)

const int inf = (int)1e6+5;
const int nax = (int)3e5+5;

void compute(){
    int a, b; cin >> a >> b;
    cout << max(2*a-1, max(2*b-1, a+b)) << "\n";
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    //    int t;
    //    cin>>t;
    //    while(t--)
    compute();
    return 0;
}


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

int main() {

  int i = 0;
  while(true) {
      int x;
      cin >> x;
      if (x == 0) {
          break;
      }
      else {
          i++;
          cout << "Case " << i << ": " << x << endl;
      }
  }

}



Measured memory_bytes: 3080
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define FOR(i,a,b) for(int i=(a); i<(b); i++)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
typedef long long ll;
vector<vector<char>> g(100,vector<char>(100));
int main(){
    int a,b; cin >> a >> b;
    rep(i,100){
        rep(j,100){
            if(i < 50) g[i][j] = '#';
            else g[i][j] = '.';
        }
    }

    int p = (a-1)/50;
    for(int i = 0; i < 2*p; i += 2){
        for(int j = 0; j < 100; j += 2){
            g[i][j] = '.';
        }
    }
    int q = (a-1)%50;
    for(int j = 0; j < 2*q; j += 2){
        g[2*p][j] = '.';
    }

    int r = (b-1)/50;
    for(int i = 0; i < 2*r; i += 2){
        for(int j = 0; j < 100; j += 2){
            g[i+51][j] = '#';
        }
    }
    int s = (b-1)%50;
    for(int j = 0; j < 2*s; j += 2){
        g[2*r+51][j] = '#';
    }

    cout << "100 100" << endl;
    rep(i,100){
        rep(j,100){
            cout << g[i][j];
        }
        cout << endl;
    }
}

Measured memory_bytes: 256
package main

import (
	"fmt"
)

func gcd(a, b int) int {
	if b == 0 {
		return a
	}
	return gcd(b, a%b)
}

func main() {
	var n, m int
	var s, t string
	fmt.Scan(&n, &m)
	fmt.Scan(&s)
	fmt.Scan(&t)
	gcd := gcd(n, m)   //最大公約数
	lcm := n * m / gcd // 最小公倍数
	// fmt.Printf("gcd: %d, lcm: %d\n", gcd, lcm)

	answer := -1

	rs := []rune(s)
	rt := []rune(t)
	if gcd == 1 {
		if rs[0] == rt[0] {
			answer = lcm
		} else {
			answer = -1
		}
	} else {
		si := lcm / m
		ti := lcm / n
		ok := true
		for i := 0; i < gcd; i++ {
			if rs[si*i] != rt[ti*i] {
				ok = false
			}
		}
		if ok {
			answer = lcm
		} else {
			answer = -1
		}
	}
	fmt.Println(answer)
}


Measured memory_bytes: 2176
#include<bits/stdc++.h>
#define ll long long int
#define M 1000000007
#define mod 998244353
#define mp(x,y) make_pair(x,y)
#define pb(x) push_back(x)
#define pi pair<ll,ll>
using namespace std;
const ll N=500010;


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

	ll n,r;
	cin>>n>>r;
	ll ans;
	if(n>=10){ans=r;}
	else{ans=r+100*(10-n);}
	cout<<ans;

	return(0);
}


Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define E "\n"

using namespace std;
const long long MOD = (long long)1e9 + 7;

int a;

int main()
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> a;
    int ans = a;
    ans += a * a;
    ans += a * a * a;
    cout << ans << E;
    //system("pause");
    return 0;
}

Measured memory_bytes: 3648
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>
#include <iterator>

using namespace std;

#define SORT(c) sort((c).begin(),(c).end())
#define REVERSE(v) reverse((v).begin(),(v).end())
#define ANS(ans) cout<<(ans)<<endl;
#define UNIQUE(v) (v).erase(unique((v).begin(), (v).end()), (v).end());
typedef vector<int> VI;

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


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

	int ti, xi, yi, t, x, y;
	x = 0;
	y = 0;
	t = 0;
	int dt, dxy;
	REP(i, n) {
		cin >> ti >> xi >> yi;
		dt = ti - t;
		dxy = abs(x - xi) + abs(y - yi);

		if (dt - dxy >= 0 && (dt - dxy) % 2 == 0) {

		}
		else {
			cout << "No" << endl;
			return 0;
		}
		x = xi;
		y = yi;
		t = ti;
	}

	cout << "Yes" << endl;

	return 0;
}



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

template <typename T>
ostream& operator<<(ostream& os, vector<T>& vec) {
    os << "{";
    for (int i = 0; i < (int)vec.size(); ++i) {
        os << vec[i] << (i + 1 == (int)vec.size() ? "" : ", ");
    }
    os << "}";
    return os;
}
template <typename T, typename U>
ostream& operator<<(ostream& os, pair<T, U>& pair_var) {
    os << "(" << pair_var.first << ", " << pair_var.second << ")";
    return os;
}
template <typename T, typename U>
ostream& operator<<(ostream& os, map<T, U>& map_var) {
    os << "{";
    for (auto itr = map_var.begin(); itr != map_var.end(); itr++) {
        os << "(" << itr->first << ", " << itr->second << ")";
        itr++;
        if (itr != map_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
template <typename T>
ostream& operator<<(ostream& os, set<T>& set_var) {
    os << "{";
    for (auto itr = set_var.begin(); itr != set_var.end(); itr++) {
        os << *itr;
        ++itr;
        if (itr != set_var.end()) os << ", ";
        itr--;
    }
    os << "}";
    return os;
}
void dump_func() {
    cerr << "\n";
}
template <class Head, class... Tail>
void dump_func(Head&& head, Tail&&... tail) {
    cerr << head;
    if (sizeof...(Tail) == 0) {
        cerr << " ";
    } else {
        cerr << ", ";
    }
    dump_func(std::move(tail)...);
}
#define dump(...) cerr << "[" << to_string(__LINE__) << "]"        \
                       << "    " << string(#__VA_ARGS__) << " = ", \
                  dump_func(__VA_ARGS__)

using ll = long long;
using ld = long double;
using VI = vector<int>;
using VL = vector<double>;
using VVI = vector<VI>;
using VVL = vector<VL>;
using PI = pair<int, int>;
using PL = pair<ll, ll>;
using VPI = vector<PI>;
using VPL = vector<PL>;
using VS = vector<string>;

#define ln '\n'
#define REP(t, n) for (int t = 0; t < (n); ++t)
#define FOR(t, a, b) for (int t = (a); t <= (b); ++t)
#define FORR(t, a, b) for (int t = (a); t >= (b); --t)
#define ALL(c) (c).begin(), (c).end()
#define CAUTO const auto&

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

    int n;
    cin >> n;
    VI h(n), mx(n);
    REP(i, n) {
        cin >> h[i];
        if (i == 0)
            mx[0] = h[0];
        else
            mx[i] = max(mx[i - 1], h[i]);
    }
    int ans = 0;
    REP(i, n) {
        if (mx[i] <= h[i]) ans++;
    }
    cout << ans << ln;

    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
  static String a, b, c;

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

    a = sc.next();
    b = sc.next();
    c = sc.next();

    if(a.charAt(a.length() - 1) == b.charAt(0)
      && b.charAt(b.length() - 1) == c.charAt(0)){
      System.out.println("YES");
    }
    else{
      System.out.println("NO");
    }
  }
}


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


#define li			long long int
#define rep(i,to)	for(li i=0;i<((li)(to));i++)
#define repp(i,start,to)	for(li i=(li)(start);i<((li)(to));i++)
#define pb			push_back
#define sz(v)		((li)(v).size())
#define bgn(v)		((v).begin())
#define eend(v)		((v).end())
#define allof(v)	(v).begin(), (v).end()
#define dodp(v,n)		memset(v,(li)n,sizeof(v))
#define bit(n)		(1ll<<(li)(n))
#define mp(a,b)		make_pair(a,b)
#define rin	rep(i,n)
#define EPS 1e-12
#define ETOL 1e-8
#define MOD 1000000007
typedef pair<li, li> PI;

#define INF bit(60)

#define DBGP 1


#define idp if(DBGP)
#define F first
#define S second
#define p2(a,b)		idp cout<<a<<"\t"<<b<<endl
#define p3(a,b,c)		idp cout<<a<<"\t"<<b<<"\t"<<c<<endl
#define p4(a,b,c,d)		idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<endl
#define p5(a,b,c,d,e)		idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<endl
#define p6(a,b,c,d,e,f)		idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<endl
#define p7(a,b,c,d,e,f,g)		idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<endl
#define p8(a,b,c,d,e,f,g,h)		idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<endl
#define p9(a,b,c,d,e,f,g,h,i)		idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<endl
#define p10(a,b,c,d,e,f,g,h,i,j)		idp cout<<a<<"\t"<<b<<"\t"<<c<<"\t"<<d<<"\t"<<e<<"\t"<<f<<"\t"<<g<<"\t"<<h<<"\t"<<i<<"\t"<<j<<endl
#define foreach(it,v)	for(__typeof((v).begin()) it=(v).begin(); it!=(v).end(); ++it)
#define p2p(x)		idp p2((x).F, (x).S)
#define dump(x,n)	idp{rep(i,n){cout<<x[i]<<" ";}puts("");}
#define dump2(x,n)	idp{rep(i,n){cout<<"["<<x[i].F<<" , "<<x[i].S<<"] ";}puts("");}
#define dumpi(x)	idp{foreach(it, x){cout<<(*it)<<" ";}puts("");}
#define dumpi2(x)	idp{foreach(it, x){cout<<"["<<(it)->F<<" , "<<(it)->S<<"] ";}puts("");}

#define read2d(a,w,h)	rep(i,h)rep(j,w)cin>>a[i][j]
#define dump2d(a,w,h)	rep(i,h){rep(j,w)cout<<a[i][j]<<" ";puts("");}

typedef pair<li, li> PI;

li n,k;
vector<li> edge[2020];

// @returns {#(depth >=k/2), #(depth >=k/2+1)}
PI dfs(li from, li now, li depth){
	PI res(0,0);
	rep(i,sz(edge[now])){
		li next = edge[now][i];
		if(next==from)continue;
		PI tres=dfs(now,next,depth+1);
		res.F+=tres.F;
		res.S+=tres.S;
	}
	if(depth>k/2+1){
		res.S++;
		res.F++;
	}else if(depth>k/2){
		res.F++;
	}
	return res;
}

li solve(li root){
	vector<PI> pis;
	rep(i,sz(edge[root])){
		li next=edge[root][i];
		pis.pb(dfs(root,next,1));
		//p4(root, next, pis[i].F, pis[i].S);
	}
	// k/2よりでかいの全部削除
	li res=0;
	rep(i,sz(pis)){
		res+=pis[i].F;
	}
	if(k%2>0){
		// ひとつだけ2/k+1までOK
		li minus=0;
		rep(i,sz(pis)){
			minus=max(minus, pis[i].F-pis[i].S);
		}
		res-=minus;
	}
	return res;
}

int main(){
	cin>>n>>k;
	rep(i,n-1){
		li a,b;
		cin>>a>>b;
		a--;
		b--;
		edge[a].pb(b);
		edge[b].pb(a);
	}

	// for each root node
	li res=n;
	rin{
		res=min(res,solve(i));
	}
	cout<<res<<endl;


	return 0;
}


Measured memory_bytes: 512
//45
#include<iostream>
#include<algorithm>

using namespace std;

int main(){
  int n,m;
  cin>>n>>m;
  int x=m;
  while(n--){
    int i,o;
    cin>>i>>o;
    m+=i-o;
    if(m<0){
      cout<<0<<endl;
      return 0;
    }
    x=max(x,m);
  }
  cout<<x<<endl;
  return 0;
}

Measured memory_bytes: 1160
#include <bits/stdc++.h>
using namespace std;
#define uint unsigned int
#define llong long long int
#define ullong unsigned long long int
#define rep(i, n) for (int i = 0; i < n; ++i)
const static long long int MOD = 1000000000 + 7;

int main (int argc, char *argv[]) {
    cin.tie(0);
    ios::sync_with_stdio(false);

    string S;
    cin >> S;
    map<char, int> M;
    rep (i, S.size()) {
        ++M[S[i]];
    }

    // cout << M.size() << endl;
    if (M.size() == 4) {
        cout << "Yes" << endl;
    } else if (M.size() == 2) {
        auto itr = M.begin();
        if (itr->first == 'N') {
            ++itr;
            if (itr->first != 'S') {
                cout << "No" << endl;
            } else {
                cout << "Yes" << endl;
            }
        } else if (itr->first == 'S') {
            ++itr;
            if (itr->first != 'N') {
                cout << "No" << endl;
            } else {
                cout << "Yes" << endl;
            }
        } else if (itr->first == 'W') {
            ++itr;
            if (itr->first != 'E') {
                cout << "No" << endl;
            } else {
                cout << "Yes" << endl;
            }
        } else if (itr->first == 'E') {
            ++itr;
            if (itr->first != 'W') {
                cout << "No" << endl;
            } else {
                cout << "Yes" << endl;
            }
        }
    } else {
        cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
    int N, M;
    int x,y;
    cin>>N>>M;
    int YN[N]={0};
    int H[N];
    int flag=0;//好观测点数目
    for(int i=0;i<N;i++)
    {
        cin>>H[i];
    }
    for(int i=0;i<M;i++)
    {
        cin>>x>>y;
        x--;
        y--;
        if(H[x]>H[y]) YN[y]=1;
        else if(H[x]<H[y]) YN[x]=1;
        else 
        {
            YN[y]=1;
            YN[x]=1;
        }
    }
    for (int i = 0; i < N; i++)
    {
        if(YN[i]==0) flag++;
    }
    cout<<flag<<endl;
    return 0;
}

Measured memory_bytes: 4352
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <queue>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <unordered_map>
#include <unordered_set>
#include <cmath>
#include <cstdlib>
#include <memory.h>
#include <ctime>
#include <bitset>

using namespace std;

#define ABS(a) ((a>0)?a:-(a))
#define MIN(a,b) ((a<b)?(a):(b))
#define MAX(a,b) ((a<b)?(b):(a))
#define FOR(i,a,n) for (int i=(a);i<(n);++i)
#define FI(i,n) for (int i=0; i<(n); ++i)
#define pnt pair <int, int>
#define mp make_pair
#define PI 3.1415926535897
#define MEMS(a,b) memset(a,b,sizeof(a))
#define LL long long
#define U unsigned

multiset<int> s;
int a[300100];
LL preSum[300100];
LL sufSum[300100];

int main()
{
#ifdef Fcdkbear
	freopen("in.txt", "r", stdin);
	//freopen("out.txt", "w", stdout);
	double beg = clock();
#endif

	int n;
	scanf("%d", &n);
	FOR(i, 0, 3 * n) {
		scanf("%d", &a[i]);
	}
	FOR(i, 0, n) {
		preSum[i] = a[i];
		s.insert(a[i]);
		if (i) {
			preSum[i] += preSum[i - 1];
		}
	}
	FOR(i, n, n + n) {
		preSum[i] = preSum[i - 1] + a[i];
		s.insert(a[i]);
		int v = *s.begin();
		preSum[i] -= v;
		s.erase(s.begin());
	}
	s.clear();
	for (int i = 3 * n - 1; i >= 2 * n; --i) {
		sufSum[i] = a[i];
		s.insert(a[i]);
		if (i + 1 != 3 * n) {
			sufSum[i] += sufSum[i + 1];
		}
	}
	for (int i = 2 * n - 1; i >= n; --i) {
		sufSum[i] = sufSum[i + 1] + a[i];
		s.insert(a[i]);
		auto it = s.end();
		it--;
		sufSum[i] -= (*it);
		s.erase(it);
	}
	LL res = -1000000000000000000ll;
	FOR(i, n, n + n + 1) {
		res = max(res, preSum[i - 1] - sufSum[i]);
	}
	cout << res << endl;

#ifdef Fcdkbear
	double end = clock();
	fprintf(stderr, "*** Total time = %.3lf ***\n", (end - beg) / CLOCKS_PER_SEC);
#endif
	return 0;
}

Measured memory_bytes: 9472
#include <bits/stdc++.h>
using namespace std;
const int64_t MOD = 1000000007;
int64_t dp[2010][2010]; // Sのi番目, Tのj番目までの共通部分列ペアの個数

void init()
{
  for (int i = 0; i < 2010; i++)
  {
    dp[0][i] = dp[i][0] = 1;
  }
}

int main()
{
  int N, M;
  cin >> N >> M;
  vector<int> S(N), T(M);
  for (int i = 0; i < N; i++)
  {
    cin >> S.at(i);
  }
  for (int i = 0; i < M; i++)
  {
    cin >> T.at(i);
  }
  init();
  for (int i = 1; i <= N; i++)
  {
    for (int j = 1; j <= M; j++)
    {
      if (S[i - 1] == T[j - 1])
      {
        dp[i][j] = (dp[i - 1][j] + dp[i][j - 1]) % MOD;
      }
      else
      {
        dp[i][j] = ((dp[i - 1][j] + dp[i][j - 1]) % MOD - dp[i - 1][j - 1] + MOD) % MOD;
      }
    }
  }
  cout << dp[N][M] << endl;
}

Measured memory_bytes: 35088
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <string>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll mod = 1000000007;
int n, m, a[500000], b[500000], node[710], ans, group[2][710];
bool road[710][710], judge;
bool dp[710][710];


ll pow(ll x, ll y)
{
	if (y == 0) return 1;
	if (y % 2)
	{
		return pow(x, y - 1) * x % mod;
	}
	else
	{
		ll yyy = pow(x, y / 2);
		return yyy * yyy % mod;
	}
}

ll div(ll x)
{
	return pow(x, mod - 2);
}


void dfs(int s, int t)
{
	node[s] = t;
	for (int i = 1; i <= n; i++)
	{
		if (road[s][i] && node[i] == 0)
		{
			if (t < 1000)
			{
				dfs(i, 1000 + t);
			}
			else
			{
				dfs(i, t - 1000);
			}
		}
	}
	
}

int main(void)
{
	cin >> n >> m;
	for (int i = 1; i <= n; i++)
	{
		for (int j = 1; j <= n; j++)
		{
			if (i == j) continue;
			road[i][j] = true;
		}
	}
	for (int i = 0; i < m; i++)
	{
		cin >> a[i] >> b[i];
		road[a[i]][b[i]] = false;
		road[b[i]][a[i]] = false;
	}
	judge = true;
	for (int i = 1; i <= n; i++)
	{
		if (node[i] != 0) continue;
		dfs(i, i);
	}
	for (int i = 1; i <= n; i++)
	{
		for (int j = 1; j <= n; j++)
		{
			if (road[i][j] && node[i] == node[j])
			{
				judge = false;
			}
		}
	}
	for (int i = 1; i <= n; i++)
	{
		if (node[i] < 1000)
		{
			group[0][node[i]]++;
		}
		else
		{
			group[1][node[i] - 1000]++;
		}
	}
	if (!judge)
	{
		cout << -1 << endl;
		return 0;
	}
	dp[0][0] = true;
	for (int i = 1; i <= n; i++)
	{
		for (int j = 0; j <= n; j++)
		{
			if (j + group[0][i] <= n && dp[i - 1][j])
			{
				dp[i][j + group[0][i]] = true;
			}
			if (j + group[1][i] <= n && dp[i - 1][j])
			{
				dp[i][j + group[1][i]] = true;
			}
		}
	}
	ans = 100000000000;
	for (int i = 0; i <= n; i++)
	{
		if (!dp[n][i]) continue;
		int j = n - i;
		ans = min(ans, (i - 1) * i / 2 + (j - 1) * j / 2);
	}
	cout << ans << endl;
	int www;
	cin >> www;
}


Measured memory_bytes: 4224
package main

import (
	"fmt"
)

func main() {
	var a, b, t int
	fmt.Scan(&a, &b, &t)

	count := 0
	for i := 1; i <= t; i++ {
		if i%a == 0 {
			count += b
		}
	}

	fmt.Println(count)

}


Measured memory_bytes: 512
package main

import "fmt"

func main() {
    var A, B, C int
    fmt.Scan(&A, &B, &C)
    ret := (A <= C && C <= B) || (B <= C && C <= A)
    if ret {
        fmt.Println("Yes")
    }else {
        fmt.Println("No")
    }
} 


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

int main(){
    float R;
    cin >> R;
    cout << 2*R*M_PI << endl;
}

Measured memory_bytes: 3748
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <iomanip>
#include <math.h>
#include <map>
using namespace std;

int main() {
    int n;
    cin >> n;
    int ans = 0;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a.at(i);
    }
    sort(a.begin(), a.end());
    for (int i = 0; i < n; i++) {
        int count = 0;
        for (int j = i; j < n; j++) {
            if (a.at(i) == a.at(j)) {
                count++;
            }
            else goto next;
        }
        next:
        if (a.at(i) < count) ans += count - a.at(i);
        else if (a.at(i) > count) ans += count;
        i += count - 1;
    }
    cout << ans << endl;
}

Measured memory_bytes: 640
from itertools import combinations
n,k=map(int,input().split())
m=((n-1)*(n-2))//2
if k>m:
    print(-1)
    exit()
edges=[]
for i in range(2,n+1):
    edges.append((1,i))
add_edges=list(combinations(range(2,n+1),2))
a=m-k
for i in range(m-k):
    edges.append(add_edges[i])
print(len(edges))
for edge in edges:
    print(*edge)

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

int main() {
  int n,k;

  cin >> n >> k;

  int flag = 0;

  vector<int> h(n);

  rep(i,n){
    cin >> h.at(i);
    if(k<=h.at(i))
    flag ++;
  }

  cout << flag ;


}


Measured memory_bytes: 3772
import kotlin.math.floor

fun readString() = readLine()!!
fun readInt() = readLine()!!.toInt()
fun readLong() = readLine()!!.toLong()
fun readIntList() = readLine()!!.split(" ").map(String::toInt)
fun readLongList() = readLine()!!.split(" ").map(String::toLong)
fun <T> Array<Array<T>>.print() {
    this.forEach {
        println(it.joinToString(" "))
    }
}

fun main() {
    val x = readLong()
    var start: Double = 100.0
    var year = 0
    while (start < x) {
        start = floor(start * 1.01)
        year++
    }
    println(year)
}


Measured memory_bytes: 34464
import sys
import math
import itertools as it
def I():return int(sys.stdin.readline().replace("\n",""))
def I2():return map(int,sys.stdin.readline().replace("\n","").split())
def S():return str(sys.stdin.readline().replace("\n",""))
def L():return list(sys.stdin.readline().replace("\n",""))
def Intl():return [int(k) for k in sys.stdin.readline().replace("\n","").split()]
def Lx(k):return list(map(lambda x:int(x)*-k,sys.stdin.readline().replace("\n","").split()))

if __name__ == "__main__":
    n,k = I2()
    a = Intl()
    a.sort()
    print(sum(a[:k]))


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

int main() 
{
  int n;
  cin >> n;
  int h[n];
  for(int i=0; i<n; i++) cin >> h[i];
  for(int i=n-2; i>=0; i--){
    if(h[i] <= h[i+1]) continue;
    else if(h[i] == h[i+1]+1) h[i]--;
    else{
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
 
}

Measured memory_bytes: 640
#include<string>
#include<string.h>
#include<map>
#include<set>
#include<vector>
#include<stdio.h>
#include<math.h>
#include<iostream>
#include<algorithm>
#include<queue>
using namespace std;
int main()
{
string s;
cin>>s;
s[0]='2';
s[1]='0';
s[2]='1';
s[3]='8';
cout<<s;
system("pause"); 
return 0;
}


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

int a[N],b[N];
int main()
{
int n;

cin >> n;

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

sort(b,b+n);

for(int i=0;i<n;i++){
if(a[i]==b[n-1]) cout << b[n-2] << endl;
else cout << b[n-1] << endl;
}

return 0;
}


Measured memory_bytes: 3200
#include <array>
#include <cstdio>
#include <string>

using namespace std;

array<string, 100> ar;

int main()
{
    int A, B;
    if (scanf("%d%d", &A, &B) < 2) return 0;

    string SHP = "##########";
    string DOT = "..........";

    string s;
    string d;

    for (int i = 0; i < 10; i++) s += SHP;
    for (int i = 0; i < 10; i++) d += DOT;

    ar.fill(s);

    for (int i = 50; i < 100; i++) ar[i] = d;

    int cnt = 0;
    for (int i = 0; i < 50; i += 2)
    {
        for (int j = 0; j < 98; j += 2)
        {
            if (cnt < A - 1)
            {
                ar[i][j] = '.';
                cnt++;
            }
        }
    }

    cnt = 0;
    for (int i = 51; i < 100; i += 2)
    {
        for (int j = 0; j < 98; j += 2)
        {
            if (cnt < B - 1)
            {
                ar[i][j] = '#';
                cnt++;
            }
        }
    }

    printf("%d %d\n", 100, 100);

    for (int i = 0; i < 100; i++)
    {
        printf("%s\n", ar[i].c_str());
    }

    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<iomanip>
#include<cmath>
#include<vector>
#include<algorithm>
#include<utility>

using namespace std;

#define int long long
#define endl "\n"

constexpr long long INF = (long long)1e18;
constexpr long long MOD = 1'000'000'007; 

struct fast_io {
	fast_io(){
		std::cin.tie(nullptr);
		std::ios::sync_with_stdio(false);
	};
} fio;

signed main(){
	cout<<fixed<<setprecision(10);
	
	int N, K;
	int ans = 0;
	vector<int> A;
	vector<vector<int>> table;
	
	cin>>N>>K;
	
	table.resize(61, vector<int>(N));
	A.resize(N);
	
	for(int i = 0; i < N; i++){
		cin>>A[i];
		
		table[0][i] = A[i]-1;
	}
	
	for(int i = 1; i < table.size(); i++){
		for(int j = 0; j < N; j++){
			table[i][j] = table[i-1][table[i-1][j]];
			// cout<<table[i-1][j]<<" ";
		}
		// cout<<endl;
	}
	
	ans = 0;
	
	for(long long i = 0; i < table.size(); i++){
		if((K>>i)&1){
			ans = table[i][ans];
		}
	}
	
	cout<<ans+1<<endl;
	
	return 0;
}

Measured memory_bytes: 99772
k, n = map(int, input().split())
a = list(map(int, input().split()))

diff = 0
total = 0
for i in range(n-1):
    diff = max(abs(a[i] - a[i+1]), diff)
    total += abs(a[i] - a[i+1])
    
diff_tmp = abs(a[n-1] - k) + a[0]
diff = max(diff_tmp, diff)
total += abs(a[n-1] - k) + a[0] - diff

print(total)

Measured memory_bytes: 26444
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long int ll;

int main(){
	int N, K; ll L, R;
	cin >> N >> K >> L >> R;
	int n1 = N / 2, n2 = N - n1;
	vector<ll> a1(n1), a2(n2);
	for(int i = 0; i < n1; i++) cin >> a1[i];
	for(int i = 0; i < n2; i++) cin >> a2[i];
	vector<vector<ll> > b1(n1 + 1, vector<ll>());
	for(int i = 0; i < (1 << n1); i++){
		int cnt = 0;
		ll sum = 0;
		for(int j = 0; j < n1; j++){
			if(i & (1 << j)){
				cnt++;
				sum += a1[j];
			}
		}
		b1[cnt].push_back(sum);
	}
	for(int i = 0; i <= n1; i++) sort(b1[i].begin(), b1[i].end());
	ll res = 0;
	for(int i = 0; i < (1 << n2); i++){
		int cnt = 0;
		ll sum = 0;
		for(int j = 0; j < n2; j++){
			if(i & (1 << j)){
				cnt++;
				sum += a2[j];
			}
		}
		if(K - cnt < 0 || K - cnt > n1) continue;
		res += upper_bound(b1[K - cnt].begin(), b1[K - cnt].end(), R - sum) - lower_bound(b1[K - cnt].begin(), b1[K - cnt].end(), L - sum);
	}
	cout << res << endl;
	return 0;
}



Measured memory_bytes: 12324
#include<cstdio>
#include<iostream>
using namespace std;
int N;
const int MAX_SIZE = 101;
int arr[MAX_SIZE];
void trace(int arr[], int N){
	for(int i = 0; i < N ; i++){
		if(i > 0) printf(" ");
		printf("%d",arr[i]);
	}
	printf("\n");
}
void insertionSort(int arr[], int N){
	for(int i = 1; i < N; i++){
		int v = arr[i];
		int j = i - 1;
		while(j >= 0 && arr[j] > v){
			arr[j+1] = arr[j];
			j--;
		}
		arr[j+1] = v;
		trace(arr,N);
	}
} 
int main(){
	scanf("%d",&N);
	for(int i = 0; i < N; i++){
		scanf("%d",&arr[i]);
	}
	trace(arr,N);
	insertionSort(arr,N);
	return 0;
}


Measured memory_bytes: 3204
N, M, Q = map(int, input().split())
Trains = []
for i in range(M):
    l, r = map(int, input().split())
    l, r = l - 1, r - 1
    Trains.append((l, r))


class Ruisekiwa2D:
    def __init__(self, h, w):
        self.H = h
        self.W = w
        self.G = [[0] * w for _ in range(h)]

    def load(self, points):
        # 問題によってイメージしやすいよう書き換えてください
        for x, y in points:
            self.G[x][y] += 1

    def load_imos(self, points):
        # pointsは[[左上h, 左上w, 右下h, 右下w], ...]であること
        for i1, j1, i2, j2 in points:
            self.G[i1][j1] += 1  # 左上
            if j2 + 1 < self.W:  # 右上
                self.G[i1][j2+1] -= 1
            if i2 + 1 < self.H:
                self.G[i2+1][j1] -= 1  # 左下
            if j2 + 1 < self.W and i2 + 1 < self.H:  # 右下
                self.G[i2+1][j2+1] += 1

    def calc(self):
        for y in range(self.W):
            for x in range(1, self.H):
                self.G[x][y] += self.G[x-1][y]

        for y in range(1, self.W):
            for x in range(self.H):
                self.G[x][y] += self.G[x][y-1]

    def get(self, i1, j1, i2, j2):
        if i1 > i2 or j1 > j2 or i1 < 0 or j1 < 0 or i2 < 0 or j2 < 0:
            return 0
        elif i1 > 0 and j1 > 0:
            return self.G[i2][j2] - self.G[i1-1][j2] - self.G[i2][j1-1] + self.G[i1-1][j1-1]
        elif i1 <= 0 < j1:
            return self.G[i2][j2] - self.G[i2][j1-1]
        elif j1 <= 0 < i1:
            return self.G[i2][j2] - self.G[i1 - 1][j2]
        else:
            return self.G[i2][j2]


R2D = Ruisekiwa2D(N, N)
R2D.load(Trains)
R2D.calc()

for i in range(Q):
    p, q = map(int, input().split())
    p, q = p - 1, q - 1
    print(R2D.get(p, p, q, q))


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

int main()
{
    ll n, m;
    cin >> n >> m;
    bool solved[100010] = {false};
    ll wa[100010] = {0};

    for (ll i = 0; i < m;i++)
    {
        ll p;
        string s;
        cin >> p >> s;
        if(s == "AC" && solved[p] == false)
        {
            solved[p] = true;
        }
        else if(s == "WA" && solved[p] == false)
        {
            wa[p]++;
        }
    }
    ll a = 0, w = 0;
    for (ll i = 0; i <= n;i++)
    {
        if(solved[i] == true)
        {
            a++;
            w += wa[i];
        }
    }
    cout << a << " " << w;
}

Measured memory_bytes: 1152