akhauriyash/Code-Regression huggingface dataset:
#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; }

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T> ostream& operator << (ostream &s, set<T> P)
{ for(auto it : P) { s << "<" << it << "> "; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ for(auto it : P) { s << "<" << it.first << "->" << it.second << "> "; } return s << endl; }


int main() {
    string S;
    cin >> S;
    int N = S.size();
    long long res = 0;
    for (int bit = 0; bit < (1<<(N-1)); ++bit) {
        long long tmp = 0;
        for (int i = 0; i < N-1; ++i) {
            tmp *= 10;
            tmp += S[i] - '0';
            if (bit & (1<<i)) res += tmp, tmp = 0;
        }
        tmp *= 10;
        tmp += S.back() - '0';
        res += tmp;
    }
    cout << res << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using V = vector<int>;
using VV = vector<V>;
using VVV = vector<VV>;
using VL = vector<ll>;
using VVL = vector<VL>;
using VVVL = vector<VVL>;
template<class T> using VE = vector<T>;
template<class T> using P = pair<T, T>;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define REP(i,k,n) for(int i=(k);i<(n);i++)
#define all(a) (a).begin(),(a).end()
#define output(x,y) cout << fixed << setprecision(y) << x << endl;
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; }
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
// const ll MOD = 1e9 + 7;
const ll MOD = 998244353;
ll upper = MOD + MOD;
ll under = -upper;
ll UPPER = MOD * MOD;
ll UNDER = -UPPER;
const long double pi = 3.141592653589793;
const int N = 202020;
ll n, k;
VL a(N);
bool cheak(ll x){
	ll cnt = 0;
	rep(i, n) {
		if (a[i] / x == 0) break;
		cnt += (a[i] / x);
	}
	return cnt <= k;
}
int main() {
	cin >> n >> k;
	rep(i, n) {
		cin >> a[i];
	}
	sort(all(a), greater<ll>());
	int low = 0, high = 1e9 + 1;
	while (high - low > 1) {
		ll mid = (high + low) / 2;
		if (cheak(mid)) high = mid;
		else low = mid;
	}
	cout << low + (n <= k) << endl;
	return 0;
}

Measured memory_bytes: 4684
#include<iostream>
#include<fstream>
#include<iomanip>
#include<cstdio>
#include<string>
#include<cstring>
#include<climits>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<deque>
#include<tuple>
#include<list>
#include<unordered_map>
#include<random>
#define ll long long
#define ull unsigned long long
#define pii pair<int,int>
#define pp pair<pair<ll, ll>,pair<ll, ll>>
#define pll pair<ll,ll>
#define vii vector<int>
#define vll vector<ll>
#define mat vector<vector<ll>>
#define lb lower_bound
#define pb push_back
#define mp make_pair
#define fi first
#define sc second
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep2(i,a,b) for(ll i=a;i<b;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define all(x) x.begin(),x.end()
#define LB(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define UB(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
#define ERASE(v) v.erase(unique(v.begin(),v.end()),v.end())
// #define int ll
using namespace std;
const ll INF = (1 << 30 ) - 1;
const ll LLINF = (1LL << 60LL);
const ll MOD = 1000000007;
const ll mod = 998244353;
const ll MAX = 1100000;
const double pi = acos(-1);
const double eps = 1e-10;
ll dx[4] ={1,0,-1,0} , dy[4] ={0,1,0,-1};



int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    ll a,b,c;
    cin>>a>>b>>c;
    if(a==b&&b==c) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
    return 0;
}

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

using namespace std;

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

typedef long long int lo;
#define pb push_back
#define st first
#define nd second
#define inf (int)1e9
#define N (int)1e5 * 5
#define mod (int)1e9 + 7
#define all(x) (x).begin(), (x).end()
int in(){ int a; cin >> a; return a; }

void solve(){
	int n, k;
	cin >> n >> k;
	vector<int> a(n);
	for(int i = 0 ; i < n ; i++){
		cin >> a[i];
	}
	sort(all(a));
	int sum = 0;
	for(int i = 0 ; i < k ; i++){
		sum += a[i];
	}
	cout << sum;
}

int main(){
  	ios_base::sync_with_stdio(0); cin.tie(nullptr); cout.tie(0); cerr.tie(0);
	// freopen("gir.gir", "r", stdin);
	// freopen("cik.cik", "w", stdout);
	int t = 1;
	// cin >> t;
	while(t--){
		solve();
	}
	return 0;
}

Measured memory_bytes: 3652
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;


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

  int A, B, C, D, K;
  int g;
  cin >> A >> B >> C;
  cin >> K;

  D = max(max(A, B), C);
  g = D;
  for(int i=0;i<K;i++){
    g *= 2;
  }

  int ans = A + B + C - D + g;
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
//
// Created by kuroneko on 2019-07-06.
//

#include <iostream>
#include <vector>

typedef long long ll;
using namespace std;

int main() {
    int N, M; cin >> N >> M;
    vector<ll> A(N);
    for (int i = 0; i < N; i++) {
        cin >> A[i];
    }

    vector<pair<ll, int>> v(M);
    for (int i = 0; i < M; i++) {
        int b;
        ll c;
        cin >> b >> c;
        v[i] = make_pair(c, b);
    }
    sort(A.begin(), A.end());
    sort(v.rbegin(), v.rend());

    int left = 0;
    for (int i = 0; i < M; i++) {
        auto it = upper_bound(A.begin()+left, A.end(), v[i].first);
        int right = int(it - A.begin());

        if (right - left > v[i].second) right = left + v[i].second;

        for (int j = left; j < right; j++) {
            A[j] = v[i].first;
        }

        left = right;
    }

    ll ans = 0;
    for (int i = 0; i < N; i++) {
        ans += A[i];
    }

    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 2560
#include<iostream>

using namespace std;

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

    int m[n];
    int min = 1000;
    for(int i=0;i<n;i++){
        cin >> m[i];
        x -= m[i];
        if(min>m[i])min = m[i];
    }

    cout << n + x/min << endl;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
using Graph = vector<vector<int>>;
const int INT_INF = 1001001001;

int main(){
    int n;
    cin >> n;
    vector<ll> A(n);
    for(int i=0;i<n;i++){
        cin >> A[i];
    }
    map<ll,int> m;
    for(int i=0;i<n;i++){
        m[A[i]]++;
    }

    vector<ll> q(1,0);

    vector<ll> p(2,0);
    for(auto x:m){
        if(x.second >= 4){
            q.push_back(x.first);
        }
        if(x.second >= 2){
            p.push_back(x.first);
        }
    }
/*
    for(auto x:p){
        cout << x << " ";
    }
    cout << endl;

    for(auto x:q){
        cout << x << " ";
    }
    cout << endl;
*/
    sort(q.begin(),q.end(),greater<ll>());
    sort(p.begin(),p.end(),greater<ll>());

/*
    for(auto x:p){
        cout << x << " ";
    }
    cout << endl;

    for(auto x:q){
        cout << x << " ";
    }
    cout << endl;
*/

    cout << max(q[0]*q[0],p[0]*p[1]) << endl;
    
}

Measured memory_bytes: 7296
package main

import "fmt"

func main() {
	var S, T string
	fmt.Scan(&S, &T)
	S += S
	for i := 0; i < len(T); i++ {
		if S[i:i+len(T)] == T {
			fmt.Println("Yes")
			return
		}
	}
	fmt.Println("No")
}


Measured memory_bytes: 1776
#include <bits/stdc++.h>
using namespace std;
#define AC 0
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	vector<int> prime;
	vector<bool> isprime(1e6+1,true),cnt(1e6+1);
	for(int i=2;i<=1e6;i++)
		if(isprime[i]) {
			prime.push_back(i);
			for(int j=i+i;j<=1e6;j+=i) isprime[j]=false;
		}
	int n,gcd=0;
	bool p=true;
	cin>>n;
	for(int a;n--;) {
		cin>>a;
		gcd=__gcd(gcd,a);
		if(p) {
			for(int i=0;i<prime.size()&&1ll*prime[i]*prime[i]<=a;i++)
				if(!(a%prime[i])) {
					if(cnt[prime[i]]) {
						p=false;
						break;
					}
					cnt[prime[i]]=true;
					while(!(a%prime[i])) a/=prime[i];
				}
			if(a>1) {
				if(cnt[a]) p=false;
				else cnt[a]=true;
			}
		}
	}
	if(p) cout<<"pairwise coprime";
	else if(gcd==1) cout<<"setwise coprime";
	else cout<<"not coprime";
	return AC;
}

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

typedef long long int ll;
typedef pair<ll, ll> pii;
#define f(i,a,b) for(ll i=a;i<b;i++)
#define fo(i,a,b) for(ll i = a; i<=b;i+=1)
#define rf(i,a,b)  for(ll i=a;i>=b;i--)
#define vll vector<ll>
#define sz(a) ll(a.size())
#define all(v) v.begin(),v.end()
#define pb push_back
#define pf push_front 
#define MAXN 100010
#define MOD 1000000007
#define mod 998244353
#define deb(x) cout << '>' << #x << ':' << x << endl;
#define debug(x) cout << '>' << #x << ':' << x << " ";
#define nl '\n'
#define INF 1000000000000000000
#define IO                 \
	ios::sync_with_stdio(0); \
	cin.tie(0);              \
	cout.tie(0);
#define int long long int

const int N = 3e5+5;
int n, t[8*N+5];

void build(int a[], int v, int tl, int tr) {
    if (tl == tr) {
        t[v] = a[tl];
    } else {
        int tm = (tl + tr) / 2;
        build(a, v*2, tl, tm);
        build(a, v*2+1, tm+1, tr);
        t[v] = max(t[v*2], t[v*2+1]);
    }
}

int query(int v, int tl, int tr, int l, int r) {
    if (l > r) 
        return 0;
    if (l == tl && r == tr) {
        return t[v];
    }
    int tm = (tl + tr) / 2;
    return max(query(v*2, tl, tm, l, min(r, tm)), query(v*2+1, tm+1, tr, max(l, tm+1), r) );
}

void update(int v, int tl, int tr, int pos, int new_val) {
    if (tl == tr) {
        t[v] = new_val;
    } else {
        int tm = (tl + tr) / 2;
        if (pos <= tm)
            update(v*2, tl, tm, pos, new_val);
        else
            update(v*2+1, tm+1, tr, pos, new_val);
        t[v] = max(t[v*2], t[v*2+1]);
    }
}

void solve(){
    int k;
    cin >> n >> k;
    fo(i, 0, n){
        t[i] = 0;
    }
    f(i, 0, n){
        int t;
        cin >> t;
        int x = query(1, 0, N, max(t-k, 0ll), min(t+k, N));
        update(1, 0, N, t, x+1);
    }
    cout << query(1, 0, N, 0, N) << nl;
}
main()
{
    IO;
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif
	int T = 1;
    // cin >> T;
    fo(c, 1, T){
        solve();
        // cout<<"Case #"<<c<<": ";
    }
    return 0;
}

Measured memory_bytes: 11792
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main() {
  int k, n;
  cin >> k >> n;
  int a[n];
  rep(i, n) cin >> a[i];

  int max = 0;
  int pos_right, pos_left;

  rep(i, n) {
    int diff;
    if (i != n - 1) {
      diff = a[i + 1] - a[i];
      // cout << "diff=" << diff << endl;
    } else {
      diff = k - a[n - 1] + a[0];
      // cout << "diff=" << diff << endl;
    }
    if (diff > max) {
      max = diff;
      pos_left = i;
      pos_right = i + 1;
      if (pos_right == n)
        pos_right = 0;
    }
  }
  // cout << "pos_left=" << pos_left << endl;
  // cout << "pos_right=" << pos_right << endl;

  int ans = 0;
  if (pos_right == 0) {
    rep(i, n - 1) {
      // cout << a[i + 1] << " " << a[i] << endl;
      ans += a[i + 1] - a[i];
      // cout << ans << endl;
    }

  } else {
    rep(i, pos_left) ans += a[i + 1] - a[i];
    // cout << ans << endl;
    for (int i = pos_right; i < n - 1; i++)
      ans += a[i + 1] - a[i];
    // cout << ans << endl;
    ans += (k - a[n - 1]) + a[0];
  }
  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define INFL 0x3f3f3f3f3f3f3f3f
#define EPS (1e-10)
using namespace std;
typedef long long ll;
typedef pair<int,int>P;

vector<int>v;
int a[200000],b[200000];
int sum[200000];

int main(){
	int n;cin>>n;
	rep(i,n){
		cin>>a[i]>>b[i];
		v.push_back(a[i]);
		v.push_back(b[i]+1);
	}
	sort(v.begin(),v.end());
	v.erase(unique(v.begin(),v.end()),v.end());
	rep(i,n){
		sum[lower_bound(v.begin(),v.end(),a[i])-v.begin()]++;
		sum[lower_bound(v.begin(),v.end(),b[i]+1)-v.begin()]--;
	}
	int Max=0;
	rep(i,v.size()){
		if(i)sum[i]+=sum[i-1];
		Max=max(Max,sum[i]);
	}
	cout<<Max<<endl;
}


Measured memory_bytes: 5484
#region using directives
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using static System.Console;
using static System.Convert;
#endregion

namespace for_contests
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = ReadLine();
            int k = 0;
            for (int i = 0; i < 6; i++)
                if (s[i] == '1')
                    k++;
            WriteLine(k);
            ReadKey();
        }
    }
}


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

