akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <map>
#include <vector>
#include <algorithm>
#include <string>
using namespace std;
int main(void){
    int a[3],b[3],c[4] = {};
    for(int i = 0;i < 3;i++){
        cin >> a[i] >> b[i];
        c[a[i]-1]++;
        c[b[i]-1]++;
    }
    if(c[0] == 1 && c[1] == 1 && c[2] == 2 && c[3] == 2){
        cout << "YES" << endl; 
        return 0;
    }
    if(c[0] == 1 && c[1] == 2 && c[2] == 1 && c[3] == 2){
        cout << "YES" << endl;
        return 0;
    }
    if(c[0] == 1 && c[1] == 2 && c[2] == 2 && c[3] == 1){
        cout << "YES" << endl;
        return 0;
    }
    if(c[0] == 2 && c[1] == 1 && c[2] == 1 && c[3] == 2){
        cout << "YES" << endl;
        return 0;
    }
    if(c[0] == 2 && c[1] == 1 && c[2] == 2 && c[3] == 1){
        cout << "YES" << endl;
        return 0;
    }
    if(c[0] == 2 && c[1] == 2 && c[2] == 1 && c[3] == 1){
        cout << "YES" << endl;
        return 0;
    }
    cout << "NO" << endl;
    return 0;
}


Measured memory_bytes: 256
def calc(i, k):
    for _ in range(k):
        i = A[i]
    return i

N, K = map(int, input().split())
M = 3 * 10 ** 5
A = [int(a) - 1 for a in input().split()]

if K < 10 ** 6:
    print(calc(0, K) + 1)
    exit()
i = calc(0, M)
j = A[i]
c = 1
while j != i:
    j = A[j]
    c += 1
r = c
while (K - c - M) % r:
    j = A[j]
    c += 1
print(j + 1)

Measured memory_bytes: 32332
#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <iomanip>
#include <stack>
#include <fstream>
#include <cstdint>
#include <cmath>
#include <algorithm>
#include <utility>
#include <numeric>
#include <functional>
using namespace std;
typedef int64_t ll;
typedef uint64_t ull;
constexpr uint64_t L1 = 1ull;
constexpr ull bit(int n){ return 1ull << n;}

// for(auto && i : Range(l,r))
// -> i = [l..r)
class Range {
private: struct It{ int x; int operator*(){return x;}
 bool operator!=(It& lhs){ return x<lhs.x;} void operator++(){++x;} }; It l,r;
public: Range(int n):l({0}),r({n}){} Range(int i,int n):l({i}),r({n})
 {}It& begin(){return l;} It& end(){return r;} };

void solve(istream& cin) {
    int a, b;
    cin >> a >> b;
    cout << (a + b ) % 24 << endl;
}


int main(int argc, char *argv[]) {
    string FileName("A2"), Modifier("MEPH_");
    string ExecutionName = Modifier + FileName;
    string sub(argv[0]);
    if(sub.size() > ExecutionName.size())
        sub = sub.substr(sub.size()-ExecutionName.size(), ExecutionName.size());
    cerr << sub << endl;
    if (sub != ExecutionName) {
        cin.tie(0);
        ios::sync_with_stdio(false);
        solve(cin);
    }
    else {
        string inFile = "sample.txt";
        auto fs = fstream(inFile, fstream::in);
        solve(fs);
    }
}

Measured memory_bytes: 256
import math
from decimal import Decimal
a,b,h,m = map(int,input().split())
kakudo = abs((30*h+(m*(0.5)))-m*6)
k = min(kakudo,360-kakudo)
#print(k)
#print(math.radians(k))
co = math.cos(math.radians(k))
nijo = a**2 + b**2 - 2*a*b*co
#print(Decimal(nijo).sqrt())
#print(math.sqrt(nijo))
print(Decimal(a**2 + b**2 - 2*a*b*math.cos(math.radians(k))).sqrt())

Measured memory_bytes: 10280
#include <bits/stdc++.h>
using namespace std;
#define rep(i, a) for (int i = 0; i < (a); i++)
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
typedef long long ll;
template<typename T>istream& operator>>(istream&i,vector<T>&v){rep(j,sz(v))i>>v[j];return i;}
template<typename T>string join(const vector<T>&v){stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template<typename T>ostream& operator<<(ostream&o,const vector<T>&v){if(sz(v))o<<join(v);return o;}
template<typename T1,typename T2>istream& operator>>(istream&i,pair<T1,T2>&v){return i>>v.first>>v.second;}
template<typename T1,typename T2>ostream& operator<<(ostream&o,const pair<T1,T2>&v){return o<<v.first<<","<<v.second;}
template<typename T>bool mins(T& x,const T&y){if(x>y){x=y;return true;}else return false;}
template<typename T>bool maxs(T& x,const T&y){if(x<y){x=y;return true;}else return false;}
template<typename T>ll suma(const vector<T>&a){ll res(0);for(auto&&x:a)res+=x;return res;}

#ifdef _DEBUG
inline void dump() { cerr << endl; }
template<typename Head> void dump(Head&& head) { cerr << head; dump(); }
template<typename Head, typename... Tail> void dump(Head&& head, Tail&&... tail) { cerr << head << ", "; dump(forward<Tail>(tail)...); }
#define debug(...) do {cerr << __LINE__ << ":	" << #__VA_ARGS__ << " = "; dump(__VA_ARGS__); } while (false)
#else
#define dump(...)
#define debug(...)
#endif

template <typename T> struct edge {
  int src, to;
  T cost;
  edge(int to, T cost) : src(-1), to(to), cost(cost) {}
  edge(int src, int to, T cost) : src(src), to(to), cost(cost) {}
  edge &operator=(const int &x) {
    to = x;
    return *this;
  }
  operator int() const { return to; }
};
template <typename T> using Edges = vector<edge<T>>;
template <typename T> using WeightedGraph = vector<Edges<T>>;
using UnWeightedGraph = vector<vector<int>>;
template <typename T> using Matrix = vector<vector<T>>;

const ll LINF = 1LL << 60;
const int INF = 1001001001;

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

int main() {
  ll n; cin>>n;
  n--;
  vector<ll> c(n);
  vector<ll> s(n);
  vector<ll> f(n);
  rep(i, n) cin>>c[i]>>s[i]>>f[i];

  vector<ll> ans;
  rep(i, n) {
    ll tmp = 0;
    for (int j=i; j<n; j++) {
      maxs(tmp, s[j]);
      tmp += (f[j]-(tmp%f[j]))%f[j] + c[j];
    }
    ans.push_back(tmp);
  }
  ans.push_back(0);
  for (auto v:ans) cout << v << endl;

  return 0;
}


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

typedef long long   ll;
typedef long double ld;
using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n;
    cin >> n;
    int a[n];
    for(int i = 0; i < n; i++) {
        cin >> a[i];
    }
    map<int,int> apmp;
    for(int i = 0; i < n; i++) {
        int tmp=a[i];
        apmp[tmp]++;
    }

    int count=0;
    for(auto itr = apmp.begin(); itr !=apmp.end(); itr++) {
        if(itr->first > itr->second)      count+=itr->second;
        else if(itr->first < itr->second) count+=(itr->second - itr->first);
        else continue;
    }
    cout << count << "\n";
    return 0;
}

