akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
    #define M 1000000007
    #define U 998244353
    #define int long long
    #define sz(c) (int)c.size()
    #define fr first
    #define ll long long 
    #define sc second
    #define pb push_back
    #define ppb pop_back
    #define mp make_pair
    #define all(a) (a).begin(),(a).end()
    #define rep(i,a,n) for(int i=a ; i<n ; i++)
    #define r0 return 0;
    #define N 1000005
    #define U 998244353
    #define bs binary_search
    #define endl '\n'
    #define FILEIO     freopen("input.txt","r",stdin); freopen("output.txt","w", stdout);
    #define PI 3.1415926535
    #define INF LLONG_MAX-5
    using namespace std;
    int po(int n, int exp){
        int prod=1;
        rep(i,0,exp)
            prod*=n;
        return prod;
    }

    set<int> Divisors(int n) 
    { 
        set<int> ans;
        for (int i=2; i<=sqrt(n); i++) 
        {
            if (n%i == 0) 
            {
                if (n/i == i) 
                    ans.insert(i);
                else
                {
                    ans.insert(i);
                    ans.insert(n/i);
                }
            } 
        } 
        return ans;
    } 
    int power(int x, unsigned int y, unsigned int m)
    {
        if (y == 0)
            return 1;
        int p = power(x, y/2, m) % m;
        p = (p * p) % m;
        return (y%2 == 0)? p : (x * p) % m;
    }
    int gcd(int a, int b, int &x, int &y) {
        if (a == 0) {
            x = 0; y = 1;
            return b;
        }
        int x1, y1;
        int d = gcd(b%a, a, x1, y1);
        x = y1 - (b / a) * x1;
        y = x1;
        return d;
    }
    signed main()
    {
        ios_base::sync_with_stdio(0);
        // cin.tie(0);
        // cout.tie(0);
        int TESTS=1;
        // cin>>TESTS;
        while(TESTS--)
        {   
            int l,r;
            cin>>l>>r;
            if((r/2019)!=(l/2019)){
                cout<<0;
                r0;
            }
            l%=2019;
            r%=2019;
            if(r<=l) r+=2019;
            int mn = INT_MAX;
            rep(i,l,r){
                rep(j,i+1,r+1){
                    mn = min(mn, (i*j)%2019);
                }
            }
            cout<<mn;
        }   
    }       


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

#define int               long long
#define endl              '\n'
#define ff                first
#define ss                second
#define pb                push_back
#define vii               vector<int> 
#define pii               pair<int,int>
#define loop(i,s,e)       for(int i=s;i<e;i++)
#define mset(a,f)         memset(a,f,sizeof(a))
#define fastio            ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)

int n, W;
const int N = 107, inf = 1e18;
pii arr[N];
int  dp[N][100007];

int getval(int it, int v)
{            
      if( v == 0 ) return 0;
      if( v < 0 || it == 0 ) return inf;  
      if( dp[it][v] != -1 ) return dp[it][v];
      int a = inf , b = inf;
      a = arr[it].ff + getval(it - 1, v - arr[it].ss);
      b = getval(it - 1, v);
      return dp[it][v] = min(a,b);
}

int32_t main() {
      fastio;
    
      cin >> n >> W;
      loop(i,1,n+1)  cin >> arr[i].ff >> arr[i].ss;
      mset(dp,-1);
      int ans = 0;
      loop(v,0,100001) if( getval(n,v) <= W ) ans = v;
      cout << ans << endl; 

}















Measured memory_bytes: 83840
using System;
using static System.Console;
using System.Collections.Generic;
using System.Linq;

namespace Atcoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var nm = InputNumList();
            var n = nm[0];
            var m = nm[1];
            var a = InputNumList();

            a.Sort();

            var listDis = new List<int>();
            int ans = 0;
            if (n >= m)
            {

            }
            else
            {
                for (int i = 0; i < m - 1; i++)
                {
                    listDis.Add(a[i + 1] - a[i]);
                }
                listDis.Sort();
                listDis.Reverse();
                for(int i = 0; i < n - 1; i++)
                {
                    listDis.RemoveAt(0);
                }
                ans = listDis.Sum();
            }
            WriteLine(ans);
        }

        static int InputNum()
        {
            return int.Parse(ReadLine());
        }
        static List<int> InputNumList()
        {
            return ReadLine().Split(' ').Select(int.Parse).ToList();
        }
    }
}

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

int main() {
  int N;
  cin >> N;
  vector<int> a(N);
  for (int i = 0; i < N; i++) cin >> a[i];
  int four = 0, two = 0;
  for (int i = 0; i < N; i++) {
    if (a[i] % 4 == 0) four++;
    else if (a[i] % 2 == 0) two++;
  }
  if (four + two / 2 >= N / 2) cout << "Yes" << endl; else cout << "No" << endl;
}

Measured memory_bytes: 640
#include<iostream>
#include<vector>
#include<climits>
#include<vector>
using namespace std;
long long dp[101][100001]={0};
vector<int> v;
vector<int> w;
long long int knapsack(int N,int W)
{ if(N==0)
   return 0;
   if(W==0)
   return 0;
   if(dp[N][W]!=0)
    return dp[N][W];
    long long int ans1=0;
   if(W-w[N-1]>=0) 
   ans1=v[N-1]+knapsack(N-1,W-w[N-1]);
   long long int ans2=knapsack(N-1,W);
 return dp[N][W]=max(ans1,ans2);
    
    
    
}
int main()
{
	int n,W;
	cin>>n>>W;
	for(int i=0;i<n;i++)
     { int x;
       cin>>x;
       w.push_back(x);
       cin>>x;
       v.push_back(x);
     	
	 }
 	cout<<knapsack(n,W);

}

Measured memory_bytes: 77312
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int[] a=new int[200];
        while(sc.hasNext()){
            String s=sc.nextLine().toLowerCase();
            for(int i=0;i<s.length();i++){
                a[s.charAt(i)]++;
            }
        }
        
        
        //for(int i=0;i<26;i++) a[i]=0;
        //char now='a';
        for(char now='a';now<='z';now++){
            System.out.print(now+" "+':'+" "+a[now]);
            System.out.println();
        }
    }
}


Measured memory_bytes: 26340
#include <iostream>
#include <cstdio>
using namespace std;
int main(void){
     int S,h,m,s;
     cin >> S;
     h = S /3600;
     m = (S-(h*3600)) /60;
     s = S-(h*3600+m*60);
     
    
      cout << h;
      cout <<":";
      cout << m;
      cout <<":";
      cout << s;
      cout <<endl;
      
      
     
     
    
    
}


