akhauriyash/Code-Regression huggingface dataset:
import sys
from io import StringIO
import unittest
import os
import math

# 再帰処理上限(dfs作成時に設定するのが面倒なので限度近い値を組み込む)
sys.setrecursionlimit(999999999)


# 0 = 1桁目
def digit_val(number, n) -> int:
    return number // 10 ** n % 10


def max_digit_val(number) -> int:
    return number // 10 ** int(math.log10(number)) % 10


def min_digit_val(number) -> int:
    return number // 10 ** 0 % 10


def int_len(number) -> int:
    return int(math.log10(number) + 1)


# 実装を行う関数
def resolve(test_def_name=""):
    n = int(input())

    # 対象となる数字の一覧を作成(1～20万の数字かつ、0を含まない数字)
    target_list = []
    ignore_cnt = 0
    for i in range(1, n + 1):
        ignore_cnt += 1
        if ignore_cnt == 10:
            ignore_cnt = 0
            continue
        target_list.append(i)

    # 先頭X で末尾Y という数字がいくつ存在するか・・というカウンタを作成。
    cnt_dict = {}
    for i in target_list:
        if int_len(i) == 1:
            # 1桁目の場合は最初桁と最後桁が同じ
            cnt_dict[i * 10 + i] = cnt_dict.get(i * 10 + i, 0) + 1
        else:
            val = max_digit_val(i) * 10 + min_digit_val(i)
            cnt_dict[val] = cnt_dict.get(val, 0) + 1

    # 使用できるパターンを足し込みしていく。
    ans = 0
    for i in target_list:
        if int_len(i) == 1:
            ans += cnt_dict.get(i * 10 + i, 0)
        else:
            val = min_digit_val(i) * 10 + max_digit_val(i)
            ans += cnt_dict.get(val, 0)

    print(ans)


# テストクラス
class TestClass(unittest.TestCase):
    def assertIO(self, assert_input, output):
        stdout, sat_in = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(assert_input)
        resolve(sys._getframe().f_back.f_code.co_name)
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, sat_in
        self.assertEqual(out, output)

    def test_input_1(self):
        test_input = """25"""
        output = """17"""
        self.assertIO(test_input, output)

    def test_input_2(self):
        test_input = """1"""
        output = """1"""
        self.assertIO(test_input, output)

    def test_input_3(self):
        test_input = """100"""
        output = """108"""
        self.assertIO(test_input, output)

    def test_input_4(self):
        test_input = """2020"""
        output = """40812"""
        self.assertIO(test_input, output)

    def test_input_5(self):
        test_input = """200000"""
        output = """400000008"""
        self.assertIO(test_input, output)

    # 自作テストパターンのひな形(利用時は「tes_t」のアンダーバーを削除すること
    def tes_t_1original_1(self):
        test_input = """データ"""
        output = """データ"""
        self.assertIO(test_input, output)


# 実装orテストの呼び出し
if __name__ == "__main__":
    if os.environ.get("USERNAME") is None:
        # AtCoder提出時の場合
        resolve()

    else:
        # 自PCの場合
        unittest.main()


Measured memory_bytes: 23340
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long int64;
#define first fr
#define second sc

typedef pair< int , int > Pi;

vector< int > g[111];
map < string , int > data;
int cost[111];
int n, m;

int solve(int x){
  if(g[x].empty())return cost[x];
  int ret = 0 ;
  for(int i = 0 ; i < g[x].size() ; ++i){
    ret += solve(g[x][i]);
  }
  return min(ret,cost[x]);
}

int main()
{
 
  while(cin >> n && n){
    data.clear();
    rep(i,111)g[i].clear();
    for(int i = 0; i < n; i++){
      string s;
      int foo;
      cin >> s >> foo;
      data[s] = i;
      cost[i] = foo;
    }
    cin >> m;
    for(int i = 0; i < m; i++){
      string s;
      int k;
      cin >> s >> k;
      int idx = data[s];
      for(int j = 0; j < k; j++){
        string hoge;
        cin >> hoge;
        g[idx].push_back(data[hoge]);
      }
    }
    string r;
    cin >> r ;
    cout << solve(data[r]) << endl;
  }
  return 0;

}

Measured memory_bytes: 1248
// #define _GLIBCXX_DEBUG // for STL debug (optional)
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
using namespace std;
using ll = long long int;
using int64 = long long int;
 
template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}
 
int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
const ll INF = 1001001001001001LL;
const ll MOD = 1000000007LL;

ll dp[100010][13];
int main() {
    string s; cin >> s;

    int N = s.size(), M = 13;
    dp[0][0] = 1;
    for(int i=0; i<N; i++) {
        for(int j=0; j<M; j++) {
            for(int x=0; x<10; x++) {
                if(s[i] != '?' and s[i] != '0' + x) continue;
                int nj = (j * 10 + x) % 13;
                (dp[i+1][nj] += dp[i][j]) %= MOD;
            }
        }
    }
    cout << dp[N][5] << endl;
    return 0;
}


Measured memory_bytes: 10624
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<queue>
#include<stack>
#include<cassert>
#include<numeric>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
const int INF = 1001001001;
const long long LINF = 1001002003004005006ll;
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;
typedef pair<int,int> P;

int main(){
  int n,k,c;
  cin >> n >> k >> c;
  string s;
  cin >> s;
  vector<int> fast(n,-1);
  vector<int> slow(n,-1);
  int day = 1;
  rep(i,n){
    if(s[i]=='o'){
      fast[i]=day;
      if(day==k)break;
      day++;
      i+=c;
    }
  }
  for(int i=n-1;i>=0;i--){
    if(s[i]=='o'){
      slow[i]=day;
      if(day==1)break;
      day--;
      i-=c;
    }
  }
  rep(i,n){
    if(fast[i]==-1)continue;
    if(fast[i]==slow[i])cout << i+1 << endl;
  }
}