Measured memory_bytes: 5120
#include <bits/stdc++.h>
#include <queue>
using namespace std;
priority_queue<int,vector<int>,greater<int> > a;
struct mv{
	int b,c;
}v[100005];
int cmp(mv k,mv kk){
	return k.c>kk.c;
}
int main(){
	int n,m;
	cin>>n>>m;
	int kkk;
	for(int i=0;i<n;i++){
		scanf("%d",&kkk);
		a.push(kkk);
	}
	for(int i=0;i<m;i++){
		scanf("%d%d",&v[i].b,&v[i].c);
	}
	sort(v,v+m,cmp);
	for(int i=0;i<m;i++){
		for(int j=0;j<v[i].b;j++){
			if(v[i].c>a.top()){
				a.pop();
				a.push(v[i].c);	
			}else{
				break;
			}
		}
	}
		long long ans=0;
	for(int i=0;i<n;i++){
		ans+=a.top();
		if(!a.empty()){
			a.pop();
		}else{
			break;
		}
	}
	cout<<ans;
	return 0;
}

Measured memory_bytes: 1528
/*

                   _ooOoo_
                  o8888888o
                  88" . "88
                  (| -_- |)
                  O\  =  /O
               ____/`---'\____
             .'  \\|     |//  `.
            /  \\|||  :  |||//  \
           /  _||||| -:- |||||-  \
           |   | \\\  -  /// |   |
           | \_|  ''\---/''  |   |
           \  .-\__  `-`  ___/-. /
         ___`. .'  /--.--\  `. . __
      ."" '<  `.___\_<|>_/___.'  >'"".
     | | :  `- \`.;`\ _ /`;.`/ - ` : | |
     \  \ `-.   \_ __\ /__ _/   .-` /  /
======`-.____`-.___\_____/___.-`____.-'======
                   `=---='
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                    prayer
*/

// g++ -std=c++11 a.cpp
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<unordered_map>
#include<utility>
#include<cmath>
#include<random>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define FOR(i,a) for(auto i:a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define show1d(v) rep(_,v.size())cout<<" "<<v[_];cout<<endl;
#define show2d(v) rep(__,v.size()){rep(_,v[__].size())cout<<" "<<v[__][_];cout<<endl;}
using namespace std;
//kaewasuretyuui
typedef long long ll;
// #define int ll
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
// #define mt make_tuple
// typedef tuple<int,int,int> tp;
// typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
//template<class C>constexpr int size(const C &c){return (int)c.size();}
//template<class T,size_t N> constexpr int size(const T (&xs)[N])noexcept{return (int)N;}
const double PI=acos(-1);
const double EPS=1e-9;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9+10;
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};


signed main(){
	int n,m,sum=0;
	cin>>n>>m;
	int cost[20][20]={0};
	rep(i,m){
		int a,b,c;
		cin>>a>>b>>c;
		a--;b--;
		cost[a][b]=cost[b][a]=c;
		sum+=c;
	}
	vvi memo(1<<n,vi(n));
	rep(i,1<<n){
		int s=0;
		rep(j,n)rep(k,n)if((i&1<<j)&&(i&1<<k)&&j<k)s+=cost[j][k];
		rep(j,n)memo[i][j]=s;
	}
	vvi dp(1<<n,vi(n,-inf));
	dp[1][0]=0;
	rep(i,1<<n)rep(j,n)if(i&1<<j){
		rep(k,n)if(cost[j][k]&&(i&1<<k)==0)cmax(dp[i|1<<k][k],dp[i][j]+cost[j][k]);
		int t=(1<<n)-i-1;
		for(int k=t;k>0;k=(k-1)&t)
			cmax(dp[i|k][j],dp[i][j]+memo[k|1<<j][j]);
	}
	cout<<sum-dp[(1<<n)-1][n-1]<<endl;
}















Measured memory_bytes: 6912
# -*- coding: utf-8 -*-
from collections import Counter
import numpy as np
import sys

def IMPOSSIBLE():
    print(-1)
    sys.exit()
    

k = int(input())
a = list(map(int,input().split()))[::-1]
min_num = 2
max_num = 3

if(a[0]!=2):IMPOSSIBLE()

