akhauriyash/Code-Regression huggingface dataset:
#!/usr/bin/env python3
from collections import defaultdict,deque
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
import sys, random, itertools, math
sys.setrecursionlimit(10**5)
input = sys.stdin.readline
sqrt = math.sqrt
def LI(): return list(map(int, input().split()))
def LF(): return list(map(float, input().split()))
def LI_(): return list(map(lambda x: int(x)-1, input().split()))
def II(): return int(input())
def IF(): return float(input())
def LS(): return list(map(list, input().split()))
def S(): return list(input().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    a = II()
    s = input()
    print(s if a >= 3200 else "red")
    return

#B
def B():
    II()
    a = LI()
    ans = 0
    for ai in a:
        ans += 1 / ai
    print(1/ans)
    return

#C
def C():
    n = II()
    v = LI()
    q = []
    for vi in v:
        heappush(q, vi)
    while 1:
        a = heappop(q)
        if q:
            b = heappop(q)
            heappush(q, (a + b) / 2)
        else:
            print(a)
            return

#D
def D():
    n, q = LI()
    tree = [[] for i in range(n)]
    for _ in range(n - 1):
        a, b = LI_()
        tree[a].append(b)
        tree[b].append(a)
    ans = [0] * n
    c = defaultdict(int)
    def dfs(now):
        for nex in tree[now]:
            if c[nex]:
                continue
            c[nex] += 1
            ans[nex] += ans[now]
            dfs(nex)
    for _ in range(q):
        p, x = LI_()
        x += 1
        ans[p] += x
    c[0] = 1
    dfs(0)
    print(*ans)
    return

#E
def E():
    return

#F
def F():
    return

#Solve
if __name__ == '__main__':
    C()


Measured memory_bytes: 41328
#include<bits/stdc++.h>
#define ll long long
#define F(i,a,b) for(i = a; i <= b; i ++)
#define RF(i,a,b) for(i = a; i >= b;i --)
#define sz(a) sizeof(a)

using namespace std;
typedef pair<int,int> pii;
typedef pair<char,int> pci;
typedef map<int,int> mii;
typedef map<char,int> mci;
typedef unordered_map<int,int> umii;
typedef unordered_map<char,int> umci;

//LCS ->longest common subsequence
//LCS -> f(i,j) => a[0...i]
//                  b[0....j]
//dp[i][j] represents the LCS of a[0....i] & b[0....j]
//dp[i][j] = (a[i] == b[j]) ? (1 + dp[i - 1][j - 1]) : 
//                            max(dp[i - 1][j], dp[i][j - 1]) 
int dp[3001][3001];
inline int adjust(string &a,int i_a, int i_b)
{
    std::cout<<a[i_a - 1]<<' ';
    return 1 + dp[i_a - 1][i_b - 1];
}
void solve()
{
    vector<vector<pii>> ans_a(3001, vector<pii>(3001,pii(0,0)));
    vector<vector<pii>> ans_b(3001, vector<pii>(3001,pii(0,0)));
    string a,b;
    cin>>a>>b;
    int i_a, i_b, lim_a = a.size(), lim_b = b.size(), i;
    F(i, 0 ,3000)
    {
        dp[i][0] = dp[0][i] = 0;
    }
    int l_s = 0;
    F(i_a, 1, lim_a)
    {
        F(i_b, 1, lim_b)
        {
            if(a[i_a - 1] == b[i_b - 1])
            {
                ans_a[i_a][i_b] = pii(ans_a[i_a - 1][i_b - 1].second, i_a);
                ans_b[i_a][i_b] = pii(ans_b[i_a - 1][i_b - 1].second, i_b);
                dp[i_a][i_b] = 1 + dp[i_a - 1][i_b - 1];
            }
            else
            {
                if(dp[i_a - 1][i_b] >= dp[i_a][i_b - 1])
                {
                    dp[i_a][i_b] = dp[i_a - 1][i_b];
                    ans_a[i_a][i_b] = ans_a[i_a - 1][i_b];
                    ans_b[i_a][i_b] = ans_b[i_a - 1][i_b];
                }
                else
                {
                    dp[i_a][i_b] = dp[i_a][i_b - 1];
                    ans_a[i_a][i_b] = ans_a[i_a][i_b - 1];
                    ans_b[i_a][i_b] = ans_b[i_a][i_b - 1];
                }
            }
        }
    }
    string ans_s;
    i_a = ans_a[lim_a][lim_b].second;
    i_b = ans_b[lim_a][lim_b].second;
    while(i_a > 0)
    {   
        //cout<<i_a<<' '<<i_b<<'\n';
        ans_s += a[i_a - 1];
        int old_a = i_a;
        i_a = ans_a[i_a][i_b].first;
        i_b = ans_b[old_a][i_b].first;
    }
    reverse(ans_s.begin(),ans_s.end());
    cout<<ans_s<<'\n';
    // F(i_a,1,lim_a)
    // {
    //     F(i_b,1,lim_b)
    //         std::cout<<ans_a[i_a][i_b].first<<" & "<<ans_a[i_a][i_b].second<<" , ";
    //     std::cout<<'\n';
    // }
    // F(i_a,1,lim_a)
    // {
    //     F(i_b,1,lim_b)
    //         std::cout<<ans_b[i_a][i_b].first<<" & "<<ans_b[i_a][i_b].second<<" , ";
    //     std::cout<<'\n';
    // }

}

signed main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    std::cout.tie(0);
    //#ifndef ONLINE_JUDGE
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    //#else
    //#endif
    solve();
}


Measured memory_bytes: 176384
#include<stdio.h>
int main(void) {
	float xa,ya,xb,yb,xc,yc,xd,yd;

	while (scanf("%f %f %f %f %f %f %f %f",&xa,&ya,&xb,&yb,&xc,&yc,&xd,&yd) != EOF) {
		if ((xb-xa)*(xd-xc)+(yb-ya)*(yd-yc)==0)
			puts("YES");
		else
			puts("NO");
	}
	return 0;
}

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

#define boost ios_base::sync_with_stdio(false), cin.tie(NULL);

using namespace std;
const int N = 1e6 + 55;
const int mod = 1e9 + 7;
const long long INF = 1e18 + 12;
const int inf = 1e9;

vector <int> g[N];

int deg[N];

int ans[N];

long long sum, a[N];

int main () {
	boost;
	int n;
	string s;
	cin >> s;
	n = s.size() + 1;
	for (int i = 0 ; i < n - 1 ; ++ i) {
		if (s[i] == '<') g[i].push_back (i + 1), deg[i + 1]++;
		else g[i + 1].push_back (i), deg[i]++;
	}
	queue <int> q;
	for (int i = 0 ; i < n ; ++ i) {
		if (!deg[i]) q.push (i);
	}
	while (q.size()) {
		int v = q.front(); q.pop();
		for (int to : g[v]) {
			ans[to] = max (ans[to], ans[v] + 1);
			--deg[to];
			if (!deg[to]) q.push (to);
		}
	}
	for (int i = 0 ; i < n ; ++ i) sum += ans[i];
	cout << sum;
}