Measured memory_bytes: 5160
# include<iostream>
# include<string.h>
# include<algorithm>
using namespace std;
struct node
{
    char s[7];
    friend bool operator < (node a, node b)
    {
        int i;
        for(i = 0; a.s[i] != '\0' && b.s[i] != '\0'; ++i)
            if(a.s[i] != b.s[i])
                return a.s[i] < b.s[i];
        return a.s[i] < b.s[i];
    }
} s1[300000];
int main(void)
{
    char s[5003];
    int k, i, j;
    cin >> s;
    cin >> k;
    int cnt = 0;
    for(i = 0; s[i] != '\0'; ++i)
    {
        s1[cnt].s[0] = s[i];
        s1[cnt++].s[1] = '\0';
        int q = 1;
        for(j = i + 1; s[j] != '\0' && q <= 5; ++j)
        {
            strcpy(s1[cnt].s, s1[cnt-1].s);
            s1[cnt].s[q] = s[j];
            s1[cnt++].s[++q] = '\0';
            //cout << "i=" << i<<"      "<<s1[cnt-1].s << endl;
        }
    }
    sort(s1, s1+cnt);
    if(k == 1)
    {
        cout << s1[0].s << endl;
        return 0;
    }
    i = 1;
    int q = 1;
    while(k)
    {
        if(strcmp(s1[i].s, s1[i-1].s) != 0)
        {
            q++;
            if(k == q)
            {
                cout << s1[i].s << endl;
                return 0;
            }
        }
        i++;
    }
    return 0;
}


Measured memory_bytes: 512
#include<iostream>
using namespace std;
int main(){
int W,H,x,y,r;
cin>>W>>H>>x>>y>>r;
if(x+r<=W&&x-r>=0&&y+r<=H&&y-r>=0)cout<<"Yes"<<endl;
else cout<<"No"<<endl;
return 0;
}



































































































































































































































































































































































































































































































































Measured memory_bytes: 3112
//Lion's Sin Escanor 

#include<bits/stdc++.h>
using namespace std;
     
     
//#define SPEED ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define ll long long
#define sd(x) scanf("%d",&x)
#define sld(x) scanf("%lld",&x)
#define pld(x) printf("%lld\n",x)
#define pd(x) printf("%d\n",x)
#define moder 1000000007
#define forn(i,n) for(int i = 0; i < n ; i++)

ll moding( ll x , ll y ){
   
    ll ans = x % y;

    if(ans < 0)ans = ans + y ;

    return ans ;

}


bool isprime(ll n){
    if(n==2) return true;
    if(n==3) return true;
    if(n%2 == 0) return false;
    if(n%3 == 0) return false;

    ll i = 5,w=2;

    while(i*i <= n){
        if(n%i == 0)return false;

        i += w;
        w = 6 - w;
    }

    return true;
}

ll cmp(string s1 , string s2){
    // 1 for diff
    // 0 for same 

    int n = s1.size();
    int m = s2.size();

    if(n!=m)return 1;

    forn(i,n)
        if(s1[i] != s2[i])return 1;


    return 0; // SAME
}

ll hcf(ll n1, ll n2) {
    if (n2 != 0)
        return hcf(n2, n1 % n2);
    else
        return n1;
}




int main(){

    ll a , b; cin >> a >> b;

    ll lcm = 0 + a * b;

    lcm = lcm / hcf(a,b);

    cout << lcm << endl;




           
     
     
        
    return 0;
}
      
       

Measured memory_bytes: 256
import math
ini = lambda : int(input())
inm = lambda : map(int,input().split())
inl = lambda : list(map(int,input().split()))
gcd = lambda x,y : gcd(y,x%y) if x%y else y
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])
    return arr
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    divisors.sort()
    return divisors
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())
mod = 10**9 + 7

#maincode-------------------------------------------------


n,x,t = map(int,input().split())

if n%x == 0:
    print(int(n/x*t))
