akhauriyash/Code-Regression huggingface dataset:
#include <iostream>

int main(){
    std::string s;
    std::string w[3]={
        "Sunny",
        "Cloudy",
        "Rainy"
    };
    std::cin >> s;
    
    for(int i=0;i<3;i++){
        if(s==w[i]){
            i++;
            if(i==3){
                i=0;
            }
            std::cout << w[i] << std::endl;
            break;
        }
    }
    return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env python3
# ITP2_10_C: Bitset 1 - Bit Flag


class BitMask:
    def __init__(self, size):
        self.size = size
        self.masks = []
        self.data = 0 & (1 << self.size)

    def add_mask(self, m):
        mask = 0 & (1 << self.size)
        for i in m:
            mask |= 1 << i
        self.masks.append(mask)

    def set(self, m):
        self.data |= self.masks[m]

    def test(self, i):
        return self.data & (1 << i) > 0

    def clear(self, m):
        self.data &= ~(self.masks[m])

    def flip(self, m):
        self.data ^= (self.masks[m])

    def all(self, m):
        return self.data & self.masks[m] == self.masks[m]

    def any(self, m):
        return not self.data & self.masks[m] == 0

    def none(self, m):
        return self.data & self.masks[m] == 0

    def count(self, m):
        def test(i):
            return data & (1 << i) > 0
        data = self.data & self.masks[m]
        return sum(1 for i in range(self.size) if test(i))

    def val(self, m):
        return self.data & self.masks[m]


def run():
    bit = BitMask(64)
    m = int(input())
    for _ in range(m):
        mask = [int(i) for i in input().split()]
        bit.add_mask(mask[1:])

    q = int(input())
    for _ in range(q):
        cmd, val = [int(i) for i in input().split()]

        if cmd == 0:
            if bit.test(val):
                print(1)
            else:
                print(0)
        elif cmd == 1:
            bit.set(val)
        elif cmd == 2:
            bit.clear(val)
        elif cmd == 3:
            bit.flip(val)
        elif cmd == 4:
            if bit.all(val):
                print(1)
            else:
                print(0)
        elif cmd == 5:
            if bit.any(val):
                print(1)
            else:
                print(0)
        elif cmd == 6:
            if bit.none(val):
                print(1)
            else:
                print(0)
        elif cmd == 7:
            print(bit.count(val))
        elif cmd == 8:
            print(bit.val(val))


if __name__ == '__main__':
    run()



Measured memory_bytes: 5652
import java.awt.print.Printable;
import java.util.Scanner;
import javax.sound.midi.SysexMessage;
  
public class Main{      
    public static void main(String[] args){

        Scanner sc = new Scanner(System.in);

        while(true){
            int n = sc.nextInt();
            int r = sc.nextInt();
        
            if(n==0&&r==0)
                break;

            int fudas[] =new int[n+1];
            int count=1;
            for(int i=n;i>0;i--)
            {
                fudas[i]=count;
                //System.out.println("fudas["+i+"] = "+count);
                count++;
            }
            //System.out.println("----");
            for(int i=0;i<r;i++)
            {
                int p = sc.nextInt();
                int c = sc.nextInt();
                int fudas_p[] = new int[p];
                for(int j=1;j<p;j++)
                {
                    fudas_p[j]=fudas[j];
                }
                for(int j=1;j<p;j++){
                    //System.out.println("fudas_p["+j+"] = "+fudas_p[j]);
                }
                //System.out.println("----");
                for(int j=1;j<=c;j++)
                {
                    fudas[j]=fudas[j+p-1];
                }
                for(int j=1;j<=c;j++){
                    //System.out.println("fudas["+j+"] = "+fudas[j]);
                }
                //System.out.println("----");
                for(int j=1;j<p;j++)
                {
                    fudas[j+c]=fudas_p[j];
                }
                for(int j=1;j<=n;j++){
                    //System.out.println("fudas["+j+"] = "+fudas[j]);
                }
                //System.out.println("----");
            }
            System.out.println(fudas[1]);
        }
        sc.close();
        
    }   
}


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

#define V vector
typedef long long ll;
typedef unsigned long long ull;

typedef V<int> vi;
typedef V<ll> vll;
typedef V<string> vs;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define f(i,a) for(int i = 0 ; i < a ; i++)
#define fll(i,a) for(ll i = 0 ; i < a ;i++)
#define forab(i,a,b) for(int i = a ; i < b ; i++)
#define prec(x) cout<<fixed<<setprecision(x)
#define ff first
#define ss second

#define pb push_back
#define mp make_pair
#define numberofdigits(x) floor(log10(x)) + 1
#define all(x) (x).begin() ,(x).end()

const ll mod = 1e9 + 7;

ll binpow(ll a, long long b) {
	ll res = 1;
	while (b > 0) {
		if (b & 1)
			res = (res * a);
		a = (a * a);
		b >>= 1;
	}
	return res;
}
const int N = 1e5 + 5;

void solve() {

	int n;
	cin >> n;

	int a[n];
	for (int i = 0 ; i < n ; i++)
		cin >> a[i];
	vector<pair<int, int>> odd , even;

	map<int, int> fr;

	for (int i = 0 ; i < n ; i += 2)
		fr[a[i]]++;
	for (auto x : fr)
		even.pb({x.ss , x.ff});
	fr.clear();

	for (int i = 1 ; i < n ; i += 2)
		fr[a[i]]++;
	for (auto x : fr)
		odd.pb({x.ss , x.ff});

	sort(all(odd)) , reverse(all(odd));
	sort(all(even)) , reverse(all(even));

	int ans = 1e9;

	if (even[0].ss != odd[0].ss)
		ans = min(ans , n - even[0].ff - odd[0].ff);
	else {
		if ((int)even.size() >= 2)
			ans = min(ans , n - even[1].ff - odd[0].ff);
		if ((int)odd.size() >= 2)
			ans = min(ans , n - odd[1].ff - even[0].ff);
		ans = min(ans , n - even[0].ff);
		ans = min(ans , n - odd[0].ff);
	}

	cout << ans << "\n";

}

int main() {

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

	int t = 1;
	//cin >> t;

	while (t--)
		solve();
	return 0;
}





Measured memory_bytes: 6808
#include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <queue>
#include <set>
#include <map>
#include <limits>
#include <cmath>
#include <iomanip>
#include <functional>
#include <random>
#include <boost/multiprecision/cpp_int.hpp>

using namespace std;
using ll = long long;
namespace mp = boost::multiprecision;

struct UnionFind {
  vector< int > data;

  UnionFind(int sz) {
    data.assign(sz, -1);
  }

  bool unite(int x, int y) {
    x = find(x), y = find(y);
    if(x == y) return (false);
    if(data[x] > data[y]) swap(x, y);
    data[x] += data[y];
    data[y] = x;
    return (true);
  }

  bool same(int x, int y) {
    x = find(x), y = find(y);
    return x == y;
  }
  int find(int k) {
    if(data[k] < 0) return (k);
    return (data[k] = find(data[k]));
  }

  int size(int k) {
    return (-data[find(k)]);
  }
};

int main()
{
    // 整数の入力
    ll N;
    cin >> N;
    vector<ll> A(N);
    map<ll,ll> counts;
    for(int i = 0; i<N;i++){
      cin >> A[i];
      counts[A[i]]++;
    }
    ll su = 0;
    for(auto p:counts){
      su += p.second * (p.second -1)/2;
    }
    for(int i = 0;i < N;i++){
      ll m = counts[A[i]];
      cout << su - m * (m -1) /2 + (m -1) * (m - 2)/2 << endl;
    }
    return 0;
}

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

int main(){
    int n, k;
    cin >> n >> k;
    vector<double> p(n+1);
    p[0] = 0.0;
    rep(i, n) {
        double tmp_p;
        cin >> tmp_p;
//        cout << ((double)1 + tmp_p ) / (double)2 << endl;
        p[i+1] = ((double)1 + tmp_p ) / (double)2 + p[i];  
    }
    double ans = 0.0;
    rep(i, n - k + 2 ) {
        ans = max(ans, p[i+k] - p[i] );
    }
    printf("%.7lf\n", ans);
}


Measured memory_bytes: 1792
from itertools import permutations

N = int(input())
nums = ''.join([str(i) for i in range(1, N+1)])
P = list(map(str, input().split()))
Q = list(map(str, input().split()))
P = ''.join(P)
Q = ''.join(Q)


ref_list = list(permutations(nums, N))
for i in range(len(ref_list)):
  s = ''.join(ref_list[i])
  if s == P:
    a = i+1
  elif s == Q:
    b = i+1
    
if P == Q:
  print(0)
else:
  print(abs(a - b))

Measured memory_bytes: 8052
def main():
    N = int(input())
    A = [[int(i) for i in input().split()] for j in range(2)]
    ans = 0
    for i in range(N):
        cur = sum(A[0][:i+1]) + sum(A[1][i:])
        ans = max(ans, cur)
    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 38512
def readinput():
    n=int(input())
    return n

def main(n):
    stock=[]
    for _ in range(10):
        stock.append([])

    stock[0].append('')
    for m in range(1,10):
        for i in range(len(stock[m-1])):
            stock[m].append(stock[m-1][i]+'3')
            stock[m].append(stock[m-1][i]+'5')
            stock[m].append(stock[m-1][i]+'7')
    #print(stock)
    count=0
    for m in range(3,10):
        for i in range(len(stock[m])):
            if int(stock[m][i]) <= n and '3' in stock[m][i] and '5' in stock[m][i] and '7' in stock[m][i]:
                count+=1
                #print(stock[m][i])
    return count

if __name__=='__main__':
    n=readinput()
    ans=main(n)
    print(ans)


Measured memory_bytes: 11004
#include <iostream>
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 5e3+5;
string arr[MAXN];
bool block[MAXN][MAXN];
int dp[MAXN][MAXN];
int l[MAXN];
int r[MAXN];
int h[MAXN];

int main(){
    int n,m;
    cin>>n>>m;
    for(int i=1;i<=n;i++){
        string s;
        cin>>s;
        s = '1'+s;
        arr[i] = s;
    }
    for(int i=1;i<n;i++){
        for(int j=1;j<m;j++){
            int cnt = 0;
            if(arr[i][j] == '#'){
                cnt++;
            }
            if(arr[i+1][j] == '#'){
                cnt++;
            }
            if(arr[i][j+1] == '#'){
                cnt++;
            }
            if(arr[i+1][j+1] == '#'){
                cnt++;
            }
            if(cnt%2){
                block[i][j] = true;
                //cout<<i<<" "<<j<<endl;
            }
        }
    }
    int ans = 0;
    /*for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            if(block[i][j]){
                
                continue;
            }
            if(arr[i][j] == arr[i-1][j]){
                dph[i][j] = dph[i-1][j]+1;
            }else{
                dph[i][j] = 1;
            }
            if(arr[i][j] == arr[i][j-1]){
                dpw[i][j] = dpw[i][j-1]+1;
            }else{
                dpw[i][j] = 1;
            }
            
        }
    }*/
    h[0] = -1;
    h[m] = -1;
    ans = max(n,m);
    for(int i=1;i<n;i++){
        for(int j=1;j<m;j++){
            if(!block[i][j]){
                h[j]++;
            }else{
                h[j] = 0;
            }
        }
        stack<int> s1;
        s1.push(0);
        for(int j=1;j<m;j++){
            while(h[s1.top()]>=h[j]){
                s1.pop();
            }
            l[j] = s1.top();
            s1.push(j);
        }
        while(s1.size()){
            s1.pop();
        }
        s1.push(m);
        for(int j=m-1;j>0;j--){
            while(h[s1.top()]>=h[j]){
                s1.pop();
            }
            r[j] = s1.top();
            s1.push(j);
        }
        for(int j=1;j<m;j++){
            ans = max(ans,(h[j]+1)*(r[j]-l[j]));
            
        }
        
    }
    
    cout<<ans<<endl;
    
}


Measured memory_bytes: 16640
#include<iostream>
#include<algorithm>
using namespace std;
int main(){
  int a[4];cin >> a[0] >> a[1] >> a[2] >> a[3];
  sort(a,a+4);
  cout << ((a[0] == 1 && a[1] == 4 && a[2] == 7 && a[3] == 9) ? "YES":"NO") << endl;
}

Measured memory_bytes: 256
/*==============================================*\
ID:          shahidul_brur
 
Name:     Md. Shahidul Islam
Study:      CSE, BRUR
Address:  Rangpur, Bangladesh
 
 mail: shahidul.cse.brur@gmail.com
 FB  : fb.com/shahidul.brur
 Blog: shahidul-brur.blogspot.com(in Bengali),
       shahidul-brur-en.blogspot.com(in English)
\*===============================================*/
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp> // Common file
//#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
//using namespace __gnu_pbds;
using namespace std;
//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
 
//#pragma GCC optimize("O3")
//#pragma GCC optimize("unroll-loops")
//#pragma GCC target("avx,avx2,fma")
 
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef pair<ll, int> li;
typedef pair<int, ll> il;
typedef vector<ii> vii;
typedef vector<il> vil;
typedef vector<li> vli;
 
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define sz size()
#define all(a)  a.begin(), a.end()
#define mem(a, b)     memset(a, b, sizeof(a))
#define f0(i,b) for(int i=0;i<(b);i++)
#define f1(i,b) for(int i=1;i<=(b);i++)
#define f2(i,a,b) for(int i=(a);i<=(b);i++)
#define fr(i,b,a) for(int i=(b);i>=(a);i--)
#define rep(i,a,b,c) for(int i=(a);i!=(b);i+=(c))
 
int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1};
int dy8[] = {1,-1, 1, -1, 0, 0, -1, 1};
int dx4[] = {0, 0, 1, -1};
int dy4[] = {1, -1, 0, 0};
 