Measured memory_bytes: 3088
//minamoto
#include<bits/stdc++.h>
#define R register
#define fp(i,a,b) for(R int i=(a),I=(b)+1;i<I;++i)
#define fd(i,a,b) for(R int i=(a),I=(b)-1;i>I;--i)
#define go(u) for(int i=head[u],v=e[i].v;i;i=e[i].nx,v=e[i].v)
template<class T>inline bool cmax(T&a,const T&b){return a<b?a=b,1:0;}
template<class T>inline bool cmin(T&a,const T&b){return a>b?a=b,1:0;}
using namespace std;
typedef long long ll;
const int P=1e9+7;
inline void upd(R int &x,R int y){(x+=y)>=P?x-=P:0;}
inline int inc(R int x,R int y){return x+y>=P?x+y-P:x+y;}
inline int dec(R int x,R int y){return x-y<0?x-y+P:x-y;}
inline int mul(R int x,R int y){return 1ll*x*y-1ll*x*y/P*P;}
int ksm(R int x,R ll y){
	R int res=1;
	for(;y;y>>=1,x=mul(x,x))(y&1)?res=mul(res,x):0;
	return res;
}
int n,m,T,res,h,g;
int main(){
	scanf("%d%d%d",&n,&m,&T);
	h=n/__gcd(n,T),g=m/__gcd(m,T);
//	printf("%d %d\n",h,g);
	res=((0ll+1+ksm(2,h)-1+ksm(2,g)-1+ksm(2,__gcd(h,g))-2)%P+P)%P;
	res=ksm(res,1ll*(n/h)*(m/g));
	printf("%d\n",res);
	return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <climits>
#include <cmath>
#include <csignal>
#include <cstdio>
#include <cstdlib>
#include <iomanip>
#include <iostream>
#include <string>
#include <vector>

using ll = long long;
using namespace std;

int main() {
    int h = 0, w = 0;
    cin >> h >> w;
    int cnt = 0;
    char buf = 0;
    for (int i=0; i<h*w; i++) {
        cin >> buf;
        if (buf == '#') {
            cnt++;
        }
    }
    if (cnt == h+w-1) {
        cout << "Possible" << endl;
    }
    else {
        cout << "Impossible" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#18:29
n = int(input())
mod = 10 ** 9 + 7
now = [[[0 for _ in range(4)] for _ in range(4)] for _ in range(4)]
now[3][3][3] = 1
#print(part)
boo = [[0,0,1,2],[1,0,1,2],[2,0,1,2],[3,0,1,2],
       [0,0,1,2],[0,1,1,2],[0,2,1,2],[0,3,1,2],
       [0,1,0,2],[0,1,1,2],[0,1,2,2],[0,1,3,2],
       [0,1,0,2],[1,1,0,2],[2,1,0,2],[3,1,0,2],
       [0,0,2,1],[1,0,2,1],[2,0,2,1],[3,0,2,1]]
#print(now)
for i in range(n):
  last = now
  now = [[[0 for _ in range(4)] for _ in range(4)] for _ in range(4)]
  #print(i,'l',last)
  #print(i,'n',now)
  for i in range(4):
    for j in range(4):
      for k in range(4):
        for l in range(4):
          if [i,j,k,l] not in boo:
            now[j][k][l] += last[i][j][k]
            now[j][k][l] %= mod
ans = 0
for i in range(4):
  for j in range(4):
    for k in range(4):
      ans += now[i][j][k]
      ans %= mod
#print(last)
#print(now)
print(ans)

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

using namespace std;

long long n;
string s;

int main(){
	cin>>n;
	cin>>s;
	if(n>=s.length())cout<<s<<endl;
	else{
		for(int i=0; i<n; i++){
			cout<<s[i];
		}
		cout<<"..."<<endl;
	}
}


Measured memory_bytes: 3612
#include <stdio.h>

#define MAX 200000
#define SENTINEL 2000000000
typedef long long llong;

int L[MAX/2 + 2],R[MAX/2 + 2];

llong merge(int A[],int n,int left,int mid,int right){
  int i,j,k;
  llong cnt = 0;
  int n1 = mid -left;
  int n2 = right - mid;
  for(i = 0;i < n1;i++) L[i] = A[left + i];
  for(i = 0;i < n2;i++) R[i] = A[mid + i];
  L[n1] = R[n2] = SENTINEL;
  i = j = 0;
  for(k = left;k < right;k++){
    if(L[i] <= R[j]){
      A[k] = L[i++];
    } else{
      A[k] = R[j++];
      cnt += n1 - i;
    }
  }
  return cnt;
}

llong mergeSort(int A[] ,int n,int left,int right){
  int mid;
  llong v1,v2,v3;
  if(left + 1 < right){
    mid = (left + right)/2;
    v1 = mergeSort(A,n,left,mid);
    v2 = mergeSort(A,n,mid,right);
    v3 = merge(A,n,left,mid,right);
    return v1+v2+v3;
  } else return 0;
}

int main(){
  int A[MAX],n,i;

  scanf("%d",&n);
  for(i = 0;i < n;i++){
    scanf("%d",&A[i]);
  }
  llong ans = mergeSort(A,n,0,n);
  printf("%lld\n",ans);
  return 0;
}

Measured memory_bytes: 2156
#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>
#include <cassert>

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)

template<class T> void debug(T begin, T end){ for(T i = begin; i != end; ++i) cout<<*i<<" "; cout<<endl; }
inline bool valid(int x, int y, int W, int H){ return (x >= 0 && y >= 0 && x < W && y < H); }

typedef long long ll;
const int INF = 100000000;
const double EPS = 1e-8;
const int MOD = 1000000007;
int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
int N;
typedef pair<int, int> P;
bool comp(const P& p, const P& q){
  return (p.first + p.second) < (q.first + q.second);
}
P point[100000];
int dist(P p, P q){
  return abs(p.first - q.first) + abs(p.second - q.second);
}
int value1(P p){
  return (p.first + p.second);
}
int value2(P p){
  return (p.first - p.second);
}
int min1, max1, min2, max2;
//最大値をd以下に出来る
bool C1(int d){
  bool used[1000000] = {};
  REP(i, N){
    if(point[i].first <= min1 + d && point[i].second <= min2 + d) used[i] = true;
  }
  REP(i, N){
    if(!used[i] && !(point[i].first >= max1 - d && point[i].second >= max2 - d)) return false;
  }
  return true;
}
bool C2(int d){
  bool used[1000000] = {};
  REP(i, N){
    if(point[i].first <= min1 + d && point[i].second >= max2 - d) used[i] = true;
  }
  REP(i, N){
    if(!used[i] && !(point[i].first >= max1 - d && point[i].second <= min2 + d)) return false;
  }
  return true;
}

int main(){
  while(cin>>N && N){
    REP(i, N) scanf("%d %d", &point[i].first, &point[i].second);
    REP(i, N) point[i] = P(value1(point[i]), value2(point[i]));
    REP(i, N) {
      min1 = min(min1, point[i].first);
      min2 = min(min2, point[i].second);
      max1 = max(max1, point[i].first);
      max2 = max(max2, point[i].second);
    }
    //sort(point, point + N);
    int lb = 0, ub = 4 * 100000 + 1;
    while(ub - lb > 1){
      int mid = (lb + ub) / 2;
      if(C1(mid) || C2(mid)) ub = mid;
      else lb = mid;
    }
    printf("%d\n", ub);
  }
  return 0;
}

Measured memory_bytes: 2992
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define endl "\n"
#define mod 1000000007
#define fast   ios_base::sync_with_stdio(false); cin.tie(NULL);
int main(){
	fast
//code here-----------
    ll k;
    cin>>k;
    string s="ACL";
    string result="";
    for(int i=0;i<k;i++){
    	result=result+s;
	}
	cout<<result<<endl;
  	
  	
  	
	return 0;
}

Measured memory_bytes: 3644
n = int(input())
index6, index9, num6, num9 = 0, 0, 0, 0
INF = float('inf')    
a = [INF for _ in range(n+1)]
a[n] = 0

for i in range(n, -1, -1):
    if a[i] == INF:
        continue
    j = 1
    while i-9**j >= 0:
        a[i-9**j] = min(a[i]+1, a[i-9**j])
        j += 1
    j = 1
    while i-6**j >= 0:
        a[i-6**j] = min(a[i]+1, a[i-6**j])
        j += 1
    if i-1 >= 0:
        a[i-1] = min(a[i]+1, a[i-1])
print(a[0])


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

using namespace std;

#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define rrep(i, n) for (ll i = (n - 1); i >= 0; --i)
#define blank(ans) cout << (ans) << " ";
#define mp(p, q) make_pair(p, q)
#define mt(p, q, r) make_tuple(p, q, r)
#define pb(n) push_back(n)
#define all(a) a.begin(), a.end()

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef string str;

typedef vector<ll> vll;
typedef vector<ld> vd;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<str> vs;
typedef vector<vector<ll>> vvll;
typedef vector<vector<ld>> vvd;
typedef vector<vector<bool>> vvb;
typedef vector<vector<char>> vvc;
typedef vector<vector<str>> vvs;
typedef vector<pair<ll, ll>> vpll;
typedef vector<tuple<ll, ll, ll>> vtlll;

const ld PI = acos(-1.0);
const ll MAX = 9000000000000000000;
const ll MIN = -9000000000000000000;
const ld DMAX = 4500;
const ld DMIN = -4500;
const ll MOD = 1000000007;

template <typename T>
void fin(T a)
{
  cout << a << endl;
  exit(0);
}

//実行部
void Main()
{
  ll n, m; cin >> n >> m;
  ll s[200009], g[200009]; rep(i, m) cin >> s[i] >> g[i];
  map <ll, ll> S;
  rep(i, m) if(s[i] == 1) S[g[i]]++;
  rep(i, m) if (g[i] == n && S.count(s[i])) fin("POSSIBLE");
  fin("IMPOSSIBLE");
}

//前処理
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(20); //高精度少数表示
  Main();
  return 0;
}

/*
//test時
  g++ test.cpp -o test;./test
*/


Measured memory_bytes: 9600
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
vector<long long> t(100001, -1);
vector<vector<long long>> dp(101, t);

long long knapsack(long long *w, int *v,  int i, int value){
    if(value <= 0)return 0;
    if( i < 0)return INT_MAX;
    
    if(dp[i][value] != -1)return dp[i][value];
    
    if(v[i] <= value){
        dp[i][value] = min(knapsack(w, v, i - 1, value), knapsack(w, v,  i-1, value - v[i]) + w[i]);
    }else{
        dp[i][value] = knapsack(w, v, i - 1, value);
    }
    return dp[i][value];
}

int main() {
    int n;
    cin>>n;
    long long maxw;
    cin>>maxw;
    
    long long w[n];
    int v[n];
    for(int i = 0 ; i < n ; i++) {
        cin>>w[i]>>v[i];
    }
    int ans = 0;
    for(int i = 100000 ; i >= 0; i--){
        int minwv = knapsack(w, v, n - 1, i);
        if(minwv <= maxw)ans = max(ans, i);
    }
    cout<<ans;
	return 0;
}


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

int main() {
  vector<vector<int>> data(3, vector<int>(3));
  for (int i=0; i<3; i++) {
    for (int j=0; j<3; j++) {
      cin >> data.at(i).at(j);
    }
  }
  int flag = 0;
  for (int i=0;i<2;i++) {
    if (data.at(i).at(0) - data.at(i+1).at(0) != data.at(i).at(1) - data.at(i+1).at(1)
        || data.at(i).at(0) - data.at(i+1).at(0) != data.at(i).at(2) - data.at(i+1).at(2)) {
      flag = 1;
    }
  }
  if (!flag) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}


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

int main(){
    int n,a=0,b=0;
    cin>>n;
    for(int i=0; i<n; ++i){
        string s,t;
        cin>>s>>t;
        if(s>t)a+=3;
        else if(s<t)b+=3;
        else a++,b++;
    }
    cout<<a<<" "<<b<<endl;
    return 0;
}


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

int main() {
	int a[100], n;
	cin >> n;
	for(int i = 0; i < n; i++){
		cin >> a[i];
	}
	
	for (int i = n-1; i >= 0; i--){
		cout << a[i];
		if (i != 0){
			cout << " ";
		} else{
			cout << endl;
		}
	}
	return 0;
}


Measured memory_bytes: 3076
#include <stdio.h>
int A[100];
int N;
void trace(){
  int i;
  for(i=0;i<N;i++){
    if(i>0)printf(" ");
    printf("%d",A[i]);
  }
  printf("\n");
}

void insertionSort(){
  int i,j,v;
  for(i= 1;i<N;i++){
    v = A[i];
    j = i - 1;
    while (j >= 0&&A[j] > v){
      A[j+1] = A[j];
      j--;
    }
      A[j+1] = v;
      trace();
  }
}

int main(){
  int i;
  scanf("%d",&N);
  for(i=0;i<N;i++){
    scanf("%d",&A[i]);
  }
  trace();
  insertionSort();
  return 0;
}



Measured memory_bytes: 2140
#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<cmath>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<numeric>
#include<functional>
#include<algorithm>
#include<bitset>
#include<tuple>
#include<unordered_set>
#include<unordered_map>
#include<random>
#include<array>
#include<cassert>
using namespace std;
#define INF (1<<29)
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define uniq(v) v.erase(unique(all(v)),v.end())





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

	string s;
	cin >> s;
	sort(all(s));
	cout << (s[0] == s[1] && s[2] == s[3] && s[0] != s[3] ? "Yes" : "No") << endl;



	return 0;
}

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

