akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define INFTY 10000000000
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long int ll;
const int MOD=1000000007;
const int di[4] = {-1,0,1,0};
const int dj[4] = {0,-1,0,1};
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
int main(){
    int n;cin>>n;
    vector<int> x(n),y(n);
    vector<ll> h(n);
    vector<ll> hi(n,0);
    ll eh;
    rep(i,n)cin>>x[i]>>y[i]>>h[i];
    rep(c_x,101)rep(c_y,101){
        int ok = 1;
        rep(i,n){
            if(h[i]==0)continue;
            if(h[i]>0){hi[i]=abs(x[i]-c_x)+abs(y[i]-c_y)+h[i];eh = hi[i];}
        }
        rep(i,n){
            if(hi[i]>0&&hi[i]!=eh){
                ok = 0;break;
            }
            if(hi[i] ==0 && eh-abs(x[i]-c_x)-abs(y[i]-c_y)>0){
                ok = 0;break;
            }
        }
    if(ok&&eh>=1){
        cout<<c_x<<" "<<c_y<<" "<<eh<<endl;
        return 0;
    }
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(x) begin(x), end(x)
#define dbg(x) cerr << #x << " = " << x << endl
#define _ << ' ' <<
using namespace std;
using ll = long long;
using vi = vector<int>;

int n, m, c[10] = {0,2,5,5,4,5,6,3,7,6};
int dp[10001], p[10001], a[10], inf = 100000;

int f(int n)
{
    if (n < 0) return -inf;
    if (n == 0) return 0;
    if (dp[n] != -1) return dp[n];
    int md = -inf, mi = -1;
    for (int i = 0; i < m; ++i)
    {
        int d = 1 + f(n - c[a[i]]);
        if (d > md)
            md = d, mi = i;
    }
    return p[n] = mi, dp[n] = md;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> n >> m;
    memset(dp, -1, sizeof dp);
    for (int i = 0; i < m; ++i)
        cin >> a[i];
    sort(a, a + m, [](int i, int j)
    {
        return i > j;
    });
    f(n);
    while (n)
    {
        cout << a[p[n]];
        n -= c[a[p[n]]];
    }
}


Measured memory_bytes: 512
def judge(visited):
    for v in visited:
        if not v:
            return True
    else:
        # 完走 橋ではない
        return False


def main():
    def dfs(visited, n):
        visited[n] = True

        for k, v in enumerate(graph[n]):
            if not v:
                continue

            if visited[k]:
                continue

            visited = dfs(visited, k)

        return visited

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

    graph = [[False for j in range(N)] for i in range(N)]

    am = [0] * M
    bm = [0] * M

    for i in range(M):
        # 0-indexed
        ai, bi = map(int, input().split())
        ai -= 1
        bi -= 1

        am[i] = ai
        bm[i] = bi

        graph[ai][bi] = True
        graph[bi][ai] = True

    ans = 0

    for ai, bi in zip(am, bm):
        graph[ai][bi] = False
        graph[bi][ai] = False

        # 訪問済 All False
        if judge(dfs([False] * N, 0)):
            ans += 1

        # 元に戻す
        graph[ai][bi] = True
        graph[bi][ai] = True

    print(ans)
    return


main()


Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
 
int main(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int a, b, c;
cin >> a >> b >> c;
(c>= a && c <=b) ? cout << "Yes\n" : cout << "No\n";
return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
#include <queue>
#include <vector>
#define fs first
#define sc second
#define mp make_pair
#define sf scanf
#define pf printf
#define pb push_back
#define tl(x) ((int)x.size()-1)
#define rep(i,j,k) for (i=j;i<=k;i++)
using namespace std;
const int N=1e5+5;
typedef pair<int,int> Pair;
int n,i,j,a[N],vis[N],dgr[N];
vector <int> b[N],c[N];
priority_queue <Pair> heap;
int gcd(int a,int b) {
	int c=a%b;
	while (c) {	a=b; b=c; c=a%b;}
	return b;
}
void dfs(int x)
{
	int j; vis[x]=1;
	rep(j,0,tl(b[x]))
	if (!vis[b[x][j]])
	{
		dgr[b[x][j]]=1;
		c[x].pb(b[x][j]);
		dfs(b[x][j]);
	}
}
int main()
{
	//freopen("game.in","r",stdin);
	//freopen("game.out","w",stdout);
	sf("%d",&n); rep(i,1,n) sf("%d",&a[i]); sort(a+1,a+1+n);
	rep(i,1,n)
		rep(j,1,n)
			if (i!=j && gcd(a[i],a[j])>1) b[i].pb(j);
	rep(i,1,n) if (!vis[i]) dfs(i);
	rep(i,1,n) if (!dgr[i]) heap.push(mp(a[i],i));
	while (!heap.empty())
	{
		i=heap.top().sc;
		heap.pop();
		pf("%d ",a[i]);
		rep(j,0,tl(c[i])) heap.push(mp(a[c[i][j]],c[i][j]));
	}
 	return 0;
}

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

int main(){
  ll N;cin>>N;
  ll A[N];
  rep(i,N) cin>>A[i];
  
  ll cnt=A[0];
  ll sum=0;
  rep(i,N-1){
    if(A[i]>A[i+1]){
      sum+=A[i]-A[i+1];
      cnt=max(cnt,A[i]);
      A[i+1]=A[i];
    }
    
  }
  cout<<sum<<endl;
}


Measured memory_bytes: 5144
#include <stdio.h>
#include <string.h>
int main(int argc, const char * argv[]) {
    int i,n;
    int hanako=0,tarou=0;
    int result;
    char str1[1000];
    char str2[1000];
    
    scanf("%d",&n);
    for(i=0; i<n; i++){
        scanf("%s %s",str1,str2);
        //str1 str2????????????-1, 0, 1??§??°????????????
        result = strcmp(str1,str2);
        
        if(result > 0){
            tarou += 3;
        } else if(result < 0)
            hanako += 3;
        else{
            tarou++;
            hanako++;
        }
    }
    printf("%d %d\n",tarou, hanako);
    
    return 0;
}

Measured memory_bytes: 604
package main

import (
	"fmt"
	"sort"
)

func main() {
	var N int
	fmt.Scanf("%d", &N)

	m := make(map[string]int, 0)
	for i := 0; i < N; i++ {
		var s string
		fmt.Scanf("%s", &s)
		if _, ok := m[s]; ok {
			m[s]++
		} else {
			m[s] = 0
		}
	}
	set := make(map[string]struct{})
	max := -1
	for _, v := range m {
		if max < v {
			max = v
		}
	}
	for k, v := range m {
		if max == v {
			set[k] = struct{}{}
		}
	}
	uni := make([]string, 0)
	for k := range set {
		uni = append(uni, k)
	}
	sort.Strings(uni)
	for _, k := range uni {
		fmt.Println(k)
	}
}


Measured memory_bytes: 44672
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#ifdef ONLINE_JUDGE
#define LLD "%I64d"
#else
#define LLD "%lld"
#endif
#define fu(a,b,c) for(int a=b;a<=(int)c;++a)
#define fd(a,b,c) for(int a=b;a>=(int)c;--a)
#define cu(a,b,c) for(int a=b;a<(int)c;++a)
#define cd(a,b,c) for(int a=(b)-1;a>=(int)c;--a)
#define gcd(a,b) __gcd(a,b) 
#define pii pair<int,int>
#define pll pair<long long,long long>
#define all(a) a.begin(),a.end()
#define F first
#define S second
#define pb push_back
#define pf push_front
#define MOD 1000000007 
#define MAXN 52
#define MAXH 20
#define MAXM 52
#define INF 100000000
#define ll long long
#define ull unsigned long long
#define RNG rng mt19937(time(NULL))
#define udist(a,b) uniform_int_distribution<uint32_t> distribution(a,b)
#define max3(a,b,c) max(a, max(b, c))
#define min3(a,b,c) min(a, min(b, c))
#define gmax(a,b) a = max(a, b)
#define gmin(a,b) a = min(a, b)
#define whatis(x) cerr << #x << " is " << x << endl;
#define fast_io() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define PI 3.1415926535897932384626433
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
const int N = 10005;
int n,val[N],c[N],adj[N];
vector<int> t[N];
queue<int> q;
int score;

void dfs(int cur,int par){
	if(par != 0)score += c[cur];	
	for(int a:t[cur]){
		if(par != a)dfs(a,cur);	
	}
}


int main(){
	cin >> n;
	cu(i,0,n-1){
		int x,y;
		cin >> x >> y;
		t[x].pb(y);
		t[y].pb(x);
		++adj[x];
		++adj[y];
	}
	cu(i,0,n)cin >> val[i];
	int vh = 0;
	sort(val, val + n);
	fu(i,1,n)if(adj[i] == 1)q.push(i);
	int last = 0;
	while(q.size()){
		int cur = q.front();q.pop();
		last = cur;
		c[cur] = val[vh++];
		--adj[cur];
		for(int a:t[cur]){
			if(adj[a])--adj[a];
			if(adj[a] == 1){
				q.push(a);
			}
		}
	}
	dfs(last, 0);
	cout << score << '\n';
	fu(i,1,n){
		cout << c[i] << ' ';
	}cout << '\n';
}


Measured memory_bytes: 1152
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);

        int mine = scan.nextInt();
        int friend = scan.nextInt();
        int book = scan.nextInt();

        if (mine >= book) {
            System.out.println(0);
        } else if (friend + mine < book) {
            System.out.println("NA");
        } else {
            System.out.println(book - mine);
        }

    }
}