const double pi = acos(-1.0);
const double eps = 1e-6;
const int mod = (int)1e9+7;
const int maxn = 300005;
const int logn = 20;
int a[maxn];
int main()
{
    ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL);
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    int t = 1;
//    cin>>t; 
    while(t--)
    {
        int n;
        cin>>n;
        f0(i,n) cin>>a[i];
        sort(a,a+n);
        int p = n-2;
        ll ans = a[n-1];
        f0(i,n-2)
        {
            ans+=a[p];
            ++i;
            if(i<n-2) ans+=a[p];
            --p;
        }
        cout << ans << "\n";
    }
    return 0;
}


Measured memory_bytes: 4372
#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define ll long long
#define ld long double
#define all(a) a.begin(),a.end()
#define endl '\n'
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ull unsigned long long
#define int long long
#define iter set<int>::iterator
using namespace std;
using namespace __gnu_pbds;

template<class T>
using ordered_set=tree<T,null_type,less<T>,rb_tree_tag,tree_order_statistics_node_update>;

template<class T>
using ordered_multiset=tree<T,null_type,less_equal<T>,rb_tree_tag,tree_order_statistics_node_update>;

mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
mt19937_64 rnd1(chrono::steady_clock::now().time_since_epoch().count());

//find_by_order
//order_of_key