#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define FORD(i,b,a) for (int i = (int)(b) - 1; i >= a; --i)
#define REP(i,N) FOR(i,0,N)
#define st first
#define nd second
#define pb push_back

typedef pair<int, int> PII;
typedef long long LL;

LL A[222222];
vector<int> adj[222222];

LL go(int v, int p = -1) {
  if (adj[v].size() == 1 && adj[v].front() == p) return A[v];

  LL all = 0;
  LL maxi = 0;
  for (int u: adj[v]) if (u != p) {
    LL tmp = go(u,v);
    if (tmp == -1) return -1;
    all += tmp;
    maxi = max(maxi, tmp);
  }

  if (all < A[v]) return -1;

  LL max_pairs = min(all - maxi, all / 2);

  LL needed_pairs = all - A[v];
  if (needed_pairs > max_pairs) return -1;
  return all - 2 * needed_pairs;
}

int main() {
  int N;
  scanf("%d", &N);
  REP(i,N) scanf("%lld", &A[i]);
  REP(i,N-1) {
    int a, b;
    scanf("%d%d", &a, &b);
    --a, --b;
    adj[a].pb(b);
    adj[b].pb(a);
  }
  bool ok;
  if (N == 2) {
    ok = A[0] == A[1];
  } else {
    int not_leaf = 0;
    REP(i,N) if (adj[i].size() > 1) not_leaf = i;
    ok = (go(not_leaf) == 0);
  }
  if (ok) {
    printf("YES\n");
  } else {
    printf("NO\n");
  }
}


