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

using namespace std;

int main(void){
  double R, G;
  cin >> R >> G;

  /*求めるものをxとする．
    このとき，
      (R+x)/2 = G
    であるから，
      x=2G-R
    である．
   */

  cout << 2*G-R << endl;
  
  return 0;
}


Measured memory_bytes: 256
s = gets.chomp
ans = gets.to_i
res1 = eval(s)
s = s.split('')
n = s.shift
res2 = s.each_slice(2).reduce(n.to_i){ |res, (c, m)| c == '+' ? res + m.to_i : res * m.to_i }
if res1 == ans && res2 == ans
  puts 'U'
elsif res1 == ans
  puts 'M'
elsif res2 == ans
  puts 'L'
else
  puts 'I'
end

Measured memory_bytes: 8708
#include <stdio.h>

int main()
{
  int i, n, v, x, y, z, dx, dy;
  char *p, buf[32];
  buf[31]=0;
  buf[30]='\n';
  fgets(buf, 32, stdin);
  for (n=0,p=buf; *p!=' '; n=n*10+*(p++)-'0'); 
  int s[n], d[n];
  for (i=0; i<n; s[i]=i,d[i++]=0);
  while (fgets(buf, 32, stdin)) {
    for (x=0,p=buf+2; *p!=' '; x=x*10+*(p++)-'0');
    for (y=0,p++; *p>='0'; y=y*10+*(p++)-'0');
    if (buf[0]=='0') { // relate x y z
      for (z=0,p++; *p!='\n'; z=z*10+*(p++)-'0');
      for (dx=0; s[x]!=x; dx+=d[x],x=s[x]);
      for (dy=0; s[y]!=y; dy+=d[y],y=s[y]);
      if (x==y) continue;
      if (x<y) {
	s[y] = x;
	d[y] = dx + z - dy;
      }	else {
	s[x] = y;
	d[x] = dy - z - dx;
      }
    } else { // diff
      for (v=0; s[x]!=x; v-=d[x], x=s[x]);
      for (;s[y]!=y; v+=d[y], y=s[y]);
      if (x!=y) {
	putc_unlocked('?', stdout);
	putc_unlocked('\n', stdout);
      } else {
	i=30;
	if (v>0)  for (; v>0; buf[--i]='0'+v%10,v/=10);
	else if (v<0) {
	  for (; v<0; buf[--i]='0'-v%10,v/=10);
	  buf[--i] = '-';
	} else  buf[--i] = '0';
	fputs(buf+i, stdout);
      }
    }
  }
  return 0;
}



Measured memory_bytes: 2432
#include <stdio.h>

int main(void)
{
  int a,b;
  a = b = 0;
  
  scanf("%d %d", &a, &b);
  
  if((b % a) == 0){
    printf("%d", b + a);
  }
  else{
    printf("%d", b - a);
  }
  return (0);
}
    
    
    

Measured memory_bytes: 128
#include<cstdio>
#include<algorithm>
#include<cmath> 
#include<iostream>
using namespace std;
int a,b,c;
int gcd(int x,int y){
	return y==0?x:gcd(y,x%y);
}
int main(){
	scanf("%d%d",&a,&b);
	c=gcd(a,b);
	printf("%d\n",c);
}



Measured memory_bytes: 3212
require 'pp'
$DEBUG ? define_method(:dpp){|e|pp e} : define_method(:dpp){|e|}

# 入力値を数値で返却する
def gets_i()
  gets.chomp.to_i
end

# 空白区切の入力値を数値の配列で返却する
def gets_i_list()
  gets.chomp.split(" ").map(&:to_i)
end
n = gets_i

xys = []
n.times do
  xys.push gets_i_list
end

total = 0.0
perms = xys.permutation(n).to_a
perms.each do |route|
  1.upto(n-1) do |i|
    dx = (route[i][0] - route[i-1][0])
    dy = (route[i][1] - route[i-1][1])
    total += ((dx**2 + dy**2)) ** 0.5
  end
end

puts total / perms.size

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

int main() {
  char b;
  cin>>b;
  if(b=='A'){
    cout<<'T'<<endl;
  }
  if(b=='T'){
    cout<<'A'<<endl;
  }
  if(b=='C'){
    cout<<'G'<<endl;
  }
  if(b=='G'){
    cout<<'C'<<endl;
  }
}


Measured memory_bytes: 256
#include<stdio.h>
int main(void){
  long long int h,w;
  scanf("%lld %lld",&h,&w);
  if(h==1 || w==1){
    printf("1\n");
  }else{
    printf("%lld\n",(h*w+1)/2);
  }
  return 0;
}

Measured memory_bytes: 128
#include <stdio.h>
int main()
{
	int a,b,c=0;
	scanf("%d %d %d",&a,&b,&c);
    if(a+b==c||a+c==b||c+b==a){
    	printf("Yes\n");
	}
	else
		printf("No\n");
	return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
#include<algorithm>
#include<math.h>
#include<string>
#include<iostream>
#include<vector>
#include<cstdlib>
#include<stdio.h>
#include<cmath>
#include<limits>
#include<iomanip>

using namespace std;

template <class T> using V = vector<T>;

template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

const long long INF = 1LL << 60;

using ll = long long;
using db = long double;
using st = string;
using ch = char;
using bl = bool;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
using vbl = V<bl>;
using graph = V<V<int>>;
using pq = priority_queue<ll>;



#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>=(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define pb(a) push_back(a);



ll Sum(ll n) {
ll m=0;
  while(n){
    m+=n%10;
    n/=10;
  }
  return m;
}



const int MAX = 510000;
const int MOD = 1000000007;
 
long long fac[MAX], finv[MAX], inv[MAX];
 
void Comuse() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}


#define comuse Comuse()

ll combi(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

ll perm(int n,int k){
    if(n < k) return 0;
    if(n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] % MOD) % MOD;
}


ll lcm(ll a,ll b){
  ll n;
  n=a/gcd(a,b)*b;
  return n;
}


vll div(ll n){
  vll 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);
  return (ret);
}

ll modpow(ll a,ll n,ll mod){
  ll ans=1;
  while(n>0){
    if(n&1){
      ans=ans*a%mod;
    }

    a=a*a%mod;
    
    n>>=1;
  }

  return ans;
}

void Solve();


const int MAX_N = 131072;
//segment tree 
int NN;
int seg[MAX_N*2-1];
void seguse(){
  for(int i=0;i<2*NN-1;i++){
    seg[i]=INT_MAX;
  }
}

signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout<<setprecision(20)<<fixed;
  Solve();
}




/****************************************\
| Thank you for viewing my code:)        |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka                  | 
\****************************************/
//segtreeの葉の先頭の添え字はn-1
void Solve(){
  //vll segtree(524287);
  //ll N=262144;
  int n,m;
    cin>>n>>m;
  if(n==m){
    cout<<"Yes\n";
  }
  else{
    cout<<"No\n";
  }
}

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

typedef long long ll;
typedef unsigned long long ull;

int main()
{
    ull N;
    cin >> N;
    vector<ull> A(N+1);
    for(int i=0;i<N+1;i++){
        cin >> A[i];
    }
    if(N == 0){
        if(A[0] == 1) cout << "1" << endl;
        else          cout << "-1" << endl;
        return 0;
    }
    if(A[0] > 0){
        cout << "-1" << endl;
        return 0;
    }
    vector<ull> n_available(N+1, 1);
    for(int i=1;i<N+1;i++){
        //if(i < N && 2 * n_available[i-1] < A[i]){
        if(2 * n_available[i-1] < A[i]){
            cout << "-1" << endl;
            return 0;
        }
        n_available[i] = 2 * n_available[i-1] - A[i];
        if(n_available[i] >= ((ull)1 << 62)) n_available[i] = ((ull)1 << 62);
    }
    ull res = 0;
    ull n_occ = A.back();
    res += n_occ;
    for(int i=N-1; i>=0; i--){
        n_occ = min(n_occ, n_available[i]) + A[i];
        res += n_occ;
    }
    cout << res << endl;

    return 0;
}

Measured memory_bytes: 4836
#include <bits/stdc++.h>
#include <stdlib.h>
#include <string.h>
#define rep(i,l,r) for((i)=(l);(i)<(r);(i)++)
#define erep(i,l,r) for((i)=(l);(i)<=(r);(i)++)
#define drep(i,l,r) for((i)=(l);(i)>=(r);(i)--)
#define MOD 1000000007
#define ll long long
#define MAX(a,b) ((a)>(b)?(a):(b))
using namespace std;
int main(){
    int k,g,i;
    char s[110];
	cin>>s;
    int n=strlen(s);
    rep(i,0,n){
        if((i%2==0&&s[i]=='L')||(i%2==1&&s[i]=='R')){
            cout<<"No"<<endl;
            return 0;
        }
    }
    cout<<"Yes"<<endl;
}



Measured memory_bytes: 256
#pragma region head
    #include <bits/stdc++.h>
    using namespace std;
    using ll = long long;
    using vi = vector<int>;
    using vll = vector<ll>;
    using pi = pair<int, int>;
    using pll = pair<ll,ll>;
    template <class T> using vv = vector<vector<T>>;
    #define rep(i,n) for(int i = 0; i < (int)(n); i++)
    #define repi(i,a,b) for(int i = (int)(a); i < (int)(b); i++)
    #define rrep(i,n) for(int i = (int)(n)-1; i >= 0; i--)
    #define rrepi(i,a,b) for(int i = (int)(b)-1; i >= (int)(a); i--)
    #define all(x) (x).begin(), (x).end()
    #define rall(x) (x).rbegin(), (x).rend()    
    #define bit(n) (1LL<<(n))
    template<class T> inline bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
    template<class T> inline bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
    const int INF = 1002003004;
    const ll LINF = 1002003004005006007ll;
    struct preprocess{preprocess()
    {cin.tie(nullptr);ios::sync_with_stdio(false);cout<<fixed<<setprecision(20);}}____;
#pragma endregion head

#pragma region library
#pragma endregion library

int main(){
    int n,m; cin >> n >> m;
    priority_queue<int> q;
    rep(i,n){
        int a; cin >> a;
        q.emplace(a);
    }
    rep(i,m){
        int a = q.top();
        q.pop();
        a /= 2;
        q.emplace(a);
    }
    ll ans = 0;
    while(!q.empty()){
        ans += q.top();
        q.pop();
    }
    cout << ans << '\n';
    
}


Measured memory_bytes: 3896
#include<iostream>
#include<string>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;
const double PI = 3.14159265358979;
const double E = 2.718281828459045;
const double root2 = sqrt(2);
typedef pair<int, int> P;
typedef unsigned int ui;
int main() {
	int m; string s;
	cin >> m;
	for (int i = 0; i < m; i++) {
		cin >> s;
		vector<string> t;
		int n = s.length();
		string u, v;
		t.push_back(s);
		for (int j = 0; j < n - 1; j++) {
			u = s.substr(0, j + 1);
			v = s.substr(j + 1, n - j - 1);
			t.push_back(v + u);
			reverse(u.begin(),u.end());
			t.push_back(u + v); t.push_back(v + u);
			reverse(v.begin(), v.end());
			t.push_back(u + v); t.push_back(v + u);
			reverse(u.begin(), u.end());
			t.push_back(u + v); t.push_back(v + u);
		}
		sort(t.begin(), t.end());
		int cnt = 1;
		for (int j = 1; j < (int)t.size(); j++) {
			if (t[j] != t[j - 1])cnt++;
		}
		cout << cnt << endl;
	}
	return 0;
}



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

int main()
{
    int N, M;
    cin >> N >> M;
    if (N == M)
    {
        cout << "Yes" << endl;
    }
    else
        cout << "No" << endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		long k = sc.nextLong();
		if(k %2 ==0) {
			System.out.println(a-b);;
		}else {
			System.out.println(b-a);;
		}
	}
}

Measured memory_bytes: 21972
import sys
input = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 7)

N, M, P = map(int, input().split())
edge = [[] for _ in range(N + 1)]
ein = [[] for _ in range(N + 1)]
for _ in range(M):
    a, b, c = map(int, input().split())
    edge[a].append((b, P - c))
    ein[b].append(a)

# 到達できる地点を決める
reach1 = [False] * (N + 1)
reach1[1] = True
node = [1]
while node:
    s = node.pop()
    for t, _ in edge[s]:
        if not reach1[t]:
            reach1[t] = True
            node.append(t)

reach2 = [False] * (N + 1)
reach2[N] = True
node = [N]
while node:
    s = node.pop()
    for t in ein[s]:
        if not reach2[t]:
            reach2[t] = True
            node.append(t)

can_go = []
Vertices = []
for i, (x, y) in enumerate(zip(reach1, reach2)):
    can_go.append(x & y)
    if x & y:
        Vertices.append(i)