Measured memory_bytes: 26404
//By Don4ick 
//#define _GLIBCXX_DEBUG

#include <bits/stdc++.h>

typedef long long ll;
typedef long double ld;
typedef unsigned int ui;

#define forn(i, n) for (int i = 1; i <= n; i++)
#define pb push_back
#define all(x) x.begin(), x.end()
#define y1 qewr1234

const double PI = acos(-1.0);
const int DIR = 4;
const int X[] = {1, 0, -1, 0};
const int Y[] = {0, 1, 0, -1};

const int M = (int)3e7;
const int K = 10000;
const int N = (int)1e5 + 228;
const ll MX = (ll)1e10 + 228;

using namespace std;

bool np[M];
int n;
ll s[N];

int main()
{
	//ios_base::sync_with_stdio(false);
	//cin.tie();
	//cout.tie();		

	//freopen(".in", "r", stdin);
	//freopen(".out", "w", stdout);

	//~resheto
	np[1] = true;
	vector < int > a, b;
	for (int i = 2; i < M; i++)
	{
		if (!np[i])
		{               	
			if (i <= K)
				a.pb(i);
			else
				b.pb(i);			
			if (1ll * i * i < M)
			{
				for (int j = i * i; j < M; j += i)
					np[j] = true;		
			}
		}
	}
	//~read
	scanf("%d", &n);
	forn(i, n)
		scanf("%lld", &s[i]);
	//~solve
	map < ll, int > cnt;
	set < ll > st;
	forn(i, n)
	{
		ll x = s[i];
		vector < pair < int, int > > p;
		for (auto y : a)
		{
			while(x % (1ll * y * y * y) == 0)	
				x /= 1ll * y * y * y;
		}
		st.insert(x);
		cnt[x]++;
	}
	int ans = 0;
	map < ll, bool > was;
	for (auto x : st)
	{
		if (was.count(x))
			continue;
		ll y = 1;
		ll z = x;
		for (auto i : a)
		{
			if (x % i == 0)
			{
				y *= i;
				z /= i;
				if (x / i % i != 0)
					y *= i;							 
				else
					z /= i;
			}
		}	
		if (z != 1)
		{
			ll k = sqrt(z);
			while(k * k < z)
				k++;
			while(k * k > z)
				k--;
			if (k * k == z)
			{
				y *= k;
			}
			else if (z < M && !np[z])
			{
				if (MX / y >= z)
				{
					y *= z;
					if (MX / y >= z)
						y *= z;
					else
						y = -1;	
				}
				else
					y = -1;
			}
			else
				y = -1;
		}
		if (x == 1)
		{
			ans += min(1, cnt[1]);
			continue;
		}
		was[x] = was[y] = true;
		int res = max(cnt[x], cnt[y]);
		ans += res;
	}
	cout << ans << endl;

	return 0;
}



Measured memory_bytes: 62068
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef long double ld;
using pll=pair<ll,ll>;
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep2(i,l,r) for(ll i = (l); i <= (ll)(r); i++)
#define rep3(i,l,r) for(ll i = (l); i >= (ll)(r); 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; }
const int inf = 1001001001;
const ll INF = 1LL << 60;
const ll mod = 1000000007;
const ld pi = acos(-1);
 
// union by size + path having
class UnionFind {
public:
   vector <ll> par; // 各元の親を表す配列
   vector <ll> siz; // 素集合のサイズを表す配列(1 で初期化)
 
   // Constructor
   UnionFind(ll sz_): par(sz_),siz(sz_, 1LL){
       for (ll i=0; i<sz_; i++) par[i]=i; // 初期では親は自分自身
   }
   void init(ll sz_){
       par.resize(sz_);
       siz.assign(sz_, 1LL);  // resize だとなぜか初期化されなかった
       for (ll i=0; i<sz_; i++) par[i]=i; // 初期では親は自分自身
  }
 
