akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
vector<long long>adjlist[100010];
long long  value[1000010];
int main()
{
    long long n,m,cnt=0;
    cin>>n>>m;
    int i,j,k;
    long long a,b;
    for(i=1; i<=n; i++)
        cin>>value[i];
    for(i=1; i<=m; i++)
    {
        cin>>a>>b;
        adjlist[a].push_back(b);
        adjlist[b].push_back(a);
    }
   long long mx=-1;
   long long mx1=-1;
    for(i=1; i<=n; i++)
    {
        map<long long,long long>mp;
        mx=value[i];
        mx1=-1;
       //cout<<i<<endl;
        for(j=0; j<adjlist[i].size(); j++)
        {
            int v=adjlist[i][j];
          //  cout<<" "<< v<<" ";

            mx1=max(mx1,value[v]);
            mp[v]=1;
        }
      //  cout<<endl;
        if(mx1<mx)
            cnt++;
    }
    cout<<cnt<<endl;
    return 0;
}


Measured memory_bytes: 12772
package main

import (
	"fmt"
	"unicode/utf8"
)

func main() {
	var a, b string
	fmt.Scan(&a)
	fmt.Scan(&b)

	S := spritString(a)
	T := spritString(b)

	res := 0
	for i, s := range S {
		if s == T[i] {
			res++
		}
	}
	fmt.Println(res)
}

func spritString(input string) (res []string) {
	for i := 0; i < utf8.RuneCountInString(input); i++ {
		res = append(res, input[i:i+1])
	}
	return
}


Measured memory_bytes: 512
h = input()
S = list(h)

atc = ['A', 'T', 'C', 'G']

flag = False
count = 0
maxt = 0
for i in range(len(S)):
    for s in range(len(S)):
        s = s + i
        if len(S) <= s:
            if maxt <= count:
                maxt = count
            break
        if flag == False and (S[s] in atc):
            flag = True
            count += 1
        elif flag == True and (S[s] in atc):
            count += 1
        elif flag == True:
            break
        if maxt < count:
            maxt = count
    count = 0
    flag = False
print(maxt)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007

map<ll,ll>a;
int main() {
	ll n,k;
	cin>>n>>k;
	for(ll i=0;i<n;i++){
		ll x;
		cin>>x;
		a[x]++;
	}
	vector<ll>b;
	for(auto itr=a.begin();itr!=a.end();itr++){
		ll now=itr->second;
		b.push_back(now);
	}
	sort(b.begin(),b.end());
	ll ans=0;
	for(ll i=0;i+k<b.size();i++){
		ans+=b[i];
	}
	cout <<ans;
	// your code goes here
	return 0;
}

Measured memory_bytes: 14964
#include<bits/stdc++.h>
using namespace std;
template<class S, class T> inline S min_L(S a,T b){
  return a<=b?a:b;
}
inline void rd(int &x){
  int k, m=0;
  x=0;
  for(;;){
    k = getchar_unlocked();
    if(k=='-'){
      m=1;
      break;
    }
    if('0'<=k&&k<='9'){
      x=k-'0';
      break;
    }
  }
  for(;;){
    k = getchar_unlocked();
    if(k<'0'||k>'9'){
      break;
    }
    x=x*10+k-'0';
  }
  if(m){
    x=-x;
  }
}
inline void wt_L(char a){
  putchar_unlocked(a);
}
inline void wt_L(long long x){
  char f[20];
  int m=0, s=0;
  if(x<0){
    m=1;
    x=-x;
  }
  while(x){
    f[s++]=x%10;
    x/=10;
  }
  if(!s){
    f[s++]=0;
  }
  if(m){
    putchar_unlocked('-');
  }
  while(s--){
    putchar_unlocked(f[s]+'0');
  }
}
int N;
int A[100001];
int B[100000];
int main(){
  int i, m;
  long long res=0;
  rd(N);
  {
    int Lj4PdHRW;
    for(Lj4PdHRW=0;Lj4PdHRW<N+1;Lj4PdHRW++){
      rd(A[Lj4PdHRW]);
    }
  }
  {
    int KL2GvlyY;
    for(KL2GvlyY=0;KL2GvlyY<N;KL2GvlyY++){
      rd(B[KL2GvlyY]);
    }
  }
  for(i=0;i<N;i++){
    m =min_L(B[i], A[i]);
    res += m;
    B[i] -= m;
    m =min_L(B[i], A[i+1]);
    res += m;
    A[i+1] -= m;
  }
  wt_L(res);
  wt_L('\n');
  return 0;
}
// cLay varsion 20190721-1

// --- original code ---
// int N, A[100001], B[100000];
// {
//   int i, m;
//   ll res = 0;
// 
//   rd(N,A(N+1),B(N));
// 
//   rep(i,N){
//     m = min(B[i], A[i]);
//     res += m;
//     B[i] -= m;
//     m = min(B[i], A[i+1]);
//     res += m;
//     A[i+1] -= m;
//   }
// 
//   wt(res);
// }


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

#define REP(i,num) for(int i=0;i<(num);++i)
#define LOOP(i) while(i--)
#define ALL(c) c.begin(),c.end()
#define PRINTALL(c) for(auto& x:c){cout<<x<<' ';}cout<<endl;
#define PAIRCOMP(c,comp) [](const pair<ll,ll>& lhs,const pair<ll,ll>& rhs){return lhs.c comp rhs.c;}

using namespace std;
using ll = long long;

constexpr ll atcoder_mod = 1e9+7;

template<typename T=int>
T in(){T x; cin >> x; return (x);}
template<typename T=int,typename C=vector<T>>
C vecin(int N){C x(N);REP(i,N){x[i]=in<T>();}return move(x);}

void vout(){cout << endl;}
template<typename Head,typename... Tail>
void vout(Head&& h,Tail&&... t){cout << ' ' << h;vout(forward<Tail>(t)...);}
void out(){cout << endl;}
template<typename Head,typename... Tail>
void out(Head&& h,Tail&&... t){cout << h;vout(forward<Tail>(t)...);}

class RootedNode{
public:
	vector<ll> parent;
	ll depth,dist;
	RootedNode():depth(0),dist(0){}
};

class ConnectNodeInfo{
	vector<vector<pair<ll,ll>>> graph;
public:
	ConnectNodeInfo(int node_num){
		graph.resize(node_num);
	}
	void AddNonDirectionalConnection(ll u,ll v,ll w){
		graph[u].emplace_back(v,w);
		graph[v].emplace_back(u,w);
	}
	void AddDirectionalConnection(ll u,ll v,ll w){
		graph[u].emplace_back(v,w);
	}
	vector<pair<ll,ll>>& operator[](ll index){
		return graph[index];
	}
	size_t size(){return graph.size();}
};