Measured memory_bytes: 49308
from collections import defaultdict

N, W = map(int, input().split())

data_list = []
for i in range(N):
    w, v = map(int, input().split())
    data_list.append((w, v))
    
data = defaultdict(int)
data[0] = 0
for w, v in data_list:
    for cw, cv in list(data.items()):
        if cw + w <= W:
            data[cw+w] = max(data[cw+w], cv+v)
            
print(max(data.values()))

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

using namespace std;



int main()
{

int l;
cin >> l;            // или double a = 1000.0
//double b = pow(l, 1.0 / 3.0);
double b = (double) l/3;
//cout << b << "\n";
long double res = b * b * b;

cout << fixed << setprecision(7) << res;


}


Measured memory_bytes: 256
//ITP1_10_D_19140837_Ojima_Yukiya.cpp
//提出日 2020/6/24 wednesday
//プログラミング基礎演習2 CS 第７回課題 ITP1_10_D
//学修番号 19140837　小島優希也
#include <iostream>
#include <cmath>
#include <vector>
using namespace std;

double Minkowski_distance(const vector<double> x, const vector<double> y, int n, double p) {
    double sum = 0;
    for (int i = 0; i < n; i++) {
        sum += pow(abs(x.at(i) - y.at(i)), p);
    }
    return pow(sum, 1.0/p);
}

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

    vector<double> x(n);
    vector<double> y(n);

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

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

    double max = 0;
    for (int i = 0; i < n; i++) {
        if (abs(x.at(i) - y.at(i)) > max) {
            max = abs(x.at(i) - y.at(i));
        }
    }

    printf("%.100lf\n", Minkowski_distance(x, y, n, 1.0));
    printf("%.100lf\n", Minkowski_distance(x, y, n, 2.0));
    printf("%.100lf\n", Minkowski_distance(x, y, n, 3.0));
    printf("%.100lf\n", max);

    return 0;
}



Measured memory_bytes: 3484
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
const ll MOD = 1e9 + 7;
const ll INF = LLONG_MAX;
const ll MINF = LLONG_MIN;
const int INT_INF = INT_MAX;

int main()
{
    int n;
    cin >> n;
    vector<int> h(n);
    vector<int> ans(n, 0);
    for (int i = 0; i < n; i++)
    {
        cin >> h.at(i);
    }
    int res = 0;
    for (int i = n - 1; i >= 1; i--)
    {
        if (h[i - 1] >= h[i])
        {
            ans[i - 1] = ans[i] + 1;
            if (res < ans[i - 1])
                res = ans[i - 1];
        }
        else
            ans[i - 1] = 0;
    }
    cout << res << endl;
}

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

int main(){ 
  int k, x;
  cin >> k >> x;
  if (500 * k >= x) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
} 

Measured memory_bytes: 256
# encoding:utf-8
def main():
	n = int(input())
	nums = list(map(int, input().split()))
	counter = [0 for _ in range(max(nums) + 3)]

	for x in nums:
		counter[x] += 1
		counter[x + 1] += 1
		counter[x + 2] += 1

	print(max(counter))

if __name__ == '__main__':
	main()

Measured memory_bytes: 14008
#include <iostream>

using namespace std;

void print(int A[], int N) {
    for (int k = 0; k < N-1; k++) {
        cout << A[k] << " ";
    }
    cout << A[N-1] << "\n";

}
void bubbleSort(int A[], int N) {
    int flag = true;
    int count = 0, i=0;
    while (flag) {
        flag = false;
        for (int j = N-1; j >= i + 1; j--) {
            if (A[j] < A[j - 1]) {
                int tmp = A[j];
                A[j] = A[j - 1];
                A[j - 1] = tmp;
                count++;
                flag = true;
            }
        }
        i++;
    }
    print(A, N);
    cout << count << "\n";
}
static int A[100];
int main() {
    int n;
    cin >> n;
    //int A[n];
    for (int i = 0; i < n; i++) {
        cin >> A[i];
    }
    //print(A);
    bubbleSort(A, n);
    return 0;

}




Measured memory_bytes: 3100
using System;

namespace Test
{
    class MainClass
    {
        public static void Main(string[] args)
        {
            var inputs = Array.ConvertAll(Console.ReadLine().Split(),int.Parse);
            var n = inputs[0];
            var p = inputs[1];
            var processes = new Process[n];
            for (int i = 0; i < processes.Length; i++)
            {
                var temp=Console.ReadLine().Split();
                processes[i] = new Process();
                processes[i].Name = temp[0];
                processes[i].Time = int.Parse(temp[1]);
            }

            var time=0;
            var queue = new Queue<Process>(processes.Length);
            foreach (var item in processes)
            {
                queue.Enqueue(item);
            }
            while (queue.IsEmpty() == false)
            {
                var process = queue.Dequeue();
                var temp = process.Time - p;
                if (temp > 0)
                {
                    time += p;
                    process.Time = temp;
                    queue.Enqueue(process);
                }
                else
                {
                    time += process.Time;
                    Console.WriteLine("{0} {1}", process.Name, time);
                }
            }

            Console.Read();
        }
    }
    class Process
    {
        public string Name { get; set; }
        public int Time { get; set; }
    }
    class Queue<T>
    {
        private T[] array;
        private int top = 0;
        private int back = 0;
        private bool isFull = false;

        public Queue(int capacity)
        {
            array = new T[capacity];
        }
        public void Enqueue(T item)
        {
            array[top++] = item;
            if (top == array.Length)
            {
                top = 0;
            }
            if (top == back)
            {
                isFull = true;
            }
        }
        public T Dequeue()
        {
            isFull = false;
            var temp = array[back++];
            if (back == array.Length) back = 0;
            return temp;
        }
        public bool IsEmpty()
        {
            if (isFull == true) return false;
            return top == back;
        }
        
    }

}

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

int N, M, Q;
vector<long long> a, b, c, d;

long long score(const vector<int> &A) {
    long long res = 0;
    for (int i = 0; i < Q; ++i) if (A[b[i]] - A[a[i]] == c[i]) res += d[i];
    return res;
}


long long dfs(vector<int> &A) {
    if (A.size() == N) {
        return score(A);
    }
    long long res = 0;
    int prev_last = (A.empty() ? 0 : A.back());
    for (int add = prev_last; add < M; ++add) {
        A.push_back(add);
        res = max(res, dfs(A)); 
        A.pop_back();
    }
    return res;
}

int main() {
    cin >> N >> M >> Q;
    a.resize(Q); b.resize(Q); c.resize(Q); d.resize(Q);
    for (int q = 0; q < Q; ++q) {
        cin >> a[q] >> b[q] >> c[q] >> d[q];
        --a[q], --b[q];
    }
    vector<int> A;
    cout << dfs(A) << endl;
}

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