else:
    print(int((n//x+1)*t))

Measured memory_bytes: 9344
#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;

int main() {
	int n = 0, v = 0;
	for (; ~scanf("%*c%d", &v); v = 0) n += v;
	printf("%d\n", n);
	return 0;
}

Measured memory_bytes: 3196
#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;
#define range(i,a,b) for(int i=a;i<b;++i)
#define rep(i,n) range(i,0,n)

int main(){
    int x;
    cin >> x;
    int maxx=0;
    rep(b,1000){
        range(p,2,10){
            int a=pow(b,p);
            if(a<=x) maxx=max(maxx,a);
        }
    }
    cout << maxx << endl;
}

Measured memory_bytes: 768
#include <bits/stdc++.h>
using namespace std;
#define start_routine int begtime = clock();
#define end_routine int endtime = clock(); cerr << endl << "Time elapsed: " << (endtime - begtime)*1000/CLOCKS_PER_SEC << " ms"; return 0
#define SPEED cin.tie(0), cout.tie(0), ios_base::sync_with_stdio(false)
#define endl '\n'
#define contests_de_diya_kar 0
#define PB push_back
#define MP make_pair
#define int long long
#define MOD ((long long) (1000*1000*1000 + 7))
#define inf (int) 2e15
#define exit(a, b) return cout << a, b;
#define eps (double)1e-8
#define sd(n) scanf("%lld", &n)
#define pdn(n) printf("%lld\n", n);
#define pds(n) printf("%lld ", n);
#define forn(a, b, i) for (int i = a; i < b; i += 1)
#define vi vector<int>
#define vb vector<bool>
#define all(v) v.begin(), v.end() 
#define pii pair<int, int>
#define mii map<int, int> 
#define print(stuff) cout << stuff << endl
#define len(stuff) stuff.size()

int dp[500+1][500+1];
int ct[500+1][500+1];
int rec (int i, int j) {
  if (j < i) return 0;

  if (dp[i][j] < inf) return dp[i][j];
  if (i == j) return ct[i][j];
  dp[i][j] = ct[i][j] + rec(i + 1, j) + rec(i, j - 1) - rec(i + 1, j - 1);
  return dp[i][j];
}

signed main () {
  start_routine;
  // SPEED;
  #ifndef ONLINE_JUDGE
  //freopen("input.txt", "r", stdin);
  #endif

  vi d[201];

  int n;
  cin >> n;

  for (int i = 1; i <= n; i += 1) {
    for (int j = i; j <= n; j += i) d[j].push_back(i);
  }
  
  int ans = 0;
  for (int i = 1; i <= n; i += 2) {
    if (len(d[i]) == 8) ans += 1;
  }
  cout << ans << endl;
  end_routine;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <vector>
using namespace std;
int main() {
	int n;
	cin>>n;
	vector <int> v(n);
	for(int i=0;i<n;i++)
	{
	    v[i]=0;
	}
	for(int i=1;i<n;i++)
	{
	    int temp;
	    cin>>temp;
	    v[temp-1]++;
	}
	for(int i=0;i<n;i++)
	{
	    cout<<v[i]<<"\n";
	}
	return 0;
}


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

long mizu(int l, int r, int hmin, int h[]){
    if(r-l<0)return 0;
    else{
        for(int i=l;i<=r;i++){
            if(h[i-1]==hmin){
                return mizu(l,i-1,hmin,h)+mizu(i+1,r,hmin,h);
                break;
            }
            if(i==r){
                return 1+mizu(l,r,hmin+1,h);
            }
        }
    }
}

int main ()
{
    int N;
    int H[110];
    cin >> N;
    for(int i=0;i<N;i++){
        cin >> H[i];
    }
    cout << mizu(1,N,0,H) << endl;
    
}












Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define MAX(a,b) a=a>b?a:b
#define MIN(a,b) a=a<b?a:b
#define REP(i,x,n) for(int i=x;i<n;i++)
#define REPR(i,x,n) for(int i=n-1;i>=x;i--)
#define pb  push_back
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLr(obj) (obj).rbegin(), (obj).rend()
#define endl "\n"
#define F first
#define S second
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const ll MOD = 1e9 + 7;

ll dp[2][21010]={};

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


Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define EPS (1e-7)
#define INF (1e9)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
const double PI = acos(-1);
const ll MOD = 1000000007;
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}
 
template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
///////////////////////////////////////////////////////////////

string S,T,U;
int N,M,L;
int i = 0;
int j = 0;
int k = 0;

char dfs(int x) {
    if (x == 0 && i == N) return 'A';
    if (x == 1 && j == M) return 'B';
    if (x == 2 && k == L) return 'C';
    if (x == 0) return dfs(S[i++] - 'a');
    if (x == 1) return dfs(T[j++] - 'a');
    if (x == 2) return dfs(U[k++] - 'a');
    
}

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    cin >> S >> T >> U;
    N = S.size();
    M = T.size();
    L = U.size();

    cout << dfs(0) << endl;
}


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

constexpr int INF = 1E9;
struct Maximum {
    int val[2];
    Maximum() : val {0, -INF} {}
    Maximum(int a, int b) : val {a, b} {}
};
Maximum operator+(const Maximum &a, const Maximum &b) {return Maximum(max(a.val[0], b.val[0]), max(a.val[1], b.val[1]));}

constexpr int M = 5E6;
struct Node {
    Node *c[2];
    Maximum val;
} nodes[M];

int cnt_nodes = 0;
Node *null = &nodes[0];
Node *newNode() {
    auto p = &nodes[++cnt_nodes];
    p->c[0] = p->c[1] = null;
    return p;
}
Node *insert(Node *p, int l, int r, int x, const Maximum &v) {
    auto q = newNode();
    q->val = p->val + v;
    if (r - l == 1)
        return q;
    int mid = (l + r) / 2;
    if (x < mid) {
        q->c[0] = insert(p->c[0], l, mid, x, v);
        q->c[1] = p->c[1];
    } else {
        q->c[0] = p->c[0];
        q->c[1] = insert(p->c[1], mid, r, x, v);
    }
    return q;
}
Maximum rangeMax(Node *p, int l, int r, int x, int y) {
    if (p == null || l >= y || r <= x)
        return Maximum();
    if (l >= x && r <= y)
        return p->val;
    int mid = (l + r) / 2;
    return rangeMax(p->c[0], l, mid, x, y) + rangeMax(p->c[1], mid, r, x, y);
}

int main() {
    null->c[0] = null->c[1] = null;
    
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int n;
    cin >> n;
    vector<int> p(n);
    for (int i = 0; i < n; ++i) {
        cin >> p[i];
        --p[i];
    }
    
    vector<int> points(n);
    for (int i = 0, j = -1; i < n; ++i) {
        if (p[i] > j) {
            j = p[i];
            points[i] = 2;
        } else {
            points[i] = 1;
        }
    }
    
    vector<Node *> root(n + 1);
    root[n] = newNode();
    for (int i = n - 1; i >= 0; --i) {
        auto x = rangeMax(root[i + 1], 0, n, p[i] + 1, n);
        x.val[0] += points[i];
        x.val[1] += points[i];
        if (points[i] == 1)
            swap(x.val[0], x.val[1]);
        root[i] = insert(root[i + 1], 0, n, p[i], x);
    }
    vector<int> sum(n);
    for (int i = n - 1, j = 0; i >= 0; --i) {
        sum[i] = j;
        j += points[i] == 2;
    }
    
    vector<int> val[2], mx[2];
    mx[0] = mx[1] = {-1};
    int c[2] = {};
    string ans;
    for (int i = 0; i < n; ++i) {
        auto check = [&](int d) {
            int need = c[d] - c[d ^ 1] + sum[i];
            return need >= 0 && rangeMax(root[i + 1], 0, n, mx[d ^ 1].back() + 1, n).val[need % 2] >= need;
        };
        for (int d = 0; d <= 1; ++d) {
            val[d].push_back(p[i]);
            mx[d].push_back(max(mx[d].back(), p[i]));
            c[d] += mx[d].back() == p[i];
            if (check(0)) {
                ans += d + '0';
                break;
            }
            if (check(1)) {
                ans += d + '0';
                break;
            }
            c[d] -= mx[d].back() == p[i];
            val[d].pop_back();
            mx[d].pop_back();
        }
        if (ans.length() <= i) {
            cout << -1 << "\n";
            return 0;
        }
    }
    cout << ans << "\n";
    return 0;
}

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

int main() {
  // ここにプログラムを追記
int a,b ;
  cin >> a >>b ;
  if((a+b)%2==1){
  cout << (a+b+1)/2 << endl ;
  }
  else{
  cout << (a+b)/2<<endl;
  }
  
}

Measured memory_bytes: 256
#include<iostream>
#include<bits/stdc++.h>
#include<array>
using namespace std;
#define int long long
#define fast_cin ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define endl "\n"
#define endl "\n"
#define with_tests int t; cin >> t; while(t--){ solve(); cout << endl; }
#define without_tests solve(); cout << endl;
#define CEIL(x, y) (ll)ceil((long double)(x)/(long double)(y))
#define epsilon 1e-9 
typedef long long ll;
const int mod = 1e9+7;
const int N = 1e5+1;

vector<int> adj[N];
int n, m, u, v, w, k;
int ans = 0;

int vis[N];

int c = 0;

int mul(int i, int j){
    int res = (i*j)%mod;
    return res;
}

int pow(int i, int j){
    int res = 1;
    while(j){
        if(j&1){
            res = mul(res, i);
        }
        i = mul(i, i);
        j /= 2;
    }
    return res;
}

int dfs(int u, int par, int cur=0){
    
    vector<int> mx = {0, 0};
    for(int v: adj[u]){
        if(v != par){
            int val = dfs(v, u, cur+1) + 1;
            if(val > mx[0]){
                mx[0] = val;
                sort(mx.begin(), mx.end());
            }
        }
    }
    ans = max(ans, mx[0]+mx[1]);
    return mx[1];
}

void addEdge(int i, int j){
    adj[i].push_back(j);
    adj[j].push_back(i);
}

void solve(){
    
    double d, t, s;
    cin >> d >> t >> s;
    double ans = d/s;
    if(t >= ans){
        cout << "Yes";
    }
    else{
        cout << "No";
    }
}

int32_t main(){

    fast_cin;
    // with_tests;
    without_tests;

    return 0;
}


Measured memory_bytes: 6068
import sys
import math
import bisect

def main():
    d = dict()
    s = input()
    for c in list(s):
        if c not in d:
            d[c] = 0
        d[c] += 1
    ans = True
    if len(s) != 4:
        ans = False
    if len(d) != 2:
        ans = False
    for k in d:
        if d[k] != 2:
            ans = False
    if ans:
        print('Yes')
    else:
        print('No')
    
if __name__ == "__main__":
    main()


Measured memory_bytes: 3060
#include <iostream>
#include <stdio.h>
#define _USE_MATH_DEFINES
#include <math.h>
#include <set>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>
#include <limits>
#include <bitset>
#include <stack>
#include <ctype.h>

typedef long long int lli;
#define rep(i,s,N) for(int i=s;i<N;i++)
#define MOD 1000000007
#define more(a,b) (((a)>(b))?(a):(b))
#define less(a,b) (((a)<(b))?(a):(b))
using namespace std;


int main(void)
{
	int N; cin >> N;
	map<string, int> mp;
	rep(i, 0, N) {
		string S; cin >> S;
		mp[S]++;
	}
	map<string, int>::iterator it;
	int max = 0;
	for (it = mp.begin(); it != mp.end(); it++) {
		if (max < it->second)max = it->second;
	}
	for (it = mp.begin(); it != mp.end(); it++) {
		if (max == it->second)cout << it->first << endl;
	}

	return 0;
}


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

int main() {
    int N, K;
    std::cin >> N >> K;

    for (int i = 1; i < 10000; ++i) {
        if (N < std::pow(K, i)) {
            std::cout << i << std::endl;
            return 0;
        }
    } 

    return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

using static Input;
using static Util;
class Program
{
    static int N;
    static void INPUT()
    {
        N = NextInt();
    }

    static void OUT()
    {
        var dp = new int[N + 1];
        for (int i = 1; i <= N; i++)
            dp[i] = INF;
        for (int i = 1; i <= N; i++)
        {
            dp[i] = Math.Min(dp[i], dp[i - 1] + 1);
            var a = 6;
            while (i - a >= 0)
            {
                dp[i] = Math.Min(dp[i], dp[i - a] + 1);
                a *= 6;
            }

            a = 9;
            while (i - a >= 0)
            {
                dp[i] = Math.Min(dp[i], dp[i - a] + 1);
                a *= 9;
            }
        }
        Console.WriteLine(dp[N]);
    }
    static void Main(string[] args)
    {
#if DEBUG  
        //TESTINPUT();
        INPUT();

#else
        INPUT();
#endif
        OUT();
    }

    static void TESTINPUT()
    {
    }

}

public class Input
{
    public const long MOD = 1000000007;
    public const int INF = 1000000007;
    private static Queue<string> q = new Queue<string>();
    private static void Confirm() { if (q.Count == 0) foreach (var s in Console.ReadLine().Split(' ')) q.Enqueue(s); }
    public static int NextInt() { Confirm(); return int.Parse(q.Dequeue()); }
    public static long NextLong() { Confirm(); return long.Parse(q.Dequeue()); }
    public static string NextString() { Confirm(); return q.Dequeue(); }
    public static double NextDouble() { Confirm(); return double.Parse(q.Dequeue()); }
    public static int[] LineInt() { return Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); }
    public static long[] LineLong() { return Console.ReadLine().Split(' ').Select(long.Parse).ToArray(); }
    public static string[] LineString() { return Console.ReadLine().Split(' ').ToArray(); }
    public static double[] LineDouble() { return Console.ReadLine().Split(' ').Select(double.Parse).ToArray(); }
}

class Util
{

}




Measured memory_bytes: 13268
#include <bits/stdc++.h>
#define FI(__n) for(int i = 0; i < __n; ++i)
#define FJ(__n) for(int j = 0; j < __n; ++j)
#define INT_MAX 2147483647
#define INT_MIN -2147483648
#define l first
#define r second
#define mp make_pair
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int MOD=1000000007;
int solve()
{
    int n,m;
    cin>>n>>m;
    vector<int> s,e;
    int t1,t2;
    FI(m)
    {
        cin>>t1>>t2;
        if((t1!=1)&&(t2!=n)) continue;
        if(t1==1) s.pb(t2);
        else if(t2==n) e.pb(t1);
    }
    sort(e.begin(),e.end());
    FI(s.size())
    {
        /*FJ(e.size())
        {
            if(s[i]==e[j])
            {
                cout<<"POSSIBLE";
                return 0;
            }
        }*/
        /*if(bsearch(&s[i],e,e.size(),sizeof(int))!=NULL)
        {
            cout<<"POSSIBLE";
                return 0;
        }*/
        if(binary_search(e.begin(),e.end(),s[i]))
        {
            cout<<"POSSIBLE";
                return 0;
        }
    }
    cout<<"IMPOSSIBLE";
    return 0;
}
int main()
{
    ofstream coutf;
    coutf.open("output.txt");
    ifstream cinf;
    cinf.open("input.txt");
    solve();
    cinf.close();
    coutf.close();
    return 0;
}


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

#define ll long long int
#define pb push_back
#define fi first
#define se second
#define mp make_pair
#define mt make_tuple
#define all(A) A.begin(), A.end()
#define sz(A) (int)A.size()
typedef vector <int> vi;
typedef vector <ll> vl;
typedef pair <int, int> pii;
typedef tuple <int, int, int> tii;
const ll mod = 1e9 + 7;
//const ll mod = 998244353;
const int inf = 1e9;
//const ll inf = 1e18;
const int N = 2e5;

void solve () {
	int n;
	cin >> n;
	int a[n + 1];
	int cnt = 0;
	for (int i = 1; i <= n; i++) {
		cin >> a[i];
		if ((a[i] & 1) && (i & 1)) 
			cnt++;
	}
	cout << cnt << "\n";
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	#ifndef ONLINE_JUDGE
    freopen("in.txt", "r", stdin);
  #endif
	int t = 1;
	while (t--) {
		solve();
	}
 	return 0;
}

Measured memory_bytes: 3664
// AOJ DPL_5_L Balls and Boxes 12
// n 個の区別できないボールを k 個の区別できない箱に入れる
// とき、可能な入れ方の総数を求めてください。
// ただし、
//    どのボールも、必ずいずれかの箱に入れる。
//    どの箱にも、1つ以上のボールを入れる。
// 答えは制限付き分割数 divnum(n-k, k)
// 2019.3.11 bal4u

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

#define MOD 1000000007
int tbl[1001][1001];

int divnum(int n, int k)
{
	int ans;

	if (tbl[n][k]) return tbl[n][k];
	if (n < 0) return 0;
	if (n == 0 || n == 1 || k == 1) return 1;
	else {
		ans = divnum(n, k - 1);
		if (n >= k) ans += divnum(n - k, k);
	}
	return tbl[n][k] = ans % MOD;
}

int main()
{
	int n, k;

	scanf("%d%d", &n, &k);
	if (n < k) puts("0");
	else printf("%d\n", divnum(n-k, k));
	return 0;
}


Measured memory_bytes: 5080
/// Code By t_bone_289 (Tushar Singh)
/// An Immature Programmer.... I'm still developing !!
#include<bits/stdc++.h>
using namespace std;
#define pll pair<ll,ll>
#define fi first
#define se second
#define mp make_pair
#define pb emplace_back
#define endl '\n'
#define M 1000000007
#define error(x) cout << #x << " = " << x << endl;
#define pi 3.14159265358979323846
typedef long long ll;
typedef double d;
typedef long double ld;
ll powmod(ll base,ll exp,ll MOD){ll res=1;while(exp>0){if(exp%2==1) res=(res*base)%MOD;base=(base*base)%MOD;exp/=2;}return (res%MOD);}
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    ll n;
    cin>>n;
    vector<ll> a(n);
    vector<ll> b(n);
    vector<ll> c(n);
    for(ll i=0;i<n;i++)
    {
        cin>>a[i]>>b[i]>>c[i];
    }
    vector<ll> dpa(n);
    vector<ll> dpb(n);
    vector<ll> dpc(n);
    dpa[0]=a[0];
    dpb[0]=b[0];
    dpc[0]=c[0];
    for(ll i=1;i<n;i++)
    {
        dpa[i]=a[i]+max(dpb[i-1],dpc[i-1]);
        dpb[i]=b[i]+max(dpa[i-1],dpc[i-1]);
        dpc[i]=c[i]+max(dpa[i-1],dpb[i-1]);
    }
    ll ans=max({dpa[n-1],dpb[n-1],dpc[n-1]});
    cout<<ans;
    return 0;
}




Measured memory_bytes: 4992
#include <iostream>
#include<cmath>
using namespace std;
long int my_xor(long int a,long int b);

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

    long int N;
    long int all_a_xor;
    long int *a;

    cin>>N;
    a=new long int[N];
    for(int i=0;i<N;i++)
        cin>>a[i];

    all_a_xor=a[0];
    for(int i=1;i<N;i++)
        all_a_xor=my_xor(all_a_xor,a[i]);

    for(int i=0;i<N;i++)
    {
        cout<<my_xor(a[i],all_a_xor);
        if(i!=N-1)
            cout<<' ';
    }
    delete [] a;
}