const int N=2e5+7;
const int inf=1e18+5;
const int mod=2520;

vector<int>a[N];

main ()
{
    int n,m;
    cin>>n>>m;
    for (int i=1;i<=n;++i){
        int x,y;
        cin>>x>>y;
        a[x].pb(y);
    }
    for (int i=1;i<=m;++i){
        sort(all(a[i]));
        reverse(all(a[i]));
    }
    multiset<int>setik;
    int ans=0;
    for (int i=1;i<=m;++i){
        if (a[i].size()>0){
            if(setik.size()>0){
                iter it=setik.end();
                --it;
                if (*it>a[i][0]){
                    ans+=*it;
                    for (int j=0;j<a[i].size();++j){
                        setik.insert(a[i][j]);
                    }
                    setik.erase(it);
                }
                else {
                    ans+=a[i][0];
                    for (int j=1;j<a[i].size();++j){
                        setik.insert(a[i][j]);
                    }
                }
            }
            else {
                ans+=a[i][0];
                for (int j=1;j<a[i].size();++j){
                    setik.insert(a[i][j]);
                }
            }
        }
        else {
            if (setik.size()>0){
                iter it=setik.end();
                --it;
                ans+=*it;
                setik.erase(it);
            }
        }
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 10624
//https://atcoder.jp/contests/abc154/tasks/abc154_d
//D - Dice in Line
#include <bits/stdc++.h>
#if LOCAL
#include "dump.hpp"
#else
#define dump(...)
#endif
using namespace std;
using ll=long long;
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
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;}
int main() {
#if LOCAL&01
    std::ifstream in("./test/sample-1.in");
    //std::ifstream in("./input.txt");
    std::cin.rdbuf(in.rdbuf());
#else
    cin.tie(0);
    ios::sync_with_stdio(false);
#endif
    ll N,K; cin>>N>>K;
    vector<ll> an(N+1);
    FOR(i,1,N+1){
        cin>>an.at(i);
    }
    vector<double> expval(N+1,0);
    FOR(i,1,N+1){
        ll a=an.at(i);
        double ded = (1+a)*a/2;
        expval.at(i)=ded/(double)a;
    }
    vector<double> sums(N+1,0);
    double tmp=0.0;
    FOR(i,1,N+1){
        tmp += expval.at(i);
        sums.at(i)=tmp;
    }
    double ans=0;
    FOR(i,0,N+1-K){
        ans = max(ans, (sums.at(i+K) - sums.at(i)));
        dump(i+K,i);
    }
    cout<<fixed<<std::setprecision(10)<<ans<<endl;
    return 0;
}

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

int main()
{
	int x,n,s;
	cin>>x;
	if (x<500)
	{
		x/=5;
		cout<<x*5;
	}
	else if (x>=500)
	{
		n=x/500;
		s=x%500;
		s/=5;
		cout<<s*5+n*1000;
	}
	return 0;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int [] in = new int [a];
        int ans = 0;       
        for(int i=0;i<a;i++){
                             in[i] = sc.nextInt();
                             if(i%2==0 && in[i]%2==1){ans++;}
                            }
		
		System.out.println(ans);
	}
}


Measured memory_bytes: 36024
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