Measured memory_bytes: 16512
n = int(input())
import sys
for i in range(1, 3501):
    for j in range(1, 3501):
        w_t = n*i*j
        w_u = 4*i*j - i*n -j*n
        if w_u > 0:
            w = w_t/w_u
            if w.is_integer():
                print("%s %s %s" % (i, j, int(w)))
                sys.exit()

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

#define rep(i, n) for(int i = 0; i < (n); i++)
#define all(a) (a).begin(),(a).end()

using ll = long long;
constexpr ll INF = 10000000000;

using namespace std;

//fixed << setprecision(10)

/////////////////////////////////////////////////////////////////////////////////////////////////////////

int main() {
	int n; cin >> n;
	vector<int>a(n);
	rep(i, n)cin >> a[i];

	int odd = 0;
	int even = 0;

	rep(i, n) {
		if (a[i] % 2 == 0)even++;
		else odd++;
	}

	if (odd % 2 == 0)cout << "YES" << endl;
	else cout << "NO" << endl;
}

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

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

#define ll          long long
#define pb          push_back
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define rs(v,n)     v.resize(n)
#define hell        1000000007
#define peak        9123372036854775807
#define pii         acos(-1)
#define clr(a,x)    memset(a,x,sizeof(a))
#define ios         ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ordered_set tree<ll int, null_type,less<ll int>, rb_tree_tag,tree_order_statistics_node_update>
using namespace std;
template<class x,class y> x sum(x a,y b){return a+b;}
template<class x,class y> x mul(x a,y b){return a*b;}
template<class x,class y> x sub(x a,y b){return a-b;}
template<class x,class y> x divi(x a,y b){return a/b;}

template<class x,class y>
istream &operator>>(istream &in,pair<x,y> &p) 
{ 
    in>>p.F>>p.S;
    return in;
}
template<class x>
istream &operator>>(istream &in,vector<x> &v) 
{
    for(auto& i:v)
        in>>i;
    return in;
}
template<class x,class y>
ostream &operator<<(ostream &out,pair<x,y> &p) 
{ 
    out<<"("<<p.F<<","<<p.S<<") ";
    return out; 
}
template<class x>
ostream &operator<<(ostream &out,vector<x> &v) 
{ 
    out<<v.size()<<endl;
    for(auto i:v)
        out<<i<<" ";
    out<<endl;
    return out; 
}
#define N  1000005

int main()
{
    ios;
    ll tt=1;
    // cin>>tt;
    while(tt--)
    {
        ll i,j,k,l,m,n;
        cin>>n;
        string s;
        cin>>s;
        ll dp[3002][3002];
        clr(dp,0);
        for(i=1;i<=n;i++)
            dp[0][i]=1;
        for(i=1;i<n;i++)
        {
            if(s[i-1]=='>')
            {
                for(j=1;j<=i+1;j++)
                {
                    dp[i][j]=(dp[i-1][n]-dp[i-1][j-1]+hell)%hell;
                }
            }
            else
            {
                for(j=2;j<=i+1;j++)
                {
                    dp[i][j]=(dp[i-1][j-1]-dp[i-1][0]+hell)%hell;
                }
            }
            for(j=1;j<=n;j++)
            {
                dp[i][j]=(dp[i][j-1]+dp[i][j])%hell;
            }
        }
        ll ans=0;
        cout<<dp[n-1][n];
    }
    return 0;
}

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

#define NDEBUG
#ifdef DEBUG
#include "../cout11.h"
#undef NDEBUG
#endif
#include <cassert>

typedef long long ll;
typedef long double Double;
typedef unsigned long long ull;
typedef pair<int,int> ii;
typedef pair<ll,ll> llll;
typedef pair<double,double> dd;

typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<ii> vii;
typedef vector<vector<ii>> vvii;
typedef vector<ll> vll;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<long double> vD;

#define sz(a)  int((a).size())
#define pb  push_back
#define FOR(var,from,to) for(int var=(from);var<=(to);++var)
#define rep(var,n)  for(int var=0;var<(n);++var)
#define rep1(var,n)  for(int var=1;var<=(n);++var)
#define repC2(vari,varj,n)  for(int vari=0;vari<(n)-1;++vari)for(int varj=vari+1;varj<(n);++varj)
#define ALL(c)  (c).begin(),(c).end()
#define RALL(c)  (c).rbegin(),(c).rend()
#define tr(i,c)  for(auto i=(c).begin(); i!=(c).end(); ++i)
#define found(s,e)  ((s).find(e)!=(s).end())
#define mset(arr,val)  memset(arr,val,sizeof(arr))
#define mid(x,y) ((x)+((y)-(x))/2)
#define IN(x,a,b) ((a)<=(x)&&(x)<=(b))
#define cons make_pair


ll gcd(ll a, ll b) { while(a) swap(a, b%=a); return b; }

const ll MOD=1000000007LL;

ll ADD(ll x, ll y) { return (x+y) % MOD; }
ll SUB(ll x, ll y) { return (x-y+MOD) % MOD; }
ll MUL(ll x, ll y) { return x*y % MOD; }
ll POW(ll x, ll e) { ll v=1; for(; e; x=MUL(x,x), e>>=1) if (e&1) v = MUL(v,x); return v; }
ll DIV(ll x, ll y) { /*assert(y%MOD!=0);*/ return MUL(x, POW(y, MOD-2)); }
// ll comb(ll n, ll k) { ll v=1; for(ll i=1; i<=k; i++) v = DIV(MUL(v, n-i+1),i); return v; }
//