class RootedTree{
	int parent_size;

	void DFS(ConnectNodeInfo& connection,ll child,ll parent,ll dep,ll dist){
		node[child].parent[0] = parent;
		node[child].depth = dep;
		node[child].dist = dist;

		for(int i = 0;i < connection[child].size();i++){
			if(connection[child][i].first != parent){
				DFS(connection,connection[child][i].first,child,dep+1,dist+connection[child][i].second);
			}
		}
	}
public:
	vector<RootedNode> node;

	RootedTree(ConnectNodeInfo& connection){
		auto connection_size = connection.size();
		parent_size = 1;
		while((1LL<<parent_size)<connection_size) parent_size++;

		node.resize(connection_size);
		for(auto& x:node) x.parent.resize(parent_size);
		DFS(connection,0,-1,0,0);
		for(int k=0;k<parent_size-1;k++){
			for(int v=0,ev=connection_size;v<ev;v++){
				if(node[v].parent[k] < 0) node[v].parent[k+1] = -1;
				else node[v].parent[k+1] = node[node[v].parent[k]].parent[k];
			}
		}
	}
	ll FindLCA(ll u,ll v){
		if(node[u].depth > node[v].depth) swap(u,v);
		for(int k=0;k<parent_size;k++){
			if((node[v].depth - node[u].depth) & (1LL<<k)){
				v = node[v].parent[k];
			}
		}
		if(u==v) return u;
		for(int k=parent_size-1;k>=0;k--){
			if(node[u].parent[k] != node[v].parent[k]){
				u = node[u].parent[k];
				v = node[v].parent[k];
			}
		}
		return node[u].parent[0];
	}
};

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

	int N=in();
	ConnectNodeInfo connect(N);
	REP(i,N){
		int k=in();
		LOOP(k){
			int j=in();
			connect.AddNonDirectionalConnection(i,j,1);
		}
	}
	RootedTree tree(connect);
	int Q=in();
	LOOP(Q){
		int u=in(),v=in();
		out(tree.FindLCA(u,v));
	}

	return 0;
}


Measured memory_bytes: 32256
#include <iostream>
#define int unsigned long long 

using namespace std;

int n;
int res = 1LL;

int gcd(int a, int b)
{
        int r;
        while (b)
        {
                r = a%b;
                a = b;
                b = r;
        }
        return a;
}

int lcm(int a, int b)
{
        int g = gcd(a, b);
        return (a/g)*b;
}

int32_t main()
{
        cin >> n;
        for (int i=1; i<=n; i++)
        {
                int x; cin >> x;
                res = lcm(res, x);
        }
        cout << res;
        return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <utility>
#include <functional>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_map>
#include <iomanip>
#include <numeric>
#include <complex>
#include <cassert>
#include <climits>

using namespace std;
using ll = long long;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
const int INF = (1<<30);
const ll INFL = (1LL<<62);
const ll MOD = 1000000007;
template<class T> bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
template<class T> T lcm(T a, T b) { return a / gcd(a, b) * b; }
template<class T> ll mod_pow(ll a, ll n, T mod) { mod=(ll)mod; ll res=1, p=a%mod; while(n){ if(n&1) res=res*p%mod; p=p*p%mod; n>>=1; } return res; }
void print() { std::cout << std::endl; }
template <typename T, typename... A> void print(const T& first, const A&... rest) { cout << sizeof...(rest) << endl; std::cout << first; if (sizeof...(rest)) std::cout << " "; print(rest...); }
template <typename... A> void print(const A&... rest) { print(rest...); }
template <typename A> void print(const std::vector<A>& v) { std::for_each(v.begin(), v.end(), [](A x) { std::cout << x << " "; }); std::cout << std::endl; }

vector<vector<int>> to(200005);
vector<int> ans;
void dfs(int v, int p = -1){
    for(int u : to[v]){
        if(u == p) continue;
        ans[u] += ans[v];
        dfs(u, v);
    }
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, q;
    scanf("%d %d", &n, &q);
    rep(i, n-1){
        int a, b;
        scanf("%d %d", &a, &b);
        --a; --b;
        to[a].push_back(b);
        to[b].push_back(a);
    }
    ans.resize(n);
    rep(i, q){
        int p, x;
        scanf("%d %d", &p, &x);
        --p;
        ans[p] += x;
    }
    dfs(0);
    rep(i, n){
        printf("%d\n", ans[i]);
    }
    return 0;
}

Measured memory_bytes: 23552
#include<bits/stdc++.h>
using namespace std;
#define f(i,a,b) for(int i=a;i<b;i++)
#define vi vector<int>
#define vii vector<ll>
#define all(x) x.begin(),x.end()
#define mod 1000000007
#define pb push_back
#define ii pair<int,int>
#define iii pair<ll,ll>
#define MAX 10000000000000
#define pi 3.1415926535
typedef long long ll;
int main() 
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);
    int n; cin>>n;
    vector<vector<double> > dp(n+1, vector<double>(n+1,0.0));
    vector<double> p(n+1);
    f(i,1,n+1) cin>>p[i];

    dp[0][0] = 0.0;
    dp[1][0] = 1-p[1];
    dp[1][1] = p[1];

    for(int i=2; i<=n; i++) {
        for(int j=0; j<=i; j++) {
            if(!j)
                dp[i][j] = dp[i-1][j]*(1-p[i]);
            dp[i][j] = (double)dp[i-1][j-1]*(double)p[i] + (double)dp[i-1][j]*(double)(1-p[i]);
        }
    }
    double ans = 0.0;
    for(int i=n/2+1;i<=n;i++) {
        ans += (double)dp[n][i];
    }
    printf("%.10f\n",ans);
    return 0;
}


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

int main() {
	// your code goes here
	int n,p;
	cin>>n>>p; bool res=false;
	for(int i=0;i<n+1;i++)
	 if((i*2+(n-i)*4)==p) res = true;
   (res) ? cout<<"Yes" : cout<<"No";	 
	return 0;
}

Measured memory_bytes: 3628
#!/usr/bin/env python3
import sys
import math

YES = "Yes"  # type: str
NO = "No"  # type: str


def solve(A: int, B: int, C: int, D: int):
    t = math.ceil(C / B)
    h = math.ceil(A / D)
    if t<=h:
        print(YES)
    else:
        print(NO)

    return


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    A = int(next(tokens))  # type: int
    B = int(next(tokens))  # type: int
    C = int(next(tokens))  # type: int
    D = int(next(tokens))  # type: int
    solve(A, B, C, D)