using ll = long long;

void read();
template<typename First, typename... Rest> void read(First& first, Rest&... rest);
void write();
template<typename First, typename... Rest> void write(First& first, Rest&... rest);
template<typename T> void write_vec(vector<T>& v, char divider);

int main(){
    ll N;
    read(N);
    vector<ll> A(N);
    for(ll i = 0; i < N; i++){
        read(A[i]);
    }
    double ans = 0;
    for(ll i = 0; i < N; i++){
        ans += 1 / (double)A[i];
    }
    ans = 1 / ans;
    cout << fixed << setprecision(5) << ans;
    return 0;
}

//配列以外の入力を受け取る
void read(){

}
template<typename First, typename... Rest>
void read(First& first, Rest&... rest){
    cin >> first;
    read(rest...);
}
//
//配列以外を出力する
void write(){

}
template<typename First, typename... Rest>
void write(First& first, Rest&... rest){
    cout << first << " ";
    write(rest...);
}
//
//配列を区切って出力する
template<typename T>
void write_vec(vector<T>& v, char divider){
    for(size_t i = 0; i < v.size(); i++){
        cout << v[i] << divider;
    }
}
//

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define watch(x) cout << (#x) << " is " << (x) << endl
#define endl "\n"
typedef long long ll;
using namespace std;
int static fast = [](){
  ios::sync_with_stdio(false);
  cin.tie(0); cout.tie(0); return 0;
}();
// freopen("input.txt", "r", stdin);

int main() {
    int n, k;
    cin >> n >> k;
    vector<int> arr(n, 0);
    for(auto& val: arr)
        cin >> val;
    sort(arr.begin(), arr.end());
    cout << accumulate(arr.begin(), arr.begin()+k, 0) << endl;

    return 0;
}


Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 2e5+10 , OO = 0x3f3f3f3f;

#define clr(arr,val) memset(arr , val , sizeof (arr))
#define loop(i,n) for(int i = 0;i < int(n);i++)
#define rloop(i,n) for(int i = int(n)-1;i >= 0;i--)
#define range(i,a,b) for(int i = int(a);i <= int(b);i++)
#define ALL(v) ((v).begin()) , ((v).end())
#define SZ(v)  ((int)((v).size()))
typedef pair <int,int> pii ;
typedef vector < pii > vii ;
typedef vector < int > vi;
int dx[]={1,0,-1,0};int dy[]={0,1,0,-1}; //4 Direction
//int dx[]={1,1,0,-1,-1,-1,0,1};int dy[]={0,1,1,1,0,-1,-1,-1};//8 direction
//int dx[]={2,1,-1,-2,-2,-1,1,2};int dy[]={1,2,2,1,-1,-2,-2,-1};//Knight Direction
//int dx[6]={2,1,-1,-2,-1,1};int dy[6]={0,1,1,0,-1,-1}; //Hexagonal Direction
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);