long int my_xor(long int a,long int b)
{
    int a_tmp,b_tmp;
    long int total=0;

    for(int i=0;i<100;i++)
    {
        a_tmp=a%2;
        b_tmp=b%2;
        if(a_tmp+b_tmp==1)
            total+=(long int)pow((double)2,(double)i);
        
        a=a/2;
        b=b/2;
    }
    return total;
}

Measured memory_bytes: 4368
//言語iで話せる人～みたいなあれ。
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <cassert>
using namespace std;

int n, m;
vector<int> p[100000];	//p[i] = 言語iで話せる人集合

void input() {
	cin >> n >> m;
	for (int i = 0; i < n; i++) {
		int kind;
		cin >> kind;
		for (int j = 0; j < kind; j++) {
			int lang;
			cin >> lang;
			lang--;
			
			p[lang].push_back(i);
		}
	}
}

class UF {
public:
	int n;
	int num[100000];
	int sz;
	
	void init(int n) {
		this->n = n;
		sz = n;
		for (int i = 0; i < n; i++) {
			num[i] = i;
		}
	}
	
	int root(int x) {
		if (num[x] == x) return x;
		return (num[x] = root(num[x]));
	}
	
	void marge(int x, int y) {
		x = root(x);
		y = root(y);
		if (x == y) return;
		num[x] = y;
		sz--;
	}
};