int main(){
	int n;
	std::cin >> n;
	std::vector<int> L(n);
	for(int i=0; i<n; i++){
		std::cin >> L[i];
	}
	std::sort(L.begin(), L.end());
	int sum=0;
	for(int i=0; i<n-1; i++){
		sum += L[i];
	}
	if(L[n-1] < sum){
		std::cout << "Yes" <<std::endl;
	}else{
		std::cout << "No" <<std::endl;
	}
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <map>
using namespace std;


int main()
{
    int N;
    cin >> N;
    vector<int> P(N), Q(N);
    for (int i = 0; i < N; ++i){
        cin >> P[i];
    }
    for (int i = 0; i < N; ++i){
        cin >> Q[i];
    }
    vector<int> a(N);
    for (int i = 0; i < N; ++i){
        a[i] = i + 1;
    }
    map<vector<int>, int> mp;
    do{
        mp[a] = mp.size();
    }while(next_permutation(a.begin(), a.end()));
    
    int ans = abs(mp[P] - mp[Q]);
    cout << ans << endl;
}

Measured memory_bytes: 5248
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
using namespace std;

#define space " "
typedef long long LL;

const int maxn = 1e5;
const int inf = 0x3f3f3f3f;
const double eps = 1e-5;
const double pi = acos(-1.0);

int A[maxn], C[maxn];

int main()
{
	int N;
	scanf("%d", &N);
	int res = 0;
	for (int i = 0; i < N; i++) scanf("%d", A+i);
	for (int i = 0; i < N; i++) {int t; scanf("%d", &t); res += t;}
	for (int i = 0; i < N-1; i++) scanf("%d", C+i);
	
	int la = -2;
	for (int i = 0; i < N; i++) {
		int u = A[i] - 1;
		if (u == la + 1) res += C[la];
		la = u;
	}
	printf("%d\n", res);
	return 0;
}


Measured memory_bytes: 256
N = int(input())
A = list(map(int,input().split()))
ans = 1
bind = 10**18

for i in range(N):
    if A[i] == 0:
        print(0)
        exit()

for i in range(N):
    ans*=A[i]
    if ans > bind:
        print(-1)
        exit()
print(ans)

Measured memory_bytes: 84660
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<ll, double> PD;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i = (m); i <= (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define printa(x,m,n) for(ll i = (m); i <= n; i++){cout << (x[i]) << " ";} cout<<endl;

double sx, sy, gx, gy, x, y, r, xx[1008], yy[1008], rr[1008];
ll n;

struct dijkstra{//1-origin
	vector<double> min_dst;
	vector<vector<PD>> G;
	dijkstra(int n){
		min_dst.resize(n+1);
		G.resize(n+1);
	}

	void append(int u, int v, double cost){G[u].push_back(PD(v, cost));}
	
	void run(int s){
		priority_queue<P, vector<P>, greater<P>> que;
		fill(min_dst.begin(), min_dst.end(), -1);
		min_dst[s] = 0;
		que.push(P(0, s));
		
		while(!que.empty()){
			P p = que.top(); que.pop();
			int at = p.second;
			if(min_dst[at] < p.first){continue;}
			for(int i = 0; i < G[at].size(); i++){
				int to = G[at][i].first;
				double cost = G[at][i].second;
				if(min_dst[to] == -1 || min_dst[at]+cost < min_dst[to]){
					min_dst[to] = min_dst[at]+cost;
					que.push(P(min_dst[to], to));
				}
			}
		}	
	}
	
	double get(int at){return min_dst[at];}
};

int main(){
	cin.tie(0); ios::sync_with_stdio(false);
	
	cin >> sx >> sy >> gx >>gy >> n;
	xx[0] = sx;
	yy[0] = sy;
	rr[0] = 0;
	xx[n+1] = gx;
	yy[n+1] = gy;
	rr[n+1] = 0;
	
	rep(i, 1, n){
		cin >> x >> y >> r;
		xx[i] = x;
		yy[i] = y;
		rr[i] = r;
	}
	
	dijkstra d(n+1);
	rep(i, 0, n+1){
		rep(j, 0, n+1){
			d.append(i, j, (max(sqrt((xx[i]-xx[j])*(xx[i]-xx[j])+(yy[i]-yy[j])*(yy[i]-yy[j]))-rr[i]-rr[j], 0.)));
		}
	}
	
	d.run(0);
	cout << setprecision(15) << d.get(n+1) << endl;
	
	return 0;
}

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

int main(){
  int n,ans=0; cin>>n;
  while(n!=0){
    if(n/10==0){
      ans+=n;
      n=0;
    }else{
      ans+=n%10;
      n/=10;
    }
  }if(ans==1) ans=10;
  cout<<ans<<endl;
}

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

import sys

sys.setrecursionlimit(10 ** 6)

input_line = input()
inputs = input_line.split(' ')
N, = [int(s) for s in inputs]

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

num = len(make_divisors(N-1))-1

divisors = make_divisors(N)[1:]
for d in divisors:
    t = N
    while t%d==0:
        t = t // d
    if t%d==1:
        num += 1

print(num)



Measured memory_bytes: 3316
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<map>
#include<stack>
#include<cmath>
#include<iomanip>
#include<set>
#include<numeric>
#include<sstream>
#include<random>
#include<cassert>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rrep(i, st, n) for (int i = st; i < n; ++i)
using pii = pair<int, int>;
const int inf = 1e9 + 7;
int dy[] = {0, 0, -1, 1, -1, 1, -1, 1};
int dx[] = {1, -1, 0, 0, -1, 1, 1, -1};
#define ceil(a, b) a / b + !!(a % b)

int main() {
    int n, m; cin >> n >> m;
    if (n >= m) {cout << 0 << endl; return 0;}
    int x[m]; rep(i, m) cin >> x[i];
    sort(x, x + m);
    vector<int> v;
    ll sum = 0;
    rrep(i, 1, m) {
        v.push_back(x[i] - x[i - 1]);
        sum += (ll)(x[i] - x[i - 1]);
    }
    
    //cout << sum << endl;
    sort(v.begin(), v.end(), greater<int>());
    rep(i, n - 1) {
        sum -= (ll)v[i];
    }
    cout << sum << endl;
}


Measured memory_bytes: 1276
#include <bits/stdc++.h>
#include <string.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i, m, n) for(int i = m; i < n; i++) 
typedef long long ll;
int main(){
    int N,R;
    cin>>N>>R;
    if(N>=10){
        cout<<R<<endl;
    }else{
        cout<<R+100*(10-N)<<endl;
    }
    return 0;
}

Measured memory_bytes: 256
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools
from collections import deque

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

DR = [1, -1, 0, 0]
DC = [0, 0, 1, -1]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
     
def main():
    n, d = LI()
    cur = 0
    cnt = 0
    while cur < n:
        cur += (2 * d + 1)
        cnt += 1
    print(cnt)


main()



Measured memory_bytes: 5464
#include<stdio.h>
#include<math.h>
#define Pi 3.1415

int main(){

	int i,j;
	double rad,x,y,step,deg;

	x=0;
	y=0;
	rad=0;
	step=0;
	deg=0;
	while(1){
		scanf("%lf,%lf",&step,&deg);
		if(step==0 && deg==0) break;
		
		x+=sin(rad*Pi/180.0)*step;
		y+=cos(rad*Pi/180.0)*step;
		rad+=deg;
	}
	printf("%d\n%d\n",(int)x,(int)y);

	return 0;
}

Measured memory_bytes: 632
using System;
using System.Collections.Generic;//list用
using System.Text;//StringBuilder用
using System.Collections;//ハッシュテーブル用
using System.Linq;

class Program
{
    //Hashtable ht = new Hashtable();
    static List<int> s = new List<int>();
      static List<int> a = new List<int>();
      static List<int> b = new List<int>();
      static List<int> c = new List<int>();
    static decimal result;
    static int N,K;
    //StringBuilder strresult= new StringBuilder("");//Append(str ○○)関数で文字を追加していく


    static void Main()
    {
        //Modular mo = new Modular(0);//素数で割った余りを出せで使う。()内が初期値。★使い方：Modular型で宣言すると、その時点でのその素数で割った余りを保持する変数になる（powべき乗、Fac累乗、nCr組み合わせも関数として存在）
        //Node<> no = new Node<>();//UnionFind★Find関数で根っこの値を返す（根っこの値が一緒なら同グループ）、Unite関数で二つの木をくっつける
        //Permutation<> pe = new Permutation<>();//配列＆リストを並べ替えた場合の全ケースを出力★All関数でリスト形式で返す。
        //Treap<> tr = new Treap<>();//平衡二分木★Insert()関数で挿入、FindIndex()関数で該当する大きさの物が入るべき配列番号を返す。
        //PriorityQueue<int,int> pr = new PriorityQueue<int,int>();//優先度付キュー★Add(key,value)で格納、Dequeue()で取りだし。keyが小さいものから取り出す。
Read4();
Read5();

      result=int.MaxValue-1;
        //鍵の適合パターンは最大でも2^12=4096個に過ぎない。
//鍵のパターンを２進数で表現する配列。
      int size=(int)Math.Pow(2,N);
      int[] check=new int[size];
      int before=0;
      //鍵同士を組み合わせ、新たな鍵を作る繰り返し。新で出来る鍵は旧の両者より確定で大きいので、外ループで後にhitする。内ループで全体と比較できるようにすれば漏れはないはず。
      for(int i=0;i<size;i++){for(int j=0;j<K;j++){if(c[j]==i && (check[i]>a[j] || check[i]==0)){check[i]=a[j];}}}
for(int j=0;j<size;j++){for(int k=0;k<size;k++){if(j==k){continue;}if(check[j]>0 && check[k]>0 && ((check[j | k]>check[j]+check[k]) || (check[j | k]==0)))check[j | k]=check[j]+check[k];}}
  
      result=check[size-1];
      if(result==0){result=-1;}
        Console.WriteLine(result.ToString());

    }

  
  
  
    static void Read1()//1項
    {
        string tmp = Console.ReadLine();
        N = int.Parse(tmp);
    }

    static void Read2()//複数項（項目数Ｎ）
    {
        string[] tmp = Console.ReadLine().Split(' ');
        for (int i = 0; i < N; i++) { s.Add(int.Parse(tmp[i])); }
    }
    static void Read3()//1行複数項
    {
        string[] tmp = Console.ReadLine().Split(' ');
        for (int i = 0; i < tmp.Length; i++) { s.Add(int.Parse(tmp[i])); }
    }
    static void Read4()//NK１行
    {
        string[] tmp = Console.ReadLine().Split(' ');
        N = int.Parse(tmp[0]);
        K = int.Parse(tmp[1]);
    }
    static void Read5()//N行K項
    {
      for(int i=0;i<K;i++)
      {
        string[] tmp = Console.ReadLine().Split(' ');
        a.Add(int.Parse(tmp[0]));
        b.Add(int.Parse(tmp[1]));
        c.Add(0);
        string[] tmp2 = Console.ReadLine().Split(' ');
        for(int j=0;j<b[i];j++){c[i]+=(int)Math.Pow(2,int.Parse(tmp2[j])-1);}
      }
    }
}



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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rept(i,k,n) for(ll i = (k); i < (ll)(n); i++)
#define all(v) v.begin(), v.end()
#define Sort(v) sort(v.begin(),v.end())
#define Reverse(v) reverse(v.begin(),v.end())
typedef long long ll;
typedef pair<int,int> Pii;
typedef pair<long long,long long> Pll;

template <typename T>
ostream& operator<<(ostream& s, const vector<T> &vec){
    for(int i=0;i<vec.size();i++){
        if(i) s << ',';
        else s << '{';
        s <<setw(2)<< vec[i];
    }
    s << '}' << endl;
    return s;
}


int main(){
    int n,k;
    cin>>n>>k;
    vector<bool> ma(n,true);
    rep(i,k) {
        int d;
        cin>>d;
        rep(j,d){
            int a;
            cin>>a;
            ma[a-1]=false;
        }
    }
    int ans=0;
    rep(i,n){
        if(ma[i]) ans++; 
    }
    cout<<ans<<endl;

    return 0;
}

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

#define fr                first
#define se                second
#define int               long long
#define pb                push_back
#define mp                make_pair
#define pii               pair<int,int>
#define vi                vector<int>
#define mi                map<int,int>
#define pqb               priority_queue<int>
#define set_bits(x)       __builtin_popcountll(x)
#define mod               1000000007
#define inf               1e18                        //Defining infinity the overflow of int
#define ps(x,y)           fixed<<setprecision(y)<<x   //fir defining the precision int the decimal upto y places. 
#define zrosetbits(x)     __builtin_ctzll(x)         //it will give no of 0's before the first 1 from the right.
#define mk(a,n,type)     type *a=new type[n];
#define test(t)            int t; cin>>t; while(t--)


void io()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cin.tie(0);


}

int32_t main()
{
	io();
	clock_t begin = clock();

	// test(t)
	// {

	int n;
	cin >> n ;

	int ct1 = 0;
	int ct2 = 0;
	int ct3 = 0;
	int ct4 = 0;

	for (int i = 0; i < n; i++)
	{
		string s;
		cin >> s;

		if (s == "AC")
			ct1++;
		if (s == "WA")
			ct2++;
		if (s == "TLE")
			ct3++;
		if (s == "RE")
			ct4++;


	}
	cout << "AC x " << ct1 << "\n";
	cout << "WA x " << ct2 << "\n";
	cout << "TLE x " << ct3 << "\n";
	cout << "RE x " << ct4 << "\n";


	// double c_time = (double) (clock() - begin) / CLOCKS_PER_SEC;
	// cout << ps(c_time, 4) << " seconds\n";

	// }
	return 0;
}



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

#define mem(arr, i) fill(arr, arr + sizeof(arr), i)
#define MEM(arr, i) memset(arr, i, sizeof(arr))
#define Push push_back
#define Pair make_pair
#define ALL(x) x.begin(), x.end()
#define X first
#define Y second
#define ACCEL ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
typedef unsigned long long ull;
typedef long long lli;
typedef pair<int,int> pii;
typedef pair<lli,lli> pll;
typedef pair<pll,lli> p3l;
typedef vector<int> vcI;
typedef vector<lli> vcL;
typedef vector<pii> vPI;
typedef vector<pll> vPL;
typedef vector<p3l> v3L;
typedef vector<vcL> vvL;
//typedef priority_queue<T> prior_S<T>;
//typedef priority_queue< T, vector<T>, greater<T> > prior_B<T>;
const double PI = 3.141592653589793;
const lli I_MAX = 1LL << 60;
      lli   mod = 1000000007;

/// templates ///

const lli maxN = 2E5;

vcL inv(maxN+5, 1);
vcL fac(maxN+5, 1);

void ADD(lli &x, lli y) {
	x += y;
	if (x >= mod) x -= mod;
	if (x < 0) x += mod;
}

void MUL(lli &x, lli y) {
	x *= y;
	x = (x % mod + mod) % mod;
}

lli mypow(lli b, lli e) {
	lli ans = 1;
	while (e) {
		if (e & 1) MUL(ans, b);
		MUL(b, b);
		e >>= 1;
	}
	return ans;
}

lli modinv(lli n) {
	return mypow(n, mod - 2);
}

void calcInv(lli n) {
	for (int i = 2; i <= n; ++i) {
		inv[i] = (mod - mod / i) * inv[mod % i] % mod;
	}
}

void calcFac(lli n) {
	for (int i = 2; i <= n; ++i) {
		fac[i] = fac[i - 1] * i % mod;
	}
}

lli cm(lli a, lli b) {
	lli ans = 1;
	if (a < b) return 0;

	MUL(ans, inv[fac[a - b]]);
	MUL(ans, inv[fac[b]]);
	MUL(ans, fac[a]);

	return ans;
}

lli Lucas(lli n, lli m) {
	if (m == 0) return 1;
	return cm(n % mod, m % mod) * Lucas(n / mod, m / mod) % mod;
}

lli doLucas(lli n, lli m) {
	calcInv(mod);
	calcFac(mod);
	return Lucas(n, m);
}

/// coding area ///

const lli maxn = 1E5;

void precal() {

	return;
}

void solve() {
	lli r;
	cin >> r;
	cout << 3 * r * r << '\n';
}

int main() {
	precal();
	int t = 1;
	#ifdef LOCAL
		t = INT_MAX;
	#else
		ACCEL;
	#endif
//	cin >> t;
	for (int i = 1; i <= t; ++i) {
//		printf("Case #%d: ", i );
		solve();
	}
	return 0;
}



Measured memory_bytes: 3328
import java.util.Scanner;
 
public class Main {
    
    public static void main(String[] args) throws Exception{    
        Scanner sc = new Scanner(System.in);
        
        String s = sc.next();
        
        int len = s.length();
        int n = 0;
        int c;
        
        String ans;
        
        boolean[] e = new boolean[26];
        
        for(int i=0; i<len; i++){
        	if(e[(int)(s.charAt(i)) - 97] == false) n++;
        	e[(int)(s.charAt(i)) - 97] = true;
        }
        
        if(n == 2){
        	c = 0;
        } else {
        	c = len - 2;
        	if(s.charAt(0) == s.charAt(len-1)) c--;
        }
        
        if(c%2 == 0){
        	ans = "Second";
        } else {
        	ans = "First";
        }
        
        System.out.println(ans);
        
        
        sc.close();
    }
}

Measured memory_bytes: 13868
#include<bits/stdc++.h>
using namespace std;
#define fastIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long int
#define fi first
#define se second
#define pb push_back
#define all(v) (v).begin(), (v).end()
#define rep(i, l, r) for(int i=(int)(l);i<(int)(r);i++)
#define repd(i, l, r) for (int i=(int)(l);i>=(int)(r);i--)

ll mod=998244353;


int32_t main() 
{
    
	fastIO;
	ll n,a,b,q,c,y,x,i,j,k,arr[105];
	// cin>>t;
	// while(t--)
	// {
		double t,d,s;
		cin>>d>>t>>s;
		double time=d/s;
		if(time<=t)
		{
			cout<<"Yes\n";
		}
		else
		{
			cout<<"No\n";
		}
		
	//}
	return 0;
}

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

using namespace std;

#define DUMP(x) std::cerr << (#x) << " = " << (x) << "\n"
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define REP(i, k, n) for (int i = (k); i < (int)(n); ++i)
#define ALL(r) r.begin(), r.end()
#define YES puts("YES")
#define Yes puts("Yes")
#define NO puts("NO")
#define No puts("No")
#define IMP puts("IMPOSSIBLE")
#define Imp puts("Impossible")
#define imp puts("impossible")
#define M1 puts("-1")
#define pb push_back

template <typename T>
ostream &operator<<(ostream &os, vector<T> &v)
{
    os << "{";
    rep(i, v.size()) os << v[i] << (i == (int)v.size() - 1 ? "" : ", ");
    os << "}";
    return os;
}
template <typename T>
T dup(T x, T y)
{
    return (x + y - 1) / y;
};
template <typename A, size_t N, typename T>
inline void arrayFill(A (&array)[N], const T &val) { std::fill((T *)array, (T *)(array + N), val); }
struct in
{
    const size_t n = 0;
    in() = default;
    in(size_t n) : n(n){};
    template <typename T>
    operator T()
    {
        T ret;
        cin >> ret;
        return ret;
    }
    template <typename T>
    operator vector<T>()
    {
        assert(n != 0);
        vector<T> ret(n);
        for (auto &x : ret)
            cin >> x;
        return ret;
    }
};

using ll = int64_t;
using vint = vector<int32_t>;
using vvint = vector<vint>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pint = pair<int32_t, int32_t>;
using pll = pair<ll, ll>;
using setint = set<int32_t>;
using setstr = set<string>;
using qint = queue<int32_t>;
using qpint = queue<pint>;

constexpr std::int32_t INF = 1001001001;
constexpr std::int64_t LINF = 1001001001001001001;

void Main()
{
    ll n = in();
    vvll a(n, vll(n));
    rep(i, n) rep(j, n) cin >> a[i][j];

    vvll next(n, vll(n));
    rep(i, n) rep(j, n) next[i][j] = j;

    vector<setint> erased(n);

    ll sub = 0;
    rep(k, n) rep(i, n) rep(j, n)
    {
        if (a[i][j] > a[i][k] + a[k][j])
        {
            M1;
            return;
        }
        else if (a[i][j] == a[i][k] + a[k][j])
        {
            if (i == k || j == k)
                continue;
            // erase edge
            if (erased[i].count(j) == 1)
            {
                continue;
            }
            sub += a[i][j];
            erased[i].insert(j);
            /*
            DUMP(i + 1);
            DUMP(j + 1);
            DUMP(k + 1);
            DUMP(sub);
            */
        }
    }

    ll sum = 0;
    rep(i, n) REP(j, i + 1, n) sum += a[i][j];
    cout << sum - sub / 2 << endl;
}

int main()
{
    std::cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}


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

int main() {
  string a, b;
  cin >> a >> b;
  
  if (a == "H") {
    cout << b <<  endl;
  } else {
    if (b == "D")
      cout << "H" << endl;
    else
      cout << "D" << endl;
  }
  
  return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
class Program
 {
        static void Main(string[] args)
        {
        　　int n, k;
            string[] NK = Console.ReadLine().Split(' ');//2つ以上のスペース区切り入力の取得
            n = int.Parse(NK[0]); //標準入力
            k = int.Parse(NK[1]); //標準入力
            string[] str = Console.ReadLine().Split(' ');//2つ以上のスペース区切り入力の取得
            int[] a = str.Select(x => int.Parse(x)).ToArray();

            int sum = a.Sum();
            var list = new List<int>();
            for(int i=1;i*i<=sum;++i)
            {
                if (sum % i == 0)
                {
                    list.Add(i);
                    list.Add(sum / i);
                }
            }
            var ans = 1;
            foreach(var i in list)
            {
                int need = 0;
                need = CalcX(i, a, k);
                if( need <= k) { ans = Math.Max(ans, i); }
            }

            Console.WriteLine(ans);
        }

        /// <summary>
        ///
        /// </summary>
        /// <param name="x">約数x</param>
        /// <returns></returns>
        private static int CalcX(int x, int[] a, int k)
        {
            var b = new List<int>(a);
            for(int i=0;i<b.Count;++i)
            {
                b[i] %= x;
            }
            b.Sort();

            int tot = b.Sum();
            int l = b.Count - tot / x;
            int need = 0;
            for(int i=0;i<l;++i)
            {
                need += b[i];
            }
            return need;
        }
 }

Measured memory_bytes: 15408
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define hell1 1e9+7
#define hell2 1e9+9
#define pi 3.1415926535
#define ms(s, n) memset(s, n, sizeof(s))
#define prec(n) fixed<<setprecision(n)
#define eps 0.000001
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#define ll long long
#define ld long double 
#define no_of_digits(n) floor(log10(n)) + 1
#define see(x) cout << (#x) << " is " << (x) << endl
#define INF 1e9

using namespace std;

ll mult(ll a,ll b, ll p=hell1){   return ((a%p)*(b%p))%p; }
ll multbig(ll a,ll b,ll mod=hell1){   if(a==0 or b==0) return 0;if(a==1 or b==1) return (a*b)%mod;ll cur=multbig(a,b/2,mod);cur=(2*cur)%mod;if(b%2) cur=(cur+a)%mod;return cur;
}
ll add(ll a, ll b, ll p=hell1){ if(a>=p) a%=p; if(b>=p) b%=p; if(a+b>p) return (a + b)%p; else return a+b;}
ll sub(ll a, ll b, ll p=hell1){return (a%p - b%p + p)%p;}
ll fpow(ll n, ll k, ll p = hell1) {ll r = 1; for (; k; k >>= 1) {if (k & 1) r = mult(r,n,p); n = mult(n,n,p);} return r;}
ll inv(ll a, ll p = hell1) {return fpow(a, p - 2, p);}
ll inv_euclid(ll a, ll m = hell1){ll m0 = m;ll y = 0, x = 1;if (m == 1)return 0;while (a > 1){ll q = a / m;ll t = m;m = a % m, a = t;t = y;y = x - q * y;x = t;}if (x < 0)x += m0;return x;}
int isPowerof2(ll x) { return (x && !(x & x-1)); } 
ll log2(ll x) { ll res = 0; while (x >>= 1) res++; return res; } 

// max({a, b, c, d})

vector<ll>adj[200005];
ll update[200005];
ll ans[200005];

int binaryToDecimal(string n) 
{ 
    string num = n; 
    int dec_value = 0; 
  
    // Initializing base value to 1, i.e 2^0 
    int base = 1; 
  
    int len = num.length(); 
    for (int i = len - 1; i >= 0; i--) { 
        if (num[i] == '1') 
            dec_value += base; 
        base = base * 2; 
    } 
  
    return dec_value; 
} 

bool isPerfectSquare(long double x) 
{   
  // Find floating point value of  
  // square root of x. 
  long double sr = sqrt(x); 
  
  // If square root is an integer 
  return ((sr - floor(sr)) == 0); 
} 

int main()
{
    ll n, x;
    cin >> n >> x;

    ll l[n];

    for(int i=0;i<n;i++)
        cin >> l[i];

    ll cnt = 1, j = 0;

    for(int i=1;i<=n;i++)
    {
        if(j+l[i-1] > x) break;
        else
        {
            cnt++;
             j+= l[i-1];
        }
    }

    cout << cnt << "\n";

}




Measured memory_bytes: 6016
k, x = [int(v) for v in input().split()]

min_b = max(-1000000, x - (k - 1) )
max_b = min(1000000, x + (k - 1) )
ans = []
for i in range(min_b, max_b + 1):
  ans.append(str(i))
print(" ".join(ans))

Measured memory_bytes: 3060
N = int(input())
H = []
for i in range(N):
    H.append(list(map(int, input().split())))

dp = [[0]*3 for _ in range(N)]
dp[0] = H[0]
for i in range(1,N):
    for j in range(3):
        dp[i][j] = H[i][j] + max(dp[i-1][k] for k in range(3) if k != j)
print(max(dp[N-1]))

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


int main() {//孤立してる黒がなければ塗れるはず
    int h,w;
    cin >> h >> w;
    vector< vector<char>> s(h+2,vector<char>(w+2,'-'));
    rep(i,h)rep(j,w)cin >> s[i][j];
    rep(i,h)rep(j,w){
        if(i!= 0 && j != 0 && s[i][j] == '#'){
            if(s[i][j+1] != '#' && s[i][j-1] != '#' && s[i+1][j] != '#' && s[i-1][j] != '#'){
                cout << "No" << endl;
                return 0;
            }
        }
    }
    cout << "Yes" << endl;
    return 0;
}

/*
やっほい！
　　　　　　　やほほい！
　　　　+　　 　*
　　　 ∧∧　　. ∧∞∧　*
*　ヽ(=´ω｀)人(´ω｀*)ﾉ
　.～（ O x.） （ 　 O)～　+
。*　 　∪　　　　∪
*/

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

int main(){
	string s;
	int k;
	cin >> k >> s;

	if(k < s.size()){
		rep(i, k){
			cout << s.at(i);
		}
		cout << "...";
	}else {
		rep(i, s.size()) cout << s.at(i);
	}
	cout << endl;
}


Measured memory_bytes: 3604
import java.util.Scanner;

// *** at 2018/**/**

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solveA();
    }

    private void solveA() {
        Scanner sc = new Scanner(System.in);
        char[] a = sc.nextLine().toCharArray();
        int res = 700;
        char o = 'o';
        for (char c : a) {
			if (o == c) res += 100;
		}

        System.out.println(res);
    }

    private void solveB() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        System.out.println(N);
    }

    private void solveC() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        System.out.println(N);
    }

    private void solveD() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        System.out.println(N);
    }

    private void solveE() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        System.out.println(N);
    }

    private void solveF() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        System.out.println(N);
    }

}