if __name__ == '__main__':
    main()


Measured memory_bytes: 9212
#include <iostream>
#include <string>
#include <algorithm>
#include <map>
#include <vector>

using namespace std;

int main()
{   
    int a, b, c;
    cin >> a >> b >> c;
    int A = a + b;
    int B = a + c;
    int C = b + c;
    int ans = min({A, B, C});
    cout << ans << endl;
}

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

int main() {
	ios_base::sync_with_stdio(0); cin.tie(0);
	
	int x,n; cin >> x >> n;
	int a[202]; for(int i=0;i<202;i++) a[i]=0;
	for(int i=0;i<n;i++){
		int j; cin >> j;
		a[j]=1;
	}
	for(int i=0;i<=x;i++){
		if(a[x-i]==0){
			cout << x-i << endl;
			return 0;
		} else if(a[x+i]==0){
			cout << x+i << endl;
			return 0;
		}
	}
}


Measured memory_bytes: 3688
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int x=sc.nextInt();
		int n=sc.nextInt();
		int hako[] = new int[102];
		for(int i=0;i<102;i++) {
			hako[i]=0;
		}
		for(int i=0;i<n;i++) {
			int a = sc.nextInt();
			hako[a] = 1;
		}
		
		if(hako[x]==0) {
			System.out.println(x);
			return;
		}
		int up=x+1;
		int down=x-1;
		
		while(up<=101 && down>=0) {
			if(hako[down] == 0) {
				System.out.println(down);
				return;
			}
			if(hako[up] == 0) {
				System.out.println(up);
				return;
			}
			up++;
			down--;
		}
		while(up==102) {
			if(hako[down] == 0) {
				System.out.println(down);
				return;
			}
			down--;
		}
		while(down==-1) {
			if(hako[up] == 0) {
				System.out.println(up);
				return;
			}
			up++;
		}
		
		
	}
}


Measured memory_bytes: 35688
<?php
// 標準入力から取得
class Scanner {
    private $arr = [];
    private $count = 0;
    private $pointer = 0;
    public function next() {
        if($this->pointer >= $this->count) {
            $str = trim(fgets(STDIN));
            $this->arr = explode(' ', $str);
            $this->count = count($this->arr);
            $this->pointer = 0;
        }
        $result = $this->arr[$this->pointer];
        $this->pointer++;
        return $result;
    }
    public function hasNext() {
        return $this->pointer < $this->count;
    }
    public function nextInt() {
        return (int)$this->next();
    }
    public function nextDouble() {
        return (double)$this->next();
    }
}
 
class SubmitAnswer {
    public static function println($answer = "") {
        echo $answer . PHP_EOL;
    }
}
 
$sc = new Scanner();
$n = $sc->nextInt();

for ($i=0;$i<$n;$i++) {
    $songs[$sc->next()] = $sc->nextInt();
}

// 探すべきタイトル
$title = $sc->next();
$answer = 0;
$isTitle = false;

foreach($songs as $key => $val){
    if($isTitle){
        $answer = $answer + $songs[$key];
    }
    if($key == $title){
        $isTitle = true;
    }
}
 
SubmitAnswer::println("$answer");

Measured memory_bytes: 3576
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Diagnostics.Contracts;
using System.Globalization;
using System.Linq;

namespace at_coder
{
#if TEST
    [TestClass]
#endif
    public class Test_169_c
    {

#if TEST
        public static void Test_Main()
#else
        public static void Main()
#endif
        {
            var data = ReadStringArray();
            var A = Decimal.Parse(data[0], CultureInfo.InvariantCulture);
            var B = Decimal.Parse(data[1], CultureInfo.InvariantCulture);
            var C = Math.Floor(A * B);
            Write($"{C}");
        }


        private static void Write(string s)
        {
            Console.WriteLine(s);
        }

        private static int[] ReadIntArray()
        {
            string[] ss = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
            int[] ar = new int[ss.Length];
            for (int i = 0; i < ss.Length; i++)
            {
                ar[i] = int.Parse(ss[i], CultureInfo.InvariantCulture);
            }
            return ar;
        }
        private static int ReadInt()
        {
            return int.Parse(Console.ReadLine(), CultureInfo.InvariantCulture);
        }
        private static void ReadInt(out int a, out int b)
        {
            var ar = ReadIntArray();
            a = ar[0];
            b = ar[1];
        }
        private static void ReadInt(out int a, out int b, out int c)
        {
            var ar = ReadIntArray();
            a = ar[0];
            b = ar[1];
            c = ar[2];
        }
        private static string ReadString()
        {
            return Console.ReadLine();
        }
        private static string[] ReadStringArray()
        {
            string[] ss = Console.ReadLine().Split(new char[] { ' ' }, StringSplitOptions.RemoveEmptyEntries);
            return ss;
        }
#if !TEST
    }
}
#endif


Measured memory_bytes: 27608
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>

#define F first
#define S second
#define vsort(v) sort((v).begin(), (v).end())
#define vrev(v) reverse((v).begin(), (v).end())

using namespace std;
using ll = long long;

bool check(string s, string t)
{
    for (int i = 0; i < s.length(); i++)
    {
        if (s[i] != t[i] && s[i] != '?')
        {
            return false;
        }
    }
    return true;
}