   // Member Function
   // Find
   ll root(ll x){ // 根の検索
      while (par[x]!=x){
           x=par[x]=par[par[x]]; // x の親の親を x の親とする
       }
       return x;
  }
 
   // Union(Unite, Merge)
   bool unite(ll x, ll y){
       x=root(x);
       y=root(y);
       if (x==y) return false;
       // merge technique（データ構造をマージするテク．小を大にくっつける)
       if (siz[x]<siz[y]) swap(x, y);
       siz[x]+=siz[y];
       par[y]=x;
       return true;
  }
 
  bool same(ll x, ll y){ // 連結判定
       return root(x)==root(y);
  }
 
  ll size(ll x){ // 素集合のサイズ
      return siz[root(x)];
  }
};
 
ll modpow(ll x, ll n){
   x=x%mod;
   if(n==0) return 1;  //再帰の終了条件
 
   else if(n%2==1){
       return (x*modpow(x, n-1))%mod;  //nが奇数ならnを1ずらす
   }
   else return modpow((x*x)%mod, n/2)%mod;  //nが偶数ならnが半分になる
}
 
ll com(ll n, ll k){
   ll x=1;
   for(int i=n-k+1; i<=n; i++){
      x=x*i%mod;
   }
 
   ll y=1;
   for(int i=1; i<=k; i++){
       y=y*i%mod;
   }
   y=modpow(y, mod-2);
 
   return x*y%mod;
}
 
bool is_prime(const unsigned n){
   switch(n){
       case 0: // fall-through
       case 1: return false;
       case 2: // fall-through
       case 3: return true;
  } // n>3 が保証された
 
   if(n%2==0 || n%3==0) return false;
   // nは2と3のいずれの倍数でもないことが保証された
   // これよりnは(6の倍数)-1か(6の倍数)+1である
 
   // 6の倍数前後の数を使って試し割りをする
   for(unsigned i = 5; i*i<=n; i+=6) {
       if(n%i==0) return false; // (6の倍数)-1
       if(n%(i+2)==0) return false; // (6の倍数)+1
   }
 
   return true;
}
 
int digsum(int n){
   int res=0;
   while(n > 0) {
       res+=n%10; //ここをres++;に変えたら桁数を求める関数になる,res+=n%10;なら格桁の和
       n/=10;
   }
   return res;
}
vector<ll> divisor(ll n){
   vector<ll> ret;
   for(ll i=1; i*i<=n; i++){
       if(n%i==0){
           ret.push_back(i);
           if(i*i!=n) ret.push_back(n/i);
       }
   }
   sort(ret.begin(),ret.end());
   return ret;
}
 
int main(){

    vector<ll> a(5);
    rep(i,5){
        cin >> a[i];
        if(a[i]==0){
            cout << i+1 << endl;
            return 0;
        }
    }
    


 
}

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


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

typedef set<int>::iterator sit;
typedef map<int,int>::iterator mit;
typedef vector<int>::iterator vit;

const int INF = 1e9 + 7;
const int MOD = 1e9 + 7;
const int MAXN = 1e6 + 3;

#define _  %  MOD
#define __ %= MOD

#define      each(it,s)        for(auto it = s.begin(); it != s.end(); ++it)
#define      sortA(v)          sort(v.begin(), v.end())
#define      sortD(v)          sort(v.begin(), v.end(), greater<auto>())
#define      fill(a)           memset(a, 0, sizeof (a))

#define      swap(a,b)        {a=a+b;b=a-b;a=a-b;}
#define      rep(i, n)         for(ll i = 0; i < (n); ++i)
#define      repA(i, a, n)     for(ll i = a; i <= (n); ++i)
#define      repD(i, a, n)     for(ll i = a; i >= (n); --i)
#define watch(x) cout << (#x) << " is " << (x) <<endl

#define fi first
#define se second
#define mp make_pair
#define pb push_back

#define fbo find_by_order
#define ook order_of_key

#define pv(a)	{rep(i,a.size())	cout<<a[i]<<" "; cout<<endl;}
#define mark(v)	cout<<"Here--"<<v<<endl;

const double EPS = (1e-7);
int dcmp(double x, double y) {	return fabs(x-y) <= EPS ? 0 : x < y ? -1 : 1;	}

ll gcd(ll a,ll b){if(b==0) return a; else return gcd(b,a%b);}
ll power(ll x,ll y){ll res=1; while(y>0){if(y&1) res=res*x;y=y>>1;x=x*x;}return res;} // modular exponent
ll w[100005],c[100005],dp[101][100005];
int main()
{
	ios_base::sync_with_stdio(0); cin.tie(0); cout << setprecision(12);

	ll n, C;
	cin >> n >> C;
	for (int i = 1; i <= n; i++) {
		cin >> w[i] >> c[i];
	}

	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= C; j++) {
			if (j < w[i])
				dp[i][j] = dp[i - 1][j];
			else
				dp[i][j] = max(dp[i - 1][j], dp[i - 1][j - w[i]] + c[i]);
		}
	}
	cout << dp[n][C];
    return 0;
}  

Measured memory_bytes: 79360
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <cstring>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <bitset>
#include <stack>
#include <cmath>
#define ll long long
#define LINF 0x3f3f3f3f3f3f3f3f
#define INF 0x3f3f3f3f
using namespace std;
const int MAX = 1e5 + 10;
const ll MOD = 1e9 + 7;
int N, M, K, Q;
vector<pair<ll, int>> xpos, ypos;
int p[MAX];
int cnt[MAX];
bool flag;

int _find(int x) { return p[x] == x ? x : p[x] = _find(p[x]); }
void _union(int x, int y) {
	int tmp = cnt[_find(x)];
	cnt[_find(x)] += cnt[_find(y)];
	cnt[_find(y)] += tmp;
	if (cnt[_find(x)] == N || cnt[_find(y)] == N) flag = true;
	p[_find(y)] = _find(x);
}

int main()
{
	int i, j, k;
	scanf("%d", &N);
	ll x, y;
	for (i = 1; i <= N; ++i) {
		scanf("%lld%lld", &x, &y);
		xpos.push_back({ x, i });
		ypos.push_back({ y, i });
	}
	sort(xpos.begin(), xpos.end());
	sort(ypos.begin(), ypos.end());

	priority_queue<pair<ll, pair<int, int>>> pq;
	
	for (i = 0; i < xpos.size() - 1; ++i) {
		ll dif = xpos[i + 1].first - xpos[i].first;
		pq.push({ -dif, {xpos[i + 1].second, xpos[i].second} });
	}

	for (i = 0; i < ypos.size() - 1; ++i) {
		ll dif = ypos[i + 1].first - ypos[i].first;
		pq.push({ -dif, {ypos[i + 1].second, ypos[i].second} });
	}
	
	flag = false;
	for (i = 1; i <= N; ++i) {
		p[i] = i;
		cnt[i] = 1;
	}

	ll cost = 0;
	while (!flag) {
		pair<ll, pair<int, int>> tmp = pq.top();
		pq.pop();
		ll c = -tmp.first;
		int idx1 = tmp.second.first;
		int idx2 = tmp.second.second;
		if (_find(idx1) != _find(idx2)) {
			cost += c;
			_union(idx1, idx2);
		}
	}
	printf("%lld", cost);

	

}