int a;


int main()
{   

      ios_base::sync_with_stdio(0);
      cin.tie(0);cout.tie(0);


      cin >> a;
      int left = a/100;
      int right = a%100;
      if(1<=left && left <= 12){
            if(1<=right && right <= 12) cout << "AMBIGUOUS\n";
            else cout << "MMYY\n";
      }else{
            if(1 <= right && right <= 12) cout << "YYMM\n";
            else cout << "NA\n";
      }


      return 0;
}

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

int main(void) {
	string S;
	cin >> S;
	int i = 1;
	while (1) {
		string cutted = S.substr(0, S.size() - i);
		i++;
		if (cutted.size() % 2 != 0) continue;
		bool even = true;
		for (int j = 0; j < cutted.size() / 2; j++) {
			if (cutted[j] != cutted[cutted.size() / 2 + j]) even = false;
		}
		if (even) {
			printf("%d\n", cutted.size());
			return 0;
		}
	}
	return 0;
}


Measured memory_bytes: 3720
n, q = list(map(int, input().split()))
que = []
for _ in range(n):
    name, time = input().split()
    que.append([name, int(time)])
    
elapsed_time = 0
while que:
    name, time = que.pop(0)
    dt = min(q, time)
    time -= dt
    elapsed_time += dt
    if time > 0:
        que.append([name, time])
    else:
        print (name, elapsed_time)

Measured memory_bytes: 15868
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll N;
ll w[105],v[105];
#define INF 100000000000000
map<pair<ll,ll>,ll> mp;
ll solve(ll pos,ll wr) {
  if(wr < 0) return -INF;
  if(pos == N) {
     if(wr >= 0) return 0;
  }
  if(mp.find(make_pair(pos,wr)) != mp.end()) return mp[make_pair(pos,wr)];
  ll res = 0;
  res = v[pos] + solve(pos+1,wr-w[pos]);
  res = max(res,solve(pos+1,wr));
  mp[make_pair(pos,wr)] = res;
  return res;
}
int main() {
  ll W;
  cin >> N >> W;
  for(int i=0;i<N;i++) cin >> w[i] >> v[i];
  ll res = solve(0,W);
  cout << res << endl;
  return 0;
}


Measured memory_bytes: 6272
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<algorithm>
#include<math.h>
#include <string.h>
using namespace std;