ll solve(int N, vi& a) {
    ll rem0=-1, rem1=-1;

    rem0 = a[0]/2;
    if (a[0]%2) rem1 = rem0;

    for (int i=1; i<N; ++i) {
#ifdef DEBUG
        // fprintf(stderr, "%d] %lld %lld\n", i-1, rem0, rem1);
#endif
        ll nrem0=-1, nrem1=-1, tmp;
        if (rem0 >= 0) {
            tmp = rem0 + a[i]/2;
            if (a[i] % 2) nrem1 = max(nrem1, tmp);
            else          nrem0 = max(nrem0, tmp);
        }
        if (rem1 >= 0) {
            if (a[i]) {
                tmp = rem1 + 1 + (a[i]-1)/2;
                if ((a[i]-1) % 2) nrem1 = max(nrem1, tmp);
                else              nrem0 = max(nrem0, tmp);
            }
            tmp = rem1 + a[i]/2;
            if (a[i] % 2) nrem1 = max(nrem1, tmp);
            else          nrem0 = max(nrem0, tmp);
        }
        rem0 = nrem0; rem1 = nrem1;
    }
#ifdef DEBUG
    // fprintf(stderr, "%d] %lld %lld\n", N-1, rem0, rem1);
#endif
    return max(rem0, rem1);
}

int main() {
    int N; cin>>N;
    vi a(N); rep(i,N) cin>>a[i];
    cout << solve(N,a) << endl;
    return 0;
}


Measured memory_bytes: 640
a = input()
if a == 'SUN':
    print(7)
elif a == 'MON':
    print(6)
elif a == 'TUE':
    print(5)
elif a == 'WED':
    print(4)
elif a == 'THU':
    print(3)
elif a == 'FRI':
    print(2)
elif a == 'SAT':
    print(1)

Measured memory_bytes: 3060
#include<iostream>
#include<vector>
#include<cstdio>
#include<string>
#include<algorithm>
#include<map>
#include<set>
#include<cmath>
#include<deque>
#include<queue>
using namespace std;

using ll = long long;
const int INF = 1001001001;
const ll LLINF = 1001001001001001001;
const int MOD = 1000000007;

#define rep(i,n) for (int i = 0; i < (n); ++i)

int main()
{
  int n, k;
  cin >> n >> k;
  vector<int> p(n);
  rep(i,n) {
    cin >> p[i];
  }
  sort(p.begin(), p.end());

  ll result = 0;
  rep(i,k) {
    result += p[i];
  }
  cout << result << endl;
}


Measured memory_bytes: 3632
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author Kein Yukiyoshi
 */

#include "bits/stdc++.h"
#define int long long
#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 FOR(i, a)           for (auto &i : a)
#define ALL(obj)            begin(obj), end(obj)
#define MAX(x)              *max_element(ALL(x))
#define MIN(x)              *min_element(ALL(x))
#define SUM(x)              accumulate(ALL(x), 0LL)
#define LOWER_BOUND(A, key) distance(A.begin(), lower_bound(ALL(A), key))
#define UPPER_BOUND(A, key) distance(A.begin(), upper_bound(ALL(A), key))

using namespace std;
const int MOD    = (int)(1e9 + 7);
const int INF    = (int)(1e13 + 7);
const double EPS = 1e-14;
const double PI  = acos(-1);

int CEIL(int a, int b) { return (a >= 0 ? (a + (b - 1)) / b : (a - (b - 1)) / b); } //ceil() for int
int mod(int a, int b) { return a >= 0 ? a % b : a - (b * CEIL(a, b)); }             //always return positive num
int bpm(int a, int b) {                                                             //return x^y in order(log(y))
  int res = 1;
  for (a %= MOD; b; a = a * a % MOD, b >>= 1)
    if (b & 1) res = res * a % MOD;
  return res;
}

class CHAndV {
public:
  static void solve(istream &cin, ostream &cout) {
    int H, W, K;
    cin >> H >> W >> K;
    vector<string> grid(H);
    int ans = 0;
    rep(i, H) cin >> grid[i];
    rep(i, bpm(2, H + W)) {
      vector<string> temp = grid;
      rep(j, H + W) {
        if ((i >> j) & 1) {
          if (j < H) {
            rep(k, W) {
              temp[j][k] = '.';
            }
          } else {
            rep(k, H) {
              temp[k][j - H] = '.';
            }
          }
        }
      }
      int temp2 = 0;
      rep(j, H) {
        rep(k, W) {
          if (temp[j][k] == '#') {
            temp2 += 1;
          }
        }
      }
      if (temp2 == K) {
        ans++;
      }
    }
    cout << ans << endl;
  }
};


signed main() {
  cin.tie(0);
  cout.tie(0);
  ios_base::sync_with_stdio(false);
  cout<<fixed<<setprecision(15);
  CHAndV solver;
  std::istream& in(std::cin);
  std::ostream& out(std::cout);
  solver.solve(in, out);
  return 0;
}


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