Measured memory_bytes: 9700
N=int(input())
blue=[]
red=[]
ans=0

target=""

for i in range(N):
    blue.append(input())
M=int(input())
for j in range(M):
    red.append(input())

for k in range(N):
    target=""
    target=blue[k]
    count=0
    for i in range(N):
        
        if target==blue[i]:
            count+=1
    for j in range(M):
        if target==red[j]:
            count-=1
    if count>ans:
        ans=count
        
print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ull;
typedef long long ll;
typedef int Int;
typedef pair<Int, Int> pii;
typedef pair<Int, double> pid;
typedef pair<double, double> pdd;
typedef pair<Int, pii> pip;
typedef pair<double, Int> pdp;
typedef vector<Int> veci;
typedef vector<double> vecd;
typedef vector<int> veci;
typedef vector<ll> vecll;
typedef vector<double> vecd;
typedef vector<pii> vecpii;
typedef vector<veci> mati;
typedef vector<vecll> matll;
typedef vector<vecd> matd;
#define A first
#define B second
#define PB(x) push_back(x)
#define EB(x) emplace_back(x)
#define ALL(x) x.begin(),x.end()
#define SZ(x) (x).size()
#define CLR(x) memset(x,0,sizeof x)
#define pdebug() printf("%d\n",__LINE__)
#define REP(i, a, b) for(int i = (a);i <= (b);i++)
#define FORO(i, n) REP(i,0,(int)n-1)
#define FORI(i, n) REP(i,1,(int)n)
#define FORIT(i, t) for(auto i = t.begin();i != t.end();i++)
#define eps 1e-6
#define sqr(x) ((x)*(x))
#define dist(_a, _b) sqrt(sqr(_a.A-_b.A)+sqr(_a.B-_b.B))
#define norm(_a) sqrt(sqr(_a.A)+sqr(_a.B))
#define DUMP(a) do { std::cout << #a " = " << (a) << ", "; } while(false)
#define DUMPLN(a) do { std::cout << #a " = " << (a) << std::endl; } while(false)
template<typename T>
void getMin(T &a, T b) { if (a > b) a = b; }
template<typename T>
void getMax(T &a, T b) { if (a < b) a = b; }
template<typename T>
vector<T> getVector(const int n) { return vector<T>(n); }
template<typename T>
vector<T> getVector(const int n, const T a) { return vector<T>(n, a); }
template<typename T>
vector<T> getEmptyVector() { return vector<T>(); }
template<typename T>
void appendAll(vector<T> &a, vector<T> b) { a.insert(a.end(), b.begin(), b.end()); }
// #define X first
// #define Y second
const int dx[4] = {1, -1, 0, 0};
const int dy[4] = {0, 0, 1, -1};
const ll MOD = 1000000007;
const int MAXN = 1 << 17;
const int inf = 1 << 28;
const int NIL = -inf;
int popcount(int x) { return __builtin_popcount(x); }

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N;
    cin >> N;
    vecll A(N);
    FORO(i, N) cin >> A[i];
    ll x = 1000;
    FORI(i, N - 1) {
        ll a = A[i - 1];
        ll b = A[i];
        ll prex = x;
        ll nxtx = (x % a) + (x / a) * b;
        x = max(nxtx, prex);
    }
    cout << x << endl;
    return 0;
}

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

#define TRACE(x) x
#define WATCH(x) TRACE(cout << #x" = " << x << endl)
#define WATCHR(a, b) TRACE(for (auto it=a; it!=b;) cout << *(it++) << " "; cout << endl)
#define WATCHC(V) TRACE({cout << #V" = "; WATCHR(V.begin(), V.end());})

#define all(x) (x).begin(), (x).end()

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<bool> vb;
typedef vector<string> vs;

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

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);
    cout << fixed << setprecision(15);

    ll a, b;
    cin >> a >> b;
    ll g = gcd(a, b);
    ll x = g;
    ll ans = 0;
    for (ll i = 2; i*i <= x; i++){
        if (g%i == 0){
            ans++;
            while (g%i == 0){
                g /= i;
            }
        }
    }
    if (g != 1) ans++;
    // Include 1
    cout << ans + 1 << endl;

    return 0;
}


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

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

typedef long long ll;
using namespace std;

int f(int n) {
  if (n % 2 == 0) {
    return n / 2;
  } else {
    return 3 * n + 1;
  }
}

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

  int s;
  cin >> s;

  int a_n, a_n_p;
  a_n_p = s;
  vector<vector<int>> count(1000001);
  count.at(s).push_back(1);

  REPI(i, 2, 1000001) {
    a_n = f(a_n_p);
    if (count.at(a_n).size() > 0) {
      cout << i << endl;
      break;
    }

    count.at(a_n).push_back(i);
    a_n_p = a_n;
  }

  return 0;
}


Measured memory_bytes: 23680
#include<cstdio>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<queue>
#include<stack>
#include<vector>
#include<set>
#include<map>
#include<iostream>
using namespace std;
int k,tol=0,cnt=0;
char ch;
string s,p[30000],ans,note[5001];
int main(){
	while(1){
		scanf("%c",&ch);
		if(ch=='\n') break;
		tol++;
		for(int i=1;i<=tol;i++){
			if(tol-i+1<=5){
			    note[i]+=ch;
			    p[++cnt]=note[i];
			}
		}
	}scanf("%d",&k);
	sort(p+1,p+1+cnt);unique(p+1,p+1+cnt);
	cout<<p[k];
	return 0;
}

Measured memory_bytes: 1664
import java.util.Scanner;
import java.util.Arrays;

public class Main{
    public static void main(String[] args){
	Scanner scan = new Scanner(System.in);

	String s = scan.next();
	String t = scan.next();

	char[] s_ = s.toCharArray();
	char[] t_ = t.toCharArray();
	
	Arrays.sort(s_);
	Arrays.sort(t_);
	
	String s_asc = String.valueOf(s_);
	String t_asc = String.valueOf(t_);

	StringBuffer sb = new StringBuffer(t_asc);
	String t_desc = sb.reverse().toString();

	if(s_asc.compareTo(t_desc) < 0){
	    System.out.println("Yes");
	}else{
	    System.out.println("No");
	}
    }
}