for i in range(len(a)-1):
    if(a[i+1] > max_num):IMPOSSIBLE()
    else:
        min_num = a[i+1]*(min_num//a[i+1] if min_num%a[i+1]==0 else min_num//a[i+1]+1)
        max_num = a[i+1]*((max_num//a[i+1])+1)-1
        

tmpmin = min_num
tmpmax = max_num
for i in range(len(a)):
    tmpmin -= tmpmin%a[len(a)-i-1]
    tmpmax -= tmpmax%a[len(a)-i-1]
if(tmpmin != 2 or tmpmax != 2):IMPOSSIBLE()
    
print(str(min_num)+' '+str(max_num))

Measured memory_bytes: 23368
#include <bits/stdc++.h>
#define rep(i, n) for (int i=0; i<(n); ++i)
#define repr(i, a, b) for (int i=a; i<(b); ++i)
#define reprev(i, n) for (int i=n-1; i>=0; --i)
#define reprrev(i, a, b) for (int i=b-1; i>=(a); --i)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main() {
    cout << fixed << setprecision(10);
    
    int N, M; cin >> N >> M;
    vector<int> cnt(N);
    rep(i, M) {
        int a, b; cin >> a >> b;
        a--; b--;
        cnt[a] += 1;
        cnt[b] += 1;
    }
    rep(i, N) {
        if (cnt[i] % 2 == 1) {
            cout << "NO" << endl;
            return 0;
        }
    }
    cout << "YES" << endl;
    return 0;
}

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

int main() {
  int N;
  string s;
  cin >> N;
  
  for (int i = 0; i < N; i++) {
    cin >> s;
    if (s == "Y") {
      cout << "Four" << endl;
      break;
    }
    if (i == N-1) {
      cout << "Three" << endl;
    }
  }
}


Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <math.h>
#include <numeric>
#include <iomanip>
#include <map>

using namespace std;



int main(){

    int n;
    cin >> n;

    vector<int> x(n);

    for(int i=0; i<n; i++){
        cin >> x.at(i);
    }

    int avr1 = int(accumulate(x.begin(), x.end(), 0) / n);
    int avr2 = avr1 + 1;

    int ans1 = 0;
    int ans2 = 0;
    for(int i=0; i<n; i++){
        ans1 += int(pow((avr1 - x.at(i)), 2));
    }
    for(int i=0; i<n; i++){
        ans2 += int(pow((avr2 - x.at(i)), 2));
    }

    if (ans1 <= ans2){
        cout << ans1 << endl;
    } else {
        cout << ans2 << endl;
    }


    return 0;
}

Measured memory_bytes: 256
#include <iostream>
    #include <math.h>
    #include <vector>
    #include <string>
    using namespace std;
    int main() {
        int a,b,c;
        char s,t ;
        //vector<long long int> v(n);
        cin >> a >> s >> b >> t >> c ;
        //cout<< a <<s<<b<<t <<c<<endl;
        if(a<2019) cout<<"Heisei"<<endl;
        else{
          if(b>4) cout<<"TBD"<<endl;
          else cout<<"Heisei"<<endl;
         }
        return 0 ;
    }

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

using namespace std;

#define int         long long
#define pb          push_back
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define hell        1000000007
#define rep(i,a,b)  for(int i=a;i<b;i++)

vector< vector<int> > dp(405, vector<int>(405, -1) ); // dp[i][j] = minimum cost to combine slimes from positon i to j
vector<int> A(405, 0);

int findMinCost(int start, int end)
{
	if(dp[start][end] != -1)
		return dp[start][end];
	if(start == end)
		return (dp[start][end] = 0);
	if(end - start == 1)
			return (dp[start][end] = A[end] - A[start-1]);
	int ans = 1e16;
	for(int mid = start; mid < end; mid++)
		ans = min(ans, findMinCost(start,mid) + findMinCost(mid+1, end) + A[end] - A[start-1]);
	dp[start][end] = ans;
	return dp[start][end];
}

void solve()
{
	int n, i, x, sum = 0;
	cin>>n;
	for(i = 1; i <= n; i++)
	{
		cin>>x;
		sum += x;
		A[i] = sum;
	}
	cout<<findMinCost(1, n)<<endl;
}


signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int tc;
	tc = 1;
    // cin>>tc;
    while(tc--)
        solve();

    return 0;
}

Measured memory_bytes: 1536
#include<stdio.h>
int main()
{
    long long n,i,sum=0;
    scanf("%lld",&n);
    for(i=1; i<=n; i++)
    {
        if(i%3!=0&&i%5!=0)
        {
            sum=sum+i;
        }
    }
    printf("%lld",sum);
    return 0;
}

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

void solve()
{
    string ans="",s="abcdefghijklmnopqrstuvwxyz";
    ll n;cin>>n;
    
    while(n>0)
    {
        //=26;
        n--;
        ans+=s[n%26];
        n/=26;
        //s+=s[n%26];
    }
    for(int i=ans.size()-1;i>=0;i--)
    cout<<ans[i];
    cout<<"\n";
}

int main(void){
    int t;//cin>>t;
    t=1;
    while(t--)
    solve();
}


Measured memory_bytes: 3608
#include<iostream>
using namespace std;
int main(){
  int n;
  cin >> n;
  int money = 100000;
  for(int i=0;i<n;i++){
    money += (int)(money * 0.05);
    int cp = money;
    while(cp - 1000 >= 0){
      cp -= 1000;
    }
    money -= cp;
    if(cp != 0){
      money+=1000;
    }
  }
  cout << money << endl;;
}

Measured memory_bytes: 1160
import itertools

n = int(input())
route = [x for x in range(n)]
t = [list(map(int,input().split())) for _ in range(n)]
route_list =  list(itertools.permutations(route,n))
l = len(route_list)
ans = 0

for i in range(l):
    for k in range(n - 1):
        now = route_list[i][k]
        nex = route_list[i][k + 1]
        ans += ((t[now][0] - t[nex][0]) ** 2 + (t[now][1] - t[nex][1]) ** 2) ** 0.5

print(ans / l)

Measured memory_bytes: 8180
#include <bits/stdc++.h>
#define FOR(i, a, b) for (ll i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ll long long
using namespace std;

int main() {
  string s;
  cin >> s;
  ll aDup = 0, ans = 0;
  REP(i, s.size()) {
    if (s[i] == 'A') aDup > 0 && s[i - 1] == 'B' ? aDup = 1 : aDup++;
    else if (s[i] == 'C') aDup > 0 && s[i - 1] == 'B' ? ans += aDup : aDup = 0;
    else if (aDup > 0 && s[i - 1] == 'B') aDup = 0;
  }
  cout << ans << endl;
  return 0;
}

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

int main() {
  	int N;
    cin >> N;
    vector<int> A(N);
    for (int i=0; i<N; i++){
      	cin >> A[i];
    }
    sort(A.begin(), A.end());
    cout << A[N-1]-A[0] << endl;
}


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

int main() {
int N,M;
  cin>> N >> M;
  int count = 0;
  vector<int> A(M);
  for(int a = 0;a < M;a++){
    cin >> A.at(a);
    count += A.at(a);
  }
  if(N - count >= 0){
    cout << N - count << endl;
  }else{
    cout << -1 << endl;
  }
}

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

#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define mp make_pair

int hand[5];

// rock -> 1, scissor -> 2, paper -> 3

void solve() {
  REP(i,1,5) cin>>hand[i];
  
  map<int,int> var;
  rep(i,5) {
    if (!var.count(hand[i])) var.insert(mp(hand[i],0));
  }
  
  if (var.size() == 3 || var.size() == 1) {
    rep(i,5) cout<<3<<endl; return;
  }
  
  // rock vs scissor
  if (!var.count(3)) {
    rep(i,5)
    if (hand[i]==1) {
      cout<<1<<endl;
    } else {
      cout<<2<<endl;
    }
  }
  // rock vs paper
  else if (!var.count(2)) {
    rep(i,5)
    if (hand[i]==3) {
      cout<<1<<endl;
    } else {
      cout<<2<<endl;
    }
  }
  // scissor vs paper
  else if (!var.count(1)) {
    rep(i,5)
    if (hand[i]==2) {
      cout<<1<<endl;
    } else {
      cout<<2<<endl;
    }
  }
}

int main (int argc, char const* argv[]) {
  while (cin>>hand[0], hand[0]) {
    solve();
  }
  return 0;
}

Measured memory_bytes: 0
import java.util.Scanner;
class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
     
    int W = scan.nextInt();
    int H = scan.nextInt();
    int x = scan.nextInt();
    int y = scan.nextInt();
    int r = scan.nextInt();
 
 
    if(W < x+r || x-r < 0) System.out.println("No");
    else if(H < y+r || y-r < 0) System.out.println("No");
    else System.out.println("Yes");
  }
}

Measured memory_bytes: 17168
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
 
int main() {
  int n;
  cin >> n;
  vector<int> a(n+1);
  rep(i,n) cin >> a[i+1];
  vector<int> b(n+1);
  for (int i = n; i >= 1; --i) {
    int sum = 0;
    for (int j = i+i; j <= n; j += i) {
      sum ^= b[j];
    }
    b[i] = sum^a[i];
  }
  vector<int> ans;
  for (int i = 1; i <= n; i++) {
    if (b[i]) ans.push_back(i);
  }
  cout << ans.size() << endl;
  rep(i,ans.size()) {
    printf("%d%c", ans[i], i+1==ans.size()?'\n':' ');
  }
  return 0;
}

Measured memory_bytes: 3064
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <complex>
#include <iomanip>

using ll = long long;

using namespace std;

#define EPS (1e-10)
using value_t = double;
using point_t = complex<value_t>;

struct circle {
    point_t c;
    value_t r;
    
    int contains(const point_t p) {
        value_t d = abs(p - c);
        if (d < r - EPS) 
            return 2;
        else if (d < r + EPS)
            return 1;
        else
            return 0;
    }
};