UF uf;

signed main() {
	int i, j;
	
	input();
	uf.init(n);
	
	for (i = 0; i < m; i++) {
		for (j = 0; j + 1 < p[i].size(); j++) {
			uf.marge(p[i][j], p[i][j + 1]);
		}
	}
	
	if (uf.sz == 1) {
		cout << "YES" << endl;
	}
	else {
		cout << "NO" << endl;
	}
	return 0;
}

Measured memory_bytes: 4608
#include <bits/stdc++.h>
#define rep(i,a,b) for(ll i=ll(a);i<ll(b);i++)
#define irep(i,a,b) for(ll i=ll(a);i>=ll(b);i--)
#define pb push_back
#define mp make_pair
#define pll pair<ll,ll>
#define endl "\n"
using ll=long long;
using ld=long double;
using namespace std;
const ll mod= 1e9+7;
const ll INF = 1LL<<40;
ll GCD(ll a, ll b) { return b ? GCD(b, a%b) : a; }


string s[220000];
vector<string> f;
int main(){
  ll n,k,ans=1,tmp=1;
  string x;
  cin>>n;
  rep(i,0,n){cin>>s[i];}
  sort(s,s+n);
  rep(i,0,n-1){
    if(s[i]==s[i+1])tmp++;
    else{ans=max(tmp,ans);tmp=1;}
  }
  ans=max(ans,tmp);
  tmp=1;
  rep(i,0,n-1){
    if(s[i]==s[i+1])tmp++;
    else{
      if(tmp==ans)f.pb(s[i]);
      tmp=1;
    }
  }
  if(tmp==ans)f.pb(s[n-1]);
  sort(f.begin(),f.end());
  for(auto i:f)cout<<i<<endl;

}