int main(int argc, const char *argv[])
{
    string s, t;
    cin >> s >> t;

    int idx = -1;
    for (int i = 0; i + t.length() <= s.length(); i++)
    {
        if (check(s.substr(i, t.length()), t))
        {
            idx = i;
        }
    }

    if (idx >= 0)
    {
        for (int i = 0; i < s.length(); i++)
        {
            if (i == idx)
            {
                for (int j = 0; j < t.length(); j++)
                {
                    s[i + j] = t[j];
                }
            }
            else if (s[i] == '?')
            {
                s[i] = 'a';
            }
        }
        cout << s << endl;
    }
    else
    {
        cout << "UNRESTORABLE" << endl;
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>//Carefully Crafted by hetp111
using namespace std;
#define int long long
#define double long double
#define all(v) (v).begin(),(v).end()
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int,int>
#define vii vector<pii>
#define MOD 1000000007
#define MOD2 998244353
#define MOD3 1000000009
#define PI acos(-1)
#define eps (1e-8)
#define INF (1e18)
#define FASTER ios_base::sync_with_stdio(0);cin.tie(0)
template<class A,class B>ostream&operator<<(ostream&out,const pair<A,B>&a){return out<<"("<<a.first<<","<<a.second<<")";}
template<class A>ostream&operator<<(ostream&out,const vector<A>&a){for(const A &it:a)out<<it<<" ";return out;}
template<class A,class B>istream&operator>>(istream&in,pair<A,B>&a){return in>>a.first>>a.second;}
template<class A>istream&operator>>(istream&in,vector<A>&a){for(A &i:a)in>>i;return in;}
//ifstream cinn("in.in");ofstream coutt("out.out");
int poww(const int &a,int b,const int &m=MOD){if(b==0)return 1;int x=poww(a,b/2,m);x=x*x%m;if(b&1)x=x*a%m;return x;}
int ceil(const int &a,const int &b){return (a+b-1)/b;}
////Read:
//Check corner cases, n==1;
//
////Some function:
//__builtin_popcountll(), is_sorted(),

signed main(){
    FASTER;
    int n;cin>>n;
    cout<<180*(n-2);
}

Measured memory_bytes: 3580
import java.util.*;
class Main {
	public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt(),k=sc.nextInt();
        int[]p = new int[n];
        for(int i = 0;i<n;i++) p[i] = sc.nextInt();
        Arrays.sort(p);
        int ans = 0;
        for(int i = 0;i<k;i++) ans += p[i];
        System.out.println(ans);
    }
}


Measured memory_bytes: 38412
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;
typedef long long LL;
typedef pair<int, int> PII;
typedef complex<double> P;
static const double EPS = 1e-8;

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n)
double dot(P a, P b) {
  return (a.real() * b.real() + a.imag() * b.imag());
}
double cross(P a, P b) {
  return (a.real() * b.imag() - a.imag() * b.real());
}
double distance_ls_p(P a, P b, P c) {
  if ( dot(b-a, c-a) < EPS ) return abs(c-a);
  if ( dot(a-b, c-b) < EPS ) return abs(c-b);
  return abs(cross(b-a, c-a)) / abs(b-a);
}

int main(void){
  int n,m;
  while(cin>>n){
    if(n==0) break;
    vector<P> wall;
    vector<double> wall2;
    REP(i,n){
      double x,y,r;
      cin>>x>>y>>r;
      wall.push_back(P(x,y));
      wall2.push_back(r);
    }
    cin>>m;
    while(m--){
      double x1,y1,x2,y2;
      P p1,p2;
      cin>>x1>>y1>>x2>>y2;
      p1 = P(x1,y1);
      p2 = P(x2,y2);
      bool unsame = false;
      REP(i,n){
        if(abs(p1-wall[i])<wall2[i]+EPS||abs(p2-wall[i])<wall2[i]+EPS){
          if(!(abs(p1-wall[i])<wall2[i]+EPS&&abs(p2-wall[i])<wall2[i]+EPS)){
            unsame = true;
            break;
          }
        }
      }
      if(unsame){
        cout<<"Safe"<<endl;
      }else{
        bool cross = false;
        REP(i,n){
          if(distance_ls_p(p1,p2,wall[i])<wall2[i]+EPS&&abs(p1-wall[i])>wall2[i]){
            cross = true;
            break;
          }
        }
        if(cross){
          cout<<"Safe"<<endl;
        }else{
          cout<<"Danger"<<endl;
        }
      }
    }
  }
  return 0;
}

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

#define vec              vector<int>
#define vecll            vector<ll>
#define vecd             vector<double>
#define vecst            vector<string>
#define vecb             vector<bool>
#define v2(v,n,m,init)   vector<vector<int>>  v(n, vector<int>(m, init))
#define vb2(v,n,m,init)  vector<vector<bool>> v(n, vector<bool>(m, init))
#define vll2(v,n,m,init) vector<vector<ll>>   v(n, vector<ll>(m, init))

#define rep(i,n)         for(ll i=(ll)0; i<(ll)n; i++)
#define REP(i,m,n)       for(ll i=(ll)m; i<(ll)n; i++)
#define arr(var, n)      vec var(n); rep(i,n){cin >> var[i];}
#define arrll(var, n)    vecll var(n); rep(i,n){cin >> var[i];}
#define arrst(var, n)    vecst var(n); rep(i,n){cin >> var[i];}
#define all(var)         (var).begin(), (var).end()
#define sortall(var)     sort(all(var))
#define uniqueall(v)     v.erase(unique(v.begin(), v.end()), v.end());
#define pb(var)          push_back(var)
#define prt(var)         cout << (var) << "\n"
#define prtd(n, var)     cout << fixed << setprecision(n) << (var) << "\n"
#define prtfill(n, var)  cout << setw(n) << setfill('0') << (var);
#define prt2(v1, v2)     cout << (v1) << " " << (v2) << "\n"
#define prt3(v1, v2, v3) cout << (v1) << " " << (v2) << " " << (v3) << "\n"
#define prtall(v)        rep(i,v.size()){cout<<v[i]<<(i!=v.size()-1?" ":"\n");}
template <typename T>
bool chmax(T &a, const T& b){if(a<b){a=b; return true;} return false;}
template <typename T>
bool chmin(T &a, const T& b){if(a>b){a=b; return true;} return false;}
//----------------------------------------------------------------

int main(void) {
  int n, k;
  cin >> n >> k;
  int ans=0;
  while(n>0){
    n/=k;
    ans++;
  }
  prt(ans);
}


Measured memory_bytes: 3600
#include<bits/stdc++.h>
using namespace std;
int n;
int a[2333];
//long long ans;
//bool KT(int x,int y,int z)
//{
//	if(x+y>z&&x+z>y&&y+z>x)
//	return 1;
//	else
//	return 0;
//}
int main() 
{
	cin>>n;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
	}
	sort(a+1,a+1+n);
	int ans=0;
	for(int i=1;i<=n;i++)
	{
		for(int j=i+1;j<=n;j++)
		{
			for(int k=j+1;k<=n;k++)
			{
//				if(i!=j&&j!=k&&KT(a[i],a[j],a[k]))
				if(a[i]+a[j]>a[k]&&a[j]+a[k]>a[i])
				ans++;
				if(a[i]+a[j]<=a[k])
				break;
			}
		}
	}
	cout<<ans;
    return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<string.h>
 
typedef long long int ll;
#define all(x) (x).begin(), (x).end()
 
using namespace std;

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

ll nxtl(){
    ll x;
    cin>>x;
    return x;
}
 
void SieveOfEratosthenes(int n,vector <int> &primes) 
{ 
    // Create a boolean array "prime[0..n]" and initialize 
    // all entries it as true. A value in prime[i] will 
    // finally be false if i is Not a prime, else true. 
    bool prime[n+1]; 
    memset(prime, true, sizeof(prime)); 
  
    for (int p=2; p*p<=n; p++) 
    { 
        // If prime[p] is not changed, then it is a prime 
        if (prime[p] == true) 
        { 
            // Update all multiples of p greater than or  
            // equal to the square of it 
            // numbers which are multiple of p and are 
            // less than p^2 are already been marked.  
            for (int i=p*p; i<=n; i += p) 
                prime[i] = false; 
        } 
    } 
  
    // Print all prime numbers 
    for (int p=2; p<=n; p++) 
       if (prime[p]) 
          primes.push_back(p);
} 
 