Measured memory_bytes: 22996
#include <bits/stdc++.h>
#define pb push_back
#define cmin(a,b) (a>b?a=b:a)
#define cmax(a,b) (a<b?a=b:a)
#define mem(a,k) memset(a,k,sizeof(a))
#define lop(i,s,t) for(int i=s;i<(t);++i)
#define rep(i,s,t) for(int i=s;i<=(t);++i)
#define dec(i,s,t) for(int i=s;i>=(t);--i)
#define fore(i,v) for(int i=g[v],d=es[i].d;i;i=es[i].nxt,d=es[i].d)
using namespace std;

#define Pr(f,...) //fprintf(stderr,f,##__VA_ARGS__),fflush(stderr)

typedef long long ll;

template<typename T>
void read(T &x){
	x=0; 
	char c;
	for(c=getchar();!isdigit(c);c=getchar()); 
	for(;isdigit(c);c=getchar())x=x*10+c-'0'; 
}

const int N=605;

vector<int> dx,dy;

int n,d1,d2,c1[N][N],c2[N][N],(*c)[N];
vector<pair<int,int> > ans[2][2];

void dfs(int x,int y,int z){
	c[x][y]=z;
	for(size_t i=0;i<dx.size();++i){
		int nx=x+dx[i],ny=y+dy[i];
		if(nx<0||nx>=n||ny<0||ny>=n||c[nx][ny]!=-1)continue;
		dfs(nx,ny,z^1);
	}
}

void color(int n,int d){
	dx.clear(),dy.clear();
	for(int x=0;x*x<=d;++x){
		for(int y=0;x*x+y*y<=d;++y){
			if(x*x+y*y==d){
				for(int a=-1;a<=1;a+=2)for(int b=-1;b<=1;b+=2)dx.pb(a*x),dy.pb(b*y); 
				Pr("%d,%d\n",x,y);
			}
		}
	}
	lop(i,0,n)lop(j,0,n)c[i][j]=-1;
	lop(i,0,n)lop(j,0,n)if(c[i][j]==-1)dfs(i,j,0);
}

int main(int argc,char *argv[]){
#ifdef CURIOUSCAT
	//freopen("dat.in","r",stdin);
	//freopen("my.out","w",stdout);
#endif
	scanf("%d%d%d",&n,&d1,&d2); 
	n<<=1;
	c=c1,color(n,d1);
	c=c2,color(n,d2);
	lop(i,0,n)lop(j,0,n)ans[c1[i][j]][c2[i][j]].pb(make_pair(i,j)); 
	int px,py,psz=0;
	lop(a,0,2)lop(b,0,2)if((int)ans[a][b].size()>psz){
		psz=(int)ans[a][b].size();
		px=a,py=b;
	}
	int c=0;
	for(auto x:ans[px][py]){
		printf("%d %d\n",x.first,x.second);
		if(++c==n/2*n/2)break;
	}
	return 0;
}

Measured memory_bytes: 23540
#include <iostream>
#include <cstdlib>
#include <vector>
using namespace std;
int main() {
	cin.tie(0);
   	ios::sync_with_stdio(false);
	int a,b,c;
    int count = 0;
    cin >> a >> b >> c;
    for(int i=a;i<=b;i++){
        if(c % i == 0){
            count++;
        }
    }
    cout << count << "\n";
}


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

using namespace std;
int main(){
	int  n;
	cin>>n;
	string s;
	cin>>s;
	int a1=0,a2=0;
	for(int i=0;i<s.size();i++){
		if(s[i]=='R')a1++;
		else if(s[i]=='B')a2++;
	}
	if(a1>a2)cout<<"Yes";
	else cout<<"No";
	return 0;
}

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

using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
typedef vector<int> Vi;
typedef tuple<int, int, int> T;
#define FOR(i,s,x) for(int i=s;i<(int)(x);i++)
#define REP(i,x) FOR(i,0,x)
#define ALL(c) c.begin(), c.end()
#define DUMP( x ) cerr << #x << " = " << ( x ) << endl

const int dr[4] = {-1, 0, 1, 0};
const int dc[4] = {0, 1, 0, -1};

double sq(double x) { return x * x; }

int main() {
  // use scanf in CodeForces!
  cin.tie(0);
  ios_base::sync_with_stdio(false);

  int N, M; cin >> N >> M;
  vector<double> L(N), A(N), B(N);
  REP(i, N) cin >> L[i] >> A[i] >> B[i];
  double ans = 0.0;
  REP(bit, 1<<N) {
    if (__builtin_popcount(bit) != M) continue;
    double cand = 0.0;
    REP(i, N)  FOR(j, i+1, N) if ((bit >> i & 1) and (bit >> j & 1)) cand += sq(L[i] - L[j]) + sq(A[i] - A[j]) + sq(B[i] - B[j]);
    ans = max(ans, cand);
  }
  cout << setprecision(20) << ans << endl;
  return 0;
}

Measured memory_bytes: 3300
#include <iostream>
#include <stack>
#include <cstdlib>
using namespace std;
int main(void){
    
    stack<int> st;
    
    string s;
    int A, B;
    while(cin >> s){
        if(s[0] == '+' || s[0] == '-' || s[0] == '*' || s[0] == '/'){
            B = st.top();
            st.pop();
            A = st.top();
            st.pop();
            if(s[0] == '+') st.push(A + B);
            if(s[0] == '-') st.push(A - B);
            if(s[0] == '*') st.push(A * B);
            if(s[0] == '/') st.push(A / B);
        }
        
        else {
            int num = atoi(s.c_str());
            st.push(num);
        }
    }
    
    cout << st.top() << endl;
}



Measured memory_bytes: 3208
r,g,b,n = gets.split.map(&:to_i)
ans=0
x=(n/r.to_f).ceil
for i in 0..x
    y=n-i*r
    if y==0
        ans+=1
        next
    elsif y<0
        next
    end
    y=(y/g.to_f).ceil
    for j in 0..y
        z=n-i*r-j*g
        if z==0
            ans+=1
            next
        elsif z<0
            next
        end
        if (z%b).zero?
            ans+=1
        end
    end
end
puts ans

Measured memory_bytes: 14252
#include<iostream>
#include<string>
#include<algorithm>
#include<bits/stdc++.h>
#include<vector>
 
using namespace std;
int MOD=1000000007;
int main(){
    int A,B,C;
    cin >> A >> B >> C;
    if(C>=A && C<=B) cout << "Yes" << endl;
    else cout << "No" << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
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;
}

#ifdef DEBUG
void debug() { cerr << "\n"; }
template <class T> void debug(const T &x) { cerr << x << "\n"; }
template <class T, class... Args> void debug(const T &x, const Args &... args) {
    cerr << x << " ";
    debug(args...);
}
template <class T> void debugVector(const vector<T> &v) {
    for(const T &x : v) {
        cerr << x << " ";
    }
    cerr << "\n";
}
#else
template <class T, class... Args>
void debug(const T &x, const Args &... args) {}
template <class T> void debugVector(const vector<T> &v) {}
#endif