Measured memory_bytes: 16116
# -*- coding: utf-8 -*-

class UnionFindTree():
    def __init__(self, n):
        self.parent = [] # 親のノード
        self.rank = [] # 木の深さ
        self.number = [] # グループの要素数
        for i in range(n):
            self.parent.append(i)
            self.rank.append(0)
            self.number.append(1)

    # 根ノードを取得
    def find(self, x):
        if self.parent[x] == x:
            return x
        else:
            self.parent[x] = self.find(self.parent[x])
            return self.parent[x]

    # 併合
    def unite(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        
        if self.rank[x] < self.rank[y]:
            self.parent[x] = y
            self.number[y] += self.number[x]
        else:
            self.parent[y] = x
            self.number[x] += self.number[y]
            if self.rank[x] == self.rank[y]:
                self.rank[x] += 1

    # 同じノードか判別
    def same(self, x, y):
        return self.find(x) == self.find(y)

    # グループのノード数を取得
    def union_number(self, x):
        x = self.find(x)
        return self.number[x]

[N, M, K] = [int(i) for i in input().split()]

AB = []
for m in range(M):
    [a, b] = [int(i) for i in input().split()]
    AB.append((a, b))

CD = []
for k in range(K):
    [c, d] = [int(i) for i in input().split()]
    CD.append((c, d))

uf_tree = UnionFindTree(N)
for (a, b) in AB:
    a -= 1
    b -= 1
    uf_tree.unite(a, b)

# 友達候補を計算
candidates = []
for n in range(N):
    candidates.append(uf_tree.union_number(n) - 1)

# 友達を除外
for (a, b) in AB:
    a -= 1
    b -= 1
    candidates[a] -= 1
    candidates[b] -= 1

# ブロックユーザを除外
for (c, d) in CD:
    c -= 1
    d -= 1
    if uf_tree.same(c, d):
        candidates[c] -= 1
        candidates[d] -= 1

ans = ''
for candidate in candidates:
    ans += str(candidate) + ' '

print(ans[:len(ans) - 1])

Measured memory_bytes: 41904
#include <iostream>

using namespace std;

int main()
{
    string s , t;
    cin >> s >> t;
    int a , b;
    cin >> a >> b;
    string u;
    cin >> u;
    if(s == u) {
        a --;
    }
    if(t == u) {
        b --;
    }
    cout << a << ' ' << b;
    return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define all(s) s.begin(), s.end()
using namespace std;
typedef long long int ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
typedef vector<string> vs;
const int MX = 100005, INF = 1001001001;
const ll LINF = 1e18;
const double eps = 1e-10;
const int DIV = 2e9+7;

int main() {
    int n;
    cin >> n;
    rep(i, 30) rep(j, 30) {
        int val = 4 * i + 7 * j;
        if (val == n) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
}

Measured memory_bytes: 256
n,a,b,c,d=map(int,input().split())
s=input()
s2=s[min(a,b)-1:max(c,d)]
n2=len(s2)

sl=s[a-1:c]
sr=s[b-1:d]

for i in range(len(sl)-1):
    if sl[i]=="#" and sl[i+1]=="#":
        print("No")
        import sys
        sys.exit()
for i in range(len(sr)-1):
    if sr[i]=="#" and sr[i+1]=="#":
        print("No")
        import sys
        sys.exit()


if c<d:
    print("Yes")
else:
    for i in range(n2-2):
        if s2[i]=="." and s2[i+1]=="." and s2[i+2]=="." and i<d-1 and b<i+3:
            print("Yes")
            import sys
            sys.exit()
    print("No")

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

int main() {
  int N;
  cin>>N;
  vector<int> vec(N);
  vector<int> result(N,0);
  for(int i=0; i<N; i++){
  	cin>>vec.at(i);
  }
  int count=0;
  for(int i=0; i<N-1; i++){
  	if(vec.at(i)>vec.at(i+1) ||vec.at(i)==vec.at(i+1) ){
  		count+=1;
  		result.at(i)=count;
  	}else if(vec.at(i)<vec.at(i+1)){
  		count=0;
  	}
  }
  sort(result.begin(),result.end(),std::greater<int>());
  cout <<result.at(0) << endl;
}


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

using namespace std;

#define fst(t) std::get<0>(t)
#define snd(t) std::get<1>(t)
#define thd(t) std::get<2>(t)
#define unless(p) if(!(p))
#define until(p) while(!(p))

using ll = long long;
using P = std::tuple<int,int>;

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

int N;
int xs[100100];
int L, Q;

int db[17][100100], db_rev[17][100100];

void generate_db(int (&db)[17][100100]){
    int l = 0;
    for(int i=1,j=1;i<=N;++i){
        while(j + 1 <= N && l + abs(xs[j+1] - xs[j]) <= L){
            l += abs(xs[j+1] - xs[j]);
            ++j;
        }

        if(j == N){
            for(int k=i;k<=N;++k){
                db[0][k] = j;
            }

            break;
        }
        
        db[0][i] = j;
        l -= abs(xs[i+1] - xs[i]);
    }

    for(int i=0;i+1<=16;++i){
        for(int j=1;j<=N;++j){
            if(db[i][j] == N){
                db[i+1][j] = N;
            }else{
                db[i+1][j] = db[i][db[i][j]];
            }
        }
    }
}

int nth(int first, int n, const int (&db)[17][100100]){
    int step = 0;
    while(n > 0){
        if(n & 1){
            first = db[step][first];
        }
        n >>= 1;
        ++step;
    }

    return first;
}

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

    std::cin >> N;

    for(int i=1;i<=N;++i){
        std::cin >> xs[i];
    }

    std::cin >> L >> Q;

    generate_db(db);
    reverse(&xs[1], &xs[1]+N);
    generate_db(db_rev);

    // for(int i=1;i<=N;++i){
    //     std::cout << "db_rev[0][" << i << "] = " << db_rev[0][i] << std::endl;
    // }
    
    for(int i=0;i<Q;++i){
        int A, B;
        std::cin >> A >> B;

        int (&_db)[17][100100] = A < B ? db : db_rev;
        if(A >= B){
            A = N + 1 - A;
            B = N + 1 - B;
        }

        int64_t lb = 100100, ub = 0;

        while(std::abs(ub - lb) > 1){
            int64_t mid = (lb + ub) / 2;
            
            if(nth(A, mid, _db) >= B){
                lb = mid;
            }else{
                ub = mid;
            }
        }

        std::cout << lb << std::endl;
    }
}


Measured memory_bytes: 14592
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
int main()
{
    string s;
    cin >> s;
    vector<string> v(4);

    REP(i,4){
        v.at(i) = s[i];
    }
    sort(ALL(v));
    if(v.at(0) == v.at(1) && v.at(2) == v.at(3) && v.at(0) != v.at(2))
    {
        cout << "Yes" << endl;
    }else
    {
        cout << "No" << endl;
    }
    
}


Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main() {
	int W, H;
	int x, y, r;

	cin >> W >> H >> x >> y >> r;

	cout << (((0 <= x - r&&x + r <= W) && (0 <= y - r&&y + r <= H)) ? "Yes" : "No") << endl;

	return 0;
}

Measured memory_bytes: 1160
n, k = map(int, input().split())
r, s, p = map(int, input().split())
t = input()

t_sep = []
for i in range(k):
    t_sep.append([])

for j in range(n):
    list_num = j%k
    t_sep[list_num].append(t[j])

ans = 0
for each_list in t_sep:
    if each_list[0] == 'r':
        ans += p
    elif each_list[0] == 's':
        ans += r
    else:
        ans += s


for each_list in t_sep:
    for i in range(len(each_list)-1):
        if each_list[i+1]==each_list[i]:
            if each_list[i + 1] != each_list[i-1] or i ==0:
                con = 1
            if  con ==1:
                ans += 0
            else:
                if each_list[i + 1] == 'r':
                    ans += p
                elif each_list[i + 1] == 's':
                    ans += r
                else:
                    ans += s
            con = con * (-1)


        else:
            if each_list[i+1] == 'r':
                ans += p
            elif each_list[i+1] == 's':
                ans += r
            else:
                ans += s

print(ans)

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

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

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

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

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

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

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

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

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

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

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

fn main() {
    input!{
        s: chars
    }
    let n = s.len();
    let mut prev = 1;
    let mut ans = 1;
    let mut i = 1;
    while i < n {
        if prev == 2 || prev == 1 && s[i] != s[i - 1] {
            i += 1;
            prev = 1;
            ans += 1;
        } else if i < n - 1 {
            i += 2;
            prev = 2;
            ans += 1;
        } else {
            break;
        }
    }
    println!("{}", ans);
}


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

int main() {
    double l;
    cin >> l;
    double a = l / 3.0;
    printf("%.12lf\n", a * a * a);
    return 0;
}

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

int main() {
    int n, cap;
    cin>>n>>cap;
    vector<int> weights;
    vector<long long int> values;
    for(int i=0; i<n; i++){
        int w, v;
        cin>>w>>v;
        weights.push_back(w);
        values.push_back(v);
    }
    
    long long int dp[n+1][cap+1];
    memset(dp, 0, sizeof(dp));
    
    for(int i=0; i<n+1; i++){
        for(int j=0; j<cap+1; j++){
            if(i==0 || j==0){
                dp[i][j] = 0;
            }
            else if(weights[i-1]<=j){
                dp[i][j] = max(dp[i-1][j], values[i-1] + dp[i-1][j-weights[i-1]]);
                
            }
            else{
                dp[i][j] = dp[i-1][j];
            }
            
            // cout<<dp[i][j]<<" ";
        }
        // cout<<endl;
    }
    cout<<dp[n][cap];
    
}

Measured memory_bytes: 82308
#include <bits/stdc++.h>
#include <numeric>
#define rep(i,n) for (int i = 0; i < n; ++i)
#define rep1(i,n) for (int i = 1; i <= n; ++i)
template<typename T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
const long long MOD = 1e9+7;
template<typename T> inline void add(T& a, T b) { a += b; if (a >= MOD) a -= MOD; }

int gcd(int a, int b) {
  if(b > a) {
    swap(a, b);
  }
  if(a % b == 0) return b;
  return gcd(b, a % b);
}

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

  int K; cin >> K;
  int ans = 0;

  rep1(a, K) {
    rep1(b, K) {
      rep1(c, K) {
        ans += gcd(gcd(a,b), c);
      }
    }
  }

  cout << ans << endl;
}


Measured memory_bytes: 3640
#include <iostream>
#include <cmath>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <set>
#include <algorithm>
#include <iomanip>
#include <string.h>

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

typedef long long lint;

using namespace std;

int main(){
  string S;
  cin>>S;
  string S1,S2;
  REP(i,S.size()){
    if(i%2==0)S1+='0';
    else S1+='1';
  }
  S2="1"+S1;
  int ans1=0;
  int ans2=0;
  REP(i,S.size()){
    if(S[i]!=S1[i])ans1++;
    if(S[i]!=S2[i])ans2++;
  }
  cout<<min(ans1,ans2)<<endl;
  return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define rep(i, n) FOR(i, 0, n)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; --i)
#define whole(x) (x).begin(),(x).end()
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end())
using P = pair<int, int>;
#define debug(var) cerr << "[" << #var << "] " << var << endl
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
const ll mod = 1000000007;
const int dx[] = {-1,0,1,0};
const int dy[] = {0,-1,0,1};