ll max(ll a,ll b)
{
    if(a>b)
        return a;
    return b;
}
 
ll power(ll x, ll y,ll mod) 
{ 
    ll temp; 
    if( y == 0) 
        return 1; 
    temp = power(x, y/2,mod); 
    if (y%2 == 0) 
        return (temp*temp)%mod; 
    else
        return (((x*temp)%mod)*temp)%mod; 
}
int count(string &s,string &t,int in,int l,int r,int max);

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s,t;
    cin>>s>>t;
    int n=s.length();
    int m=t.length();

    map <char,set <int> > m2;
    set <int> temp;
    for(int i=0;i<n;i++){
        if(m2.find(s[i])==m2.end())
            m2[s[i]]=temp;
        m2[s[i]].insert(i);
    }

    for(int i=0;i<m;i++)
        if(!m2.count(t[i]))
        {
            cout<<"-1\n";
            return 0;
        }
    
    int test=0;
    int i=0;
    //vector <int> count,count2;
    //count.resize(26,1);
    //count2.resize(26,1);
    int p;
    while(i<m)
    {
        test++;
        int prev=*(m2[t[i]].begin());
        p=prev;
        while(i+1<m&&m2[t[i+1]].upper_bound(prev)!=m2[t[i+1]].end()){
            prev=*(m2[t[i+1]].upper_bound(prev));
            i++;
            p=prev;
        }
        i++;

    }
    ll ans=test-1;
    ans*=n;
    ans+=p+1;
    cout<<ans<<endl;
    //cout<<n<<" "<<m<<" "<<test<<endl;

    

    
    
    return 0;   
}



 
 


Measured memory_bytes: 5200
def calc_gcd(m, n)
  while true do
    tmp = n
    n = m % n
    m = tmp

    return m if n == 0
  end
end

def calc_gcm(m, n, gcd)
  m * n / gcd
end

while line = gets do
  a, b = line.chop.split(/\s+/).map { |s| s.to_i }
  gcd = calc_gcd(a, b)
  gcm = calc_gcm(a, b, gcd)

  puts("#{gcd} #{gcm}")
end



Measured memory_bytes: 6840
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0;i < n;i++)
#define rev(i, n) for(int i = n;i >= 0;i--)
#define Rep(i, m, n) for(int i = m;i < n;i++)
#define repeatrev(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define INF 999999999
#define itn int
const int MAX = 510000;


using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;
typedef priority_queue<int> Pr;

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

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    ll a[n + 1];
    rep(i, n + 1) cin >> a[i];
    ll b[n];
    rep(i, n) cin >> b[i];
    ll ans = 0;
    rep(i, n){
        if(a[i] >= b[i]){
            ans += b[i];
            a[i] -= b[i];
        }else{
            ans += a[i];
            b[i] -= a[i];
            a[i] = 0;
            ll min_1 = min(a[i + 1], b[i]);
            a[i + 1] -= min_1;
            ans += min_1;
        }
        //cout << min(a[i + 1], b[i]) << endl;
    }
    cout << ans << endl;

}

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

#define M_PI       3.14159265358979323846   // pi

using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> t3;

#define rep(a,n) for(ll a = 0;a < n;a++)

static const ll INF = 1e15;
static const ll mod = 1e9+7;

template<typename T>
static inline void chmin(T& ref, const T  value) {
    if (ref > value) ref = value;
}

template<typename T>
static inline void chmax(T& ref, const T value) {
    if (ref < value) ref = value;
}

struct MaxFlowCalculator {
	int max_flow(int s, int t, const vector<vector<pair<int, int>>>& g) {
		struct edge_ { int to, cap, rev; };
		vector<bool> used(g.size(), false);
		vector<vector<edge_>> G(g.size());
		for (int i = 0; i < g.size(); i++) for (int j = 0; j < g[i].size(); j++)
		{
			int from = i, to = g[i][j].second;
			int cap = g[i][j].first;
			G[from].push_back({ to, cap, (int)G[to].size() });
			G[to].push_back({ from, 0, (int)G[from].size() - 1 });
		}
		auto dfs = [&](auto&& f, int v, int t, int fl)->int {
			if (v == t) return fl;
			used[v] = true;
			rep(i, G[v].size()) {
				edge_& e = G[v][i];
					if (!used[e.to] && e.cap > 0) {
					int d = f(f, e.to, t, min(fl, e.cap));
					if (d > 0) {
						e.cap -= d;
						G[e.to][e.rev].cap += d;
						return d;
					}
				}
			}
			return 0;
		};
		int flow = 0;
		while (1) {
			used.assign(used.size(), false);
			int f = dfs(dfs, s, t, INT_MAX);
			if (f == 0) return flow;
			flow += f;
		}
	}
};

int main() {
	ll n, m;
	cin >> n >> m;
	vector<bool> hole(n + 1, false);
	rep(i, m) {
		int id;
		cin >> id;
		hole[id] = true;
	}
	vector<ll> dp(n + 1, 0);
	dp[0] = 1;
	for (int i = 0; i < n; i++) {
		if (!hole[i + 1]) {
			dp[i + 1] += dp[i];
			dp[i + 1] %= mod;
		}
		if (i + 2 <= n && !hole[i + 2]) {
			dp[i + 2] += dp[i];
			dp[i + 2] %= mod;
		}
	}
	cout << dp[n] << endl;
    return 0;
}


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

using namespace std;

int n;
vector<int> a;
vector<int> sol;

int main() {
    scanf("%d", &n);
    for (int i = 0; i < n; i++) {
        int x;
        scanf("%d", &x);
        a.push_back(x);
    }

    for (int i = 0; i < n; i++) {
        int ind = -1;
        for (int j = 0; j < a.size(); j++)
            if (a[j] == j + 1) ind = j;

        if (ind == -1) {
            printf("-1\n");
            return 0;
        } else {
            sol.push_back(ind + 1);
            a.erase(a.begin() + ind);
        }
    }
    reverse(sol.begin(), sol.end());
    for (int i = 0; i < n; i++)
        printf("%d\n", sol[i]);
    return 0;
}


Measured memory_bytes: 256
/*
	* ernestvw
	* C++
	* April 2020
	* ABC164/A
*/

#include <bits/stdc++.h>
using namespace std;