bool intersection_point(const circle a, const circle b, point_t &p1, point_t &p2) {
    value_t dist = abs(a.c - b.c);
    value_t rdif = abs(a.r - b.r);
    value_t rsum = a.r + b.r;
    if ((dist < EPS && rdif < EPS) || dist < rdif - EPS || dist > rsum + EPS) {
        return false;
    }
    
    point_t vec_ab = b.c - a.c;
    value_t d = abs(vec_ab);
    value_t theta = arg(vec_ab);
    value_t alpha = acos((a.r * a.r + d * d - b.r * b.r) / (a.r * d * 2));

    p1 = a.c + polar(a.r, theta + alpha);
    p2 = a.c + polar(a.r, theta - alpha);

    return true;
}

int count_overlap(vector<circle> &circles) {
    int ans = 1;
    size_t n = circles.size();
    for (size_t i=0; i<n; i++) {
        for (size_t j=0; j<i; j++) {
            point_t p1, p2;
            value_t dist = abs(circles[i].c - circles[j].c);
            value_t rsum = circles[i].r + circles[j].r;
            if (!intersection_point(circles[i], circles[j], p1, p2)) {
                if (dist > rsum + EPS) continue;
                circle insider = (circles[i].r < circles[j].r ? circles[i] : circles[j]);
                p1 = p2 = insider.c;
            }


            int cnt1 = 0, cnt2 = 0;
            for (size_t k=0; k<n; k++) {
                if (circles[k].contains(p1)) cnt1++;
                if (circles[k].contains(p2)) cnt2++;
            }
            ans = max({ans, cnt1, cnt2});
        }
    }
    return ans;
}

int main() {
    while (true) {
        int n;
        cin >> n;
        if (n == 0) break;
        vector<circle> ropes(n);
        for (auto &ri:ropes) {
            value_t x, y, l;
            cin >> x >> y >> l;
            ri = {point_t(x, y), l};
        }
        value_t l = 1, r = 301;
        while (r - l > EPS) {
            value_t m = (l + r) / 2;
            vector<circle> circles;
            for (auto ri:ropes) {
                if (ri.r < m - EPS) continue;
                ri.r = sqrt(ri.r * ri.r - m * m);
                circles.push_back(ri);
            }
            if (circles.size() >= 1 && count_overlap(circles) == n) {
                l = m;
            } else {
                r = m;
            }
        }
        cout << setprecision(10) << fixed << l << '\n'; 
    }
    return 0;
}


Measured memory_bytes: 3764
#include <stdio.h>
  