int main(){
	int i,j,m,n;
	char a,b;
	while(cin>>n){
		cout<<800*n-200*(n/15)<<endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>
#include<stdlib.h>
 
int N,A[101],B[101],C[21];

int main()
{
  int i,j;
  scanf("%d",&N);

  for(i=1;i<N;i++)
  {
    scanf("%d",&B[i]);
  }
  j=B[1];
  
  for(i=2;i<N;i++)
  {
    j+=fmin(B[i-1],B[i]);
  }
  j+=B[N-1];
          
  
  
  printf("%d",j);

  return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<cmath>
#include<tuple>
#include<string>
typedef unsigned long long ll;
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define F first
#define S second
using namespace std;
const ll INF = 1e12;
const int i_INF = 2147483647;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main() {
	string s1, s2;
	cin >> s1;
	cin >> s2;
	int dp[1111][1111];
	rep(i, 0, 1111)rep(j, 0, 1111)dp[i][j] = 0;

	rep(i, 0, s1.size() + 1)dp[0][i] = i;
	rep(i, 0, s2.size() + 1)dp[i][0] = i;

	rep(i, 1, s2.size() + 1){
		rep(j, 1, s1.size() + 1) {
			int c;
			if (s1[j - 1] == s2[i - 1])c = 0;
			else c = 1;
			dp[i][j] = min({ dp[i - 1][j] + 1,dp[i][j - 1] + 1 ,dp[i - 1][j - 1] + c });
			//cout << dp[i][j] << " ";
		}//cout << endl;
	}
	cout << dp[s2.size()][s1.size()] << endl;
	return 0;
}


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

#define ll long long

int main(){

    int N;

    cin >> N;

    if(N >= 1000){
        cout << "ABD" << endl;
    }

    else cout << "ABC" << endl;

    return 0;

}


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

constexpr long long MOD = 1e9 + 7;

int main() {
	long long n, k;
	cin >> n >> k;

	long long s = 1;
	while (k <= n) {
		s = (s + k * (n + 1 - k) + 1) % MOD;
		++k;
	}

	cout << s;

	return 0;
}
	

Measured memory_bytes: 3592
N = int(input())
now = [0, 0, 0]

for i in range(N):
    t, x, y = map(int, input().split())
    dis = abs(x-now[0]) + abs(y - now[1])
    if (t - now[2]) < dis:
        print('No')
        break
    elif ((t - now[2]) - dis) % 2 != 0:
        print('No')
        break
else:
    print('Yes')


Measured memory_bytes: 3060
// AtCoder template
// sabaより胡蝶しのぶさんの方が可愛いのではないか？
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i,n) for(int i = 0; i < n; ++i)



int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int a, b; cin >> a >> b;
    
    for(double i = 1.0; i <= 100000; ++i){
        if(int(i*0.08)  ==  a && int(i*0.1) == b){
            cout << int(i) << endl;
            return 0;
        }
    }
    cout << -1 << endl;
}

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

using namespace std;

typedef long long ll;

double getTime() {
  return clock() / (double) CLOCKS_PER_SEC;
}

void read() {};

template<typename T, typename... Args>
void read(T& a, Args&... args) {
  cin >> a;
  read(args...);
}

void print() {};

template <typename T, typename... Args>
void print(T a, Args... args) {
  cout << a << " \n"[sizeof...(args) == 0];
  print(args...);
}

int main() {
  int n, m; cin >> n >> m;
  vector <int> ans(n);
  vector <int> cnt(10, 0);
  for(int i = 0; i < m; i++) {
    int x, y; cin >> x >> y;
    if(cnt[x - 1] and ans[x - 1] != y) {
      puts("-1");
      return 0;
    }
    cnt[x - 1]++;
    ans[x - 1] = y;
  }
  for(int i = 0; i < n; i++) {
    if(cnt[i]) continue;
    if(i == 0 and n == 1) ans[i] = 0;
    else if(i == 0) ans[i] = 1;
    else ans[i] = 0;
  }
  if(ans[0] == 0 and n != 1) {
    puts("-1");
    return 0;
  }
  for(auto x : ans) cout << x;
  puts("");
}

Measured memory_bytes: 256
import java.util.Scanner;
class Main {

	public static void main(String[] args) {
		Scanner in=new Scanner(System.in);
		int a=in.nextInt();
		int b=in.nextInt();
		int c=in.nextInt();
		int n=a-b;
		if((a<b)&&(b<c)) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
	}
}



Measured memory_bytes: 26152
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <map>
#include <climits>

using namespace std;

int main() {
  int N, M;
  cin >> N >> M;

  int tmp = 1;
  for (int i = 0; i < M; i++) {
    tmp *= 2;
  }

  cout << (1900 * M + 100 * (N - M)) * tmp << endl;

  return 0;
}

Measured memory_bytes: 256
//                          **********  YATIN KWATRA  ********** 

//AC bakshi Rabha

#include <bits/stdc++.h>
#define ll                      long long 
#define ull                     unsigned long long 
#define FIO                     ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define endl                    "\n"
#define fo(i,a,b)               for(int i = a; i<=b ; i++)
#define rfo(i,a,b)              for(int i = a; i>=b ; i--)
#define vii                      vector<int>
#define vll                     vector<ll>
#define pq                      priority_queue
#define uom                      unordered_map                
#define all(v)                  v.begin(),v.end()
#define mp                      make_pair
#define pb                      push_back
#define pob                     pop_back
#define ff                      first
#define ss                      second
#define pii                     pair<int,int> 
#define pll                     pair<long,long>
#define mll                     map<ll,ll>
#define mii                     map<int,int>
#define vvii                    vector<vii>
#define vvll                    vector<vll>
#define mod                     1000000007
#define pi                      3.1415926535897932384626433832795
// #define node                    Node

using namespace std;

void INPUT() {
    #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif

}
#define m 998244353

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

    ll res = 1LL;

    while(p)
    {
        if(p&1){

            res *= n;
            res%=m;
        }

        p >>= 1;
        n *= n;
        n%=m;
    }

    return res;
}

ll cnt;

ll f(vvll &dp, vll &v, ll n, ll i, ll s)
{
    if(s == 0) return power(2,n-i);

    if(i == n) return 0LL;

    if(dp[i][s] != -1 ) return dp[i][s];


    // Case-> Take it or leave it

    ll op1 = 0, op2 = 0;

    if(s>=v[i]) op1 = f(dp,v,n,i+1,s-v[i]);
                op2 = 2*f(dp,v,n,i+1,s);

    op1 %= m;
    op2 %= m;

    dp[i][s] = op1+op2;

    dp[i][s] %= m;

    return dp[i][s];
}