#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long long
#define vll vector<ll>
#define vi vector<int>
#define pb push_back
#define fi first
#define se second
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mii map<int,int>
#define mll map<ll,ll>
#define all(x) (x).begin(),(x).end()
#define S(x) (int)(x).size()
#define L(x) (int)(x).length()

#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
typedef tree<int , null_type , less<int> , rb_tree_tag , tree_order_statistics_node_update> ordered_set;

const int mod = 1e9+7;
const ll infl = 0x3f3f3f3f3f3f3f3fLL;
const int infi = 0x3f3f3f3f;

int ans[200009];
int pref[200009];

void solve()
{
	int n,k,cntn=0,i;
	cin>>n>>k;
	for(i=1;i<=n;i++)
	{
		cin>>ans[i];
		pref[max(1,i-ans[i])]++;
		pref[min(n+1,i+ans[i]+1)]--;
	}
	for(i=1;i<=n;i++)
	{
		ans[i]=ans[i-1]+pref[i];
		if(ans[i]==n) cntn++;
	}
	k--;
	while(cntn!=n && k--)
	{
		cntn=0;
		memset(pref,0,sizeof pref);
		for(i=1;i<=n;i++)
		{
			pref[max(1,i-ans[i])]++;
			pref[min(n+1,i+ans[i]+1)]--;
		}
		for(i=1;i<=n;i++)
		{
			ans[i]=ans[i-1]+pref[i];
			if(ans[i]==n) cntn++;
		}
	}
	for(i=1;i<=n;i++)
	cout<<ans[i]<<' ';
}

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