using ll = long long;
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
const double EPS = 1e-7;
const int INF = 1 << 30;
const ll LLINF = 1LL << 60;
constexpr int MOD = 1000000007;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll k;
    cin >> k;
    set<ll> se;
    ll seven = 7;
    ll ans = 1;
    while(seven < k) {
        seven = seven * 10 + 7;
        ans++;
    }
    debug(seven);
    while(1) {
        ll r = seven % k;
        if(r == 0) {
            cout << ans << endl;
            return 0;
        }
        if(se.count(r)) {
            cout << -1 << endl;
            return 0;
        }
        se.insert(r);
        seven -= k * (seven / k);
        seven = seven * 10 + 7;
        ans++;
    }
}

Measured memory_bytes: 50448
#include <iostream>
using namespace std;
int main(){
    int n;
    cin >> n;
    string a;
    int b;
    int cards[4][13];
    for (int k=0; k<4; k++) {
        for (int t=0; t<13; t++) {
            cards [k][t] = 0;
        }
    }
    for (int s=0; s<n; s++) {
        cin >> a >> b;
       
        if (a == "S") {
            cards[0][b-1] =1;
        }
        else if (a == "H"){
            cards[1][b-1] =1;
        }
        else if (a == "C"){
            cards[2][b-1] =1;
        }
        else if (a == "D"){
            cards[3][b-1] = 1;
        }
    }
    for (int i=0; i<4; i++) {
        for (int j=0; j<13 ; j++) {
            if (cards[i][j] != 1){
                if (i == 0){
                    cout <<  "S" << " " << j+1  <<endl;
                }
                else if (i == 1){
                    cout <<  "H" << " " << j+1  <<endl;
                }
                else if (i == 2){
                    cout <<  "C" << " " << j+1  <<endl;
                }
                else if (i == 3){
                    cout <<  "D" << " " << j+1  <<endl;
                }
            }
        }
    }
}


Measured memory_bytes: 3100
#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
using namespace std;
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define all(a) a.begin(),a.end()
#define rall(c) (c).rbegin(),(c).rend()
#define mp make_pair
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef long double ld;
const ll inf=1e9+7;
const ll mod=1e9+7;
int main(){
    ll x,y,a,b,c;cin>>x>>y>>a>>b>>c;
    vector<ll>p(a),q(b),r(c);
    rep(i,a)cin>>p[i];
    rep(i,b)cin>>q[i];
    rep(i,c)cin>>r[i];
    sort(all(p));
    sort(all(q));
    sort(all(r));
    reverse(all(p));
    reverse(all(q));
    reverse(all(r));
    vector<ll>rui(x+y+1);
    ll n=0,m=0;
    while(1){
        if(n<x){
            if(m<y){
                if(p[n]>q[m]){
                    rui[n+m+1]=rui[n+m]+p[n];
                    n++;
                }else{
                    rui[n+m+1]=rui[n+m]+q[m];
                    m++;
                }
            }else{
                rui[n+m+1]=rui[n+m]+p[n];
                n++;
            }
        }else{
            rui[n+m+1]=rui[n+m]+q[m];
            m++;
        }
        if(n==x&&m==y)break;
    }
    ll ans=0;
    vector<ll>rr(c+1);
    REP(i,1,c+1){
        rr[i]=rr[i-1]+r[i-1];
    }
    rep(i,c+1){
        if(i>x+y)break;
        ans=max(ans,rr[i]+rui[x+y-i]);
    }
    cout<<ans<<endl;
}

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

int main() {
    int n; scanf("%d", &n);
    vector<vector<int>> g(n);
    for (int i = 0; i < n - 1; ++i) {
        int u, v; scanf("%d%d", &u, &v);
        u--, v--;
        g[u].push_back(v);
        g[v].push_back(u);
    }

    vector<int> dp(n, 0);
    function<void(int, int)> Dfs = [&](int x, int p) {
        for (int u : g[x]) {
            if (u == p) continue;
            Dfs(u, x);
            dp[x] ^= dp[u] + 1;
        }
    };

    Dfs(0, -1);
    if (dp[0]) puts("Alice");
    else puts("Bob");
}


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

//typedefリスト
typedef vector<int> vint;
typedef vector<string> vstr;

int main(void) {
	int A, B;
	cin >> A >> B;
	if (A%B == 0)cout << 0 << endl;
	else cout << 1 << endl;
}

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

int main(){
    string S;
    cin >> S;
    int N = S.size();

    int ans = 10000;
    for(int i=0; i<=N-3; i++){
        int num = stoi(S.substr(i, 3));
        ans = min(ans, abs(num-753));
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
N = int(input())

D = []
for _ in range(N):
        D.append([int(x) for x in input().split()])

count = 0
for i in range(N):
        if(D[i][0] == D[i][1]):
                count +=1
                if(count == 3):
                        break
        else:
                count = 0

if(count == 3):
        print('Yes')
else:
        print('No')

Measured memory_bytes: 9128
/****************************************************
*   Template for coding contests                    *
*   Author    :    Sanjeev Sharma                   *
*   Email     :    thedevelopersanjeev@gmail.com    *
*****************************************************/
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")

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

using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n, l;
    cin >>n >>l;
    vector<int> arr(n);
    for(int i = 0; i < n; i++)
        arr[i] = l + i;
    int sum = accumulate(arr.begin(), arr.end(), 0);
    int ans, mn = INT_MAX;
    for(int i = 0; i < n; i++){
        int curr = 0;
        for(int j = 0; j < n; j++){
            if(i != j){
                curr += arr[j];
            }
        }
        if(abs(sum - curr) < mn){
            mn = abs(sum - curr);
            ans = curr;
        }
    }
    cout <<ans;
    return 0;
}


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

using namespace std;

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

  int min = 1000;

  for(int i = 0;i < s.length()-2;i++){
    string f = s.substr(i,3);
    int tmp = atoi(f.c_str());
    if(abs(753 - tmp) < min){
      min = abs(753 - tmp);
    }
  }

  cout << min << endl;
}

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

int main() {
    int N, K;
    cin >> N >> K;
    K--;
    string S;
    cin >> S;

    for (int i = 0; i < S.size(); i++) {
        if (i == K) {
            if (S[K] == 'A')
                cout << 'a';
            else if (S[K] == 'B')
                cout << 'b';
            else
                cout << 'c';
        } else {
            cout << S[i];
        }
    }

    return 0;
}

Measured memory_bytes: 256
import queue

k = int(input())
q = queue.Queue()