int  main() {
    int N;
    scanf("%d", &N);

    int F[100][14];
    for (int i = 0; i < N; i++)
        for (int j = 0; j < 10; j++)
            scanf("%d", &F[i][j]);

    int P[100][15];
    for (int i = 0; i < N; i++)
        for (int j = 0; j < 11; j++)
            scanf("%d", &P[i][j]);

    int res = -(1 << 30);
    for (int b = 1; b < (1 << 10); b++) {
        int cc = 0;
        for (int i = 0; i < N; i++) {
            int c = 0;
            for (int j = 0; j < 10; j++)
                if ((b >> j & 1) && F[i][j])
                    c++;

            cc += P[i][c];
        }
        if (res < cc)
            res = cc;
    }

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


Measured memory_bytes: 128
#include<iostream>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#define lli long long int
#define uli unsigned long long int
#define inf 999999999999999999
#define rep(i,n,m) for(lli i=(lli)(n);i<(lli)(m);++i)
#define reep(i,n,m) for(int i=(int)(n);i<=(int)(m);++i)
#define per(i,m,n) for(lli i=(int)(m)-1;i>=(int)(n);--i)
#define st(n) sort(n.begin(), n.end())
#define rev(n) reverse(n.begin(),n.end())
#define ou(S) cout << S << endl
using namespace std;
int main(){
  int a,b,c,d;
  cin>>a>>b>>c>>d;
  ou(min(a,b)+min(c,d));
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>

using namespace std;

int main(void)
{
  string r,a;
  int hit = 0;
  int blow = 0;

  while(cin >> r >> a){

    if(r=="0" && a=="0")
      break;
    
    for(int i=0;i<4;i++)
      {
	for(int j=0;j<4;j++)
	  {
	    if(r[j]==a[i])
	      {
		if(i==j)
		  hit++;
		else
		  blow++;
	      }
	  }
      }

    cout << hit <<" "<< blow << endl;
    hit=0;
    blow=0;
  }

  return 0;

}



Measured memory_bytes: 3120
#include<bits/stdc++.h>
using namespace std;
#define itn int

int main(void){
    int n;
    cin >> n;
    int a[n],b[n];
    for(int i = 0;i < n;i++)cin >> a[i] >> b[i];
    
    reverse(a,a+n);
    reverse(b,b+n);
    
    long long int ans = 0;
    for(int i = 0;i < n;i++){
        if((a[i]+ans) % b[i] > 0)ans += (b[i] - ((a[i]+ans) % b[i]));
    }
    cout << ans << endl;
    
}

Measured memory_bytes: 1024
#include <iostream>
#include <sstream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include <string>
#include <cstring>
#include <bitset>
#include <functional>
#include <random>
#define REP(i,a,n) for(int i=a;i<=n;++i)
#define PER(i,a,n) for(int i=n;i>=a;--i)
#define hr putchar(10)
#define pb push_back
#define lc (o<<1)
#define rc (lc|1)
#define mid ((l+r)>>1)
#define ls lc,l,mid
#define rs rc,mid+1,r
#define x first
#define y second
#define io std::ios::sync_with_stdio(false)
#define endl '\n'
#define DB(a) ({REP(__i,1,n) cout<<a[__i]<<' ';hr;})
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int P = 1e9+7, INF = 0x3f3f3f3f;
ll gcd(ll a,ll b) {return b?gcd(b,a%b):a;}
ll qpow(ll a,ll n) {ll r=1%P;for (a%=P;n;a=a*a%P,n>>=1)if(n&1)r=r*a%P;return r;}
ll inv(ll x){return x<=1?1:inv(P%x)*(P-P/x)%P;}
inline int rd() {int x=0;char p=getchar();while(p<'0'||p>'9')p=getchar();while(p>='0'&&p<='9')x=x*10+p-'0',p=getchar();return x;}
//head



const int N = 1e6+50;
char s[N], ans[N];
int n, f[N], nxt[N][26];

int main() {
	scanf("%s",s+1);
	n = strlen(s+1);
	REP(i,0,25) nxt[n+1][i]=nxt[n+2][i]=n+1;
	int sta = 0, mx = (1<<26)-1;
	f[n+1] = 1;
	PER(i,1,n) {
		sta |= 1<<s[i]-'a';
		f[i] = f[i+1];
		if (sta==mx) ++f[i], sta = 0;
		memcpy(nxt[i],nxt[i+1],sizeof nxt[0]);
		nxt[i][s[i]-'a']=i;
	}
	f[n+1] = 0;
	int len = f[1], now = 1;
	REP(i,1,len) {
		REP(j,'a','z') {
			int t = nxt[now][j-'a']+1;
			if (i+f[t]<=len) {
				now = t, ans[i] = j;
				break;
			}
		}
	}
	puts(ans+1);
}








Measured memory_bytes: 24960
#include<stdio.h>
#include<iostream>
#include<vector>
#include<math.h>
#include<queue>
#include<map>
#include<algorithm>
#include<string.h>
#include<functional>
#include<limits.h>
#include<stdlib.h>
#include<cmath>
#include<cstring>
#include<set>
#include<climits>
#include<deque>
#include <iomanip>
#include<utility>
using namespace std;

#define intmax INT_MAX
#define lmax LONG_MAX
#define uintmax UINT_MAX
#define ulmax ULONG_MAX
#define llmax LLONG_MAX
#define ll long long
#define rep(i,a,N) for((i)=(a);(i)<(N);(i)++)
#define rrp(i,N,a) for((i)=(N)-1;(i)>=(a);(i)--)
#define llfor ll i,j
#define sc(a) cin>>a
#define pr(a) cout<<a<<endl
#define pY puts("YES")
#define pN puts("NO")
#define py puts("Yes")
#define pn puts("No")
#define pnn printf("\n")
#define all(a) a.begin(),a.end()
#define push(a,b) (a).push_back(b)
#define llvec vector<vector<ll>>
#define charvec vector<vector<char>>
#define size(a,b) (a,vector<ll>(b))
#define llpvec vector<pair<ll,ll>>
#define S 21 
llfor;ll mod=1000000007;
/*pi*/double pi=acos(-1);
/*繰り上げ除算*/ll cei(ll x,ll y){ll ans=x/y;if(x%y!=0)ans++;return ans;}
/*最大公約数*/ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
/*最小公倍数*/ll lcm(ll x,ll y){return x/gcd(x,y)*y;}
/*n乗*/ll llpow(ll x,ll n){ll ans=1;rep(i,0,n){ans*=x;ans%=mod;}return ans;}
/*階乗*/ll fact(ll x){ll ans=1;rep(i,0,x)ans*=(x-i);return ans;}
/*nCr*/ll ncr(ll n,ll r){return fact(n)*fact(n-r)/fact(r);}
/*nPr*/ll npr(ll n,ll r){return fact(n)/fact(n-r);}
/*primejudge*/bool prime(ll a){if(a<=1)return false;for(i=2;i*i<=a;i++){if(a%i==0)return false;}return true;}
/*Fibonacci数列*/ll fib(ll x){ll fibo[x+10];fibo[0]=1;fibo[1]=1;fibo[2]=1;rep(i,3,x+1)fibo[i]=fibo[i-1]+fibo[i-2];return fibo[x];}
/*桁数*/ll dig(ll n){ll d=1,tmp=n;while(tmp/10>0){tmp/=10;d++;}return d;}
/*行列のコピー*/void matcpy(ll a[S][S],ll b[S][S]){ll t=i;rep(i,0,S)rep(j,0,S)b[i][j]=a[i][j];/*(aをbに)*/i=t;}
/*行列のリセット*/void matrst(ll a[S][S]){ll t=i;rep(i,0,S)rep(j,0,S)a[i][j]=0;i=t;}
/*行列の2乗*/void matpow(ll a[S][S]){ll ans[S][S];matrst(ans);ll t=i,k;rep(i,0,S)rep(j,0,S)rep(k,0,S)ans[i][j]+=a[i][k]*a[k][j];matcpy(ans,a);i=t;}
/*行列の乗算*/void matmul(ll a[S][S],ll b[S][S], ll as[S][S]){ll t=i,k;matrst(as);rep(i,0,S)rep(j,0,S)rep(k,0,S)as[i][j]+=a[i][k]*b[k][j];i=t;}
//ll ans=0;
////////////////////////////////////////////////////////////
int main(){
 ll a[3];
 cin>>a[0]>>a[1]>>a[2];
 if(a[0]%2==0||a[1]%2==0||a[2]%2==0){
  pr(0);return 0;
 }
 ll ans=min(a[0]*a[1],a[0]*a[2]);
 ans=min(ans,a[1]*a[2]);
 pr(ans);
return 0;}


Measured memory_bytes: 3572
#include <stdio.h>

int main(void) {
	int a, b, c;
	int wk;
	scanf("%d %d %d", &a, &b, &c);
	while (1) {
		if (a < b && b < c) break;
		else if (a > b) {
			wk = a;
			a = b;
			b = wk;
			if (b > c) {
				wk = c;
				c = b;
				b = wk;
			}
		}
		else if(a < b) {
			if (b > c) {
				wk = c;
				c = b;
				b = wk;
			}
		}
		else if (a == b || b == c) break;

	}
	printf("%d %d %d\n", a, b, c);
	return 0;
}



Measured memory_bytes: 2104
import java.util.Scanner;

public class Main{
  public static void main(String[] args){
    
    Scanner scanner = new Scanner(System.in);
      
    String C = scanner.next();
    
    String[] slist = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"};
    
    for(int i=0; i<26; i++){
      
      if(C.equals(slist[i])){
        C = slist[i+1];
        System.out.println(C);
        break;
      }
  
    }
  }
}

    
    


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

#define ll long long

const int MAX = 1e5 + 100;
int v[MAX], w[MAX];
ll dp[105][MAX];

ll dp_solve(int idx, int W)
{
	if(idx == -1) return 0;
	ll &ans = dp[idx][W];
	if(~ans) return ans;
	ans = dp_solve(idx - 1, W);
	if(W - w[idx] >= 0)
		ans = max(ans, dp_solve(idx-1, W-w[idx]) + v[idx]);
	return ans;
}

int main()
{
	int n, W;
	scanf("%d %d", &n, &W);
	for(int i = 0; i < n; i++)
		scanf("%d %d", w + i, v + i);

	memset(dp, -1, sizeof dp);
	printf("%lld\n", dp_solve(n-1, W));
	return 0;
}


Measured memory_bytes: 82432
#include <iostream>
#include <ccomplex>
#include <vector>
#include <cassert>
#include <utility>
#include <algorithm>
#include <string>
#include <deque>
#include <queue>
#include <functional>
#include <cmath>
#include <iomanip>
#include <map>
#include <numeric>
#include <list>
#include <assert.h>
#include <math.h>
#include <valarray>
#include <stdio.h>
#include <algorithm>
#include <set>
#include <complex>
#include <list>
#include <time.h>
#include <stack>
#include <locale>
#include <clocale>
#include <ctype.h>
#include <wchar.h>
#include <random>
#include <vector>
#include <unordered_map>
#include <bitset>

using namespace std;
typedef long long int LL;
typedef long long int ll;
typedef pair<long long int, long long int> pii;
typedef pair<double, double> pdd;

#define SORT(c) sort((c).begin(),(c).end())
#define BACKSORT(c) sort((c).begin(),(c).end(),std::greater<LL>())
#define FOR(i,a,b) for(LL i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

LL mod = 1000000007;

struct UnionFind {
  vector<int> data;
  UnionFind(int size) : data(size, -1) { }
  bool unionSet(int x, int y) {
    x = root(x); y = root(y);
    if (x != y) {
      if (data[y] < data[x]) swap(x, y);
      data[x] += data[y]; data[y] = x;
    }
    return x != y;
  }
  bool findSet(int x, int y) {
    return root(x) == root(y);
  }
  int root(int x) {
    return data[x] < 0 ? x : data[x] = root(data[x]);
  }
  int size(int x) {
    return -data[root(x)];
  }
};


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

  LL N,M;
  cin >> N >> M;

  vector<pii> v(M);

  vector<LL> ans(M);

  REP(i,M){
    LL a, b;
    cin >> a >> b;
    v[M-i-1] = make_pair(a - 1, b - 1);
  }

  UnionFind uf(N);

  LL now = N * (N - 1) / 2;

  REP(i,M){
    ans[i] = now;

    LL a = uf.size(v[i].first);
    LL b = uf.size(v[i].second);

    LL flag = uf.unionSet(v[i].first, v[i].second);

    LL c =uf.size(v[i].first);

    if(flag){
      now += a * (a - 1) / 2;
      now += b * (b - 1) / 2;
      now -= c * (c - 1) / 2;
    }
  }

  REP(i,M){
    cout << ans[M - i - 1] << endl;
  }
}


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

using ll = long long;
#define countof(a) (sizeof(a)/sizeof((a)[0]))
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i < (n); i++)
#define all(a) begin(a),end(a)
template<class T> istream& operator >> (istream& s, vector<T>& v)
{ for (T& x: v) { s >> x; } return s;}
template<class T> void cout_v(const vector<T>& c)
{ for (int i = 0; i < c.size(); i++) cout << c[i] << endl; }
template<class T> void cout_h(const vector<T>& c)
{ for (int i = 0; i < c.size(); i++) cout << c[i] << (i==c.size()-1?"\n":" "); }
template<class T> inline bool chmin(T& a, T b) {return a>b?a=b,true:false;}
template<class T> inline bool chmax(T& a, T b) {return a<b?a=b,true:false;}
#define SP << " " <<
#define FMT(a) #a<<":"<<a 
#define FMT2(a,b) #a<<":"<<a<<", "<<#b<<":"<<b 
#define FMT3(a,b,c) #a<<":"<<a<<", "<<#b<<":"<<b<<", "<<#c<<":"<<c 
#define FMT4(a,b,c,d) #a<<":"<<a<<", "<<#b<<":"<<b<<", "<<#c<<":"<<c<<", "<<#d<<":"<<d 
void Yes(bool f){cout<<(f?"Yes":"No")<<endl;}

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

    string S; cin >>S;
    vector<int> c(S.size(), 0);

    int r = 1;
    for (int i = 1; i < S.size(); i++) {
        if (S[i] == 'R') {
            r++;
        } else {
            if (S[i-1] == 'R') {
                c[i  ] += r/2;
                c[i-1] += r - r/2;
            }
            r = 0;
        }        
    }
    int l = 1;
    for (int i = S.size()-2; i >= 0; i--) {
        if (S[i] == 'L') {
            l++;
        } else {
            if (S[i+1] == 'L') {
                c[i  ] += l/2;
                c[i+1] += l - l/2;
            }
            l = 0;
        }        
    }

    cout_h(c);
}