Measured memory_bytes: 5208
#include <iostream>
#include <algorithm>
#include<cmath>
#include<cstring>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<iomanip>
#define sqr(x) (x)*(x)
#define llx(c,itr) for(__typeof((c).begin()) itr=(c).begin();itr!=(c).end();itr++)
#define rdst(st,len) {char ss[len];scanf("%s",ss);(st)=ss;}
using namespace std;
long long n,i,j,k,a,b,mod=998244353,fac[500005],inv[500005],invf[500005],ans;
long long c(long long x,long long y)
{
	return fac[x]*invf[y]%mod*invf[x-y]%mod;
}
int main()
{
	cin>>n>>a>>b>>k;
	fac[0]=fac[1]=inv[0]=inv[1]=invf[0]=invf[1]=1;
	for (i=2;i<=n+5;i++)  
	{  
		fac[i]=fac[i-1]*i%mod;
		inv[i]=(mod-mod/i)*inv[mod%i]%mod;
		invf[i]=invf[i-1]*inv[i]%mod;
	}
	for (i=0;i<=n;i++)
	{
		j=(k-i*a)/b;
		if (i*a+j*b!=k||j>n||j<0) continue;
		ans+=c(n,i)*c(n,j)%mod;
		ans%=mod;
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 10496
#include<stdio.h>
#include<math.h>
typedef struct{
	double x,y;
}Point;

void koch(int n, Point a, Point b){
	if(n==0) return;
	Point s,t,u;
	double th=M_PI*60.0/180.0;
	s.x=(2.0*a.x+1.0*b.x)/3.0;
	s.y=(2.0*a.y+1.0*b.y)/3.0;
	t.x=(1.0*a.x+2.0*b.x)/3.0;
	t.y=(1.0*a.y+2.0*b.y)/3.0;
	u.x=(t.x-s.x)*cos(th)-(t.y-s.y)*sin(th)+s.x;
	u.y=(t.x-s.x)*sin(th)+(t.y-s.y)*cos(th)+s.y;
	
	koch(n-1, a,s);
	printf("%.8f %.8f\n", s.x, s.y);
	koch(n-1, s, u);
	printf("%.8f %.8f\n", u.x, u.y);
	koch(n-1, u, t);
	printf("%.8f %.8f\n", t.x, t.y);
	koch(n-1,t,b);
}
int main(void)
{
	Point a,b;
	int n;
	scanf("%d", &n);
	a.x=0;
	a.y=0;
	b.x=100;
	b.y=0;
	
	printf("%.8f %.8f\n", a.x, a.y);
	koch(n,a,b);
	printf("%.8f %.8f\n", b.x, b.y);
	return 0;
}


Measured memory_bytes: 2048
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
using namespace __gnu_pbds;
using namespace std;

typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
typedef pair <ll, ll> pll;
typedef pair <int, int> pii;

typedef tree <ll, null_type, less <ll>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
// order_of_key(val): returns the number of values less than val
// find_by_order(k): returns an iterator to the kth largest element (0-based)

#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(a) a.begin(), a.end()
#define sz(a) (ll)(a.size())
#define endl "\n"

template <class Ch, class Tr, class Container>
basic_ostream <Ch, Tr> & operator << (basic_ostream <Ch, Tr> & os, Container const& x) 
{
    os << "{ ";
    for(auto& y : x) 
    {
        os << y << " ";
    }
    return os << "}";
}

template <class X, class Y>
ostream & operator << (ostream & os, pair <X, Y> const& p) 
{
    return os << "[" << p.ff << ", " << p.ss << "]";
}

ll gcd(ll a, ll b)
{
    if(b==0)
    {
        return a;
    }

    return gcd(b, a%b);
}

ll modexp(ll a, ll b, ll c)
{   
    a%=c;

    ll ans = 1;

    while(b)
    {
        if(b&1)
        {
            ans = (ans*a)%c;
        }

        a = (a*a)%c;
        b >>= 1;
    }

    return ans;
}

ll nxt()
{
    ll x;
    cin >> x;
    return x;
}

const ll L = 1e5+5;
ll dp[L];

void solve()
{
    ll n = nxt(), k = nxt();
    basic_string <ll> a(n, 0);
    generate(all(a), nxt);

    for(ll i=1; i<=k; i++)
    {
        for(ll j=0; j<n; j++)
        {
            if(i - a[j] >= 0 && !dp[i-a[j]])
            {
                dp[i] = 1;
            }
        }
    }

    if(dp[k] == 1)
    {
        cout << "First" << endl;
    }

    else
    {
        cout << "Second" << endl;
    }
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    
    ll T = 1;
    // T = nxt();

    while(T--)
    {
        solve();
    }

    return 0;
}

Measured memory_bytes: 1152
x,y = map(int,input().split())
t = list(map(int,input().split()))
sum = 0

for i in range(y):
    sum += (t[i]+1)*0.5

mx = sum

for i in range(y, x):
    sum = sum + (t[i]+1)*0.5 - (t[i-y]+1)*0.5
    mx = max([sum, mx])

print(mx)

Measured memory_bytes: 25060
#include <iostream>
using namespace std;
int main() {
  int x, y;
  for(int i=0; i<3000; i++){
  cin >> x >> y;
  if (x > y)
    cout << y << ' ' << x << endl;
  else if(x == 0 && y == 0)
    return 0;
  else
   cout << x << ' ' << y << endl;
 }     
    return 0;
  }

Measured memory_bytes: 3036
(let* ((n (read))
       (tb (make-array (+ n 1) :element-type 'integer
                        :adjustable t))
       (x (make-array (+ n 1) :element-type 'integer
                        :adjustable t))
       (y (make-array (+ n 1) :element-type 'integer
                        :adjustable t))
       (ans "Yes"))
  (setf (aref tb 0) 0)
  (setf (aref x 0) 0)
  (setf (aref y 0) 0)
  (loop for i from 1 upto n
        do (setf (aref tb i) (read))
           (setf (aref x i) (read))
           (setf (aref y i) (read))
        if (< (abs (- (aref tb i) (aref tb (- i 1)))) (+ (abs (- (aref x i) (aref x (- i 1)))) (abs (- (aref y i) (aref y (- i 1)))))) do (setf ans "No")
        if (= (mod (- (abs (- (aref tb i) (aref tb (- i 1)))) (+ (abs (- (aref x i) (aref x (- i 1)))) (abs (- (aref y i) (aref y (- i 1)))))) 2) 1) do (setf ans "No"))
  (format t "~A~%" ans))


Measured memory_bytes: 59816
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cctype>
#include<climits>
#include<vector>
#include<set>
#include<map>
#include<string>
#include<queue>
#include<unordered_map>
#include<unordered_set>
#include<algorithm>
#include<utility>
#include<iomanip>

using namespace std;
typedef long long int lld;
typedef long double real;

lld mod = 1e9+7;

template<typename T>
void input_vector(vector<T>& v, lld n, lld start=0) {
	for(lld i=start; i<n; ++i) 
		cin>>v[i];
}

template<typename T>
void display_vector(vector<T> v, lld start=0, string sep=" ") {
	for(lld i=start; i<v.size(); ++i)
		cout<<v[i]<<sep;
	cout<<"\n";
}

void solve(lld a, lld b, lld h, lld m) {
	real pi=3.14159265358979;
	real htheta, mtheta, theta;
	mtheta = (m*pi)/30.0;
	htheta = (60*h+m)*pi/360.0;
	theta = min(abs(htheta-mtheta), 2*pi-abs(htheta-mtheta));
	real dist = a*a + b*b - 2*a*b*cos(theta);
	dist = sqrt(dist);
	
	cout<<fixed<<setprecision(12)<<dist<<"\n";
}

int main() {
	lld t;
	t=1;
	
	for (lld cs=1; cs<=t; ++cs) {
		lld a, b, h, m;
		cin>>a>>b>>h>>m;
		solve(a, b, h, m);
	}
	
	return 0;
}

Measured memory_bytes: 4152
//~ while (clock()<=69*CLOCKS_PER_SEC)
//~ #pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
//~ #pragma GCC optimize("Ofast")
//~ #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//~ #pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

using namespace __gnu_pbds;
using namespace std;

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

#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

#define shandom_ruffle random_shuffle

using ll=long long;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
using vi=vector<int>;
using vll=vector<ll>;
const int nax=1000*1007;

int n;

int tab[nax];
int p[nax];

vi wyn;

int main()
{
	scanf("%d", &n);
	for (int i=1; i<=n; i++)
		scanf("%d", &tab[i]);
	for (int i=n; i; i--)
	{
		int x=tab[i];
		for (int j=2*i; j<=n; j+=i)
			x^=p[j];
		if (x)
		{
			p[i]=1;
			wyn.push_back(i);
		}
	}
	reverse(wyn.begin(), wyn.end());
	printf("%d\n", (int)wyn.size());
	for (int i : wyn)
		printf("%d ", i);
	printf("\n");
	return 0;
}


Measured memory_bytes: 5412
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10000000)
INF = int(1e9)

#ans:=目標達成するのに必要な最小の金額（求める値）
#最小値を更新しながら求めていくので初期値は十分大きな数とする
ans = INF
def main():
    N, M, X = map(int, readline().split())

    #参考書、アルゴリズムは0-indexed

    #costs[i]:=参考書iの金額
    #score[i][j]:=参考書iを読んで上がるアルゴリズムjの理解度
    costs = []
    score = []
    for _ in range(N):
        c, *d = map(int, readline().split())
        costs.append(c)
        score.append([i for i in d])

    #bit:=どの参考書を買うかの組み合わせを表現するリスト
    #bit[i]が1のときi番目の参考書を買う
    #bit[i]が0のときi番目の参考書を買わない
    bit = []
    #買う参考書の組みを順に全て構成し、構成した組それぞれに対して金額の総和計算をする
    def dfs():
        global ans
        #全てのbitの0,1が決まる=購入する参考書の組みが決定したとき理解度の計算をする
        if len(bit) == N:
            #cost:=買った参考書の値段の合計金額 
            cost = 0
            #sumSocore[i]:=i番目のアルゴリズムの理解度の累計 
            sumScore = [0 for _ in range(M)]
            for i in range(N):
                if bit[i]:
                #bit[i]==1なら参考書iを購入するのでcostを更新する
                    cost += costs[i]
                    for j in range(M):
                        #sumScoreを更新
                        sumScore[j] += score[i][j]

            #全てのアルゴリズムの理解度がx以上であるかの判定
            #flag:=全てのアルゴリズムの理解度がx以上であるか
            flag = True 
            for i in range(M):
                if sumScore[i] < X: 
                    flag = False

            #全てのアルゴリズムの理解度がx以上であるときcostはansの候補である
            if flag:
                #cost < ansのときcostをansに代入
                ans = min(ans, cost)
                return 
            return 

        #bit全探索の核となる部分
        #bitを決めていく.0か1を追加していく（括弧内はi=1のときの説明）
        for i in range(2): 
            #初めのループでi=0をappendする（次のループでi=1をappendする）
            bit.append(i)
            #0がappendされた状態で次の深さのdfsを走らせる.（1がappendされた状態で次の深さのdfsを走らせる）
            dfs()
            #次のループでi=1を同じ位置へappendするために0をpopしておく（i=1をpopすることに意味はないので無駄な処理となる）
            bit.pop()

    dfs()
    if ans == INF:
        print(-1)
    else:
        print(ans)
if __name__ == '__main__':
    main()


Measured memory_bytes: 71064
function Main(input) {
  input = input.split("\n");
  var line = input[0].split(" ").map(i => parseInt(i));
  for(var i=0;i<5;i++){
    if(line[i]==0){
      var ans = i+1;
    }
  }

  console.log('%s', ans);
  return ans;
}

function debug(n){
  var input = document.getElementById("input"+n).value;
  var ans=Main(input);
  var result="WA";
  if(ans==document.getElementById("output"+n).value.split("\n")[0]){
    result="AC";
  }
  document.getElementById("result"+n).innerHTML=result;
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

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


int main(){
	int N, M;
	cin >> N >> M;
	vector<P> S;
	rep(i,N){
		int A, B;
		cin >> A >> B;
		S.push_back(make_pair(A, B));
	}
	sort(S.begin(),S.end());
	LL ans = 0;
	rep(i,N){
		auto p = S[i];
		LL drink = p.first;
		LL num = p.second;
		if(M>num) {
			ans += drink * num;
			M -= num;
		}
		else {
		   	ans += drink * M;
			break;
		}
	}
	cout << ans << endl;
	return 0;

			

}














Measured memory_bytes: 4312
//
//  AOJ0002.c
//  
//
//  Created by 中野 優 on 2014/02/16.
//
//

#include <stdio.h>
int main(void){
    int a,b,i=0,j,k,d,sum[200];
    while(scanf("%d %d",&a,&b)!=-1){
        sum[i] = a+b;
        i++;
    }
    for(j=0;j<i;j++){
        d=10;
        for(k=1;;k++){
            if(sum[j]<d){
                printf("%d\n",k);
                break;
            } else {
                d*=10;
            }
        }
    }
    return 0;
}

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

/* 大文字を小文字に変換 */
char tolower(char c) {return (c + 0x20);}
/* 小文字を大文字に変換 */
char toupr(char c) {return (c - 0x20);}

// if('A'<=s[i] && s[i]<='Z') s[i] += 'a'-'A';

/*
string s = "abcdefg"
s.substr(4) "efg"
s.substr(0,3) "abc"
s.substr(2,4) "cdef"

// イテレータ要素のインデックス
distance(A.begin(), itr);
*/

int c[10][1005];

const int INF = 1000100100;

int main()
{
    int h, w, k;
    cin >> h >> w >> k;
    vector<string> s(h);
    rep(i,h) cin >> s[i];

    int ans = INF;

    rep(div,1<<(h-1)){  // div: 横方向に切る線の書き方の集合
        // 横方向の区切り線によるグルーピング
        int g = 0;
        vector<int> id(h);
        rep(i,h){
            id[i] = g;
            if(div>>i&1) ++g;
        }
        ++g;    // gはグループ数を表すようにしたいので、最後にインクリメント

        rep(i,g) rep(j,w) c[i][j] = 0;
        rep(i,h) rep(j,w) c[id[i]][j] += (s[i][j] - '0');

        int num = g-1;
        vector<int> now(g); // これを定義した時点で次元gのベクトルnowは初期化される
        auto add = [&](int j){
            rep(i,g) now[i] += c[i][j];
            rep(i,g) if(now[i] > k) return false;
            return true;
        };
        rep(j,w){
            if(!add(j)){
                num++;
                now = vector<int> (g);  // これでベクトルnowがすべて0に初期化される
                if(!add(j)){
                    num = INF;
                    break;
                }
            }
        }
        ans = min(ans, num);
    }
    cout << ans << endl;
}

Measured memory_bytes: 3656
program answer
  implicit none

  integer :: N, i, a, b, c, d
  character :: S(100000)

  read(*,*) N
  do i = 1, n
     read(*,*) S(i:i)
  end do

  a=0
  b=0
  c=0
  d=0

  do i = 1, n
     if(S(i)=='A') then
        a=a+1
     else if(S(i)=="W") then
        b=b+1
     else if(S(i)=="T") then
        c=c+1
     else if(S(i)=="R") then
        d=d+1
     end if
  end do

  write(*,*) 'AC', ' x',a
  write(*,*) 'WA', ' x', b
  write(*,*) 'TLE', ' x', c
  write(*,*) 'RE', ' x', d

  stop
 end program answer


Measured memory_bytes: 2956
# -*- coding:utf-8 -*-
n, m = map(int, input().split())
a = [list(map(int, input().split())) for _ in range(n)]
a.sort()
v = 0
for row in a:
    if m > row[1]:
        m -= row[1]
        v += row[0] * row[1]
    else:
        v += row[0] * m
        break
print(v)

Measured memory_bytes: 27884
import java.util.Scanner;
	public class Main{
      public static void main(String[]args){
        Scanner sc = new Scanner(System.in);
        //文字の入力をし0番目を指定する
        char c = sc.next().charAt(0);
        //文字コード+1をして文字を表示させる
        System.out.println((char)(c+1));
      }
    }

Measured memory_bytes: 23252
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
typedef long long ll;
using namespace std;
const ll mod=1000000007, INF=mod*mod*3LL;
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;

int main() {
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    ll n, L, t;
    cin >> n >> L >> t;
    ll x[n], w[n];
    vector<ll> v;
    ll id = -1;
    for(int i=0;i<n;i++){
    	cin >> x[i] >> w[i];
    	if(w[i] == 1) id = i;
    }
    if(id == -1){
    	for(int i=0;i<n;i++){
    		cout << ((x[i] - t) % L + L) % L << endl;
    	}
    	return 0;
    }
    ll num = id;
    ll a = (x[id] + t) % L;

    for(int i=0;i<n;i++){
    	if(w[i] == 1){
    		v.pb((x[i] + t) % L);
    	}
    	if(w[i] == 2){
    		v.pb(((x[i] - t) % L + L)%L);
    		ll b = x[id] - x[i];
    		b += L;
    		b %= L;
    		num += (t * 2 + b) / L;
    		num %= n;
    	}
    }
    sort(be(v));
    vector<ll> ans(n);
    id = upper_bound(be(v), a) - v.begin() - 1;
    for(int i=id;i<n+id;i++, num++){
    	num %= n;
    	ans[num] = v[i % n];
    }
    for(int i=0;i<n;i++){
    	cout << ans[i] << endl;
    }
    return 0;
}


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

int main() {
  ll n,k,q;
  cin >> n >> k >> q;
  vector<ll> cor(n,0);
  rep(i,q){
    ll x;
    cin >> x;
    x--;
    cor[x]++;
  }
  
  rep(i,n){
    cor[i] = k - (q-cor[i]);
  }

  rep(i,n){
    if(cor[i] >= 1){
      cout << "Yes" << endl;
    }else{
      cout << "No" << endl;
    }
  }
  
  return(0);
}

Measured memory_bytes: 4056
#include <algorithm>
#include <cmath>
#include <iostream>
#include <queue>
#include <string>
#include <vector>

using namespace std;
using ll = long long;

int main() {
  ll N, M;
  cin >> N >> M;
  priority_queue<ll> que;
  for (ll i = 0; i < N; ++i) {
    ll tmp;
    cin >> tmp;
    que.push(tmp);
  }

  for (ll i = 0; i < M; ++i) {
    ll max_item = que.top();
    que.pop();
    max_item = ll(floor(max_item / 2));
    que.push(max_item);
  }
  ll ans = 0;
  while (!que.empty()) {
    ans += que.top();
    que.pop();
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 1400
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
int main()
{
    int N;
    cin >> N;

    vector<int> t(N);
    vector<string> s(N);

    REP(i, N){
        cin>> s[i] >> t[i];
    }

    string X;
    cin >> X;

    int cnt=0;
    REP(i, N){
        if(s[i]==X) cnt=i;
    }
    int ans=0;
    REP2(i, cnt+1, N){
        ans+=t[i];
    }

    
    cout << ans << endl;



   return 0;
}

Measured memory_bytes: 256
from collections import deque


K = int(input())

d = deque([1, 2, 3, 4, 5, 6, 7, 8, 9])

for _ in range(K-1):
    x = d.popleft()
    # x の1桁目を見る
    mod = x % 10
    if mod != 0:
        d.append(10 * x + mod - 1)
    d.append(10 * x + mod)
    if mod != 9:
        d.append(10 * x + mod + 1)

ans = d.popleft()
print(ans)

Measured memory_bytes: 11956
#include <iostream>
#include <algorithm>
#include <map>
#include <math.h>
#include <string>
typedef long long ll;

using namespace std;

int main(){
    int N;
    cin >> N;
    ll num[1010] = {0};

    for (int i = 1; i <= N; i++){
	int x = i;
	int div = 2;
	while (x > 1){
	    if (x%div == 0){
		num[div]++;
		x /= div;
		div = 2;
	    } else {
		div++;
	    }
	}
    }

    ll res = 1;
    for (int i = 1; i <= N; i++){
	res *= num[i]+1;
	res %= 1000000007;
    }

    cout << res << endl;

    return 0;
}


Measured memory_bytes: 256
N = int(input())
A = list(map(int, input().split()))
B = sum(A)
C = 0
if(B%N < N/2):
  for i in(A):
    C += (B//N-i)**2
else:
  for i in(A):
    C += (B//N+1-i)**2
print(C)

Measured memory_bytes: 3060
#define _USE_MATH_DEFINES
#include<iostream>
#include<string>
#include<cmath>
#include<queue>
#include<map>
#include<set>
#include<list>
#include<iomanip>
#include<vector>
#include<random>
#include<functional>
#include<algorithm>
#include<cstdio>
#include<bitset>
#include<unordered_map>
using namespace std;
//---------------------------------------------------
//ライブラリゾーン！！！！
typedef long long ll;
typedef long double ld;
#define str string
#define rep(i,j) for(ll i=0;i<(long long)(j);i++)
const ll Mod = 1000000007;
const ll gosenchou = 5000000000000000;
short gh[2][4] = { { 0,0,-1,1 },{ -1,1,0,0 } };
struct P {
	ll pos, cost;
};
bool operator<(P a, P b) { return a.cost < b.cost; }
bool operator>(P a, P b) { return a.cost > b.cost; }
struct B {//隣接リスト表現
	ll to, cost;
};
struct E {//辺の情報を入れる変数
	ll from, to, cost;
};
bool operator<(E a, E b) {
	return a.cost < b.cost;
}
struct H {
	ll x, y;
};
bool operator<(H a, H b) {
	if (a.x != b.x) return a.x < b.x;
	return a.y < b.y;
}
bool operator>(H a, H b) {
	if (a.x != b.x) return a.x > b.x;
	return a.y > b.y;
}
bool operator==(H a, H b) {
	return a.x == b.x&&a.y == b.y;
}
bool operator!=(H a, H b) {
	return a.x != b.x || a.y != b.y;
}
ll gcm(ll i, ll j) {//最大公約数
	if (i > j) swap(i, j);
	if (i == 0) return j;
	return gcm(j%i, i);
}
ld rad(H a, H b) {
	return sqrt(pow(a.x - b.x, 2.0) + pow(a.y - b.y, 2.0));
}//rad＝座標上の2点間の距離
ll ari(ll a, ll b, ll c) {
	return (a + b)*c / 2;
}//等差数列の和
ll fact(ll x, ll k, ll p) {//最大値、個数、あまり
	ll sum = 1;
	for (int i = 0; i < k; i++) {
		sum *= (x--);
		sum %= p;
	}
	return sum;
}//階乗(正）
ll mod_pow(ll x, ll n, ll p) {
	ll res = 1;
	while (n > 0) {
		if (n & 1) res = res*x%p;
		x = x*x%p;
		n >>= 1;
	}
	return res;
}//x^n%p
int ctoi(char a) {
	return (int)a - '0';
}
#define int long long
const long long Inf = 4523372036854775807;
const int inf = 15000000000;
//----------------------------------------------------
//++++++++++++++++++++++++++++++++++++++++++++++++++++
signed main() {
	int a, b, c;
	cin >> a >> b >> c;
	if (c < a) swap(a, c);
	if (c < b) swap(b, c);
	if (a > b) swap(a, b);
	int ans = 0;
	while (a < b) {
		a += 2;
		ans++;
	}
	if (a != b) {
		b++;
		c++;
		ans++;
	}
	while (b < c) {
		b++;
		ans++;
	}
	cout << ans << endl;
	getchar(); getchar();
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <cmath> 
#define ll long long

ll MOD=1e9+7;
ll a[100005];
using namespace std;

int main(){
	ll n;
	cin>>n;
	
	ll flag=1;//标志 
	ll ans=1;
	
	if(n%2==0){ //偶数 
		for(ll i=0;i<n;i++){
			ll x;
			cin>>x;
			a[x]++;
			if(x>=n || x%2==0 || a[x]>2){
				flag=0;
				cout<<"0"<<endl;
				break;
			}
			if(a[x]==1)
				ans=ans*2%MOD;
		}
	} 
	
	else{ //奇数 
		for(ll i=0;i<n;i++){
			ll x;
			cin>>x;
			a[x]++;
			if(x>=n || x%2==1 || a[0]>1 ||a[x]>2){
				flag=0;
				cout<<"0"<<endl;
				break;
			}
			if(x!=0 && a[x]==1)
				ans=ans*2%MOD;
		}
	}
	if(flag)
		cout<<ans<<endl;
	return 0;
}

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

int main() {
    int H, N;
    cin >> H >> N;
    vector<int> vt(N);
    rep(i, N) cin >> vt.at(i);
    int sum = 0;
    for(auto i : vt) sum += i;
    if(H <= sum) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

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

const string YES = "Yes";

// Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
int main(){
    ll n,m;
    cin >> n >> m;

    vector<int> road[n];
    rep(i,m)
    {
        int a,b;
        cin >> a >> b;
        a--;b--;
        road[a].push_back(b);
        road[b].push_back(a);
    }
    // bfs
    int ans[n];
    rep(i,n) ans[i] = -1;
    ans[0] = 0;
    queue<int> que;
    que.push(0);
    while(!que.empty())
    {
        int x = que.front();que.pop();
        // int num = ans[x];
        for (auto itr=road[x].begin();itr!=road[x].end();itr++)
        {
            if (ans[*itr]==-1)
            {
                ans[*itr] = x+1;
                que.push(*itr);
            }
        }
    }
    cout << YES << endl;
    for(int i=1;i<n;i++)
    {
        cout << ans[i] << endl;
    }

}


Measured memory_bytes: 10496
# coding: utf-8
# Your code here!
import sys
read = sys.stdin.read
readline = sys.stdin.readline

#n,m = map(int,readline().split())
s = input()
t = input()

vs = [0]
for i in s:
    if i =="A": vs.append(vs[-1]+1)
    else: vs.append(vs[-1]-1)

vt = [0]
for i in t:
    if i =="A": vt.append(vt[-1]+1)
    else: vt.append(vt[-1]-1)

#print(vs)
#print(vt)

q = int(input())
for _ in range(q):
    a,b,c,d = map(int,readline().split())
    rs = vs[b] - vs[a-1]
    rs %= 3

    rt = vt[d] - vt[c-1]
    rt %= 3

    if rs==rt: print("YES")
    else: print("NO")






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

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

#define INF 1 << 29
#define REP(i,n) for(ll i=0; i<(int)(n); i++)
#define FOR(i,k,n) for(ll i=(k);i<(int)(n);i++)



vector<bool> gen_sosuu(vector<bool> sosuu){
  int size = sosuu.size();
  REP(i,size){
    sosuu[i] = true;
  }
  sosuu[0] = false;
  sosuu[1] = false;
  sosuu[2] = true;
  FOR(i,2,sqrt(size)+1){
    if(sosuu[i] == false) continue;
    for(int j = 2; i*j<size;j++){
      sosuu[i*j] =false;
    }
  }
  return sosuu;
}

ll n,x;
ll a[100000];
ll sum = 0ll;
int main(){
  cin >> n >> x;
  REP(i,n){
    cin >> a[i];
  }
  if(a[0]>x){
    sum+= a[0]-x;
    a[0] = x;
  }
  FOR(i,0,n-1){
    if(a[i]+a[i+1] > x){
      sum += a[i+1] + a[i] - x;
      a[i+1] = x-a[i];
    }
  }
  cout << sum << endl;
}


Measured memory_bytes: 1024
#include<stdio.h>
int main()
{
	int a,b,c,i,x[100000],y[100000];
	scanf("%d %d %d",&a,&b,&c);
	for(i=0;i<c;i++){
		scanf("%d",&x[i]);
	}
	for(i=0;i<a;i++){
		y[i]=b-c;
	}
	for(i=0;i<c;i++){
		y[x[i]-1]++;
	}
	for(i=0;i<a;i++){
		if(y[i]>=1){
			printf("Yes\n");
		}
		else printf("No\n");
	}
	return 0;
}

Measured memory_bytes: 2440
#include<bits/stdc++.h>
using namespace std;
inline int read()
{
    int x=0,f=1;
    char c=getchar();
    while(c<'0'||c>'9') {if(c=='-') f=-1; c=getchar();}
    while(c>='0'&&c<='9') {x=x*10+c-'0'; c=getchar();}
    return f*x;
}
inline void write(int x)
{
    if(x<0) {putchar('-'); x=-x;}
    if(x>9) write(x/10);
    putchar(x%10+'0');
}
int main(){
	string s;
	bool num=0;
	cin>>s;
	int len=s.length();
	for (int i=0;i<len;i++){
		if (s[i]=='C'){
			num=1;
		}
		if (s[i]=='F'&&num==1){
			cout<<"Yes";
			return 0;
		}
	}
	cout<<"No";
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define vi vector<int>
#define vvi vector<vi>
#define vs vector<string>
#define pb push_back
#define P pair<int,int>
#define vp vector<P>
#define PP pair<P,int>
#define vpp vector<PP>
#define fi first
#define se second
#define INF (1<<30)
#define MOD 1000000007
#define REP(i,n) for(int i=0;i<n;i++)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define all(x) (x).begin(),(x).end()
int main(){
    string a,b;
    cin>>a>>b;
    sort(all(a));
    sort(all(b),greater<char>());
    if(a<b){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }
    return 0;
}

Measured memory_bytes: 384
IDENTIFICATION DIVISION.
      PROGRAM-ID. 059A.
      DATA DIVISION.
      WORKING-STORAGE SECTION.
      01 INP PIC X(100).
      01 S1.
        03 S1A PIC X(1).
      	03 S1B PIC X(9).
      01 S2.
        03 S2A PIC X(1).
      	03 S2B PIC X(9).
      01 S3.
        03 S3A PIC X(1).
      	03 S3B PIC X(9).
      
      01 ANS.
      	03 ANSX PIC X(1) OCCURS 3 TIMES.
      
      01 IDX PIC 9(1).
      
      PROCEDURE DIVISION.
      ACCEPT INP.
      UNSTRING INP DELIMITED BY " "
      INTO 	S1 S2 S3.

      MOVE  S1A TO ANSX(1).
      MOVE  S2A TO ANSX(2).
      MOVE  S3A TO ANSX(3).
            
      PERFORM VARYING IDX FROM 1 BY 1 UNTIL IDX > 3      
      	EVALUATE ANSX(IDX)
   	   		WHEN "a"
				MOVE "A" TO ANSX(IDX)
   	   		WHEN "b"
				MOVE "B" TO ANSX(IDX)
   	   		WHEN "c"
				MOVE "C" TO ANSX(IDX)
   	   		WHEN "d"
				MOVE "D" TO ANSX(IDX)
   	   		WHEN "e"
				MOVE "E" TO ANSX(IDX)
   	   		WHEN "f"
				MOVE "F" TO ANSX(IDX)
   	   		WHEN "g"
				MOVE "G" TO ANSX(IDX)
   	   		WHEN "h"
				MOVE "H" TO ANSX(IDX)
   	   		WHEN "i"
				MOVE "I" TO ANSX(IDX)
   	   		WHEN "j"
				MOVE "J" TO ANSX(IDX)
   	   		WHEN "k"
				MOVE "K" TO ANSX(IDX)
   	   		WHEN "l"
				MOVE "L" TO ANSX(IDX)
   	   		WHEN "m"
				MOVE "M" TO ANSX(IDX)
   	   		WHEN "n"
				MOVE "N" TO ANSX(IDX)
   	   		WHEN "o"
				MOVE "O" TO ANSX(IDX)
   	   		WHEN "p"
				MOVE "P" TO ANSX(IDX)
   	   		WHEN "q"
				MOVE "Q" TO ANSX(IDX)
   	   		WHEN "r"
				MOVE "R" TO ANSX(IDX)
   	   		WHEN "s"
				MOVE "S" TO ANSX(IDX)
      		WHEN "t"
				MOVE "T" TO ANSX(IDX)
      		WHEN "u"
				MOVE "U" TO ANSX(IDX)
      		WHEN "v"
				MOVE "V" TO ANSX(IDX)
      		WHEN "w"
				MOVE "W" TO ANSX(IDX)
      		WHEN "x"
				MOVE "X" TO ANSX(IDX)
      		WHEN "y"
				MOVE "Y" TO ANSX(IDX)
      		WHEN "z"
				MOVE "Z" TO ANSX(IDX)
			WHEN OTHER
      			CONTINUE
     	END-EVALUATE
      END-PERFORM.
      
      DISPLAY ANS.
      STOP RUN.

Measured memory_bytes: 384
H,W = list(map(int , input().split()))
h = H % 2
w = W % 2
if H > 1 and W > 1:
    if h == 1:
        s = (H+1) /2
        t = s - 1
        if w == 1:
            m = (W+1) /2
            n = m - 1
            a = s * m
            b = t * n
            c = round(a + b)
        else:
            m = W / 2
            a = s * m
            b = t * m
            c = round(a + b)
    else:
        s = H / 2
        a = s * W
        c = round(a)
else:
    c = 1
    
    
print(c)


Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define rep(i,a,n) for(int i=a;i<n;i++)
#define all(a) a.begin(),a.end()
#define o(a) cout<<a<<endl
#define int long long
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> pii;

signed main(){
	int n;
	string s="01235789";
	while(1){
		cin>>n;
		if(n==0) break;
		string ans="";
		bool f=false;
		for(int i=10;i>=0;i--){
			int now=n/(int)pow((int)8,i);
			if(now!=0) f=true;
			//cout<<now<<" ";
			if(f){
				ans+=s[now];
				//cout<<s[now]<<" ";
			}
			n%=(int)pow((int)8,i);
		}
		//cout<<endl;
		o(ans);
	}
}

Measured memory_bytes: 1240
def p_a():
    a, b = map(int, input().split())
    a1 = a*b
    a2 = a+b
    a3 = a-b

    if a1 > a2:
        if a1 > a3:
            print(a1)
        else:
            print(a3)
    else:
        if a2 > a3:
            print(a2)
        else:
            print(a3)

if __name__ == '__main__':
    p_a()

Measured memory_bytes: 3060
def resolve():
	s = input()
	K = ['dream', 'dreamer', 'erase', 'eraser']
	for i in range(len(K)):
		K[i] = K[i][::-1]
	r = ''
	for i in s[::-1]:
		r += i
		if r in K:
			r = ''
	if len(r):
		print("NO")
	else:
		print("YES")
resolve()

Measured memory_bytes: 3188
N = int(input())
*A, = map(int, input().split())

cnt = 0
total = 0
min_num = float('inf')
for a in A:
    if a<0:
        cnt = cnt + 1
    min_num = min(min_num, abs(a))
    total = total + abs(a)

if cnt%2==0:
    print(total)
else:
    print(total-2*min_num)

Measured memory_bytes: 14412
using System;
using System.Linq;

class Program {
    private static int Main() {
        var input = Console.ReadLine();
        int count = int.Parse( input );

        for( int i = 0; i < count; ++i ) {
            input = Console.ReadLine();
            if( string.IsNullOrEmpty( input ) ) { break; }

            var values = input.Split( ' ' );
            var abc = values.Select( _ => int.Parse( _ ) ).OrderBy( _ => _ ).ToArray();
            bool isRightTriangle = abc[ 0 ] * abc[ 0 ] + abc[ 1 ] * abc[ 1 ] == abc[ 2 ] * abc[ 2 ];

            Console.WriteLine( isRightTriangle ? "YES" : "NO" );
        }

        return 0;
    }
}

Measured memory_bytes: 6316
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using db = double;
#define fi first
#define se second
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define siz(v) (ll)(v).size()
#define rep(i,n) for(ll i=0;i<(ll)(n);i++)
#define repn(i,n) for(ll i=0;i<=(ll)(n);i++)
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
const ll mod = 1000000007;
const ll INF = 1000000099;
//cin.tie(0);
//ios::sync_with_stdio(false);



signed main(){
    ll x,y,ans=INF*10;cin>>x>>y;

    if(x<=y)ans=min(ans,y-x);

    if(-x<=y)ans=min(ans,1+y+x);

    if(-x<=-y)ans=min(ans,2+-y+x);

    if(x<=-y)ans=min(ans,1-y-x);

    cout<<ans<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <bits/stdc++.h> 
using namespace std;
typedef long long ll;
typedef pair<int,int> Pint;
typedef pair<ll, ll> P;
//typedef pair<int, pair<int, int>> P;
//typedef tuple<int,int,int> T;
ll INFL = 1000000000000000010;//10^18 = 2^60
int INF = 1e9 + 10;//10^9
ll MOD  = 1000000007;
int dy[] = {0,0,1,-1};
int dx[] = {1,-1,0,0};

int k[11][11];
int main(void){
    int N, K;
    cin >> N >> K;
    ll m = -INFL;
    vector<ll> V(N);
    for(int i = 0; i < N; i++) cin >> V[i];
    
    for(int i = 0; i <= N; i++){
        for(int j = 0; j <= N; j++){
            if(i + j > N) continue;
            if(i + j > K) continue;
            vector<ll> xs;
            for(int l = 0; l < i; l++){
                xs.push_back(V[l]);
            }
            for(int l = 0; l < j; l++){
                xs.push_back(V[N-1-l]);
            }
            sort(xs.begin(), xs.end());
            ll ans = 0;
            int x = K - i - j;
            int cnt = 0;
            while(cnt < x && cnt < xs.size()){
                if(xs[cnt] < 0){
                    xs[cnt] = 0;
                }
                cnt++;
            }
            for(int l = 0; l < xs.size(); l++) ans += xs[l];
            m = max(m, ans);
            
        }
    }
    
    cout << m << endl;
    
    
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int n;
const long long D=1e9+7;
long long gcd(long long x,long long y){
    if(y==0)return x;
    return gcd(y,x%y);
}
long long pow2(long long x,long long y){
    if(y%2==0)return 1;
    long long ret=pow2(x,y/2);
    return ret*ret%D*(y%2==0 ? 1: x)%D;
}
int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(0);

    int a,b;
    cin>>a>>b;
    int i;
    for(i=1 ; i<=10000 ; i++){
        if(i*8/100==a && i/10==b){
            cout<<i;
            return 0;
        }
    }
    cout<<-1;
    return 0;
}


Measured memory_bytes: 256
fun main(arg: Array<String>) {
    val N = nextInt()
    val A = Array(N) { listOfInt() }
    val R = Array(N) { BooleanArray(N) }
    for (k in 0 until N)
    for (h in 0 until N) for (w in 0 until N) {
        if (A[h][w] > A[h][k] + A[k][w]) return println(-1)
        if (A[h][w] == A[h][k] + A[k][w] && A[h][k] > 0 && A[k][w] > 0)
            R[h][w] = true
    }
    var ans = 0L
    for (h in 0 until N) for (w in h + 1 until N) {
        if (!R[h][w]) ans += A[h][w]
    }
    println(ans)
}
fun next() = readLine()!!
fun nextInt(delta: Int = 0) = Integer.parseInt(next()) + delta
fun listOfString() = next().split(" ")
fun listOfInt(D: Int = 0) = listOfString().map { Integer.parseInt(it) + D }


Measured memory_bytes: 45700