void solve()
{ 
        ll n,s,x;
        cin >> n >> s;

        vll v(n);
        cnt = 0; 

        fo(i,0,n-1)
        {
            cin >> v[i];
        } 

        sort(all(v));

    //    fo(i,0,n-1) cout << v[i] << " ";
      //  cout << endl;

        vvll dp(n+1,vll(s+1,-1));

    //    cout << power(2,6) << " " << power(3,5) << endl;
        cout << f(dp,v,n,0LL,s) << endl;

    
       
}
int main() {
    
    FIO
    INPUT();
    
    int t;
    t = 1;
 //   cin >> t;
    
    while(t--)
    {
       solve();
    }
    return 0;
}


Measured memory_bytes: 73912
import math
import sys

#imgur.com/Pkt7iIf.png

#n, m = map(int, input().split())
#n = int(input())
#d = list(map(int, input().split()))

n, x = map(int, input().split())
d = list(map(int, input().split()))
r = s = 0

for i, p in enumerate(d):
    s += p
    if s > x:
        exit(print(i+1))
print(n+1)



Measured memory_bytes: 2940
def geti; gets.to_i end
def getis; gets.split.map &:to_i end
def getin n;  n.times.map{geti}  end
def getisn n; n.times.map{getis} end
YES = "YES"; NO = "NO"; Yes = "Yes"; No = "No";

n,a,b = getis
p [n*a,b].min

__END__

a,b,c = getis
p [a,b,c].any?(&:even?) ? 0 : [a*b,b*c,c*a].min

a,b=getis
puts a > 0 ? 'Positive' : b >= 0 ? 'Zero' : (b - a) % 2 == 1 ? 'Positive' : 'Negative'


Measured memory_bytes: 1788
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <cctype>
#define len length()
#define sz size()
#define rng(i, a, b) for(int i = a; i < b; i++)
#define rep(i, n) rng(i, 0, n)
#define srt(v) sort(v.begin(), v.end())
#define rev(s) reverse(s.begin(), s.end())
#define vi(a, n) vector<int> a(n)
#define vs(a, n) vector<string> a(n)
#define vc(a, n) vector<char> a(n)
#define psb(a) push_back(a)
#define ppb pop_back()
#define erc(S, i) S.erase(S.begin() + i)
#define ers(S, i, j) S.erase(S.begin() + i, S.begin() + j)
#define sp(n) cout << setprecision(n) << fixed
#define fst(s) s.at(0)
#define lst(s) s.at(s.len - 1)
typedef long long ll;
using namespace std;
ll mod = 1000000007;

ll fctr(int n){ //nの階乗
    if(n<0) return -1;
    if(n==0) return 1;
    else{
        ll ans=1;
        rep(i,n){
            ans*=i+1;
            if(ans > mod) ans %= mod;
       }
       return ans % mod;
    }
}

int main(){
    ll N, M;
    cin >> N >> M;
    ll ans;
    if(abs(N - M) > 1) ans = 0;
    else{
        ans = fctr(N) * fctr(M);
        if(N == M){
            ans *= 2;
        }
    }
    ans %= mod;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
	public static void main(String[] args) {
	
   Scanner sc = new Scanner(System.in);
   
     int N = sc.nextInt();
     int K = sc.nextInt();
     Integer h[] = new Integer[N];
     
     int a = 0;
     
     for(int i=0; i<N; i++) {
    	 h[i] = sc.nextInt();
    	 if(h[i] >= K) {
    		 a++;
    	 }
     }
     System.out.println(a);
   }
}


Measured memory_bytes: 63204
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
ab=[]
ans=0
zure=0
for i in range(n):
    if a[i]<b[i]:
        ans+=1
        zure+=b[i]-a[i]
    ab.append([a[i]-b[i],a[i],b[i]])
ab.sort(key=lambda x:x[0], reverse=True)
i=0
while zure>0 and i<n:
    ans+=1
    zure-=ab[i][0]
    i+=1
if i==n:
    print(-1)
    exit()
print(ans)


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

#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 sz(x) int((x).size())
#define all(x) (x).begin(), (x).end()

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

mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

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

    int N;
    cin >> N;

    vvi grid(2, vi(N));
    for (int r = 0; r < 2; r++)
        for (int c = 0; c < N; c++)
            cin >> grid[r][c];

    vi pref(N), suff(N);
    for (int c = 0; c < N; c++) {
        pref[c] = grid[0][c] + (c ? pref[c-1] : 0);
    }
    for (int c = N - 1; c >= 0; c--) {
        suff[c] = grid[1][c] + (c + 1 < N ? suff[c+1] : 0);
    }

    int ans = 0;
    for (int i = 0; i < N; i++)
        ans = max(ans, pref[i] + suff[i]);
    cout << ans << endl;

    return 0;
}



Measured memory_bytes: 256
#D 別解
n,m=map(int,input().split())
a=list(map(int,input().split()))
cb=[]
for i in range(m):
    b,c=map(int,input().split())
    cb.append([c,b])
for i in range(n):
    cb.append([a[i],1])
cb.sort(reverse=True)
s=0
t=0
for i in  range(n):
    for j in range(cb[i][1]):
        if t==n:
            break
        else:
            s+=cb[i][0]
            t+=1
    if t==n:
        break
print(s)

Measured memory_bytes: 91544
import java.util.*;
class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);		
  		String s = in.nextLine();		
		for (char i = 'a'; i <= 'z'; i++) {
			if (s.indexOf(i) == -1) {
				System.out.println(i);
				break;
			}else if (i == 'z') {
				System.out.println("None");
			}
		}
	}
}

Measured memory_bytes: 24908
#include "bits/stdc++.h"
using namespace std;

int main(void) {
    int a, b, x;
    cin >> a >> b;
    x = a + b;
    if (x % 2 == 0) {
        cout << x / 2;
    }
    else {
        cout << 1 + x / 2;
    }
    return 0;
}

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