counter = 0
for i in range(9):
    q.put(i+1)
while counter < k:
    n = q.get()
    counter += 1
    mod = n % 10
    if mod != 0:
        q.put(10*n+mod-1)
    q.put(10*n+mod)
    if mod != 9:
        q.put(10*n+mod+1)
print(n)


Measured memory_bytes: 12480
#include<bits/stdc++.h>
using namespace std;
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int inf=1e9+7;
int main(){
    int a,b;
    cin>>a>>b;
    cout<<max({a+b,a-b,a*b})<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <math.h>
#include <algorithm>
#include <vector>
#include <numeric>
#include <string>
using namespace std;
const string alp = "abcdefghijklmnopqrstuvwxyz";
const string pla = "zyxwvutsrqponmlkjihgfedcba";
const string ALP = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define all(x) (x).begin(),(x).end()
#define SORT(c) sort(all(c))
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define SUM(c) accumulate(all(c),0)
#define COUNT(c,a) count(all(c), a)
#define Yn(b) puts(b?"Yes":"No")
#define YN(b) puts(b?"YES":"NO")
#define IC(n) int (n); cin >> (n)
#define IC2(n,m) int (n),(m); cin >> (n) >> (m)
#define IC3(n,m,l) int (n),(m),(l); cin >> (n) >> (m) >> (l)
#define VSI(n,c) vector<string> (c)(n); REP(i,n) cin >> (c)[i]
#define VII(n,c) vector<int> (c)(n); REP(i,n) cin >> (c)[i]
#define VII2(n,c,d) vector<int> (c)(n),(d)(n); REP(i,n) cin >> (c)[i] >> (d)[i]
#define VII3(n,c,d,e) vector<int> (c)(n),(d)(n),(e)(n); REP(i,n) cin >> (c)[i] >> (d)[i] >> (e)[i]
int main(){
    string s;
    cin >> s;
    if (s.length()==26) {
        REP(i,25){
            if (alp.find(s[25-i])>alp.find(s[24-i])) {
                cout << s.substr(0,24-i);
                int m = 26;
                int n = alp.find(s[24-i]);
                FOR(j,25-i,26) {
                    if (n < alp.find(s[j]) && m > alp.find(s[j])) m = alp.find(s[j]);
                }
                cout << alp[m];
                return 0;
            }
        }
        cout << -1;
        return 0;
    }
    REP(i,26){
        if (s.find(alp[i])==-1) {
            cout << s << alp[i];
            return 0;
        }
    }
    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <random>
#include <bitset>
#include <queue>
#include <cmath>
#include <unordered_map>
#define rep(i,n) for (int i=0; i<n;++i)
#define rep_down(i,n) for (int i=n-1; i>=0;--i)
#define ALL(a)  (a).begin(),(a).end()
typedef long long ll;
using namespace std;
const ll MOD = 1000000007LL;
const int INF = 1000000007;
int X;

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

  cin >> X;
  if (X==7 || X==5 || X==3){
    cout << "YES" << "\n";
  } else cout << "NO" << "\n";
  return 0;
}

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

#define 	ll				long long int
#define 	vll				vector<ll>
#define 	vi				vector<int>
#define		rep(i,n) 		for(i=0;i<n;i++)
#define		repe(i,I1,I2) 	for(i=I1;i<I2;i++)
#define		pb  			push_back
#define		mp  			make_pair
#define		endl			'\n'
#define 	mod				1000000007


int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	ll n,k,t,c=0,i;
	t=1;
	//cin>>t;
	
	while(t--)
	{
		cin>>n>>k;
		
		
		cout<<(n+(k/2));
		if(t!=0)
	   		cout<<"\n";
	}
	return 0;
}

Measured memory_bytes: 256
#include"bits/stdc++.h"
using namespace std;
typedef long long ll;
const ll MOD = (ll)(1e9+7);
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int (i)=0; (i)<(int)(n); (i)++)
int dx[4]={ 1,0,-1,0 };
int dy[4]={ 0,1,0,-1 };

ll a, b, c;
signed main(){
    cin >> a >> b >> c;
    if(c-a-b <= 0) cout << "No" << endl;
    else if(4*a*b < (c-a-b)*(c-a-b)) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
int main()
{
	int A,B;
	scanf("%d %d",&A, &B);
	if((A==1)&&(B==2))
	{
		printf("3");
	}
	else if((A==1)&&(B==3))
	{
		printf("2");
	}
	else if((A==2)&&(B==1))
	{
		printf("3");
	}
	else if((A==2)&&(B==3))
	{
		printf("1");
	}
	else if((A==3)&&(B==1))
	{
		printf("2");
	}
	else if((A==3)&&(B==2))
	{
		printf("1");
	}
	return 0;
}

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

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

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

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

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

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

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

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

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

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        #[cfg(debug_assertions)]
        writeln!(&mut std::io::stderr(), concat!("[DEBUG] ", $(stringify!($a), "={:?} "),*), $($a),*);
    }
}

#[allow(unused_imports)]
use std::cmp::{min, max};
#[allow(unused_imports)]
use std::io::{stdout, stdin, BufWriter, Write};

fn main() {
    let out = std::io::stdout();
    let mut out = BufWriter::new(out.lock());
    macro_rules! puts {
        ($($format:tt)*) => (write!(out,$($format)*).unwrap());
    }

    input!{
      n: usize,
      k: usize,
      aa: [usize; n],
    }

    const MAX_DIGIT: usize = 50;
    let mut dp = vec![vec![None; 2]; MAX_DIGIT+1];
    dp[0][0] = Some(0);

    for d in 0..MAX_DIGIT {
        let bit: usize = 1 << (MAX_DIGIT - d - 1);

        let mut ones = 0;
        for &a in aa.iter() {
            if a&bit > 0 {
                ones += 1;
            }
        }
        let zeros = n-ones;

        if k & bit > 0 {
            dp[d+1][0] = dp[d][0].map(|v| v + zeros*bit); // 1->1
            dp[d+1][1] = dp[d][0].map(|v| v + ones*bit); // 1->0
        } else {
            dp[d+1][0] = dp[d][0].map(|v| v + ones*bit); // 0->0
        }

        dp[d+1][1] = max(dp[d+1][1], dp[d][1].map(|v| v + max(ones * bit, zeros*bit)));
    }
    puts!("{}\n", dp[MAX_DIGIT].iter().max().unwrap().unwrap());
}


Measured memory_bytes: 4352
#include <cstdlib>
#include <iostream>
#include <string>
#include <time.h>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <sstream>
#include <iomanip>
#include <vector>
#include <functional>
//#include "bits/stdc++.h"
using namespace std;
//using namespace std::vector;
#define rep(i,a,b) for(int i=(a);i<(b);++i)