int main(){
    string s;
    cin >> s;
    s[3] = '8';
    
    
    cout << s << endl;
    return 0;
}


Measured memory_bytes: 3628
# include "bits/stdc++.h"
using namespace std;
using LL = long long;
using ULL = unsigned long long;
const double PI = acos(-1);
template<class T>constexpr T INF() { return ::std::numeric_limits<T>::max(); }
template<class T>constexpr T HINF() { return INF<T>() / 2; }
template <typename T_char>T_char TL(T_char cX) { return tolower(cX); };
template <typename T_char>T_char TU(T_char cX) { return toupper(cX); };
typedef pair<LL, LL> pii;
const int vy[] = { -1, -1, -1, 0, 1, 1, 1, 0 }, vx[] = { -1, 0, 1, 1, 1, 0, -1, -1 };
const int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
int popcnt(unsigned long long n) { int cnt = 0; for (int i = 0; i < 64; i++)if ((n >> i) & 1)cnt++; return cnt; }
int d_sum(LL n) { int ret = 0; while (n > 0) { ret += n % 10; n /= 10; }return ret; }
int d_cnt(LL n) { int ret = 0; while (n > 0) { ret++; n /= 10; }return ret; }
LL gcd(LL a, LL b) { if (b == 0)return a; return gcd(b, a%b); };
LL lcm(LL a, LL b) { LL g = gcd(a, b); return a / g*b; };
# define ALL(qpqpq)           (qpqpq).begin(),(qpqpq).end()
# define UNIQUE(wpwpw)        sort(ALL((wpwpw)));(wpwpw).erase(unique(ALL((wpwpw))),(wpwpw).end())
# define LOWER(epepe)         transform(ALL((epepe)),(epepe).begin(),TL<char>)
# define UPPER(rprpr)         transform(ALL((rprpr)),(rprpr).begin(),TU<char>)
# define FOR(i,tptpt,ypypy)   for(LL i=(tptpt);i<(ypypy);i++)
# define REP(i,upupu)         FOR(i,0,upupu)
# define INIT                 std::ios::sync_with_stdio(false);std::cin.tie(0)
# pragma warning(disable:4996)