int main(void){
    string s;
    cin >> s;
    int d = 0;
    for(int i=0;i<s.size();i++){
        d += (int)(s[i]-'0');
        d %= 9;
    }
    if(d==0) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 3728
#pragma GCC optimize("O3")
#pragma GCC optimize("O1")
#pragma GCC optimize("O2")
#pragma GCC optimize("Os")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx2")
#pragma GCC optimization("unroll-loops")
#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false);
#define FO cout.tie(NULL);
#define FI cin.tie(NULL);
#define IN cin>>
#define OUT cout<<
#define loop(i,a,n) for(int i=a; i<n; i++)
#define rloop(i,a,n) for(int i=a; i>=n; i--)
#define endl "\n";
#define pb push_back
#define mp make_pair
#define set_bits(a) __builtin_popcountll(a)
#define ll long long int
#define ld long double
#define vll vector<long long int>
#define pll pair<long long int, long long int>
#define mod 1000000007
#define M 998244353
using namespace std;
ll gcd(ll a, ll b)
{
    return (b?gcd(b,a%b):a);
}
ll P(ll B, ll power, ll modulo)
{
    ll ans=1LL;
    while(power>0LL)
    {
        if(power%2LL==1LL)
        {
            ans=(ans*B)%modulo;
        }
        B=(B*B)%modulo;
        power/=2LL;
    }
    return ans;
}
bool isPrime(ll n)
{
    if(n<=1LL)
    {
        return false;
    }
    if(n<=3LL)
    {
        return true;
    }
    if(n%2==0LL || n%3==0LL)
    {
        return false;
    }
    for(ll i=5LL; (i*i)<=n; i+=6LL)
    {
        if(n%i==0LL || n%(i+2LL)==0LL)
        {
            return false;
        }
    }
    return true;
}
void vok()
{
    FAST
    FO
    FI
    #ifndef ONLINE_JUDGE
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    #endif
}
map<ll,ll> dp;
ll n,a,b,c,d;
ll run(ll n)
{
    if(n==1)
    {
        return 0;
    }
    if(n==0)
    {
        return (ll)(4e18);
    }
    if(dp.find(n)!=dp.end())
    {
        return dp[n];
    }
    ll ans=(ll)4e18;
    if(d<(ll)1e6 && n<(ll)1e12)
    {
        ans=min(ans,(n-1)*d);
    }
    if(n%2==0)
    {
        ans=min(ans,run(n/2)+a);
    }
    else
    {
        ans=min({ans,run((n-1)/2)+a+d,run((n+1)/2)+a+d});
    }
    if(n%3==0)
    {
        ans=min(ans,run(n/3)+b);
    }
    else if(n%3==1)
    {
        ans=min(ans,run((n-1)/3)+b+d);
    }
    else
    {
        ans=min(ans,run((n+1)/3)+b+d);
    }
    if(n%5==0)
    {
        ans=min(ans,run(n/5)+c);
    }
    else if(n%5==1)
    {
        ans=min(ans,run((n-1)/5)+c+d);
    }
    else if(n%5==2)
    {
        ans=min(ans,run((n-2)/5)+c+d+d);
    }
    else if(n%5==3)
    {
        ans=min(ans,run((n+2)/5)+c+d+d);
    }
    else
    {
        ans=min(ans,run((n+1)/5)+c+d);
    }
    dp[n]=ans;
    return ans;
}
int main()
{
    vok();
    int t;
    IN t;
    while(t--)
    {
        IN n>>a>>b>>c>>d;
        dp.clear();
        ll ans=run(n)+d;
        // OUT dp[2]<<endl
        OUT ans<<endl
    }
    return 0;
}

Measured memory_bytes: 4364
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i< (n);i++)
using namespace std;
int main(){
    int ans = 1e9;
    string s;
    cin >> s;
    int l = s.size();
    for(int i=0;i+2 < l;i++) {
        string c = s.substr(i,3);
        int n = stoi(c);
        int cl = abs(753-n);
        ans = min(ans,cl);
    }
    cout << ans << endl;
}
/*abc115
int main(){
    int n;
    cin >> n;
    vector<int> v(n,0);
    rep(i,n) cin >> v.at(i);
    sort(v.rbegin(),v.rend());
    v.at(0) /= 2;
    int ans = accumulate(v.begin(),v.end(),0);
    cout << ans << endl;   
}*/

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


int countDivisor(int N){
	int ans = 0;
	for (int i = 1; i <= N; i++)
	{
		if (N % i == 0) ans++;
	}
	return ans;
}

int main() {
	int N;
	cin >> N;
	int ans = 0;
	for (int i = 1; i <= N; i += 2)
	{
		if (countDivisor(i) == 8) ans++;
	}
	cout << ans << endl;
}

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

int d[100005];//初始的数 

struct node{
	int b,c;
}a[100005];

bool cmp(node x,node y){
	return x.c>y.c;//重载：按照更改的值排序 
}

int main(){
	int n,m;
	cin>>n>>m;
	for(int i=0;i<n;i++)
	cin>>d[i];
	sort(d,d+n);//升序排列 
	for(int i=0;i<m;i++)
	cin>>a[i].b>>a[i].c;//记录更改的pair 
	sort(a,a+m,cmp);//升序排列更改的pair 
	int tot=0;//遍历pair指针 
	ll count=0;//计数器 
	
	//关键，待研究 
	
	for(int i=0;i<n;i++){//外层循环存入的值，内层循环用pair更改小的值 
		if(d[i]<a[tot].c&&a[tot].b){//找比它小的数 
			count+=a[tot].c;
			a[tot].b--;
		}
		else count+=d[i];
		if(a[tot].b==0){//用光了就下一个 
			if(tot+1<m)
				tot++;
		}
	}
	cout<<count<<endl;
}

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

int main() {

    int n, m;

    cin >> n >> m;

    vector<double> v(n);

    int sum = 0;
    for(int i = 0; i < n; ++i) {
        cin >> v[i];
        sum += v[i];
    }

    sort(v.begin(), v.end(), greater<int>());

    int i;
    double d = 1.0 / (4 * m);
    for(i = 0; i < m; ++i) {
        if(v[i] / sum < d)
            break;   
    }

    if(i == m)
        cout << "Yes";
    else
        cout << "No";

    cout << endl;

    return 0;
}

Measured memory_bytes: 3676
#include <iostream>
#include <string>
#include <algorithm>
#include <stdio.h>

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