#define huge 1000000007
typedef long long ll;
ll gcd(ll a, ll b);

int main(void) {

	ll N = 0;
	ll A = 0;
	ll B = 0;
	ll C = 0;
	ll D = 0;
	ll M = 0;
	//ll M = 0;
	ll a[200] = {};
	ll b[200] = {};
	ll v[3] = {};
	//ll *a, *b, *x;
	string S,T,U;
	ll count = 0;
	ll sum = 0;
	ll min = 100000;
	ll max = 0;
	int flag = 0;
	char temp,head;
	//int is = 0;
	
	vector<int> c(3);
	//char p;
	cin >> c[0] >> c[1] >> c[2];
	//cin >> S;
	
	//a = (ll *)malloc(M * sizeof(ll));
	//b = (ll *)malloc(M * sizeof(ll));
	//vector<pair<int,int>> ch(N+1);
	//vector<bool> flag(N);
	
	//count--;
	//	cout << X << endl;
	//x = (ll *)malloc((N+1) * sizeof(ll));
	//c = (ll *)malloc((N) * sizeof(ll));
	//cin >> D >> G;
	//vector<pair<int,int>> tr(M);
	//vector<pair<int,int>> qes(Q);
	//sort(c.begin(), c.end());
	
	//cout << c[2] - c[1] << endl;

	if(c[0] == c[1])
		cout << c[2] << endl;
	else if (c[1] == c[2])
		cout << c[0] << endl;
	else if (c[0] == c[2])
		cout << c[1] << endl;


	/*A = N / 1000;
	N %= 1000;
	B = N / 100;
	N %= 100;
	C = N / 10;
	N %= 10;
	D = N;*/

	
	

	return 0;

}

ll gcd(ll a, ll b) {
	ll c;
	c = a % b;
	while (c != 0) {
		a = b;
		b = c;
		c = a % b;
	}

	return b;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std ;
typedef  long long int ll ;
#define inf 9e18
#define mod 1000000007
#define mod1 998244353
long long int power(long long int a,long long int n,long long int m) ;
 long long int power(long long int a,long long int n,long long int m)
{  if(n==0)
   return 1 ;
   long long int x=power(a,n/2,m) ;
   if(n%2!=0)
    return (((a*x)%m)*(x)%m)%m ;
    else return (x*x)%m ;
}


int main()
{ ll n,i,j,x,y,m,k,t,sum,count,cnt,b,c,d,j1,z,a,o;
  ios_base::sync_with_stdio(false);
   cin.tie(NULL);
  cin>>n ;
  for(i=-120;i<=120;i++)
  {
      for(j=-120;j<=120;j++)
      {
          if(pow(i,5)-pow(j,5)==n)
            break ;
      }
      if(j!=121)
        break ;
  }
  cout<<i<<" "<<j ;
  return 0; }


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

const double EPS = 1e-8;
const double INF = 1e12;
const double PI = acos(-1);

using Point = complex<double>;
using Polygon = vector<Point>;

inline int sgn(const double &a) { return (a < -EPS ? -1 : (a > EPS ? 1 : 0)); }

inline bool eq(const Point &a, const Point &b) { return abs(a - b) < EPS; }

namespace std {
inline bool operator<(const Point &a, const Point &b) {
    if (sgn(a.real() - b.real()))
        return sgn(a.real() - b.real()) < 0;
    return sgn(a.imag() - b.imag()) < 0;
}
} // namespace std

double dot(const Point &a, const Point &b) { return real(conj(a) * b); }

double det(const Point &a, const Point &b) { return imag(conj(a) * b); }

struct Line {
    Point p1, p2;

    Line(Point p1 = Point(), Point p2 = Point()) : p1(p1), p2(p2) {}

    bool operator<(const Line &rhs) const {
        if (eq(p2, rhs.p2))
            return p1 < rhs.p1;
        return p2 < rhs.p2;
    }
    bool operator==(const Line &rhs) const {
        return (eq(p1, rhs.p1) && eq(p2, rhs.p2)) ||
               (eq(p1, rhs.p2) && eq(p2, rhs.p1));
    }
};

double get_area(Polygon poly){
    double res = 0;
    for(int i=0;i<poly.size();i++){
        res += det(poly[i], poly[(i+1)%poly.size()]);
    }
    return abs(res) / 2.0;
}

int main(){
    int n;
    cin >> n;
    Polygon pg;
    for(int i=0;i<n;++i){
        double x, y;
        cin >> x >> y;
        Point p = Point(x, y);
        pg.push_back(p);
    }
    printf("%.1f\n", get_area(pg));

    return 0;
}



Measured memory_bytes: 3168
import java.util.*;
import java.io.*;
import java.lang.*;

public class Main{
public static void main(String[] args) throws FileNotFoundException, IOException {
        Scanner s = new Scanner(System.in);
        StringBuilder sb=new StringBuilder();
       int n=s.nextInt(),m=s.nextInt(),l=s.nextInt();
       long[][] g1=new long[n+1][n+1];
       for(int i=1;i<=n;i++){
       	Arrays.fill(g1[i],(long)1e13);
       }
       for(int i=0;i<m;i++){
       	int x=s.nextInt(),y=s.nextInt(),c=s.nextInt();
       	g1[x][y]=c;  
       	g1[y][x]=c;  
       }

       for(int i=0;i<n;i++){
       	g1[i][i]=0;
       }

       	for (int k = 1; k <= n; k++) 
        { 
            for (int i = 1; i <= n; i++) 
            { 
                for (int j = 1; j <= n; j++) 
                { 
                    g1[i][j]=Math.min(g1[i][j],g1[i][k] + g1[k][j]); 
                } 
            } 
        } 
        long[][] g2=g1.clone();
        for(int i=1;i<=n;i++){
        	for(int j=1;j<=n;j++){
        		g2[i][j]=g1[i][j]<=l? 1:(long)1e13;
        	}
        }

        for (int k = 1; k <= n; k++) 
        { 
            for (int i = 1; i <= n; i++) 
            { 
                for (int j = 1; j <= n; j++) 
                { 
                    g2[i][j]=Math.min(g2[i][j],g2[i][k] + g2[k][j]); 
                } 
            } 
        } 

        BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out));
        List<Integer>l1=new ArrayList<>();
        int q=s.nextInt();
        for(int i=0;i<q;i++){
        	int start=s.nextInt(),end=s.nextInt();
        	if(g2[start][end]==(long)1e13){
        		l1.add(-1);
        	}
        	else{
        		l1.add((int)g2[start][end]-1);        	
        	}
        }
        for(int i=0;i<l1.size();i++){
        	out.write(l1.get(i)+ " ");
        	out.write("\n");
            out.flush();
        }
    }
}
    
  












Measured memory_bytes: 95604