int V;
int E;
struct edge { int from, to, cost; };

typedef pair<int, int> PP;

vector<edge> e;

int Par[100000];
int Rank[100000];

void init(int n) {
	for (int i = 0; i < n; i++) {
		Par[i] = i;
		Rank[i] = 0;
	}
}

int find(int x) {
	if (Par[x] == x) {
		return x;
	}
	else {
		return Par[x] = find(Par[x]);
	}
}

void unite(int  x, int y) {
	x = find(x);
	y = find(y);
	if (x == y) return;
	if (Rank[x] < Rank[y]) {
		Par[x] = y;
	}
	else {
		Par[y] = x;
		if (Rank[x] == Rank[y])Rank[x]++;
	}
}

bool same(int x, int y) {
	return find(x) == find(y);
}

// ソート時に比較するための関数 
bool comp(const edge& e1, const edge& e2) {
	return e1.cost < e2.cost;
}

int kruskal() {
	init(V);
	sort(e.begin(), e.end(), comp);
	int ans = 0;
	for (int i = 0; i<E; i++) {
		if (!same(e[i].from, e[i].to)) {
			unite(e[i].from, e[i].to);
			ans += e[i].cost;
		}
	}
	return ans;
}

int main() {
	cin >> V >> E;
	int a, b, c;
	for (int i = 0; i < E; i++) {
		cin >> a >> b >> c;
		e.push_back(edge{ a,b,c });
	}
	cout << kruskal() << endl;
}



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

int main() {
    int N;
    cin >> N;
    string S;
    cin >> S;

    int bcnt = 0, wcnt = 0;
    vector<int> b(N-1, 0), w(N-1, 0);
    for(int i=0; i<N-1; i++) {
        if(S[i] == '#') bcnt++;
        if(S[N-1-i] == '.') wcnt++;
        b[i] = bcnt; w[N-2-i] = wcnt;
    }

    int res = min(bcnt, wcnt);
    for(int i=0; i<N-1; i++) {
        res = min(res, b[i]+w[i]);
    }

    
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 2180