int main() {
	char a;
	cin>>a;
	
	if(a>='A' && a<='Z'){
		cout<<'A'<<endl;
	}else{
		cout<<'a'<<endl;
	}
	// your code goes here
	return 0;
}

Measured memory_bytes: 3588
#!/usr/bin/env python3
#EDPC F

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(1000000000)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

s = input()
t = input()
n,m = len(s),len(t)
dp = [[0]*(m+1) for _ in range(n+1)]
for i in range(n):
    for j in range(m):
        if s[i] == t[j]:
            dp[i+1][j+1] = dp[i][j] + 1
        else:
            dp[i+1][j+1] = max(dp[i+1][j],dp[i][j+1])

res = ''
while n > 0 and m > 0:
    if dp[n][m] == dp[n][m-1]:
        m -= 1
    elif dp[n][m] == dp[n-1][m]:
        n -= 1
    elif dp[n][m] == dp[n-1][m-1] + 1:
        res += s[n-1]
        n -= 1
        m -= 1
print(res[::-1])

Measured memory_bytes: 112348
n = int(input())

talk = [[] for i in range(n)]

for i in range(n):
    messages = int(input())
    for _ in range(messages):
        talk[i].append(tuple(map(int, input().split())))

res = 0

for key in range(2 ** n):
    flag = True
    answer = [0 for i in range(n)]
    for i in range(n):
        if key & (1 << i) > 0:
            answer[i] = 1

    for i in range(n):
        if answer[i] == 0:
            continue
        for t in talk[i]:
            person = t[0] - 1
            if t[1] != answer[person]:
                flag = False
                break

    if flag:
        res = max(res, sum(answer))

print(res)


Measured memory_bytes: 3064
mod = 10**9+7
N = int(input())
l = list(map(int, input().split()))

if N % 2 == 1:
    l.append(0)
    N -= 1
else:
    l = list(map(lambda x: x-1, l))

l = sorted(l)
i = 0
for f, s in zip(l[0::2], l[1::2]):
    if f == 2*i and s == 2*i:
        i += 1
    else:
        print(0)
        exit()