Measured memory_bytes: 1104
#include<stdio.h>
#include<stdlib.h>

int r[8];
int c1[8];
int k;

void ppp(int *aq){
  int i,j;
  for(i=0;i<8;i++){
    for(j=0;j<8;j++){
      if(aq[i]==j)printf("Q");
      else printf(".");
    }
    printf("\n");
  }
}
    

int check(int* e,int f){
  int i;
  for(i=0;i<f;i++){
    if(e[i]==e[f]||(abs(e[i]-e[f])==f-i))return 0;
  }
  //  for(i=f+1;i<8;i++){
  // if(e[i]==e[f]||(abs(e[i]-e[f])==i-f))return 0;
  //}
  return 1;  
}

void search(int *a,int b){
  
  for(a[b]=0;a[b]<8;++a[b]){
    if(check(a,b)==1){
      if(b==7){
	if(k==2) if(a[r[0]]==c1[r[0]]&&a[r[1]]==c1[r[1]])ppp(a);
	if(k==3) if(a[r[0]]==c1[r[0]]&&a[r[1]]==c1[r[1]]&&a[r[2]]==c1[r[2]])ppp(a);
	if(k==4) if(a[r[0]]==c1[r[0]]&&a[r[1]]==c1[r[1]]&&a[r[2]]==c1[r[2]]&&a[r[3]]==c1[r[3]])ppp(a);
	if(k==5) if(a[r[0]]==c1[r[0]]&&a[r[1]]==c1[r[1]]&&a[r[2]]==c1[r[2]]&&a[r[3]]==c1[r[3]]&&a[r[4]]==c1[r[4]])ppp(a);
	if(k==6) if(a[r[0]]==c1[r[0]]&&a[r[1]]==c1[r[1]]&&a[r[2]]==c1[r[2]]&&a[r[3]]==c1[r[3]]&&a[r[4]]==c1[r[4]]&&a[r[5]]==c1[r[5]])ppp(a);
	if(k==7) if(a[r[0]]==c1[r[0]]&&a[r[1]]==c1[r[1]]&&a[r[2]]==c1[r[2]]&&a[r[3]]==c1[r[3]]&&a[r[4]]==c1[r[4]]&&a[r[5]]==c1[r[5]]&&a[r[6]]==c1[r[6]])ppp(a);
	if(k==8) if(a[r[0]]==c1[r[0]]&&a[r[1]]==c1[r[1]]&&a[r[2]]==c1[r[2]]&&a[r[3]]==c1[r[3]]&&a[r[4]]==c1[r[4]]&&a[r[5]]==c1[r[5]]&&a[r[6]]==c1[r[6]]&&a[r[7]]==c1[r[7]])ppp(a);
      }
      else search(a,b+1);
    }
  }
}



int main(){

  int i,j;
  int c2[8];

  for(i=0;i<8;i++){
    r[i]=-1;
    c1[i]=-1;
    c2[i]=-1;
  }

  scanf("%d",&k);

  for(i=0;i<k;i++){
    scanf("%d",&r[i]);
    scanf("%d",&c2[r[i]]);
    c1[r[i]]=c2[r[i]];
  }

  search(c2,0);
  
  return 0;
}

  
      



Measured memory_bytes: 2112
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#pragma comment(linker, "/STACK:16777216")

#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <string>
#include <vector>
#include <iostream>
#include <map>
#include <stack>
#include <set>
#include <queue>
#include <numeric>
#include <algorithm>
#include <utility>
#include <bitset>
#include <cmath>
#include <sstream>
#include <functional>
#include <iomanip>
#include <unordered_map>

#define all(a) (a).begin(),(a).end()
#define sz(a) (int)(a).size()
#define eps (1e-15)
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector< vi > vvi;
typedef vector<double> vd;
typedef vector< vd > vvd;
typedef vector< string > vs;
typedef pair< int, int > pii;
typedef vector< pii > vpii;




int main() {
#ifdef LOCAL_MACHINE
	freopen("input.txt", "rt", stdin);
	freopen("output.txt", "wt", stdout);
#endif
	long long a, b;
	cin >> a >> b;
	if (a > b)
		swap(a, b);
	if ((a + b) % 2 == 1) {
		cout << "IMPOSSIBLE" << endl;
		
	}
	else {
		cout << (a + b) / 2 << endl;

	}

	return 0;
}