Measured memory_bytes: 23124
#include<stdio.h>
#include<string>
#include<stdlib.h>
#include<math.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<numeric>
#include<string.h>

using namespace std;

typedef pair<int,int> pii;

#define rep(i,j) for(int i=0;i<(j);i++)
#define reps(i,j,k) for(int i=j;i<=k;i++)


int main(){
	int n,l[3],m=100000001,f;
	scanf("%d\n",&n);
	rep(i,n){
		scanf("%d",l+i);
		m=min(m,l[i]);
	}
	for(int i=1;i<m;i++){
		f=1;
		rep(j,n)if(l[j]%i!=0)f=0;
		if(f)printf("%d\n",i);
	}
	return 0;
}

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

int main(){
    long long N;
    cin>>N;
    long int r=(N-1)/26;
    long int b=(N-1)%26;
    string S;
    S = (char)('a'+b);
    while(r>0){
        b = (r-1)%26;
        r = (r-1)/26;
        S = (char)('a'+b)+S;
    }
    cout<<S<<endl;
    return 0;
}

Measured memory_bytes: 3612
#include<iostream>
#include<algorithm>
#include<string>
#include<cmath>
#include<vector>
#include<functional>
#include<stack>

using namespace std;

int main() {
	int m, f, r;
	while (cin >> m >> f >> r) {
		if (m < 0 && f < 0 && r < 0)break;
		if (m < 0 || f < 0)cout << "F" << endl;
		else {
			if (m + f >= 80)cout << "A" << endl;
			else if (m + f >= 65)cout << "B" << endl;
			else if (m + f >= 50 || r >= 50)cout << "C" << endl;
			else if (m + f >= 30)cout << "D" << endl;
			else cout << "F" << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <climits>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <bitset>
#include <utility>
#include <numeric>
#include <queue>
#include <stack>

using ll = long long;
using namespace std;

constexpr int MOD = 1e9 + 7;
constexpr ll MOD_LL = ll(1e9) + 7;

int main(void) {	
	
	string s;
	stack<int> sc;
	int a, b;
	
	while( cin >> s ) {
		if( s == "+" ) {
			a = sc.top();
			sc.pop();
			b = sc.top();
			sc.pop();
			sc.push(a + b);
		} else if( s == "-" ) {
			b = sc.top();
			sc.pop();
			a = sc.top();
			sc.pop();
			sc.push(a - b);
		} else if( s == "*" ) {
			a = sc.top();
			sc.pop();
			b = sc.top();
			sc.pop();
			sc.push(a * b);
		} else {
			sc.push( stoi(s) );
		}
	}
	
	cout << sc.top() << endl;
	sc.pop();
	
	return 0;
}



Measured memory_bytes: 3192
#include<bits/stdc++.h>
#define rep(i,a) for(int i=(int)0;i<(int)a;++i)
#define rrep(i,a) for(int i=(int)a-1;i>=0;--i)
#define REP(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define RREP(i,a,b) for(int i=(int)a-1;i>=b;--i)
#define pb push_back
#define eb emplace_back
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
typedef std::vector<int> vi;
typedef std::vector<std::vector<int>> vvi;
typedef std::vector<long long> vl;
typedef std::vector<std::vector<long long>> vvl;
using ll=long long;
constexpr ll mod = 1e9 + 7;
constexpr ll INF = 1LL << 60;
 
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}


ll gcd(ll n, ll m) {
    ll tmp;
    while (m!=0) {
        tmp = n % m;
        n = m;
        m = tmp;
    }
    return n;
}
 
ll lcm(ll n, ll m) {
    return abs(n) / gcd(n, m)*abs(m);//gl=xy
}

using namespace std;

void solve()
{
  int n;
  cin>>n;
  vector<ll> a(n);
  rep(i, n) cin >> a[i];
  ll ans = 0;
  while(1){
    vector<ll> cnt(n);
    ll sum = 0;
    rep(i, n)
    {
      ans += a[i] / n;
      cnt[i] = a[i] / n;
      sum += cnt[i];
      a[i] = a[i] % n;
    }
    rep(i,n){
      a[i] += sum - cnt[i];
    }
    ll maxv = 0;
    rep(i, n)
    {
      chmax(maxv, a[i]);
    }
    if(maxv<n)
      break;
  }
  cout << ans << "\n";
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(15);
    solve();
    return 0;
}



Measured memory_bytes: 256