int main(){
  int n, ans = 0;
  cin >> n;
  vector<int> v(n), c(n), xx(n);
  rep(i, n) cin >> v[i];
  rep(i, n) cin >> c[i];
  rep(i, n) xx[i] = v[i] - c[i];
  sort(xx.rbegin(), xx.rend());
  
  rep(i, n){
    if(xx[i] > 0) ans += xx[i];
    else break;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define ll long long 
#define inf 0x3f3f3f3f
#define infll 0x3f3f3f3f3f3f3f3f
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define ii pair<int,int>
#define vii vector<ii>
#define vi vector<int>

#define F_OR(i, a, b, s) for (int i=(a); (s)>0?i<(b):i>(b); i+=(s))
#define F_OR1(e) F_OR(i, 0, e, 1)
#define F_OR2(i, e) F_OR(i, 0, e, 1)
#define F_OR3(i, b, e) F_OR(i, b, e, 1)
#define F_OR4(i, b, e, s) F_OR(i, b, e, s)
#define GET5(a, b, c, d, e, ...) e
#define F_ORC(...) GET5(__VA_ARGS__, F_OR4, F_OR3, F_OR2, F_OR1)
#define FOR(...) F_ORC(__VA_ARGS__)(__VA_ARGS__)
#define EACH(x, a) for (auto& x: a)
 
// debug templates 
#define debug(x)       cerr<< #x <<" : "<< x << endl;
#define debuga(A,N)    cerr<< #A <<" : [";for(int i = 0; i<N;i++) cerr<<A[i]<<" "; cerr<<"]\n";
#define debuga2(A,N,M) cerr<< #A << " : \n"; for(int i=0;i<N;i++){cerr<<"[";for(int j=0;j<M;++j) cerr<<A[i][j]<<" ";cerr<<"]\n";}
#define debugp(p)      cerr<< #p <<" : "<<"("<<(p).first<<","<<(p).second<<")\n";
#define debugv(v)      cerr<< #v <<" : "<<"[";for(int i = 0; i< (v).size(); i++) cerr<<v[i]<<" "; cerr<<"]\n";
#define debugv2(v)     cerr<< #v << " : \n"; for(int i=0;i<v.size();i++){cerr<<"[";for(int j=0;j<(v[0].size());++j) cerr<<v[i][j]<<" ";cerr<<"]\n";}
#define debugs(m)      cerr<< #m <<" : [ "; for(auto itr = m.begin(); itr!=m.end();itr++) cerr<<*itr<<" "; cerr<<"]\n";
#define debugm(m)      cerr<< #m <<" : [ "; for(auto itr = m.begin();itr!=m.end(); itr++) cerr<<"("<<itr->first<<","<<itr->second<<") ";cerr<<"]\n";

const int mxN = 3e5;
int n, a[mxN], visited[mxN];

// a, a-b, 2a-b, 2a-2b
// let a-b = c
// a,c,a+c, 2c, a+2c, 3c, ....
// we have to start at 0 and end at n-1 
// so we have 2 sequences one from 0 to somenode of size c
// and another from n-1 to somenode of size c
// note a and b cant be zero
void solve(){
	cin >> n;
	FOR(n) cin >> a[i];
	ll ans = 0;
	// we loop thru all a-b's 
	FOR(i,1,n){
		ll cur_sum = 0;
		int l = 0, r = n-1;
		while(r>i && visited[r]<i){
			cur_sum += a[l] + a[r];
			//debuga(visited,n);
			//cout << cur_sum << " CUR\n";
			ans = max(ans, cur_sum);
			l+=i;
			r-=i;
			visited[l] = i;
		}
	}
	cout << ans;
}
 
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	
	solve();
	return 0;
}
 


Measured memory_bytes: 4392
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <queue>
#include <deque>
#include <bitset>
#include <iterator>
#include <list>
#include <stack>
#include <map>
#include <set>
#include <functional>
#include <numeric>
#include <utility>
#include <iomanip>
#include <limits>
#include <time.h>
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <assert.h>

#define debug(x) cout << #x << " = " << x << endl
#define fori(i, ini, lim) for(int i = int(ini); i < int(lim); i++)
#define ford(i, ini, lim) for(int i = int(ini); i >= int(lim); i--)

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;

int main() {
    ios_base::sync_with_stdio(false);
    int x, y, a, b, c;
    cin >> x >> y >> a >> b >> c;
    vector<ii> v;
    fori (i, 0, a) {
        int k;
        cin >> k;
        v.emplace_back(k, 0);
    }
    fori (i, 0, b) {
        int k;
        cin >> k;
        v.emplace_back(k, 1);
    }
    fori (i, 0, c) {
        int k;
        cin >> k;
        v.emplace_back(k, 2);
    }
    sort(begin(v), end(v), [] (ii lhs, ii rhs) {
        return lhs.first > rhs.first;
    });
    int r = 0, g = 0, cl = 0;
    ll ans = 0;
    for (int i = 0; i < (int) v.size() && r + g + cl < x + y; i++) {
        int f, s;
        tie(f, s) = v[i];
        if (s == 0 && r < x) {
            ans += f;
            r++;
        }
        if (s == 1 && g < y) {
            ans += f;
            g++;
        }
        if (s == 2) {
            ans += f;
            cl++;
        }
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 6384
#include <bits/stdc++.h>
#include <math.h>
#include <vector>
#include <iostream>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
/*vector<Type> v;
vector<Type> v();
vector<Type> v(n);
vector<Type> v(n, d);
vector<vector<Type>> vv;
vector<vector<Type>> vv();
vector<vector<Type>> vv(n);
vector<vector<Type>> vv(n, vector<Type>(m));
vector<vector<Type>> vv(n, vector<Type>(m, d));*/

int main() {
  long long x,k,d,r,r_inv,m_time;
  cin>>x>>k>>d;
  if(x<0) x *= -1;
  m_time = x/d;
  if(m_time>k){
    cout<<x-d*k;
    return 0;
  }
  k -= x/d;
  r=x-d*m_time;
  r_inv = d-r;
  if(k%2==0){
    cout<<r;
  }else{
    cout<<r_inv;
  }
  return 0;
}


Measured memory_bytes: 3612
#include <stdio.h>
#include <stdlib.h>
#include <iostream>
#include <iomanip>
#include <vector>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <map>
#include <queue>
#define rep(i,n) for(int i=0;i<(n);i++)

using namespace std;

int main() {
	int n;
	cin >> n;
	vector<int> a(n);
	long long ans = 0;

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

	sort(a.rbegin(),a.rend());

	for (int i = 1;i < n;i++) {
		int j = i / 2;
		ans += a[j];
	}

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

Measured memory_bytes: 4032
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  
  int n;
  
  cin >> n;
  int a[n+1],b[n];
  for(int i=0;i<n+1;i++){
 	 cin >> a[i];
  }
    for(int i=0;i<n;i++){
 	 cin >> b[i];
  }
  
  long int max = 0;
   if(b[0] <= a[0]){
         max += b[0];
         b[0] = 0;
    }else{
         max += a[0];
         b[0] -=a[0];
     }
  //a[0~n-1]
  for(int i=1;i<n;i++){
 	 if(b[i-1]<=a[i]){//a[i]が余る
       	max += b[i-1];
       	a[i] -= b[i-1];
       
       if(b[i] <= a[i]){
        	 max += b[i];
        	 b[i] = 0;
       	}else{
         max += a[i];
        	 b[i]-=a[i];
       }
     }else{//a[i]が余らない
       max += a[i];
     }  
  }
  if(b[n-1] <= a[n]){
         max += b[n-1];
   }else{
         max += a[n];
   }
  
  cout << max << endl;
 
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#include <boost/range/algorithm.hpp>
#include <boost/range/numeric.hpp>
#include <boost/range/irange.hpp>
#include <boost/range/adaptor/indexed.hpp>

using namespace std;
using namespace boost::adaptors;
using namespace std::string_literals;
using ll = int64_t;
using vecint = vector<int>;
using vecll = vector<ll>;
using boost::irange;

int main()
{
  int n;
  cin>>n;
  string s;
  cin>>s;
  int ecnt = 0;
  for(auto&& c:s) {
    if (c == 'E') ++ecnt;
  }
  int wcnt = 0;
  int mn = n;
  for(auto&& c:s) {
    if (c == 'E') --ecnt;
    mn = min(mn, ecnt + wcnt);
    if (c == 'W') ++wcnt;
  }
  cout<<mn<<endl;
  return 0;
}


Measured memory_bytes: 900
import java.util.*;

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

        int a = sc.nextInt();
        int b = sc.nextInt();
        int c = sc.nextInt();

        int min = 0;
        int mid = 0;
        int max = 0;
        int x = 0;

        if(a > b){
            min = b;
            max = a;
        }else if(a <= b){
            min = a;
            max = b;
        }

        if(c > max){
            mid = max;
            max = c;
        }else if(c <= max){
            mid = c;
        }

        if(min > mid){
            x = mid;
            mid = min;
            min = x;
        }
        System.out.println(min + " " + mid + " " + max);
        sc.close();
    }
}


Measured memory_bytes: 25976
#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;

int main(){
	int N;
	string s1,s2;
	cin >> N >> s1 >> s2;
	vector<int> v;
	for(int i = 0 ; i < N ; ){
		if( s1[i] == s2[i] ){
			v.push_back(0);
			i += 1;
		}else{
			v.push_back(1);
			i += 2;
		}
	}
	long long ans = 1;
	if( v[0] == 0 ){
		ans *= 3;
	}else{
		ans *= 6;		
	}
	for(int i = 1 ; i < v.size() ; i++){
		if( v[i] == 0 ){
			if( v[i-1] == 0 ){
				ans *= 2;
			}else{
				ans *= 1;
			}
		}else{
			if( v[i-1] == 0 ){
				ans *= 2;
			}else{
				ans *= 3;
			}
		}
		ans %= 1000000007;
	}
	cout << ans << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<queue>
#include<algorithm>
#include<map>
#include<set>
#include<cmath>
#include<iomanip>
#include<stack>
#include<string.h>
typedef long long ll;
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define sz(a) (int)a.size()
using namespace std;

int main() {
	int n, m;
	cin >> n >> m;
	vector<int> cnt(n);
	rep(i, m) {
		int ai, bi;
		cin >> ai >> bi;
		ai--; bi--;
		cnt[ai]++;
		cnt[bi]++;
	}
	rep(i, n) cout << cnt[i] << endl;
}

Measured memory_bytes: 256
/* Manish Pant - insider_pants */

#include <bits/stdc++.h>
using namespace std;
#ifndef ONLINE_JUDGE
    #include "debug.h"
#endif

#define F first
#define S second
#define endl "\n"
#define pb push_back
typedef long long ll;
typedef long double ldob;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

void fast()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}

vector<string> v;
vector<pii> temp;
int n;

bool comp(pii &a, pii &b)
{
    return a.S > b.S;
}

void solve()
{
    vector<pii> a, b;
    for(int i = 0; i < n; i++)
    {
        vector<int> s;
        for(int j = 0; j < v[i].length(); j++)
        {
            if(v[i][j] == '(')
            {
                s.push_back(0);
            }
            else
            {
                if(!s.empty() && s.back() == 0) s.pop_back();
                else s.pb(1);
            }
        }
        if(s.empty()) continue;

        assert(is_sorted(s.rbegin(), s.rend()));

        int x = 0, y = 0;
        for(int i:s)
        {
            if(i == 0) y++;
            else x++;
        }

        if(x > y) b.pb(make_pair(x, y));
        else a.pb(make_pair(x, y));
    }   
    
    sort(a.begin(), a.end());
    sort(b.begin(), b.end(), comp);

    int sum = 0;
    for(auto i: a)
    {
        if(sum < i.F)
        {
            cout << "No\n";
            return;
        }
        sum -= i.F;
        sum += i.S;
    }
    for(auto i: b)
    {
        if(sum < i.F)
        {
            cout << "No\n";
            return;
        }
        sum -= i.F;
        sum += i.S;
    }

    if(sum == 0) cout << "Yes\n";
    else cout << "No\n";
}

int main()
{
    fast();
    cin >> n;
    for(int i = 0; i < n; i++)
    {
        string s; cin >> s;
        v.pb(s);
    }
    solve();
}

Measured memory_bytes: 47788
//include
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath> 
#include <iomanip>
#include <math.h>
#include <utility>
//using
using namespace std;
/*using vi = vector <int>;
using vs = vector <string>;
using vc = vector <char>;*/
//define

#define rep(i,n) for(int i=0; i<n; i++)
//グローバル変数宣言
double a=0,b=0,c=0;

int main(){
    cin>>a>>b>>c;
    if (a/c>b)
    {
        cout<<"No"<<endl;
    }else
    {
        cout<<"Yes"<<endl;
    }
    
    
}


Measured memory_bytes: 3720
using System;

public class Circle
{
    //????????????????????¢?????¨??¨?????????????±???????
    static void Main(string[] args)
    {
        /*---??£?¨???¨---*/
        double radius;

        /*---??£?¨???¨---*/

        /*????????????*/
        radius = double.Parse(Console.ReadLine());

        /*----?¨??????¨----*/
        //??¢???
        Console.WriteLine((radius * radius * Math.PI).ToString("F5"));

        //?????¨
        Console.WriteLine((2 * radius * Math.PI).ToString("F5"));
    }
}

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

ll cnt[100005];
const int mod=1000000007;
   

int main() {
  int n;
  cin>>n;
  ll ans=1;
  rep(i,n) {
    int a;
    cin>>a;
    ans=ans*((a!=0? cnt[a-1]:3)-cnt[a])%mod;
    cnt[a]++;
  }
  cout<<ans<<endl;
  return 0;
}



Measured memory_bytes: 1024
#include<iostream>
#include<cstring>
using namespace std;
int main(){
    string a;
    bool f=0;
    cin>>a;
    for(int i=0;i<a.size();i++){
        if(a[i]=='C') f=1; 
        if(a[i]=='F'&&f){
            cout<<"Yes"<<endl;
            return 0;
        }
    }
    cout<<"No"<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
	int a;
	cin >> a;
	switch (a % 7){
	case 0:
		cout << "thu"<<endl;
		break;
	case 1:
		cout << "fri" << endl;
		break;
	case 2:
		cout << "sat" << endl;
		break;
	case 3:
		cout << "sun" << endl;
		break;
	case 4:
		cout << "mon" << endl;
		break;
	case 5:
		cout << "tue" << endl;
		break;
	case 6:
		cout << "wed" << endl;
		break;
	}
	return 0;
}


Measured memory_bytes: 3112
import sys
input = sys.stdin.readline
read = sys.stdin.read

n = int(input())
A = map(int, read().split())
L = sorted([(j, i) for i, j in enumerate(A)])
count = 0
for i in range(n):
  count += (L[i][1]-i)%2
ans = (count+1) // 2
print(ans)


Measured memory_bytes: 23552
#include <iostream>
 
using namespace std;
 
 
 int main(){
int a,b;scanf("%d%d",&a,&b);
double ret=0;
for(int i=1;i<=a;i++){
double tmp=1.0/a;
int now=i;
while(now<b){
now*=2;
tmp/=2;
}
ret+=tmp;
}
printf("%.12f\n",ret);
}

Measured memory_bytes: 3808
ac = 0
wa = 0
tle = 0 
re = 0

n = gets.to_i

results = n.times.map { gets.chomp }

results.each do |e|
  case e 
  when 'AC'
    ac += 1
  when 'WA'
    wa += 1
  when 'TLE'
    tle += 1
  when 'RE'
    re += 1
  end
end

print "AC x #{ac}\n"
print "WA x #{wa}\n"
print "TLE x #{tle}\n"
print "RE x #{re}\n"

Measured memory_bytes: 20656
#include <bits/stdc++.h>
using ld = long double;
const int NMAX = 3000;
ld prob[NMAX][NMAX];
int main() {
    std::ios_base::sync_with_stdio(false);
    std::cin.tie(0);
    std::cout << std::fixed << std::setprecision(9);
    prob[0][0] = 1;
    for (int n; std::cin >> n; ) {
        for (int i = 1; i <= n; i++) {
            ld p; std::cin >> p;
            for (int curr = 0; curr <= i; curr++) {
                prob[i][curr] = (curr == 0 ? 0 : p * prob[i-1][curr-1]) + (1-p) * prob[i-1][curr];
            }
        }
        ld answ = 0;
        for (int i = (n+1)/2; i <= n; i++) {
            answ += prob[n][i];
        }
        std::cout << answ << std::endl;
    }
    return 0;
}

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

#define repd(i, a, b) for (ll i = (a); i < (b); i++)
#define repb(i, n) for (ll i = (n)-1; i >= 0; i--)
#define rep(i, n) repd(i, 0, n)

using namespace std;

using ll = long long;
using ul = unsigned long long;
using ld = long double;
ll mod = 1000000007;

int main() {
    ll n;
    cin >> n;
    ll l[n];
    rep(i, n) { cin >> l[i]; }

    ll ans = 0;
    rep(l0, n) {
        repd(l1, l0 + 1, n) {
            repd(l2, l1 + 1, n) {
                ll a = l[l0], b = l[l1], c = l[l2];
                if (a == b || b == c || c == a) {
                    continue;
                }
                if (a + b > c && b + c > a && c + a > b) {
                    ans++;
                }
            }
        }
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 3668
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <cstdio>
#include <algorithm>
#include <cstring>
#define N 110
#define ll long long
using namespace std;
int a[505];
int main()
{
    char a1,b2,c3,d4,n;
    int a,b,c,d;
    scanf("%c%c%c%c",&a1,&b2,&c3,&d4);
    a=a1-'0';
    b=b2-'0';
    c=c3-'0';
    d=d4-'0';

    int sum;
    for(int i=1; i<=2; i++)
    {

        for(int k=1; k<=2; k++)
        {

            for(int j=1; j<=2; j++)
            {

                for(int l=1; l<=2; l++)
                {
                    sum=a;
                    if(k==2)
                        sum+=b;
                    else
                        sum-=b;
                    if(j==2)
                        sum+=c;
                    else
                        sum-=c;
                    if(l==2)
                        sum+=d;
                    else
                        sum-=d;
                    if(sum==7)
                    {

                        printf("%d%c%d%c%d%c%d=7\n",a,k==2?'+':'-',b,j==2?'+':'-',c,l==2?'+':'-',d);
                        return 0;
                    }


                }

            }

        }

    }
        return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(){
  int a[3];
  for(int i=0; i<3; i++) scanf("%d", &a[i]);
  for(int i=0; i<3; i++){
    if(a[i] == a[(i+1)%3] && a[i] != a[(i+2)%3]){
      printf("Yes\n");
      return 0;
    }
  }
  printf("No\n");
  return 0;
}
  


Measured memory_bytes: 128
#pragma GCC optimize("O3")
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
using P=pair<int,int>;
template<class T> using V=vector<T>; 
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
//const ll mod=998244353;
const ll mod=1000000007;
ll GCD(ll a,ll b) {return b ? GCD(b,a%b):a;}
ll LCM(ll c,ll d){return c/GCD(c,d)*d;}
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
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 main(){
  V<int> a(5);
  for(int i=0;i<5;i++)cin>>a[i];
  for(int i=0;i<5;i++)if(a[i]==0){cout<<i+1<<"\n";break;}
}


Measured memory_bytes: 3612
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define SZ(x) ((int)x.size())
#define L(i,u) for (register int i=head[u]; i; i=nxt[i])
#define rep(i,a,b) for (register int i=(a); i<=(b); i++)
#define per(i,a,b) for (register int i=(a); i>=(b); i--)
using namespace std;
typedef long long ll;
typedef unsigned int ui;
typedef pair<int,int> Pii;
typedef vector<int> Vi;
template<class T> inline void read(T &x){
	x=0; char c=getchar(); int f=1;
	while (!isdigit(c)) {if (c=='-') f=-1; c=getchar();}
	while (isdigit(c)) {x=x*10+c-'0'; c=getchar();} x*=f;
}
template<class T> inline void umin(T &x, T y){x=x<y?x:y;}
template<class T> inline void umax(T &x, T y){x=x>y?x:y;}
inline ui R() {
	static ui seed=416;
	return seed^=seed>>5,seed^=seed<<17,seed^=seed>>13;
}
const int N = 2303;
int n,a[N];bool e[N][N],vis[N];Vi ch[N],ans[N];
int gcd(int a, int b){return !b?a:gcd(b,a%b);}
void dfs(int u){
	vis[u]=1;
	rep(i,1,n)if(e[u][i]&&!vis[i])dfs(i),ch[u].pb(i);
}
void dfs1(int u){
	rep(i,0,SZ(ch[u])-1)dfs1(ch[u][i]);
	ans[u].pb(u);int p[N]={0};
	while(1){
		int mx=-1,pos=-1;
		rep(i,0,SZ(ch[u])-1)if(p[i]<SZ(ans[ch[u][i]]))
			if(mx<ans[ch[u][i]][p[i]])mx=ans[ch[u][i]][p[i]],pos=i;
		if(mx<0)break;ans[u].pb(ans[ch[u][pos]][p[pos]++]);
	}
}
int main() {
	read(n);rep(i,1,n)read(a[i]);sort(a+1,a+n+1);
	rep(i,1,n)rep(j,1,n)if(i!=j)e[i][j]=gcd(a[i],a[j])>1;
	rep(i,1,n)if(!vis[i])dfs(i),ch[0].pb(i);
	dfs1(0);rep(i,1,SZ(ans[0])-1)printf("%d ",a[ans[0][i]]);
	return 0;
}


Measured memory_bytes: 33664
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
const ll INF=1LL<<60;
const double EPS = 1e-10;
const ll mod=1000000007;
//const ll mod=998244353;

int main(void){
  ll D,T,S;
  cin>>D>>T>>S;
  if(D<=T*S) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
}

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

#define ll long long
#define ar array



int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	string s;
	cin >> s;
	if(s[2] == s[3] && s[4]==s[5]) {
		cout << "Yes";
	}
	else {
		cout << "No";
	}
}


Measured memory_bytes: 256