#define int long long

#define x first
#define y second
#define pb push_back
#define pii pair<int, int>
#define veci vector<int>
#define vecs vector<string>
#define amax(x, v) x = max(x, (v))
#define amin(x, v) x = min(x, (v))
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define sz(v) (int)(v.size())
#define FOR(i, n) for(int i = 0; i < (n); ++i)
#define nl '\n'

using ll = long long;
using ld = long double;
template <class T>
using PQ = priority_queue<T, vector<T>, greater<T>>;

const int oo = 1e9; // INT_MAX
const int OO = 1e18; // LLONG_MAX
const double eps = 1e-9;

#define TEST_CASES 0

void solve(int test_case);

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

	int T = 1;
	if(TEST_CASES) cin >> T;
	for(int t = 1; t <= T; t++)
		solve(t);

	return 0;
}

// ---------------------------------------------------

void solve(int test_case) {
	int s, w;
	cin >> s >> w;
	if(w>=s)cout<<"unsafe"<<endl;
	else cout<<"safe"<<endl;
}



















































Measured memory_bytes: 3640
//verma_ankit484

#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>

#define int long long
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define pb push_back
const int mod = (int) 1e9+7;

using namespace std;
//using namespace __gnu_pbds;

//#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>


int32_t main() {
  IOS
  #ifdef AV
  freopen("input.txt", "r", stdin);
  #endif
  int a, b;
  cin >> a >> b;
  cout << a * b << endl;
  return 0;
}


Measured memory_bytes: 3688
#include<bits/stdc++.h>
using namespace std;
main()
{

int n;
cin>>n;
int a[n+1];
a[0]=0;
for(int i=2;i<=n;i++)
     cin>>a[i];
int ans[n+1];
unordered_map<int,int> m;
for(int i=n;i>=1;i--)
{
    ans[i]=m[i];
   m[a[i]]++;
}
for(int i=1;i<=n;i++)
    cout<<ans[i]<<endl;
}



Measured memory_bytes: 13052
#include <iostream>
#include <iomanip>
#include <cassert>
#include <algorithm>
#include <functional>
#include <vector>
#include <string>
#include <cstring>
#include <stack>
#include <queue>
#include <map>
#include <bitset>
#include <sstream>
#include <istream>
#include <cmath>
#include <cstdio>

using namespace std;

#define vci vector<int>
#define vcs vector<string>
#define pb push_back
#define sz size()
#define mapii map<int, int>
#define mapci map<char, int>
#define mapsi map<string, int>
#define all(x) x.begin(), x.end()
#define minit(a, i) memset(a, i, sizeof(a));

#define for_(i, a, b) for (int i=(int)a; i<(int)b; i++)
#define for_d(i, a, b) for (int i=(int)a-1; i>=b; i--)
#define for_r(i, a, b, c) for (int i=(int)a; i<(int)b; i += c)
#define for_dr(i, a, b, c) for (int i=(int)a-1; i>=b; i -= c)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)

typedef long long ll;

const int iINF = 2147483647;
const ll lINF = 9223372036854775807;

template <class T> inline void dbg(T t) { cout << t << endl; }


int main() {
	vcs let(1010); mapsi freq;
	int i = 0;
	while (cin>>let[i]) { freq[let[i]]++; i++; }
	
	string ret1 = "", ret2 = "";
	int mf = 0, ml = 0;
	FOR(it, freq) {
		if (mf < (*it).second) {
			mf = (*it).second; ret1 = (*it).first;
		}
		if (ml < (*it).first.sz) {
			ml = (*it).first.sz; ret2 = (*it).first;
		}
	}
	cout << ret1 << " " << ret2 << endl;

	
	return 0;
}

Measured memory_bytes: 1208
#include<stdio.h>
#include<math.h>
#include<string.h>
int main(){
    int a,b,c,i,j,arr[3],temp,sum=0;
    scanf("%d %d %d",&arr[0],&arr[1],&arr[2]);
    for(i=0;i<2;i++){
        for(j=i+1;j<3;j++){
            if(arr[i]>arr[j]){
               temp=arr[i];
               arr[i]=arr[j];
               arr[j]=temp;
            }
        }
    }
    for(i=0;i<2;i++){
        sum+=arr[i+1]-arr[i];
    }
    printf("%d\n",sum);
    return 0;
}


Measured memory_bytes: 128
import sys
df = list(map(int, list(str(input()))))
counter = 0
for i in range(2**3):
    bin_i = format(i, '03b')
    counter += df[0]
    for j in range(3):
        if bin_i[j] == '1':
            counter -= df[j+1]
        else:
            counter += df[j+1]
    if counter == 7:
        result = str(df[0])
        for j in range(3):
            if bin_i[j] =='0':
                result += '+' + str(df[j+1])
            else:
                result += '-' + str(df[j+1])
        result += '=7'
        print(result)
        sys.exit()
    else:
        counter = 0

Measured memory_bytes: 3188
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int x,i,r;
	cin>>x;
	if(x>=500&&(x%500==0))
	{
		cout<<((x/500)*1000);
	}
	else
	{
		i=((x/500)*1000);
		r=x%500;
		cout<<i+((r/5)*5);
	}
	return 0;
}
    

Measured memory_bytes: 256
/*
ID:xmydada1
LANG:C++
TASK:
*/
#include<bits/stdc++.h>
#define reg register

using namespace std;

const long long mod=1e9+7;

long long m,n,ans=0,sum=0,p,a[2001],b[2001],dp[2001][2001];

inline long long read() {
reg long long s = 0, t = 0; reg char ch = getchar();
while(ch > '9' || ch < '0') t |= ch == '-', ch = getchar();
while(ch >= '0' && ch <= '9') s = (s << 1) + (s << 3) + (ch ^ 48), ch = getchar();
return t ? -s : s;
}


int main()
{
//	freopen(".in","r",stdin);
//	freopen(".out","w",stdout);
	n=read();m=read();
	for(long long i=1;i<=n;i++)a[i]=read();
	for(long long j=1;j<=m;j++)b[j]=read();
	for(long long i=1;i<=max(n,m);i++)dp[i][0]=1,dp[0][i]=1;
	dp[0][0]=1;
	for(long long i=1;i<=n;i++)
		for(long long j=1;j<=m;j++ )
		{
			dp[i][j]=(dp[i-1][j]+dp[i][j-1]-dp[i-1][j-1]+mod)%mod;
			if(a[i]==b[j])
			{
				dp[i][j]=(dp[i][j]+dp[i-1][j-1])%mod;
			}
		}
	cout<<dp[n][m];

return 0;
}