Measured memory_bytes: 256
n = int(input())
a = list(map(int, input().split()))
import numpy as np
na1 = np.array(a).cumsum()
na2 = np.array(a).cumsum()
cnt1 = 0
hoge1 = 0
cnt2 = 0
hoge2 = 0
delta1 = 0
delta2 = 0
for i in range(n):
  na1[i] += hoge1
  na2[i] += hoge2
  if(i % 2 == 0 and na1[i] <= 0):
    delta1 = abs(na1[i]) + 1
    cnt1 = cnt1 + delta1
    hoge1 += delta1
    na1[i] += delta1
  elif(i % 2 == 1 and na1[i] >= 0):
    delta1 = abs(na1[i]) + 1 
    cnt1 = cnt1 + delta1
    hoge1 -= delta1
    na1[i] -= delta1    
  if(i % 2 == 1 and na2[i] <= 0):
    delta2 = abs(na2[i]) + 1
    cnt2 = cnt2 + delta2
    hoge2 += delta2
    na2[i] += delta2  
  elif(i % 2 == 0 and na2[i] >= 0):
    delta2 = abs(na2[i]) + 1
    cnt2 = cnt2 + delta2
    hoge2 -= delta2
    na2[i] -= delta2
  else:
    na1[i]
print(min([abs(cnt1),abs(cnt2)]))


Measured memory_bytes: 20828
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for (int i = a; i < b; i++)
#define REP(i,b) FOR(i,0,b)
#define RFOR(i,a,b) for (int i = a-1; i >= b; i--)
#define RREP(i,a) RFOR(i,a,0)
#define REPALL(i,v) for (int i = 0; i < v.size(); i++)
#define RREPALL(i,v) for (int i = v.size()-1; i >= 0; i--)
#define ALL(v) v.begin(), v.end()
#define SORT(v) sort(v.begin(), v.end())
#define MIN_ELEMENT(v) min_element(v.begin(), v.end())
#define MAX_ELEMENT(v) max_element(v.begin(), v.end())
#define COUNT(v,n) count(v.begin(), v.end(), n)
void YES(bool flag) {cout<<(flag ? "YES" : "NO")<<endl;}
void Yes(bool flag) {cout<<(flag ? "Yes" : "No")<<endl;}
void yes(bool flag) {cout<<(flag ? "yes" : "no")<<endl;}
typedef long long ll;
typedef unsigned long long ull;
const int INF = 1e7;
const ll MOD = 1e9 + 7;

int x[22][22];

int main()
{
    int n, d, ans = 0;
    cin>>n>>d;
    REP(i,n) REP(j,d) {
        cin>>x[i][j];
    }
    FOR(i,0,n) {
        FOR(j,i+1,n) {
            double tmpd = 0.0;
            REP(k,d) {
                tmpd += (x[i][k] - x[j][k]) * (x[i][k] - x[j][k]);
            }
            if (sqrt(tmpd) == (int)sqrt(tmpd)){
                ans++;
            }
        }
    }
    cout<<ans<<endl;

    return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cmath>
#include<cstring>
#include<cstdlib>
#include<iostream>
#include<cctype>
#include<iomanip>
#include<string>
#include<utility>
#include<vector>
#include<queue>
#include<map>
#include<set>
#include<algorithm>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<ll> vl;
typedef queue<int> qi;
typedef queue<ll> ql;
typedef pair<ll,ll> pll;
typedef pair<int,ll> pil;
typedef pair<ll,int> pli;
#define pq priority_queue
#define rep(i,n) for (int i=0;i<n;++i)
#define mp make_pair
#define pb push_back
#define pf push_front
#define F first
#define S second
#define INF 1e15
#define init(x) memset(x,0,sizeof(x))
int n,m;
char a[100][100];

int main()
{
	ios::sync_with_stdio(false);
    cin>>n>>m;
    for (int i=1;i<=n;++i){
    	cin>>a[i];
    	for (int j=m;j>0;--j) a[i][j]=a[i][j-1];
	} 
    
    for (int i=1;i<=n;++i) for (int j=1;j<=m;++j)
      if (a[i][j]=='#'&&!(a[i-1][j]=='#'||a[i+1][j]=='#'||a[i][j-1]=='#'||a[i][j+1]=='#')){
      	cout<<"No";return 0;
	  }
	cout<<"Yes";
	return 0;
}

Measured memory_bytes: 256
/**
 * @author Finn Lidbetter
 */
import java.util.*;
import java.io.*;
import java.awt.geom.*;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    StringBuilder sb = new StringBuilder();

    int n = Integer.parseInt(br.readLine());
    int[] arr = new int[n];
    for (int i=0; i<n; i++) {
      arr[i] = Integer.parseInt(br.readLine());
    }
    boolean[][] dp = new boolean[n+1][10001];
    dp[0][0] = true;
    for (int i=1; i<=n; i++) {
      int val = arr[i-1];
      for (int j=0;j<dp[0].length; j++) {
        if (dp[i-1][j]) {
          dp[i][j] = true;
          if (j+val<dp[0].length) {
            dp[i][j+val] = true;
          }
        }
      }
    }
    int max = 0;
    for (int i=0; i<dp[0].length; i++) {
      if (dp[n][i] && i%10!=0) {
        max = i;
      }
    }
    System.out.println(max);
  }
}


Measured memory_bytes: 23252
N = int(input())
a = 0
b = 0
n = 1
b = 2*5**(n)
if N % 2 == 1:
  print(0)
else:
  while b <= N:
    a += int(N // b)
    n += 1
    b = 2*5**(n)
  print(a)

Measured memory_bytes: 3060
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <functional>
#include <vector>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <cassert>
#define InfL 1000000000
#define InfLL 1000000000000000000LL
#define mod 1000000007
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rrep(i,n) for(int (i)=(n-1);(i)>=(0);(i)--)
using namespace std;
typedef long long ll;
typedef double db;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<bool> vb;
typedef vector<db> vd;

int main() {
	double ans;
	cin >> ans;
	ans *= M_PI * 2.0;
	printf("%.12f\n", ans);
	return 0;
}


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

#define ll long long
#define ff first
#define ss second
#define pb push_back
#define vll vector<ll>
#define mll map<ll,ll>
#define MOD 1000000007
#define pll pair<ll,ll>
#define fastio ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL)

int main(){
  fastio;
  
  ll n,k;
  cin>>n;
  ll a[n+1];
  for(ll i=0;i<n;i++)
  {  ll x;
    cin>>x;
    a[x]=i+1;
  }
for(ll i=1;i<=n;i++)
    cout<<a[i]<<' ';
cout<<endl;
}

Measured memory_bytes: 1664
n, m = map(int, input().split())
A = sorted(list(map(int, input().split())))

bc = []
for i in range(m):
    b, c = map(int, input().split())
    bc.append([b,c])

from operator import itemgetter
bc.sort(key=itemgetter(1), reverse = True)
k = 0
c = bc[0][1]
b = bc[0][0]
bn = 0
while A[k] < c:
    A[k]=c
    k+=1
    if k == len(A):
        break
    b-=1
    if b  == 0:
        bn += 1
        if bn == len(bc):
            break
        b = bc[bn][0]
        c = bc[bn][1]
print(sum(A))

Measured memory_bytes: 25640
#include "bits/stdc++.h"
using namespace std;
#define rep(i,n)for(int i=0;i<(int)(n);i++)
//#define PI 3.141592653589793
//vector < vector<int>>a(0, vector<int>(0));二次元配列宣言


int main()
{
	int n;
	int cnt = 0;
	cin >> n;
	int r = 0, w = 0;
	vector<char>c(n);
	for (int i = 0; i < n; i++)
	{
		cin >> c.at(i);
		if (c.at(i) == 'W')
		{
			w++;
		}
		if (c.at(i) == 'R')
		{
			r++;
		}
	}
	for (int i = 0; i < r; i++)
	{
		if (c.at(i) == 'W')
		{
			cnt++;
		}
	}
	cout << cnt << endl;

}


	
	

	
	
/**/
/*#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>

#define PI 3.141592653589793

int main(void) {
	return 0;
}
*/

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

using namespace std;
using ll = long long;
using ld = long double;

//#define int long long
//signed main(){
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int x;
    cin >> x;
    if(x<30) cout << "No" << "\n";
    else cout << "Yes" << "\n";
    return 0;
}