inf = 10**18
cost = [inf] * (N + 1)
cost[1] = 0
for _ in range(M + 5):
    update = False
    for s in Vertices:
        now = cost[s]
        for t, c in edge[s]:
            if not can_go[t]:
                continue
            if cost[t] > now + c:
                cost[t] = now + c
                update = True


if update:
    print(-1)
else:
    print(max(0, -cost[N]))

Measured memory_bytes: 48168
#include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdlib>
#include <string>
#include <cstring>
#include <cmath>
#include <climits>
#include <ctime>
#define endl '\n'
#define ll long long
#define mod 1000000007
#define NCONS 200001

using namespace std;

int A[21][21];
int ret;

int main(void)
{
    cin.tie(NULL); ios_base::sync_with_stdio(false);
    int N, M, C; cin >> N >> M >> C;
    vector<int> B(M, 0); for(int i = 0; i < M; i++) cin >> B[i];
    for(int i = 0; i < N; i++)
    {
        for(int j = 0; j < M; j++)
        {
            cin >> A[i][j];
        }
    }
    
    for(int i = 0; i < N; i++)
    {
        ll temp = C;
        for(int j = 0; j < M; j++)
            temp += A[i][j] * B[j];
        if(temp > 0)
            ret += 1;
    }
    

    cout << ret << endl;
    return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize ("O3")

#include <bits/stdc++.h>

using namespace std;

#ifdef LOCAL
#include <prettyprint.hpp>
#define debug(...)  cerr << "[" << #__VA_ARGS__ << "]: ", d_err(__VA_ARGS__);
#else
#define debug(...) 83;
#endif

void d_err() {
    cerr << endl;
}

template <typename H, typename... T>
void d_err(H h, T... t) {
    cerr << h << " ";
    d_err(t...);
}

template <typename T>
void print(T x) {
    cout << x << endl;
}

#define ALL(x) (x).begin(), (x).end()
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define REVFOR(i, m, n) for (int i = (n - 1); i >= (m); --i)
#define REP(i, n) FOR(i, 0, n)
#define REVREP(i, n) REVFOR(i, 0, n)
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define bcnt __builtin_popcountll

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef pair<ll,ll> Pll;
typedef pair<int,int> Pin;

ll INF = 1e16;
int inf = 1e9;
ll MOD = 1e9+7;

int main(){
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    
    int N, M;
    string S;
    cin >> N >> M;
    cin >> S;

    reverse(ALL(S));

    vi ans;

    int i = 0;
    while(i != S.size() - 1) {
        bool f = true;
        REVFOR(j, 1, M + 1) {
            if (i + j >= S.size()) continue;

            if (S[i + j] == '0') {
                i += j;
                ans.pb(j);
                f = false;
                break;
            }
        }
        if (f) {
            print(-1);
            return 0;
        }
    }

    reverse(ALL(ans));

    REP(i, ans.size()) {
        if (i > 0) cout << " ";
        cout << ans[i];
    }

    cout << endl;
}


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

using namespace std;

int main () {
	int n, a, b, c, d;
	cin >> n;
	vector<pair <int, int>> red(n), blue(n);
	for (int i = 0; i < n; i++) {
		cin >> a >> b;
		red[i].first = a;
		red[i].second = b;
	}
	sort(red.begin(), red.end(), [](const pair<int, int>& p1, const pair<int, int>&p2) {
		return (p1.first == p2.first) ? (p1.second < p2.second) : (p1.first < p2.first);
	});
	for (int i = 0; i < n; i++) {
		cin >> c >> d;
		blue[i].first = c;
		blue[i].second = d;
	}
	sort(blue.begin(), blue.end(), [](const pair<int, int>& p1, const pair<int, int>&p2) {
		return (p1.first == p2.first) ? (p1.second < p2.second) : (p1.first < p2.first);
	});
	vector<bool> redpaired(n);
	for (int j = 0; j < n; ++j)
	{
		redpaired[j] = false;
	}
	for (int i = 0; i < n; ++i)
	{
		int maxsecond = -1, maxj = -1;
		for (int j = 0; j < n; ++j)
		{
			if (redpaired[j])
				continue;
			if ((red[j].first < blue[i].first) && (red[j].second < blue[i].second)) {
				if (maxsecond < red[j].second) {
					maxsecond = red[j].second;
					maxj = j;
				}
			}
		}
		if (maxsecond != -1) {
			redpaired[maxj] = true;
		}
	}
	int p = 0;
	for (int i = 0; i < n; i++) {
		if (redpaired[i])
			p++;
	}
	cout << p << endl;

	return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main()
{
int i,j,k,l=0,N,A,B;
cin>>N>>A>>B;
for(i=1;i<=N;i++)
{
j=0;
k=i;
while(k)
{
j+=k%10;
k/=10;
}
if(j>=A&&j<=B)
l+=i;
}
cout<<l;
return 0;
}

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

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

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

  int loop = *min_element(a.begin(), a.end());
  list<int> ans;
  for(int i = 1; i <= loop; i++){
    bool flg = true;
    for(int j = 0; j < a.size(); j++){
      if(a[j] % i != 0) flg = false;
    }
    if(flg) ans.push_back(i);
  }

  for(list<int>::iterator it = ans.begin(); it != ans.end(); it++){
    cout << *it << endl;
  }

  return 0;
}

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

using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<string> vs;
using pll = pair<ll, ll>;
using vl = vector<ll>;
using vll = vector<vl>;
using vpll = vector<pll>;
struct Edge {
	ll to;
	ll cost;
};
using Graph = vector<vector<Edge>>;

#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define ALL(a) (a).begin(), (a).end()
/***** define constant start *******/
const ll MOD = 1000000007;
const double PI = 2.0 * asin(1.0);
const ll INF = 1L<<60;
string abc = "abcdefghijklmnopqrstuvwxyz";
string ABC = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
const ll MAX = 10000000;
/****** define constant end ********/
/****** define variable start ******/
ll x, n;
vl p;
/******* define variable end *******/
int solve() {
	cin >> x >> n;
	p.resize(n);
	REP(i, n){
		cin >> p[i];
	}
	if(n == 0){
		cout << x << endl;
		return 0;
	}
	vl no;
	for(ll i = -1; i <= 105; i++){
		if(find(ALL(p), i) == p.end()){
			no.push_back(i);
		}
	}
	ll mi = INF;
	ll ite = 0;
	sort(ALL(no));
	for(ll i = no.size()-1; i >= 0; i--){
		if(abs(no[i] - x) <= mi){
			mi = abs(no[i]-x);
			ite = no[i];
		}
	}
	cout << ite << endl;
	return 0;
}

int main() {
	//clock_t start = clock();
	cout << std::fixed << std::setprecision(10);
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	int end_solve = solve();
	/*
	clock_t end = clock();
	const double time = static_cast<double>(end - start) / CLOCKS_PER_SEC *
	1000.0; printf("time %lf[ms]\n", time);
	*/

	return end_solve;
}


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

int main() {
    vector<char> grade;
    bool tf = true;
    while (tf) {
        int m,f,r;
        scanf("%d%d%d", &m,&f,&r);
        int s = m + f;
        if (m == -1 && f == -1 && r == -1) {
            tf = false;
            continue;
        }
        if (m == -1  || f == -1 || s < 30) {
            grade.push_back('F');
        } else if (s >= 80) {
            grade.push_back('A');
        } else if (s >= 65) {
            grade.push_back('B');
        } else if (s >= 50 || (s >= 30 && r >= 50)) {
            grade.push_back('C');
        } else if (s >= 30) {
            grade.push_back('D');
        }
    }
    for (int i = 0; i < grade.size(); i++) {
        printf("%c\n", grade.at(i));
    }
}


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

#define int long long
#define uint unsigned int
#define pii pair<int, int>
#define fi first
#define se second

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORR(i, a, b) for (int i = (a); i >= (b); --i)
#define REP(i, n) FOR(i, 0, n)
#define REPR(i, n) FORR(i, n, 0)
#define ALL(a) (a).begin(), (a).end()
#define SZ(a) ((int)(a).size())

#define PF(a) push_front(a)
#define PB(a) push_back(a)
#define EMPF(...) emplace_front(__VA_ARGS__)
#define EMPB(...) emplace_back(__VA_ARGS__)
#define EMP(...) emplace(__VA_ARGS__)
#define MP(a, b) make_pair(a, b)
#define MT(...) make_tuple(__VA_ARGS__)

#define ZERO(a) memset(a, 0, sizeof(a))
#define MINUS(a) memset(a, -1, sizeof(a))

#define PW(n) (1LL << (n))
#define NUM(x) char(x + '0')
#define ALP(x) char(x + 'a')

using namespace std;

template <class T> inline bool CHMIN(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template <class T> inline bool CHMAX(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template <class T> inline void SORT(T &a) { sort(a.begin(), a.end()); }
template <class T> inline void REV(T &a) { reverse(a.begin(), a.end()); }
template <class T> inline void UNIQUE(T &a) { sort(a.begin(), a.end()); a.erase(unique(a.begin(), a.end()), a.end()); }

template <class S, class T> ostream& operator << (ostream& os, const pair<S, T> v) {
  os << "(" << v.first << ", " << v.second << ")"; return os;
}

const int MOD = 1000000007;
const int INF = 1LL << 30;
const double EPS = 1e-10;

/* ---------------------------------------------------------------------------------------------------- */

int A, B, C;

signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  cin >> A >> B >> C;
  cout << min(C, B/A) << endl;

  return 0;
}

Measured memory_bytes: 256
n = int(input())
a = list(map(int,input().split()))
count = 0
for j in range(n):
    for i in range(n-1,j,-1):
        if a[i] < a[i-1]:
            a[i],a[i-1] = a[i-1],a[i]
            count += 1

print(*a)
print(count)


Measured memory_bytes: 5608
#include<functional>
#include <algorithm>
#include <iostream>
#include <memory.h>
#include <string.h>
#include <string>
#include <math.h>
#include <time.h>
#include <vector>
#include <queue>
#include<stack>
#include <map>
#include <set>
#include <list>
#include <deque>
#include <bitset>
#include <limits>
#include <unordered_map>
#include <unordered_set>
using namespace std;
typedef long long ll;
const int M = 1e9 + 7;
const int N = 2e5;
const int oo = 1e9;
const double pi = acos(-1);
int main() {
	//freopen("src.txt", "r", stdin);
	int a, b;
	cin >> a >> b;
	int ans = 0, x = 1;
	while (x < b) {
		--x;
		x += a;
		++ans;
	}
	cout << ans << endl;
	return 0;
}

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

int main() {
    int N;
    cin>>N;
    if(N<=1) {
        cout<<0;
        return 0;
    }
    vector<int> height(N,0);
    vector<int> cost(N,0);
    for(int i=0;i<N;i++)
        cin>>height[i];

    cost[N-2] = abs(height[N-2]-height[N-1]);

    for(int i=N-3; i>=0;i--) {
        cost[i] = min(cost[i+1] + abs(height[i]-height[i+1]), 
                      cost[i+2]+abs(height[i]-height[i+2]));
    }    
    cout<<cost[0]<<endl;
    return 0;
}

Measured memory_bytes: 1024
#include "bits/stdc++.h"
#define REP(i, m, n) for(long long i = m; i < n; ++i)
#define CO(n) cout << n << endl
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

int N,M;
int ans=0;
int a[60],b[60];
int perm[8];

int main()
{
    ios::sync_with_stdio(false);
    cin >> N >> M;
    REP(i,0,M) cin >> a[i] >> b[i];
    REP(i,0,M){
        a[M+i]=b[i]; b[M+i]=a[i];
    }
    REP(i,0,N) perm[i]=i+1;
    do {
        bool flag, flag2;
        REP(i,0,N-1){
            flag = false;
            flag2 = true;
            int s=perm[i]; int g=perm[i+1];
            REP(j,0,2*M){
                if (s == a[j] && g == b[j]){
                    flag = true;
                    break;
                }
            }
            if (!flag){
                flag2 = false;
                break;
            }
        }
        if (flag2) ++ans;
    } while(next_permutation(perm+1, perm+N));
    CO(ans);
    return 0;
}

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

        int n,j,temp;

        cin>>n;
         int a[n],b[n];
          for(int i=0;i<n;i++){
                cin>>a[i];
                b[i]=a[i];
            }
            sort(a,a+n);
            int diff=0;

        for(int i=0;i<n;i++){
            if(a[i]!=b[i]){
                    diff++;

            }
        }

    if(diff==2||diff==0){
        cout<<"YES"<<endl;
    }
    else
        cout<< "NO"<< endl;





    return 0;
    }



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

int main()
{
    int N, ans = 0;
    cin >> N;
    if (N % 2 == 0)
    {
        ans = N / 2 - 1;
    }
    else
    {
        ans = (N - 1) / 2;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
using namespace std;
int q(int n){
  int a=0;
  for(int i=1;i<=int(sqrt(n));i++){
if(n%i==0){
  a+=1;
}

  }
  if(sqrt(n)==int(sqrt(n))){
    return 2*a-1;
  }else{
    return 2*a;
  }
}
int main() {
 int n,b,c=0;
 cin>>n;
 if(n==1000000){
   cout<<13969985;
 }else{
 for(int i=1;i<=n-1;i++){
b=n-i;
c+=q(b);
 }
 cout<<c;
 }
}

Measured memory_bytes: 3672
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cassert>
#include <cstring>
#include <numeric>
#include <ctime>
#include <complex>
#include <bitset>
#include <random>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>

using namespace std;
//using namespace __gnu_pbds;

typedef long long ll;
typedef long double ld;

//#define int ll
#define double ld
#define loop(i, n) for(int i = 0; i < (int)n; ++i)
#define loop1(i, n) for(int i = 1; i <= (int)n; ++i)
#define F first
#define S second
#define pb push_back
#define pi pair <int, int>
#define all(x) begin(x), end(x)
#define ti tuple <int, int, int>
#define Point Vect 

void solve() {
    string s; cin >> s;
    if (s.size() % 2) {
        cout << "No"; return;
    }
    loop(i, s.size()) {
        if (!((i % 2 && s[i] == 'i' ) || (i % 2 == 0 && s[i] == 'h'))) {
            cout << "No"; return;
        }
    }
    cout << "Yes";
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    //int t; cin >> t; loop(i, t)
    solve();
    return 0;
}

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

int main(void) {
	vector<char> v;
	char s[11];
	cin >> s;
	//cout << "a\n";
	for (int i = 0; s[i] != '\0'; i++) {
		if (s[i] == 'B' && v.size() != 0) {
			v.erase(v.begin() + v.size()-1);
		} else if (s[i] != 'B') {
			v.push_back(s[i]);
		} else if (s[i] == 'B' && v.size() == 0) {
		}
		//cout << i << endl;
	}
	//cout << "b" << endl;
	for (int i = 0; i < v.size(); i++) {
		cout << v[i];
	}
	cout << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll        = long long;
using ld        = long double;
using vl        = vector<ll>;
using vd        = vector<ld>;
using vs        = vector<string>;
using vb        = vector<bool>;
using vvl       = vector<vector<ll>>;
using vvd       = vector<vector<ld>>;
using vvs       = vector<vector<string>>;
using vvb       = vector<vector<bool>>;
using pll       = pair<ll, ll>;
constexpr ll mod= 1e9 + 7;
#define ALL(x) (x).begin(), (x).end()
#define REP(i, n) for(ll(i)= 0; (i) < (n); (i)++)
#define REPS(i, n) for(ll(i)= 1; (i) <= (n); (i)++)
#define RREP(i, n) for(ll(i)= (n - 1); (i) >= 0; (i)--)
#define RREPS(i, n) for(ll(i)= (n); (i) > 0; (i)--)
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define UNIQUE(v) v.erase(unique(ALL(v)), v.end())
#define YES(n) ((n) ? "YES" : "NO")
#define Yes(n) ((n) ? "Yes" : "No")
#define yes(n) ((n) ? "yes" : "no")

template <class T>
inline void chmin(T& a, T b) {
    if(a > b) { a= b; }
}

template <class T>
inline void chmax(T& a, T b) {
    if(a < b) { a= b; }
}

/* 最大公約数 */
ll gcdx(ll a, ll b) {
    return b ? gcdx(b, a % b) : a;
}

/* 最小公倍数 */
ll lcmx(ll a, ll b) {
    return a / gcdx(a, b) * b;
}

signed main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(12);
    ll X;
    cin >> X;
    cout << lcmx(360,X)/X << "\n";
}

Measured memory_bytes: 3636
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <unordered_map>

using namespace std;
using ll = long long;

void _cin(){} template <class Head, class... Tail> void _cin(Head&& head, Tail&&... tail){ cin >> head; _cin(forward<Tail>(tail)...); }
void _cout(){ cout << "\n"; } template <class Head, class... Tail> void _cout(Head&& head, Tail&&... tail){ cout << head; _cout(forward<Tail>(tail)...); }
int gcd(int a, int b){ return (b == 0) ? a : gcd(b, a % b); }

#define Sq(x) (x)*(x)
#define For(i, n) for(int i = 0; i < (n); i ++)
#define Rep(n) For(_, n)
#define Range(c) c.begin(), c.end()
#define RevRange(c) c.rbegin(), c.rend()
#define Contains(c, x) (find(Range(c), x) != c.end())
#define Search(rb, re, x) distance(rb, find(rb, re, x))
#define Sort(a) sort(Range(a))
#define DeSort(a) sort(RevRange(a))
#define Reverse(c) reverse(Range(c))
#define Unique(a) a.erase(unique(Range(a)), a.end())
#define Vec2(T, n, m, xs) vector<vector<T>> xs(n, vector<T>(m))
#define Sum(a) accumulate(Range(a), 0)
#define Cusum(T, xs, sxs) vector<T> sxs(xs.size()+1); For(i, (int)xs.size()) sxs[i+1] = sxs[i] + xs[i]
#define Cin(T, ...) T __VA_ARGS__; _cin(__VA_ARGS__)
#define Cins(T, n, xs) vector<T> xs(n); For(i, n) cin >> xs[i]
#define Cins2(T, n, xs, ys) vector<T> xs(n), ys(n); For(i, n) cin >> xs[i] >> ys[i]
#define Cins3(T, n, xs, ys, zs) vector<T> xs(n), ys(n), zs(n); For(i, n) cin >> xs[i] >> ys[i] >> zs[i]
#define Cinss(T, n, m, xs) Vec2(T, n, m, xs); For(i, n) For(j, m) cin >> xs[i][j]
#define Cinm(T, n, map) unordered_map<T, int> map; Rep(n){ Cin(T, x); map[x] ++; }
#define Cout(...) _cout(__VA_ARGS__)
#define Couts(xs) for(const auto &e : xs) cout << e << " "; cout << "\n"
#define Coutyn(cond) Cout((cond) ? "yes" : "no")
#define CoutYn(cond) Cout((cond) ? "Yes" : "No")
#define CoutYN(cond) Cout((cond) ? "YES" : "NO")

// constexpr int MOD = 1e9+7;

int main(){
    Cin(int, n, a, b, c, d);
    a--; b--; c--; d--;
    Cin(string, s);
    
    // a -> c
    {
        int i = a;
        while(true){
            if(i+2 >= c) break;
            if(s[i+2] == '.') i += 2;
            else if(s[i+1] == '.') i ++;
            else{
                Cout("No");
                return 0;
            }
        }
    }
    // b -> d
    {
        int i = b;
        while(true){
            if(i+2 >= d) break;
            if(s[i+2] == '.') i += 2;
            else if(s[i+1] == '.') i ++;
            else{
                Cout("No");
                return 0;
            }
        }
    }
    
    // cross
    if(c > d){
        bool f = false;
        for(int i = b; i <= d; i ++){
            if(s[i] == '.' && s[i-1] == '.' && s[i+1] == '.'){
                f = true;
                break;
            }
        }
        if(!f){
            Cout("No");
            return 0;
        }
    }

    Cout("Yes");
}


Measured memory_bytes: 640
import java.util.Scanner;

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

    for (int i = 1;; i++) {
      a = sc.nextInt();
      if (a == 0) break;
      System.out.printf("Case %d: %d\n", i, a);
    }

    sc.close();
  }
}



Measured memory_bytes: 65580
#include <bits/stdc++.h>
using namespace std;
long long n,z,x,c;
string ss;
int main()
{
    cin>>n;
    if(n<=111)cout<<111<<endl;
    else if(n<=222)cout<<222<<endl;
    else if(n<=333)cout<<333<<endl;
    else if(n<=444)cout<<444<<endl;
    else if(n<=555)cout<<555<<endl;
    else if(n<=666)cout<<666<<endl;
    else if(n<=777)cout<<777<<endl;
    else if(n<=888)cout<<888<<endl;
    else if(n<=999)cout<<999<<endl;

}


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

int main(){
  int a,b,c,d;
  
  cin >> a >> b >> c >> d;
  
  if(a + b > c + d)
    cout << "Left" << endl;
  else if(a + b < c + d)
    cout << "Right" << endl;
  else
    cout << "Balanced" << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <math.h>
#include <string>

using namespace std;

int main(){

  int N, M, sum_A = 0, ans;
  cin >> N >> M;

  int A[M];
  for(int a=0; a<M; a++){
    cin >> A[a];
    sum_A += A[a];
  }

  ans = N - sum_A;
  if (ans < 0) ans = -1;
  cout << ans;
}


Measured memory_bytes: 3636
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
struct Data{
  int p;
  string c;
  int num;
  bool operator<(const Data &ot) const{
    if(c==ot.c) return p>ot.p;
    else return c<ot.c;
  };
};

int main(){
  int i,n;
  cin>>n;
  vector<Data> d(n);

  for(i=0;i<n;i++){
    cin>>d[i].c;
    cin>>d[i].p;
    d[i].num=i+1;
  }

  sort(d.begin(),d.end());

  for(i=0;i<n;i++) cout<<d[i].num<<endl;
  
  

  return 0;
}

Measured memory_bytes: 256
#include <math.h>
#include <time.h>
#include <ctype.h>
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <string>
#include <vector>
#include <iostream>
#include <algorithm>
#include<iomanip>

#define MX 10000000000
#define mod 1000000007
#define ll long long int
#define pb(x) push_back(x)
#define MP(x,y) make_pair(x,y)

using namespace std;

ll power(ll a, ll b, ll m)
{
	if (b == 0)
		return(1);
	ll sol = power(a, b / 2, m);
	sol = (sol * sol) % m;
	if (b % 2 == 1)
		sol = (sol * a) % m;
	return(sol);
}

ll gcd(ll a, ll b)
{
	if (b == 0)
		return a;
	else
	{
		return gcd(b, a % b);
	}
}
ll a[200005];
void solve()
{
    int n, k;
    cin >> n >> k;
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
    }
    sort(a, a + n);
    int x = max(0,n - k);
    ll sol = 0;
    for (int i = 0; i < x; i++)
    {
        sol += a[i];
    }
    cout << sol;
}
int main()
{
	int t = 1;
//	cin >> t;
	while (t--)
	{
		solve();
	}
}


Measured memory_bytes: 1792
#include<stdio.h>
#include<math.h>
using namespace std;
int main()
{
	//freopen("test.out","w",stdout);
    int n;
    scanf("%d",&n);
    int m=n,s=1,i;
    while(m>=10){
    	m=m/10;
    	s++;
	}
	int sum;
	if(s==1) {
	     printf("%d",n);
	}
	if(s==2) {
		printf("9");
	}
	if(s==3) {
		printf("%d",9+n-100+1);
	}
	if(s==4) {
		printf("909");
	}
	if(s==5) {
		printf("%d",909+n-10000+1);
	}
	if(n==100000) printf("90909");
    return 0;
}

Measured memory_bytes: 128
#![allow(clippy::needless_range_loop)]
#![allow(unused_macros)]
#![allow(dead_code)]
#![allow(unused_imports)]

use itertools::Itertools;
use proconio::input;
use proconio::marker::*;

fn main() {
    input! {
        n: usize,
        sc: [(Usize1, usize)]
    }

    let mut conditions: Vec<Option<usize>> = vec![None; n];

    for &(s, c) in &sc {
        if let Some(digit) = conditions[s] {
            if digit != c {
                println!("-1");
                return;
            }
        }

        conditions[s] = Some(c);
    }

    let mut ans = 0;
    for (index, &digit) in conditions.iter().enumerate() {
        let min = if index == 0 && conditions.len() > 1 {
            1
        } else {
            0
        };

        let digit = digit.unwrap_or(min);
        if digit < min {
            println!("-1");
            return;
        }
        ans = ans * 10 + digit;
    }

    println!("{}", ans);
}


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

int main(){
	int n;
	double tate, yoko, takasa, ana, taikaku, hankei;
	while(1){
		cin >> tate >> yoko >> takasa;
		if(tate == 0 && yoko == 0 && takasa == 0){
			break;
		}

		if(tate > yoko){
			if(yoko > takasa){
				taikaku = sqrt(yoko * yoko + takasa * takasa);
			}

			else if(takasa > yoko && tate > takasa){
				taikaku = sqrt(yoko * yoko + takasa * takasa);
			}
		}

		else if(yoko > tate){
			if(tate > takasa){
				taikaku = sqrt(takasa * takasa + tate * tate);
			}

			else if(takasa > tate && yoko > takasa){
				taikaku = sqrt(takasa * takasa + tate * tate);
			}
		}

		else if(takasa > yoko){
			if(yoko > tate){
				taikaku = sqrt(yoko * yoko + tate * tate);
			}

			else if(tate > yoko && takasa > tate){
				taikaku = sqrt(yoko * yoko + tate * tate);
			}
		}

		hankei = taikaku / 2;

		cin >> n;

		for(int i = 0; i < n; i++){
			cin >> ana;
			if(ana > hankei){
				cout << "OK" << endl;
			}

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

	return 0;
}

Measured memory_bytes: 1220
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
 
/* attention
    long longのシフト演算には気をつけよう
    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも
    sizeは(int)とキャストしよう
    ごちゃごちゃ場合分けを考える前に全探索は考えましたか？
*/
 
const ll mod = 1e9+7;

void chmod(ll &M){
    if(M >= mod) M %= mod;
    else if(M < 0){
        M += (abs(M)/mod + 1)*mod;
        M %= mod;
    }
}

ll modpow(ll x, ll n){
    if(n == 0) return 1;

    ll res = modpow(x, n/2);
    if(n%2 == 0) return res*res%mod;
    else return res*res%mod*x%mod;
}

ll power(ll x, ll n){
    if(n == 0) return 1;

    ll res = power(x, n/2);
    if(n%2 == 0) return res*res;
    else return res*res*x;
}

int getl(int i, int N) { return i==0? N-1:i-1; };
int getr(int i, int N) { return i==N-1? 0:i+1; };

/* <--------------------------------------------> */

class UnionFind{
public:
    //親の番号を格納する。親だった場合はー（その集合のサイズ）
    vector<int> parents;

    //作る時はparentsを-1で初期化する
    //こうすることで全部ばらばらになる
    UnionFind(int n){
        parents = vector<int>(n, -1);
    }

    //Aがどのグループにいるか調べる
    int root(int A){
        if(parents[A]<0) return A;
        return parents[A] = root(parents[A]);
    }

    //自分のいるグループの大きさを調べる
    int size(int A){
        return -parents[root(A)];
    }

    //AとBをくっつける
    bool connect(int A, int B){
        //AとBを直接ではなく親同士をくっつける
        A=root(A);
        B=root(B);
        if(A==B){
            return false;
        }

        //大きい方（A)に小さい方（B)をくっつけたい
        if(size(A)<size(B)) swap(A, B);

        parents[A] += parents[B];
        parents[B] = A;

        return true;
    }
};



typedef tuple<ll, ll, ll> T;


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

    int N, M; cin >> N >> M;
    UnionFind uni(N);
 
    for(int i=0; i<M; i++){
        int x,y,z; cin >> x >> y >> z;
        --x; --y;
        uni.connect(x, y);
    }
 
    map<int, int> mp;
    for(int i=0; i<N; i++) ++mp[uni.root(i)];
    cout << mp.size() << endl;

	return 0;
}

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

typedef long long LL;
int a[50];
int main() {
    int n; cin>>n;
    for(int i=0; i<n; i++) cin>>a[i];
    int sum = 1, Max = a[0];
    for(int i=1; i<n; i++) {
        if(a[i] >= Max) {
            Max = a[i];
            sum++;
        }
    }
    cout<<sum<<endl;
    return 0;
}


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

int main(){
  while(true){
    int H,W;
    cin>>H>>W;
    if(W==0&&H==0)break;
    string tiles[H][W];
    bool same_tiles[H][W];
    for(int i=0;i<H;i++){
      for(int j=0;j<W;j++){
        same_tiles[i][j]=false;
      }
    }
    string tiles_line;
    for(int i=0;i<H;i++){
      cin>>tiles_line;
      for(int j=0;j<W;j++){
        tiles[i][j]=tiles_line[j];
      }
    }
    int now_x=0,now_y=0;
    while(true){
      if(same_tiles[now_y][now_x]==true){
        cout<<"LOOP"<<endl;
        break;
      }
      same_tiles[now_y][now_x]=true;
      if(tiles[now_y][now_x]==">")now_x++;
      else if(tiles[now_y][now_x]=="<")now_x--;
      else if(tiles[now_y][now_x]=="v")now_y++;
      else if(tiles[now_y][now_x]=="^")now_y--;
      else if(tiles[now_y][now_x]=="."){
        cout<<now_x<<' '<<now_y<<endl;
        break;
      }
    }
  }
}

Measured memory_bytes: 3672
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")


#include<bits/stdc++.h>

using namespace std;
#define ll long long
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define ins insert
#define ull unsigned long long
#define repi(i,a) for(auto i = a.begin(); i!= a.end() ;++i) 
#define repdi(i,a) for(auto i = a.rbegin(); i!=a.rend();++i) 
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define MOD 1000000007
#define ff first
#define ss second
#define fast ios::sync_with_stdio(0) , cin.tie(0) , cout.tie(0); 
#define nl "\n"
#define INF 1e18
#define sz(a) (int)a.size() 
#define all(a) a.begin(),a.end()
#define M 998244353
#define limit 100000000

typedef vector<ll> vll;
typedef pair<ll,ll> pii;
typedef vector<pii> vpi;
typedef vector<vector<ll> > vv;


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

signed main() {

#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
#endif 

    fast;
	int t=1;
	// cin>>t;
	rep(i,0,t) {
		solve() ;
	}
	return 0;
}


Measured memory_bytes: 3648
using System;
using System.Collections.Generic;
using System.Linq;

namespace abc161
{
    class Program
    {
        static void Main(string[] args)
        {
            var abc = Console.ReadLine().Split().Select(s => int.Parse(s));
            if(abc.Where(w=>w==5).Count()==2 && abc.Where(w => w == 7).Count() == 1)
            {
                Console.WriteLine("YES");
            }
            else
            {
                Console.WriteLine("NO");
            }
        }
    }
}


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

 int main(){
 int x[10000] ;
 for (int i=1; i<10001; i=i+1 )
 {
 cin >> x[i] ;
 }

 for (int i=1; i<10001; i=i+1 )
 {
 if( x[i] == 0 )
 {
 break;
}else{
 cout<< "Case "<< i << ": "<< x[i] << endl;
 }
}
 return 0;
 }


Measured memory_bytes: 3120
#include <stdio.h>
int main()
{
  long a, b;
  scanf("%ld %ld", &a, &b);
  long ans = 0;
  if (a & 1 && b & 1)
  {
    ans = (b - a) / 2 % 2 ^ a;
  }
  else if (a & 1 && (b & 1) == 0)
  {
    ans = (b - a - 1) / 2 % 2 ^ a ^ b;
  }
  else if ((a & 1) == 0 && b & 1)
  {
    ans = (b - a + 1) / 2 % 2;
  }
  else
  {
    ans = (b - a) / 2 % 2 ^ b;
  }
  printf("%ld", ans);
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#include <iomanip>
using namespace std;
#define reps(i,s,n) for(int i = s; i < n; i++)
#define rep(i,n) reps(i,0,n)
#define fi first
#define se second
#define mp make_pair
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;

ll N,M,H,W,K,Q,A,B,L,R;
string S,T;
const ll MOD = (1e+9) + 7;
const ll INF = 1LL << 60;
typedef pair<ll,ll> P;

typedef vector<P> vp;
typedef vector<vp> matP;

int main(){
    cin>>A>>B>>N;
    cout<<(A+B >= N ? "Yes" : "No")<<endl;
}

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

#define  int        long long int
 #define    sp(x)                 setprecision(x)
#define    bp(x)           __builtin_popcount(x)
 #define  ld         long double
 #define  f(i,j,n)            for(int i = j; i <= n; i++)
#define  r(i,n,j)       for(int i = n; i >= j; i--)
 #define  all(container)       container.begin() , container.end()
#define  sz(container)   (int)container.size()
 #define  ff             first
#define  ss             second
 #define  pii      pair <int , int>
#define  sp(x)       setprecision(x)
 #define  endl    "\n"
#define  mod  1000000007
 #define  pb    push_back
#define  mp    make_pair
 #define  T     int ttt; cin >> ttt; while(ttt--)
#define fast ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL);

int power(int x, int y, int p)  
{  
    int res = 1;    
    x = x % p; 
    if (x == 0) return 0; 
    while (y > 0)  
    {     
        if (y & 1)  
            res = (res*x) % p;  
        y = y>>1; 
        x = (x*x) % p;  
    }  
    return res; 
}
int n,m,k;

int32_t main()
{
    fast
    
    cin>>n>>m>>k;
    string s[n],a[n];
    f(i,0,n-1)
        cin>>s[i];
    int e=pow(2,n);
    int ee=pow(2,m);
    int ans=0;
    map< set<pii> ,int>mm;
    f(i,0,e-1)
    {
        f(j,0,ee-1)
        {
            int c=0;
            f(kk,0,n-1)
                a[kk]=s[kk];
           
            f(x,0,n-1)
                if((i)&(1LL<<x) )
                 f(y,0,m-1)
                {
                        a[x][y]='.';
                  
                }
            f(x,0,m-1)
                if((j)&(1LL<<x))
                    f(y,0,n-1)
            {
                        a[y][x]='.';
                 
            }
            f(ii,0,n-1)
                f(jj,0,m-1)
                    if(a[ii][jj]== '#')
                        c++;
            //cout<<c<<" ";
            if(c==k)
            {
                
                ans++;
            }
        }
    }
    cout<<ans;
}

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

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/rope>
using namespace __gnu_pbds;
using namespace __gnu_cxx;

typedef tree<int,null_type,less<int>,rb_tree_tag,
tree_order_statistics_node_update> indexed_set;

#pragma GCC optimize("O3")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("unroll-loops")

#define DEBUG(x) cout << ">> " << #x << ": " << x << endl;
#define _ ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);

const int MOD = 998244353;
typedef long long ll;
typedef long double ld;

ll n, m, k;
ll f1[200001], f2[200001];

ll expo(ll a, ll b) {
  if (b <= 0) return 1;
  if (a == 1) return 1;
  if (a == 0) return 0;
  ll ans = 1, base = a;
  for (; b; base*=base, b >>= 1) {
    base %= MOD;
    if (b&1) ans *= base;
    ans %= MOD;
  }
  return (ans + MOD) % MOD;
}

ll choose(ll n, ll r) {
  return (((((f1[n] * f2[r] % MOD) + MOD) % MOD) * f2[n-r] % MOD) + MOD) % MOD;
}

int main() { _
  cin >> n >> m >> k;
  ll ans = 0;
  f1[0] = 1, f1[1] = 1;
  f2[0] = 1, f2[1] = 1;
  for (ll i = 2; i <= 200000; i++)
    f1[i] = ((f1[i-1]*i)%MOD + MOD) % MOD;
  for (ll i = 2; i <= 200000; i++)
    f2[i] = expo(f1[i], MOD-2);

  for (ll i = 0; i <= k; i++) {
    ll j = n-i;
    ll tmp = m * expo(m-1, j-1) % MOD;
    tmp = ((tmp + MOD) % MOD) * choose(i+j-1, i) % MOD;
    ans = (ans + tmp + MOD) % MOD;
  }
  cout << ans;
  return 0;
}

Measured memory_bytes: 6784
function main()
  
  N = parse(Int,readline())
  A = map(x -> parse(Int,x), split(readline()))
  
  sort!(A)
  check = true

  for i in 1:N-1

    if A[i] == A[i+1]
      println("NO")
      check = false
      break
    end
  end
  
  if check == true
    println("YES")
  end
  
end

main()

Measured memory_bytes: 167704
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());

            for (int i = 0; i < n; i++)
            {
                double[] input = Array.ConvertAll(Console.ReadLine().Split(' '), double.Parse);

                double x1 = input[0], y1 = input[1];
                double x2 = input[2], y2 = input[3];
                double x3 = input[4], y3 = input[5];

                double dx1 = x1 - x2, dx2 = x1 - x3;
                double dy1 = y1 - y2, dy2 = y1 - y3;
                double dxy1 = x1 * x1 - x2 * x2 + y1 * y1 - y2 * y2;
                double dxy2 = x1 * x1 - x3 * x3 + y1 * y1 - y3 * y3;

                double px = (dy2 * dxy1 - dy1 * dxy2) / (2 * dx1 * dy2 - 2 * dx2 * dy1);
                double py = (dx2 * dxy1 - dx1 * dxy2) / (2 * dx2 * dy1 - 2 * dx1 * dy2);

                double r = Math.Sqrt((x1 - px) * (x1 - px) + (y1 - py) * (y1 - py));

                Console.WriteLine("{0:f3} {1:f3} {2:f3}",
                    Math.Round(px, 3, MidpointRounding.AwayFromZero),
                    Math.Round(py, 3, MidpointRounding.AwayFromZero),
                    Math.Round(r, 3, MidpointRounding.AwayFromZero));
            }
        }
    }
}

Measured memory_bytes: 9472