Measured memory_bytes: 31616
#include<iostream>
#include<stdio.h>
#include<string.h>
#include<algorithm>
#include<math.h>
#include<vector>
#include<set>
using namespace std;
int main()
{
    int a,b;
    cin>>a>>b;
    cout<<(a+b)%24;
    return 0;
}

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

using namespace std;
typedef long long ll;

bool comp(pair<int, pair<int, ll> > p1, pair<int, pair<int, ll> > p2){
    if (p1.second.first == p2.second.first) return p1.second.second < p2.second.second;
    else return p1.second.first < p2.second.first;
}

bool disp_comp(pair<int, string> p1, pair<int, string> p2){
    return p1.first < p2.first;
}

string convert(int a){
    string s1 = to_string(a);
    if (s1.size() == 6) return s1;
    else{
        while (1){
            if (s1.size() == 6) break;
            s1 = "0" + s1;
        }
    }
    return s1;
}

string make_number(int p, int index){
    string s1 = convert(p);
    string s2 = convert(index);

    return s1 + s2;
}

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

    vector<pair<int, pair<int, ll> > > vec(m, make_pair(0, make_pair(0, 0)));
    for (int i = 0; i < m; i++){
        int p = 0;
        ll y = 0;
        cin >> p >> y;
        pair<int, ll> tmp = make_pair(p, y);
        vec[i] = make_pair(i, tmp);
    }

    sort(vec.begin(), vec.end(), comp);

    vector<pair<int, string> > ans(m);
    int counter = 0;
    int previous_index = vec[0].second.first;

    for (int i = 0; i < vec.size(); i++){
        if (previous_index != vec[i].second.first){
            counter = 0;
            previous_index = vec[i].second.first;
        }
        string id = make_number(vec[i].second.first, counter + 1);
        ans[i] = make_pair(vec[i].first, id);
        counter++;
    }
    
    sort(ans.begin(), ans.end(), disp_comp);

    for (int i = 0; i < ans.size(); i++){
        cout << ans[i].second << endl;
    }

    return 0;
}

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

int n;
ll a[200200];
ll sum = 0;
int l = 0, r = 1;
ll val[400400];

int main(){
	scanf("%d", &n);
	rep(i, n) scanf("%lld", &a[i]);
	sort(a, a+n);
	reverse(a, a+n);
	rep(i, n){
		sum += val[l];
		l++;
		val[r++] = a[i];
		if(i) val[r++] = a[i];
	} 
	cout << sum << endl;
	return 0;
} 

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

// typedef
//------------------------------------------
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef vector<PII> VP;

// rep
//------------------------------------------
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) (x).begin(), (x).end()
#define DEBUG(x) cerr << #x << ": " << x << '\n'

int n;
string s;
set<string> dict; 

VI left_num(30001), right_num(30001);

signed main()
{
    cin >> n;
    cin >> s;
    left_num.resize(n);
    right_num.resize(n);

    // 中央より右側と左側でどの数字が存在するのかを管理するbitを初期化する．
    for (int i = 1; i < n - 1; i++ ){
        left_num[i] = left_num[i-1] | (1 << (s[i-1] - '0'));
        // cout << bitset<8>(left_num[i]) << endl;
    }
    
    for (int i = n-2; i > 0; i--){
        right_num[i] = right_num[i+1] | (1 << (s[i+1] - '0'));
        // cout << bitset<8>(right_num[i]) << endl;
    }

    for (int i = 1; i < n-1; i++){
        for (int digit_l = 0; digit_l < 10; digit_l++){
            if (!(left_num[i] & (1<<digit_l))) continue; 
            for (int digit_r = 0; digit_r < 10; digit_r++){
                if (!(right_num[i] & (1<<digit_r))) continue; 
                auto r = dict.insert(to_string(digit_l) + s[i] + to_string(digit_r));
                // cout << to_string(digit_l) + s[i] + to_string(digit_r) << "; \t" << r.second << endl;
            }
        }
    }

    // for(auto itr = dict.begin(); itr != dict.end(); ++itr) {
    //     cout << *itr << endl;      // イテレータの指す先のデータを表示
    // }
    cout << dict.size() << endl;

    return 0;
}

Measured memory_bytes: 896
N = int(input())
A = list(map(int,input().split()))

A.sort(reverse = True)
ans = 0

from collections import deque
tmp = deque([A[0]])

for x in A[1:]:
    ans += tmp.popleft()
    tmp.append(x)
    tmp.append(x)
    
print(ans)
    

Measured memory_bytes: 31440
#include <bits/stdc++.h>
using namespace std;
int main(){
  int a, b, c, x, y;
  cin >> a >> b >> c >> x >> y;
  c *= 2;
  int ans = min(x,y)*min(a+b,c);
  if(x-y > 0) ans += min(a, c)*(x-y);
  if(y-x > 0) ans += min(b, c)*(y-x);
  cout << ans << endl;
}

Measured memory_bytes: 3604
#include <iostream>
#include <string>
#include <algorithm>
#include <math.h>
#include <vector>
#include <iomanip>
#include <map>

using namespace std;

#define fori(x) for (int i = 0; i < x; ++i)
#define forj(x) for (int j = 0; j < x; ++j)


int main() {
    string s;
    cin>>s;
    if(s=="ABC"){
        cout<<"ARC";
        return 0;
    }
    cout<<"ABC";
}

Measured memory_bytes: 3592
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii =  pair<int, int>;
using pll =  pair<long long, long long>;
constexpr char ln =  '\n';
constexpr long long MOD = 1000000007LL;
constexpr long long INF = 1000000009LL;
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

 
int main(){
    const double PI = acos(-1.0);
    double a, b, x;
    cin >> a >> b >> x;
    x /= a;
    cout << fixed << setprecision(10);
    if (x > a*b/2) cout << atan2((a*b-x)*2, a*a) * 180 / PI << endl;
    else cout << atan2(b*b, x*2) * 180 / PI << endl;
}

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

int main() {
    string s;
    cin >> s;
    int len = s.length();
    for (int i = 0; i < len; i++) {
        if (i % 2 == 0) {
            cout << s[i];
        }
    }
    cout << endl;
}

Measured memory_bytes: 512
/*
 *  AUTHOR : MANAV PATEl
*/
#include<bits/stdc++.h>
#include<functional>
//#include<boost/multiprecision/cpp_int.hpp>
//using namespace boost::multiprecision;
using namespace std;

namespace fastio {