print(2**(N//2) % mod)


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

typedef long long ll;
int main()
{
    int n,t,a;
    cin>>n>>t>>a;
    double mn=1.0*(INT_MAX);
    int idx=0;
    for(int i=0;i<n;i++)
    {
        double h;
        cin>>h;
        double ans=t-(h*0.006);
        if(abs(ans-a)<mn)
        {
            mn=abs(ans-a);
            idx=i+1;
        }
    }
    cout<<idx<<endl;
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main()
{ long long int X,h;
int count1=0,count2=0;
    scanf("%lld",&X);
    while(X>=500)
    {X=X-500;
       count1++;
    }
     while(X>=5)
    {X=X-5;
       count2++;
    }

    h=(1000*count1)+(5*count2);

    printf("%lld",h);

}




Measured memory_bytes: 128
#include <iostream>
#include <complex>
#include <algorithm>
#include <cmath>
#include <vector>

using namespace std;

typedef complex<double> P;
typedef vector<P> polygon;

double cross(const P &a, const P &b){
    return imag(conj(a)*b);
}

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

#define curr(G, i) G[i]
#define next(G, i) G[(i+1)%G.size()]
enum { OUT, ON, IN };

int contains(const polygon& G, const P& p) {
    bool in = false;
    for (int i = 0; i < G.size(); ++i) {
        P a = curr(G,i) - p, b = next(G,i) - p;
        if (imag(a) > imag(b)) swap(a, b);
        if (imag(a) <= 0 && 0 < imag(b))
            if (cross(a, b) < 0) in = !in;
        if (cross(a, b) == 0 && dot(a, b) <= 0) return ON;
    }
    return in ? IN : OUT;
}

int main(){
    int n;
    int xp1, yp1, xp2, yp2, xp3, yp3, xa, ya, xb, yb;
    cin >> n;

    for(int i=0;i<n;i++){
        polygon triangle;
        cin >> xp1 >> yp1 >> xp2 >> yp2 >> xp3 >> yp3 >> xa >> ya >> xb >> yb;
        triangle.push_back(P(xp1,yp1));
        triangle.push_back(P(xp2,yp2));
        triangle.push_back(P(xp3,yp3));
        int a,b;
        a = contains(triangle, P(xa,ya));
        b = contains(triangle, P(xb,yb));
        if(a+b == 2 && a*b == 0){
            cout << "OK" << endl;
        }else{
            cout << "NG" << endl;
        }
    }
}

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

int main(){
  int64_t a,b,c;
  cin >> a >> b >> c;

  int64_t d= c-(a+b);
  string ans= (d > 0 && 4*a*b < d*d) ? "Yes"
                                     : "No";

  cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
#define all(x) (x).begin(), (x).end()
#define endl '\n'
#define fsp(x) cout << fixed << setprecision(x)
const ll inf = LLONG_MAX;
const long double pi = M_PI;
void Yes() {cout << "Yes" << endl;}
void No() {cout << "No" << endl;}
void YES() {cout << "YES" << endl;}
void NO() {cout << "NO" << endl;}

int main() {
  ll a, b, k;
  cin >> a >> b >> k;
  for (ll i = 0; i < k; i++) {
    if (i % 2 == 0) {
      if (a % 2 == 1) a--;
      a /= 2;
      b += a;
    }
    else {
      if (b % 2 == 1) b--;
      b /= 2;
      a += b;
    }
  }
  cout << a << " " << b << endl;
}

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

int main() {
  int t; //データセット                                                           
  int n; //フィールドアスレチックのブロックの個数                                 
  vector<int> h; //各ブロックの高さ                                               

  cin >> t;

  for(int i = 0; i < t; i++) {
    int ans_up = 0; //登る最大の段差                                              
    int ans_dwn = 0; //降りる最大の段差                                           
    cin >> n;
    for(int j = 0; j < n; j++) {
      int H;
      cin >> H;
      h.push_back(H);
    }
    for(int j = 1; j < n; j++) {
      //1つ前より大きい                                                           
      if(h[j-1] < h[j]) {
        if(ans_up < h[j]-h[j-1])
          ans_up = h[j]-h[j-1];
      }
      else {
        if(ans_dwn < h[j-1]-h[j])
          ans_dwn = h[j-1]-h[j];
      }
    }
    cout << ans_up << ' ' << ans_dwn << endl;
    h.clear();
  }
  return 0;
}



Measured memory_bytes: 3028
use proconio::input;

fn main() {
    input! {
        a: usize,
        b: usize,
        c: usize,
    }

    if (a == b && a != c) || (b == c && b != a) || (c ==a && c != b) {
        println!("Yes");
    } else {
        println!("No");
    }
}


Measured memory_bytes: 2108
def main():
    from itertools import accumulate
    N, K = map(int, input().split())
    A = list(map(int, input().split()))

    accA = [0] + list(accumulate(A))
    Bin = []

    for i in range(N + 1):
        for j in range(i + 1, N + 1):
            par_sum = accA[j] - accA[i]
            b = bin(par_sum)
            b = b[2:].zfill(40)
            Bin.append(b)

    ans = 0
    for n in range(40):
        sifted_B = [b for b in Bin if b[n] == "1"]
        if len(sifted_B) >= K:
            ans += 2 ** (39 - n)
            Bin = sifted_B

    print(ans)

    
main()


Measured memory_bytes: 143124
import java.util.*;public class Main{public static void main(String[] a){for(Scanner s=new Scanner(System.in);s.hasNext();){float[]d=new float[6];for(int i=0;i<6;)d[i++]=s.nextFloat();float x = (d[1]*d[5]-d[2]*d[4])/(d[1]*d[3]-d[0]*d[4]);x=x==0?0:x;float y=(d[0]*d[5]-d[2]*d[3])/(d[0]*d[4]-d[1]*d[3]);y=y==0?0:y;System.out.printf("%.3f %.3f\n",x,y);}}}

Measured memory_bytes: 12000
use proconio::{fastout, input};

pub trait LexicalPermutation {
    /// Return  if the slice was permuted,  if it is already
    /// at the last ordered permutation.
    fn next_permutation(&mut self) -> bool;
    /// Return  if the slice was permuted,  if it is already
    /// at the first ordered permutation.
    fn prev_permutation(&mut self) -> bool;
}

impl<T> LexicalPermutation for [T]
where
    T: Ord,
{
    /// Original author in Rust: Thomas Backman <serenity@exscape.org>
    fn next_permutation(&mut self) -> bool {
        // These cases only have 1 permutation each, so we can't do anything.
        if self.len() < 2 {
            return false;
        }

        // Step 1: Identify the longest, rightmost weakly decreasing part of the vector
        let mut i = self.len() - 1;
        while i > 0 && self[i - 1] >= self[i] {
            i -= 1;
        }

        // If that is the entire vector, this is the last-ordered permutation.
        if i == 0 {
            return false;
        }

        // Step 2: Find the rightmost element larger than the pivot (i-1)
        let mut j = self.len() - 1;
        while j >= i && self[j] <= self[i - 1] {
            j -= 1;
        }

        // Step 3: Swap that element with the pivot
        self.swap(j, i - 1);

        // Step 4: Reverse the (previously) weakly decreasing part
        self[i..].reverse();

        true
    }

    fn prev_permutation(&mut self) -> bool {
        // These cases only have 1 permutation each, so we can't do anything.
        if self.len() < 2 {
            return false;
        }

        // Step 1: Identify the longest, rightmost weakly increasing part of the vector
        let mut i = self.len() - 1;
        while i > 0 && self[i - 1] <= self[i] {
            i -= 1;
        }

        // If that is the entire vector, this is the first-ordered permutation.
        if i == 0 {
            return false;
        }

        // Step 2: Reverse the weakly increasing part
        self[i..].reverse();

        // Step 3: Find the rightmost element equal to or bigger than the pivot (i-1)
        let mut j = self.len() - 1;
        while j >= i && self[j - 1] < self[i - 1] {
            j -= 1;
        }

        // Step 4: Swap that element with the pivot
        self.swap(i - 1, j);

        true
    }
}

#[fastout]
fn main() {
    input! {
        d: [usize; 5]
    };

    let mut d: Vec<usize> = d;
    d.sort();

    let mut result = std::usize::MAX;
    loop {
        let mut sum = 0;
        for i in 0..5 {
            if i == 4 {
                sum += d[i];
            } else {
                let mut x = d[i] / 10;

                if d[i] % 10 != 0 {
                    x += 1;
                }

                sum += x * 10;
            }
        }
        result = std::cmp::min(result, sum);

        if !d.next_permutation() {
            break;
        }
    }

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


Measured memory_bytes: 2192
import java.util.Scanner;
import java.lang.Math;
import java.util.ArrayList;
import java.util.List;
//List<String> color = new ArrayList<>();
//int[] n = new int[k];

class Main {
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		List<Integer> n = new ArrayList<>();
		int[] n1 = new int[4];
		for (int i = 0; i < 4; i++)
			n1[i] = stdIn.nextInt();
			
		for (int i = 0; i < 4; i++)
			n.add(n1[i]);

		if (n.contains(1)) {
			int b = n.indexOf(1);
			n.remove(b); 
		}
		if (n.contains(9)) {
			int c = n.indexOf(9);
			n.remove(c); 
		}
		if (n.contains(7)) {
			int d = n.indexOf(7);
			n.remove(d); 
		}
		if (n.contains(4)) {
			int e = n.indexOf(4);
			n.remove(e); 
		}

		if (n.isEmpty() == true) 
			System.out.println("YES");
		else
			System.out.println("NO");
	}
}

Measured memory_bytes: 21584
N,M,K = map(int,input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))


def Cum(X):
    temp = 0
    Cum = [0]*len(X)
    for i in range(len(X)):
        temp += X[i]
        Cum[i] += temp
    return Cum

a = Cum(A)
a.insert(0,0)
b = Cum(B)
b.insert(0,0)

na = 0
for i in range(N+1):
    if i == N and a[i]<=K:
        na = N
    elif a[i]<=K and a[i+1]>K:
        na = i

ans = na

nb = 0
for i in range(na,-1,-1):
    temp = K-a[i]
    for j in range(nb,M+1):
        if j == M and b[j] <= temp:
            nb = M
            ans = max(ans,i+nb)
        elif b[j]<=temp and b[j+1]>temp:
            nb = j
            ans = max(ans,i+nb)
            break
        
print(ans)

Measured memory_bytes: 47356