Measured memory_bytes: 3636
import math
import sys
from collections import deque
import heapq
import copy
import itertools
from itertools import permutations
from itertools import combinations
import bisect
def mi() : return map(int,sys.stdin.readline().split())
def ii() : return int(sys.stdin.readline().rstrip())
def i() : return sys.stdin.readline().rstrip()
a,b=mi()
while a!=0:
  c=a
  a=b%a
  b=c
ans=1
for i in range(2,int(math.sqrt(b)+2)):
  if b%i==0:
    ans+=1
    while b%i==0:
      b=int(b/i)
if b!=1:
    ans+=1
print(ans)

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

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

using namespace std;

using ll = long long;
using P = pair<int , int>;
  
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);

  string s, t; cin >> s >> t;
  int a, b; cin >> a >> b;
  string u; cin >> u;
  cout << ((a - (s==u))) << ' ' << ((b - (t==u)));
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include<stdio.h>
#include<string>
#include<iostream>
#include<cctype>
#include<cstdio>
#include<vector>
#include<stack>
#include <algorithm>
#include<math.h>
#include<set>
#include<map>
#include<iomanip>

//#include<bits/stdc++.h>



using namespace std;




int main() {
	
	string s;
	cin>>s;
	int p=0;
	for(int i=0;i<s.size();i++){
		if(!p&&s[i]=='C')p++;
		if(p&&s[i]=='F'){p++;break;}
	}
	if(p==2)cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	return 0;
}


	

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

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

    //一次元配列の宣言
    vector<int> p(n);

    //配列に代入
    for(int i=0; i<n; i++) cin >> p[i];

    int ans = 0;

    for(int i=1; i<n-1; i++)
        if(p[i] < p[i-1]){
            if(p[i] > p[i+1]) ans += 1;
        }else if(p[i] > p[i-1]){
            if(p[i] < p[i+1]) ans += 1;
        }       
    
    cout << ans << endl;

}

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

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

using namespace std;

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

const int MAX = 18;
pair<ii, ii> sub_best[1 << MAX];
int arr[1 << MAX];
int n;

pair<ii, ii> merge(pair<ii, ii> a, pair<ii, ii> b) {
	vector<ii> v {a.first, a.second, b.first, b.second};
	sort(v.begin(), v.end(), greater<ii>());
	pair<ii, ii> c;
	fori(i, 1, v.size()) {
		if(v[i] != v[0]) {
			c = make_pair(v[0], v[i]);
			break;
		}
	}
	return c;
}

int main() {
	scanf("%d", &n);
	fori(i, 0, 1 << n) {
		scanf("%d", arr + i);
	}

	sub_best[0] = make_pair(ii(arr[0], 0), ii(0, -1));

	int best = 0;
	fori(i, 1, 1 << n) {
		sub_best[i] = make_pair(ii(arr[i], i), ii(0, -1));
		fori(j, 0, n) {
			if(i & (1 << j)) {
				sub_best[i] = merge(sub_best[i], sub_best[i & ~(1 << j)]);
			}
		}
		best = max(best, sub_best[i].first.first + sub_best[i].second.first);
		printf("%d\n", best);
	}

	return 0;
}


Measured memory_bytes: 8192
#include <bits/stdc++.h>
 
using namespace std;
 
struct odd : public unary_function<int, bool> { bool operator () (int x) const { return (x % 2) != 0; } };
void dis(int *Array, int N) { for(int i = 0; i < N; ++i) {std::cout.width(1); std::cout << Array[i];} std::cout << std::endl;}
signed fac(int n){return (n==1 || n==0) ? 1: n * fac(n - 1);}
bool V(char x) {return (x == 'a' || x == 'e' || x == 'i' || x == 'o' || x == 'u'); } 
template<typename T, typename U> inline signed  amin(T &x, U y) { if(y < x) x = y; return x;}
template<typename T, typename U> inline signed  amax(T &x, U y) { if(x < y) x = y; return x;}
//signed m(){long long T, pp,p,ppp, ct, nn, xx; cin >> p; cin.ignore(); for(int k=0;k<n;k++){for(int l=0;l<(k+1);l++){cin>>a[k][l];}}
#define inn freopen("input.txt", "r", stdin) 
#define outt freopen("output.txt", "w",stdout)
#define all(cont) cont.begin(), cont.end()
#define ll          long long
#define sz(x)       (int)x.size()
#define endl        '\n'
#define rep(i,a,b)  for(int i=a;i<b;i++)
 
ll n,E,E1,D,D1,k=0,arr1[12345],max1=0,a,b,d,e,f,flag=0,max2=0;
 
vector<ll int>fi;
vector<string>s1;
 
int main () {
    
    ll t=1;
    string s;
            cin>>s;
            if(s=="Sunny")
            {cout<<"Cloudy"<<"\n";
            }
            else if(s=="Rainy")
            {cout<<"Sunny"<<"\n";
            }
            else if(s=="Cloudy")
            {cout<<"Rainy"<<"\n";
            }
  
    	
 
   return 0;
}

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

using namespace std;

int main()
{
	int n;
	scanf("%d", &n);
	char c;
	for (int i = 0; i < n; ++i) {
		scanf("%c", &c);
		if (c == 'Y') {
			printf("Four\n");
			return 0;
		}
	}
	printf("Three\n");
	return 0;
}

Measured memory_bytes: 764
#include <stdio.h>

int main(void)
{
	int W,H,x,y,r,a=0;

	scanf("%d %d %d %d %d",&W,&H,&x,&y,&r);

	if((x + r <= W) && (0 <= x - r))
	{
		a++;
	}
	if((y + r <= H) && (0 <= y - r))
	{
		a++;
	}
	if(a==2)
	{
		printf("Yes\n");
	}
	else
	{
		printf("No\n");
	}

	return 0;
}

Measured memory_bytes: 584
#include <iostream>
#include <string>

using namespace std;

class B {
	bool appeared[26]{ false };
	string s;
public:
	void solve()
	{
		cin >> s;

		for (char c : s)
			appeared[c - 'a'] = true;

		for (int i{ 0 }; i < 26; i++)
		{
			if (!appeared[i])
			{
				cout << (char)(i + (int)'a') << endl;
				return;
			}
		}

		cout << "None" << endl;
	}

};


int main()
{
	B solution;
	solution.solve();

	return 0;
}

Measured memory_bytes: 512