	template <class T> istream &operator>>(istream &os, vector<T> & vec) {
		for (auto &u : vec)os >> u;
		return os;
	}
	template <class T> ostream &operator<<(ostream &os, const vector<T> & vec) {
		for (auto &u : vec)os << u << " ";
		return os;
	}
	template<class T1, class T2> inline istream& operator>>(istream& os, pair<T1, T2>& p) {
		return os >> p.first >> p.second;
	}
	template<class T1, class T2> ostream& operator<<(ostream& os, const pair<T1, T2>& p) {
		return os << p.first << " " << p.second;
	}
	template <class T> ostream &operator<<(ostream &os, set<T> & con) {
		for (auto &u : con) os << u << " ";
		return os;
	}
	void re() {}
	template <typename T, typename... args> void re(T& x, args&... tail) {
		cin >> x;
		re(tail...);
	}
	void pr() {}
	template <typename T> void pr(const T& x) {
		cout << x;
	}
	template <typename T, typename... args> void pr(const T& x, const args&... tail) {
		cout << x << " ";
		pr(tail...);
	}
	template <typename... args> void prln(const args&... tail) {
		pr(tail...);
		cout << "\n";
	}
}
using namespace fastio;

typedef long long int ll;
typedef long double ld;

const ll mod = 1e9+7;
const ll mod1 = 998244353;

#define fill(a)  memset(a, 0, sizeof(a))
#define fst first
#define snd second
#define mp make_pair
#define pb push_back

int main()
{
	cin.sync_with_stdio(false);
	cin.exceptions(cin.failbit);
	cin.tie(0);
	int n;
	re(n);
	string s;
	re(s);
	if(n&1)
	{
		return !printf("No");
	}
	for(int i = 0; i < n/2; i++)
	{
		if(s[i] != s[i + n/2])
		{
			prln("No");
			return 0;
		}
	}
	prln("Yes");
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
    #include <fstream>
     
    typedef long long int ll;
    using namespace std;
     
    int main()
    {
     
        //freopen("14","r",stdin);
        //freopen("sparse.out","w",stdout);
        char c[100001];
        scanf("%s",c);
        bool se[26];
        int len = strlen(c);
        for(int i=0;i<26;i++)se[i]=false;
        for(int i=0;i<len;i++)se[c[i]-'a']=true;
        for(int i=0;i<26;i++){
            if(!se[i]){
                    printf("%c",i+'a');
                    return 0;
            }
        }
        printf("None");
        return 0;
    }

Measured memory_bytes: 384
#include<iostream>
#include<string>
#include<map>
#include <algorithm>

using namespace std;
int main () {
 string W, str;
 map<string, int> data;
 cin >> W;
 while(cin >> str, str != "END_OF_TEXT") {
   transform(str.begin(), str.end(), str.begin(), ::tolower);
   data[str] += 1;
 }

 cout << data[W] << endl;

}

Measured memory_bytes: 3164
[<AutoOpen>]
module Program

open System

let read f = stdin.ReadLine() |> f
let reads f = stdin.ReadLine().Split() |> Array.toList |> List.map f

[<EntryPoint>]
let main _ =
    let [n;k] = reads int
    let hs = reads int |> List.toArray

    let dp = Array.create n 0
    for i = 1 to n - 1 do
        seq {
            for j = 1 to k do
            if i - j >= 0 then
                yield dp.[i-j] + abs (hs.[i] - hs.[i-j])
        }
        |> Seq.min
        |> fun x -> dp.[i] <- x

    printfn "%i" dp.[n-1]
    0

Measured memory_bytes: 33468
/*  ex7_1
    suuxxu  */

#include <stdio.h>
#include <math.h>

typedef struct point{
    int x_elem;
    int y_elem;
}point;

point shift_point(point p, point q){
    point r;

    // 点pを点qのまわりに反時計回りに270度回転
    r.x_elem = (p.y_elem - q.y_elem) + q.x_elem;
    r.y_elem = -(p.x_elem - q.x_elem) + q.y_elem;

    return r;
}

int main(void){
    point one, two, three, four;

    // 入力
    scanf("%d %d %d %d", &one.x_elem, &one.y_elem, &two.x_elem, &two.y_elem);

    // 残り2点を計算
    three = shift_point(one, two);
    four = shift_point(two, three);

    // 出力
    printf("%d %d %d %d\n", three.x_elem, three.y_elem, four.x_elem, four.y_elem);

    return 0;
}

Measured memory_bytes: 1716
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <math.h>
using namespace std;

int main(){
	
	int satu,dua;
	scanf ("%d %d",&satu,&dua);
	int total = (satu*3)+dua;
	printf ("%d",total/2);
	
}


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

int main() {
	int N;

	cin >> N;
	vector<tuple<string, int, int>> t( N );
	for( int i = 0; i < N; i++ ) {
		string S;
		int P;
		cin >> S >> P;

		t[i] = make_tuple( S, P, i + 1 );
	}

	sort( t.begin(), t.end(), []( tuple<string, int, int> a, tuple<string, int, int> b ) { if( get<0>( a ) < get<0>( b ) ) { return true; }
																				else if( get<0>( a ) == get<0>( b ) ) {
																					if( get<1>( a ) >= get<1>( b ) ) { return true; }
																					else return false;
																				}
																				else return false; } );

	for( int i = 0; i < N; i++ ) {
		cout << get<2>( t[i] ) << endl;
	}

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
 
#define int long long 
#define MOD 1000000007
 
using namespace std;
 
signed main(){
 

    int a,b,k;

    cin >> a>>b>>k;

    vector <int> ans;

    for(int i=1;i<=100;i++){

        if((a%i==0)&&(b%i==0)){
            ans.push_back(i);
        }
    }

    cout <<ans[ans.size()-k]<<endl;


 	return 0;
 
}

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

#define ll long long
#define vi vector<int>
#define pb push_back
#define P pair<int,int>
#define PP pair<P,int>
#define fi first
#define se second
#define INF (1<<30)
#define MOD 1000000007
#define all(a) (a).begin(),(a).end()


signed main(){
    int n;
    cin>>n;
    int ans=1;
    while(ans*2<=n)ans*=2;
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using mii = map<int, int>;
const int INF = 1e9;
const ll LINF = 1e18;
#define MP(a,b) make_pair((a),(b))
#define MT(...) make_tuple(__VA_ARGS__)

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define REPS(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)

#define ALL(x) (x).begin(),(x).end()
#define IN(type,a) type a;cin >> a
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define COUT(x) cout << (x) << endl
#define DCOUT(x,n) cout << fixed << setprecision(n) << (x) << endl

int main() {
    IN(int, n);
    int c = 0;
    REPS(i, n){
        int k;
        cin >> k;
        if (k!=i) {
            c++;
        }
    }
    YES(c==2 || c==0);
}




Measured memory_bytes: 256