akhauriyash/Code-Regression huggingface dataset:
// G++ MACRO.CPP -STD=C++14
#include <bits/stdc++.h>
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9+7;
const ll LINF = 1e18;
using namespace std;

#define dump(x)  cout << #x << " = " << (x) << endl;
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) << endl
#define possible(n) cout << ((n) ? "possible" : "impossible"  ) << endl

#define SANKOU(n,a,b) cout << ((n) ? (#a) : (#b) ) << endl

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)

#define FOREACH(x,a) for(auto& (x) : (a) )

#define WFA(d,v) REP(k,v)REP(i,v)REP(j,v)d[i][j]=min(d[i][j],d[i][k]+d[k][j])

#define SCOUT(x) cout<<(x)<<" "
#define ENDL cout<<endl

#define VECCIN(x) for(auto&youso_: (x) )cin>>youso_
#define VECIN2(x,y) REP(i,x.size())cin>>x[i]>>y[i]
#define VECCOUT(x) if(1){for(auto tt=x.begin();tt!=x.end();tt++){if(tt!=x.begin())cout<<" ";cout<<(*tt);}cout<<endl;}

#define ALL(obj) (obj).begin(),(obj).end()

#define EXIST(n,x) (find(ALL(n),x)!=n.end())
#define UNIQUE(obj) sort(ALL( obj )); obj.erase(unique(ALL(obj)),obj.end())
#define EN(x) if(1){cout<<#x<<endl;return 0;}
#define COUT(x) cout<<(x)<<endl
void CINT(){}
template <class Head,class... Tail>
void CINT(Head&& head,Tail&&... tail){
    cin>>head;
    CINT(move(tail)...);
}
#define CIN(...) int __VA_ARGS__;CINT(__VA_ARGS__)
#define LCIN(...) ll __VA_ARGS__;CINT(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(__VA_ARGS__)

template <class T = ll>
T IN(){T x;cin>>x;return (x);}

template <class Head>
void VT(Head head){}
template <class Head,class Seco,class... Tail>
void VT(Head&& head,Seco&& seco,Tail&&... tail){
    seco.resize(head);
    VT(head,move(tail)...);
}
void VT2(){}
template <class Head,class... Tail>
void VT2(Head&& head,Tail&&... tail){
  VECCIN(head);
  VT2(move(tail)...);
}

template <class Head>
void VT3(Head&& head){}
template <class Head,class Seco,class... Tail>
void VT3(Head&& head,Seco&& seco,Tail&&... tail){
  seco[head]=IN();
  VT3(head,move(tail)...);
}

#define VC1(n,...) V __VA_ARGS__;VT(n,__VA_ARGS__);VT2(__VA_ARGS__); //aaabbbccc
#define VC2(n,...) V __VA_ARGS__;VT(n,__VA_ARGS__);REP(i,n)VT3(i,__VA_ARGS__); //abcabcabc

// #include <boost/multiprecision/cpp_int.hpp>
// using namespace boost::multiprecision; // cpp_int

#define P pair<ll,ll>
#define V vector<ll>
#define M map<int,int>
#define S set<int>
#define PQ priority_queue<int>
#define PQG priority_queue<int,V,greater<int>>

#define str string

#define pb(a) push_back(a)
#define mp make_pair


int main(){
  LCIN(n,z,w);VC1(n,a);

  if(n==1){COUT(abs(a[0]-w));return 0;}
  COUT(max(abs(a[n-1]-w),abs(a[n-2]-a[n-1])));


  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lim 100005
#define mod 1000000007
#define mp make_pair
#define sd(n) scanf("%lld",&n)
#define FIO(name) freopen(name,"r",stdin)
#define F first
#define S second
ll a[lim+1];
int main()
{
	
	//FIO("in.txt");
	ll n;
	ll x;
	cin>>n>>x;

	for(ll i=0;i<n;i++)
		cin>>a[i];
	ll i=0;
	ll ans=0;
	ans+=max(0LL,a[i]-x);
	a[0]-=ans;
	i++;
	while(true)
	{
		if(i>=n)
			{
			
		break;}
		if(a[i]+a[i-1]<=x)
		{
			i++;
			continue;
		}
		ll dif=a[i]+a[i-1];
		dif-=x;
		a[i]-=dif;
		ans+=dif;
		i++;		
	}
	cout<<ans<<endl;

	
	
	
}



Measured memory_bytes: 1152
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <tuple>
#include <vector>
using namespace std;
typedef long long ll;
ll const INF = 1LL << 60;

int main() {
  ll N;
  cin >> N;
  vector<ll> a(3 * N);
  for (int i = 0; i < 3 * N; i++) {
    cin >> a[i];
  }
  sort(a.begin(), a.end());
  deque<ll> q;
  for (int i = 0; i < a.size(); i++) {
    q.push_back(a[i]);
  }
  ll ans = 0;
  while (!q.empty()) {
    q.pop_front();
    q.pop_back();
    ans += q.back();
    q.pop_back();
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 7904
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
const long double PI = (acos(-1));
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
int ctoi(char c)
{
    switch (c)
    {
    case '0':
        return 0;
    case '1':
        return 1;
    case '2':
        return 2;
    case '3':
        return 3;
    case '4':
        return 4;
    case '5':
        return 5;
    case '6':
        return 6;
    case '7':
        return 7;
    case '8':
        return 8;
    case '9':
        return 9;
    default:
        return 0;
    }
}
int main()
{
    string s;
    cin >> s;
    int ans = 0;
    for (int i = 0; i < s.size() / 2; i++)
    {
        if (s[i] != s[s.size() - i - 1])
        {
            ans++;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <unordered_map>
#include <vector>
#include <string.h>
#include <set>

using namespace std;

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

template<class T> void printvec(const vector<T>& v) {
  for (auto x : v) { cout << x << " "; }
  cout << endl;
}
template<class T> void printtree(const vector< vector<T> >& tree) {
  for (long long i = 0; i < tree.size(); ++i) {
    cout << i + 1 << ": "; printvec(tree[i]);
  }
}
template<class T, class U> void printmap(const map<T, U>& mp) {
  for (auto x : mp) { cout << x.first << "=>" << x.second << 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; }

#define rep(i, n) for(ll i = 0; i < n; ++i)
#define all(s) s.begin(), s.end()
#define fr first
#define sc second
#define mp make_pair
#define pb push_back

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef tuple<ll, ll, ll> triple;
typedef double D;

const ll INF = 1e9;
const ll MOD = 1000000007;  // 1e9 + 7

vector<vector<ll>> g;
vector<ll> dp; // -1 .. no paint, 0 .. red, 1 .. blue

// c .. 0 or 1
bool dfs(int v, int c) {
  if (dp[v] >= 0) {
    return dp[v] == c;
  }
  // Here, dp[v] == -1
  dp[v] = c;
  int nc = c^1; // next color
  for (auto nv : g[v]) {
    if (!dfs(nv, nc)) { return false; }
  }
  return true;
}

int main(int argc, char** argv) {
  cin.tie(NULL);
  cout.tie(NULL);
  ios_base::sync_with_stdio(false);
  //cout << setprecision(10) << fixed;

  ll n, m;
  cin >> n >> m;
  g.resize(n);
  dp.assign(n, -1);
  rep(i, m) {
    ll a, b;
    cin >> a >> b;
    --a; --b; //0-indexed
    g[a].push_back(b);
    g[b].push_back(a);
  }

  if (dfs(0, 0)) { // g is bipartite grah
    ll red = 0;
    rep(i, n) {
      if (dp[i] == 0) { ++red; }
    }
    ll blue = n-red;
    cout << red*blue - m << endl;
  } else {
    cout << n*(n-1)/2 - m << endl;
  }
}


Measured memory_bytes: 7296
#include <iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<math.h>
using namespace std;
typedef long long ll;
#define int long long
typedef vector<int> VI;
#define fore(i,a) for(auto &i:a)
#define REP(i,n) for(int i=0;i<n;i++)
#define eREP(i,n) for(int i=0;i<=n;i++)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define eFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define SORT(c) sort((c).begin(),(c).end())
#define rSORT(c) sort((c).rbegin(),(c).rend())
#define LB(x,a) lower_bound((x).begin(),(x).end(),(a))
#define UB(x,a) upper_bound((x).begin(),(x).end(),(a))
#define INF 1000000000
#define LLINF 9223372036854775807
#define mod 1000000007
//vector<vector<int> > dp;
//vector<vector<vector<int> > > vvvi;
//dp=vector<vector<int> >(N, vector<int>(M,0));
//vector<pair<int,int> > v;
//v.push_back(make_pair(x,y));
//priority_queue<int,vector<int>, greater<int> > q2;

int N, S;

int f(int b, int n) {
	if (b < 2)return LLINF;
	int ret = 0;
	while (n >= b) {
		ret += n % b;
		n /= b;
	}

	return ret + n;
}

int solve() {
	if (N == S)return N + 1;
	int ans = LLINF;

	FOR(B, 2, sqrt((float)N) + 1) {
		if (f(B, N) == S)
			ans = min(ans, B);
	}
	FOR(p, 1, sqrt((float)N)) {
		int B = (N - S) / p + 1;
		if (f(B, N) == S)ans = min(ans, B);
	}
	if (ans == LLINF)
		return -1;
	else
		return ans;
}
signed main(){
cin.tie(0);
ios::sync_with_stdio(false);

	
	cin >> N >> S;

	cout << solve() << endl;

	return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define REP(i,n) for(int i=0;i<(int)(n);i++)

using namespace std;
typedef pair<int,int> rect;
#define mkrect(i,j) make_pair((i),(j))
int n,w,d,p,s;
vector<rect> que;

int main(){ _;
  while(cin>>n>>w>>d,(n|w|d)!=0){
    que=vector<rect>{mkrect(w,d)};
    REP(i,n){
      cin>>p>>s;
      auto it=next(que.begin(),p-1);
      rect r=*it;
      que.erase(it);
      s%=(r.first+r.second);
      if(s<r.first){
	int minw=min(s,r.first-s);
	int maxw=r.first-minw;
	que.push_back(mkrect(minw,r.second));
	que.push_back(mkrect(maxw,r.second));
      }else{
	int minh=min(s-r.first,r.second-(s-r.first));
	int maxh=r.second-minh;
	que.push_back(mkrect(r.first,minh));
	que.push_back(mkrect(r.first,maxh));
      }
    }
    multiset<int> sq;
    for(auto q:que)sq.insert(q.first*q.second);
    for(auto i=sq.begin();i!=sq.end();i++){
      if(next(i)==sq.end())cout<<(*i)<<endl;
      else cout<<(*i)<<" ";
    }
  }
}

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

int main()
{
	int w, n, a[30], b[30], ans[30];
	char dummy;

	cin >> w >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> a[i] >> dummy >> b[i];
	}

	for (int i = 0; i < w; i++)
		ans[i] = i+1;

	for (int i = 0; i < n; i++)
		swap(ans[a[i]-1], ans[b[i]-1]);

	for (int i = 0; i < w; i++)
		cout << ans[i] << endl;

	return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
cin >> N;
 vector<int> X(N);
for(int n=0;n<N;n++){
 cin >>X.at(n);
}
vector<int> Y;
Y=X;
sort(X.begin(),X.end());

for(int i=0;i<N;i++){
if(Y.at(i)<X.at(N/2)){
cout << X.at(N/2) <<endl;
}else{
cout << X.at(N/2-1) <<endl;
}

}

}

Measured memory_bytes: 3712
#include <iostream>
#include <iomanip>
#include <string>
#include <algorithm>
#include <math.h>
#include <time.h>
using namespace std;
int main() {
	long long int a, b, c[101], d;
	long long int ans = 0;
	cin >> a >> b;
	for (int i = 1; i <= a; i++) {
		cin >> c[i];
		d = b - c[i];
		if (c[i] > d) {
			ans += d;
		}
		else {
			ans +=c[i];
		}
	}
	cout << ans * 2 << endl;

}

Measured memory_bytes: 256
# encoding: utf-8                                                                      

word = gets.chomp

words = { }

while line = gets.chomp and line != "END_OF_TEXT"
  line.downcase.split(/\s/).each do |w|
    if words[w].nil?
      words[w] = 1
    else
      words[w] += 1
    end
  end
end

puts words[word]

Measured memory_bytes: 6108
#include <stdio.h>
#include <string.h>

int main() {
	int A, B;
	char S[10], T[10], U[10];
	scanf("%s%s%d%d%s",S,T,&A,&B,U);
	if (strcmp(S,U)==0) {
		A--;
	}
	else {
		B--;
	}
	printf("%d %d",A,B);
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define int long long
int mod=1e9+7;
int h,w,k;
vector<int> r;
int dp[101][8];

int nextPos(int cur,int row){
int l,r;
  l=cur>0?(row>>cur-1)%2:0;
  r=(row>>cur)%2;
  if(cur>0 && l)return cur-1;
  else if(cur<w-1 && r)return cur+1;
  else return cur; 
}

signed main(){

cin >>h >>w >>k;
  
//cout<<nextPos(0,2)<<endl;  
//cout<<nextPos(1,2)<<endl;    
if(w>1){
for(int x=0;x<(1<<w-1)-1;x++)if((x & x>>1 & (1<<w-2)-1  ) ==0  )r.push_back(x);
}else{
 r.push_back(0);

}

//for(auto&& x:r)cout<<x<<" ";
//cout<<endl;
//cout<<r.size()<<endl;
  
//static int dp[h][w];
//fill(dp,dp+w,0);
dp[0][0]=1;  
  
for(int i=0;i<h;i++){
  for(int j=0;j<w;j++){
    for(auto&& x:r){
//      int y;
//      y=nextPos(j,x);
      dp[i+1][nextPos(j,x)]+=(dp[i][j]%mod);
    }
  }  
}

// for(int i=0;i<=h;i++){
//     for(int j=0;j<w;j++){
//         cout <<dp[i][j]<<" ";
//     }
//    cout <<endl;
// }

cout <<dp[h][k-1]%mod<<endl;
}
  


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <set>
#include <vector>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <numeric>
#include <functional>
using namespace std;

#define Rep(b, e, i) for(int i = b; i <= e; i++)
#define rep(n, i) Rep(0, n-1, i)

const int MAX = 200000;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const int INF = 1<<31-1;
const int MOD = 1000000007;

int dx4[4]={1,0,-1,0};
int dy4[4]={0,1,0,-1};
int dx8[8]={1,0,-1,1,-1,1,0,-1};
int dy8[8]={1,1,1,0,0,-1,-1,-1};

typedef unsigned long long ll;
typedef pair<ll, ll> llP;
typedef pair<int, int> intP;
typedef std::priority_queue<int> IntPrioQueue; //Z->A
typedef std::priority_queue<int, std::vector<int>, std::greater<int> > IntReversePrioQueue; //A->Z

void solve(void){
    ll N, M;
    scanf("%lld %lld\n", &N, &M);
    ll ans = 0LL;
    if (N == 1 and M == 1) {
        ans = 1LL;
    }
    else if (N == 1 or M == 1) {
        ans = max(N, M) - 2;
    }
    else {
        ans = (M-2)*(N-2);
    }

    cout << ans << '\n';
}

int main(void){
  solve();
  return 0;
}


Measured memory_bytes: 256
n,m = map(int, input().split())
a = []
b = []
for i in range(m):
	ai,bi = map(int, input().split())
	a.append(ai)
	b.append(bi)

res = [0 for i in range(n)]

for i in range(m):
	ai = a[i] - 1
	bi = b[i] - 1
	res[ai] += 1
	res[bi] += 1

for i in range(n):
	print(res[i])

Measured memory_bytes: 3064
/*
First solve the problem,then write the code.
Author-Manas Singh(@manassingh557)
*/

// #pragma GCC optimize ("Ofast")
// #pragma GCC optimization("O3")
// #pragma GCC optimization("unroll-loops")
// #pragma GCC target ("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,fma,tune=native")
// #pragma GCC optimize ("-ffloat-store")

#include<bits/stdc++.h>

#define ll long long
#define ld long double

#define mod 1000000007
#define f first
#define s second
#define pb push_back
#define mp make_pair

#define endl "\n"

#define mii map<int,int>
#define mll map<ll,ll>
#define pii pair<int,int>
#define pll pair<<ll,ll>
#define vii vector<int>
#define vll vector<ll>

#define rep(i,end) for(int i=0;i<end;i++)
#define repi(i,start,end) for(int i=start;i<=end;i++)
#define repd(i,start,end) for(int i=start;i>=end;i--)

#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)

using namespace std;

int main()
{
	fast;
	int k1,s;
	cin>>k1>>s;
	int count=0;
	for(int i=0;i<=k1;i++)
	{
	    for(int j=0;j<=k1;j++)
	    {
	        int z=s-i-j;
	        if(z>=0 && z<=k1)
	            count++;
	    }
	}
	cout<<count<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <assert.h>
#include <complex>
#include <utility>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <tuple>
#include <cmath>
#include <bitset>
#include <cctype>
#include <set>
#include <map>
#include <unordered_map>
#include <numeric>
#include <functional>
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(ll i=ll(a);i<ll(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define rrep(i,a) for(ll i=ll(a-1);i>=0;--i)
#define all(x) (x).begin(),(x).end()
#define PRINT(V) cout << V << "\n"
#define SORT(V) sort((V).begin(),(V).end())
#define RSORT(V) sort((V).rbegin(), (V).rend())
using namespace std;
using ll = long long;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
inline void Yes(bool condition){ if(condition) PRINT("Yes"); else PRINT("No"); }
template<class itr> void cins(itr first,itr last){
    for (auto i = first;i != last;i++){
        cin >> (*i);
    }
}
template<class itr> void array_output(itr start,itr goal){
    string ans = "",k = " ";
    for (auto i = start;i != goal;i++) ans += to_string(*i)+k;
    if (!ans.empty()) ans.pop_back();
    PRINT(ans);
}
ll gcd(ll a, ll b) {
    return a ? gcd(b%a,a) : b;
}

const ll INF = 1e18;
const ll MOD = 1000000007;
const ll MOD2 = 998244353;
const ll EPS = 1e-10;
int sgn(const double a){
    return (a < -EPS ? -1 : (a > EPS ? +1 : 0));
}
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> tri;
typedef pair<double,double> point;
typedef complex<double> Point;
const ll MAX = 30000;
constexpr ll nx[8] = {1,0,-1,0,1,-1,1,-1};
constexpr ll ny[8] = {0,1,0,-1,1,1,-1,-1};
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n,x,t;
    cin >> n >> x >> t;
    if (n%x){
        PRINT(t*(n/x+1));
    }
    else{
        PRINT(t*(n/x));
    }
}



Measured memory_bytes: 3608
#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <algorithm>
#include <cmath>
#include <climits>
#include <math.h>
#include <bitset>

#define P pair
#define X first
#define Y second
#define VSORT(v) sort(v.begin(), v.end())
#define VREV(v) reverse(v.begin(), v.end())
#define VMAX_P(v) max_element(v.begin(), v.end())
#define VMIN_P(v) min_element(v.begin(), v.end())
#define VMAX_IDX(v) distance(v.begin(), VMAX_P(v))
#define VMIN_IDX(v) distance(v.begin(), VMIN_P(v))
#define VCOPY(src, dst) copy(src.begin(), src.end(), back_inserter(dst))
#define SUPPER(src, dst) transform(src.begin(), src.end(), dst.begin(), toupper);
#define SLOWER(src, dst) transform(src.begin(), src.end(), dst.begin(), tolower);

using namespace std;
using ll = long long;

int main(int argc, const char *argv[])
{
    int r;
    cin >> r;
    cout << 3 * r * r << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <math.h>
using namespace std;

#define INF (1<<31-1)
#define ll long long


int digitsum(int n){
	int t=0;
	while (n > 0){
		t += n % 10;
		n /= 10;
	}
	return t;
}

int main(){

	int N;

	cin >> N;

	if (N == 2){
		cout << 2 << endl;
		return 0;
	}

	int result = INF;
	for (int i = 2; i <= N/2; i++){
		int x = digitsum(i) + digitsum(N-i);
		if (x < result) result = x;
	}

	cout << result << endl;


	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a;
	cin>>a;
	bool c=false;
	for(int i=1;i<=9;i++)
	{
		if(a%i==0)
		{
			if(a/i>=1 && a/i<=9)
			c=true;
		}
	}
	if(c==false)
	cout<<"No";
	else
	cout<<"Yes";
} 

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


int main(){
  int N;
  cin >> N;
  map<string, int> A;
  for(int ii=0; ii<N; ii++){
    string a;
    cin >> a;
    if(A.find(a) != A.end()){
      A[a]++;
    }else{
      A[a] = 1;
    }
  }
  
  int M;
  cin >> M;
  for(int ii=0; ii<M; ii++){
    string a;
    cin >> a;
    if(A.find(a) != A.end()){
      A[a]--;
    }else{
      A[a] = -1;
    }
  }
  
  auto ans = max_element(
    A.begin(),
    A.end(),
    [](const pair<string, int>& a, const pair<string, int>& b){
      return a.second < b.second;
    }
  );
  cout << max(0, ans->second) << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
int main() {
    int p, q; scanf("%d%d", &p, &q);
    q /= std::__gcd(p,q);
    long long ans = 1;
    for(int i=2; i*i<=q ; i++) {
        if(!(q % i)) {
            ans *= i;
            while(!(q % i)) q /= i;
        }
    }
    printf("%lld\n", ans*q);
}

Measured memory_bytes: 3192
#include <bits/stdc++.h>
using namespace std;
const int INF=1000000001;
int d[305][305],a[305][305];
int main(){
    int n,m,l;
    scanf("%d %d %d",&n,&m,&l);
    for(int i=1;i<=n;i++)for(int j=1;j<=n;j++)if(i!=j){
        d[i][j]=INF;
        a[i][j]=INF;
    }
    for(int i=0;i<m;i++){
        int x,y,z;
        scanf("%d %d %d",&x,&y,&z);
        d[x][y]=z,d[y][x]=z;
    }
    for(int k=1;k<=n;k++)for(int i=1;i<=n;i++)for(int j=1;j<=n;j++)d[i][j]=min(d[i][j],d[i][k]+d[k][j]);
    for(int i=1;i<=n;i++)for(int j=1;j<=n;j++)if(i!=j&&d[i][j]<=l)a[i][j]=1;
    for(int k=1;k<=n;k++)for(int i=1;i<=n;i++)for(int j=1;j<=n;j++)a[i][j]=min(a[i][j],a[i][k]+a[k][j]);
    int q;
    scanf("%d",&q);
    while(q--){
        int s,t;
        scanf("%d %d",&s,&t);
        printf("%d\n",a[s][t]==INF?-1:a[s][t]-1);
    }
}

Measured memory_bytes: 1280
/*
▄███████▀▀▀▀▀▀███████▄
░▐████▀▒ЗАПУСКАЕМ▒▀██████▄
░███▀▒▒▒▒▒ДЯДЮ▒▒▒▒▒▒▀█████
░▐██▒▒▒▒▒▒БОГДАНА▒▒▒▒▒████▌
░▐█▌▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒████▌
░░█▒▄▀▀▀▀▀▄▒▒▄▀▀▀▀▀▄▒▐███▌
░░░▐░░░▄▄░░▌▐░░░▄▄░░▌▐███▌
░▄▀▌░░░▀▀░░▌▐░░░▀▀░░▌▒▀▒█▌
░▌▒▀▄░░░░▄▀▒▒▀▄░░░▄▀▒▒▄▀▒▌
░▀▄▐▒▀▀▀▀▒▒▒▒▒▒▀▀▀▒▒▒▒▒▒█
░░░▀▌▒▄██▄▄▄▄████▄▒▒▒▒█▀
░░░░▄██████████████▒▒▐▌
░░░▀███▀▀████▀█████▀▒▌
░░░░░▌▒▒▒▄▒▒▒▄▒▒▒▒▒▒▐
░░░░░▌▒▒▒▒▀▀▀▒▒▒▒▒▒▒▐
*/
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <numeric>
#include <cstring>
#include <ctime>
#include <cstdlib>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <cmath>
#include <bitset>
#include <cassert>
#include <queue>
#include <stack>
#include <deque>
#include <cassert>
#include <iomanip>


using namespace std;


#define ll long long
#define ld long double
#define null NULL
#define prev prev228




signed main() {
	string s;
	cin >> s;
	string t = "ABC";
	cout << t + s << endl;
    return 0;
}


















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

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

  bool yellow = false;
  rep(i, N) {
    string si;
    cin >> si;
    if (si == "Y")
      yellow = true;
  }

  if (yellow)
    puts("Four");
  else
    puts("Three");
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] input = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            int mul = input[0] * input[1];
            if (mul % 2 == 0) Console.WriteLine("No");
            else Console.WriteLine("Yes");
            
        }

    }
}


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

using namespace std;

int main(){
	int n, ans = 0;
	cin >> n;
	vector<int> a(100002);
	for(int i = 0; i < n; i++){
		int x;
		cin >> x;
		a[x]++;
	}
	for(int i = 1; i <= 100000; i++){
		ans = max(ans, a[i - 1] + a[i] + a[i + 1]);
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 768
#include<stdio.h>
#include<stack>
#include<queue>
#include<string.h>
#include<algorithm>
#include<math.h>
#include<stdlib.h>
using namespace std;
int main()
{
	int a,b,c,d;
	scanf("%d %d %d %d",&a,&b,&c,&d);
	int h,k;
	h=a*b;
	k=c*d;
	if(h>k)
	printf("%d\n",h);
	else
	printf("%d\n",k);	
	return 0;
}

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

int n,k,d[10];

int sum(int a,int b,int c=0,int d=0){
	int x=a*(b>=10?100:10)+b;
	if(k==2)return x;
	x=x*(c>=10?100:10)+c;
	if(k==3)return x;
	return x=x*(d>=10?100:10)+d;
}

int main(){
	while(scanf("%d%d",&n,&k),n){
		for(int i=0;i<n;i++)scanf("%d",&d[i]);
		sort(d,d+n);
		vector<int> data;
		for(int i=n-1;i>=0;i--){
			for(int j=n-1;j>=0;j--){
				if(i==j)continue;
				if(k==2){
					data.push_back(sum(d[i],d[j]));
					continue;
				}
				for(int r=n-1;r>=0;r--){
					if(i==r||j==r)continue;
					if(k==3){
						data.push_back(sum(d[i],d[j],d[r]));
						continue;
					}
					for(int z=n-1;z>=0;z--){
						if(i==z||j==z||r==z)continue;
						data.push_back(sum(d[i],d[j],d[r],d[z]));
					}
				}
			}
		}
		sort(data.begin(),data.end());
		data.erase(unique(data.begin(),data.end()),data.end());
		printf("%ld\n",data.size());
	}
}

Measured memory_bytes: 1264
for i in range(50):
    m, f, r = map(int, input().split())
    if m == -1 and f == -1 and r == -1:
        break
    if m == -1 or f == -1:
        print('F')
    elif m + f >= 80:
        print('A')
    elif 80 > m + f >= 65:
        print('B')
    elif 65 > m + f >= 50:
        print('C')
    elif 50 > m + f >= 30 and r >= 50:
        print('C')
    elif 50 > m + f >= 30:
        print('D')
    else:
        print('F')



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

using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;

#define REP(i, n, m) for(ll i=n; i<(ll)m; ++i)
#define IREP(i, n, m) for(ll i=n-1; i>=m; --i)
#define rep(i, n) REP(i, 0, n)
#define irep(i, n) IREP(i, n, 0)
#define all(v) v.begin(), v.end()

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

    if(s.length()%2!=0) cout << "No" << endl;
    else{
        string s0 = s.substr(0, s.length()/2);
        string s1 = s.substr(s.length()/2);
        if(s0==s1) cout << "Yes" << endl;
        else cout << "No" << endl;
    }
}


Measured memory_bytes: 256
function Main(input) {
    tmp = input.split("\n");
    n = tmp[0];
    s = tmp.shift();
  
    a = 0;
    w = 0;
    t = 0;
    r = 0;

    for (let i = 0; i < tmp.length; i++) {
        if (tmp[i] == 'AC') {
            a += 1;
        }else if (tmp[i] == 'WA') {
            w += 1;
        }else if( tmp[i] == 'TLE') {
            t += 1;
        }else if( tmp[i] == 'RE'){
            r += 1;
        }
    }

    console.log( 'AC x ' + a + '\n' + 'WA x ' + w + '\n' + 'TLE x ' + t + '\n' + 'RE x ' + r + '\n');
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 37248
#include <iostream>

using namespace std;

int CardStrength(int num)
{
    return (num == 1 ? 20 : num);
}

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

    auto strength_a = CardStrength(a);
    auto strength_b = CardStrength(b);

    if (strength_a > strength_b) {
        cout << "Alice\n";
    } else if (strength_b > strength_a) {
        cout << "Bob\n";
    } else {
        cout << "Draw\n";
    }

    return 0;
}


Measured memory_bytes: 256
import string
import sys

N,K=[int(i) for i in input().split()]
D=[int(i) for i in input().split()]
use=[int(i) for i in string.digits if int(i) not in D]

def check(use,x):
    for i in str(x):
        if(int(i) not in use):
            return False
    return x

i=N-1
while True:
    i+=1
    x=check(use,i)
    if(x!=False):
        print(x)
        sys.exit()

Measured memory_bytes: 3768
#include "bits/stdc++.h"
 
using namespace std;
 
using ll = long long;
using ld = long double;
 
const int INF = (1 << 30) - 1;
const ll INF64 = ((ll)1 << 62) - 1;
const double PI = 3.1415926535897932384626433832795;
 
const int dx[] = { 0, 1, 0, -1 };
const int dy[] = { -1, 0, 1, 0 };
 
int gcd(int x, int y) { return y ? gcd(y, x % y) : x; }
ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }
int lcm(int x, int y) { return x / gcd(x, y) * y; }
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }
 
int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
 
	int a, b;
	cin >> a >> b;
 
	int ans = a * b - (a + b - 1);
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
import bisect

a, b, q = map(int, input().split())

s = [- 10 ** 19]
for i in range(a):
    s.append(int(input()))
s.append(10 ** 19)

t = [- 10 ** 19]
for i in range(b):
    t.append(int(input()))
t.append(10 ** 19)

for i in range(q):
    x = int(input())
    ps = bisect.bisect_right(s, x)
    pt = bisect.bisect_right(t, x)
    ret = 10 ** 19
    for loc1 in (s[ps], s[ps-1]):
        for loc2 in (t[pt], t[pt-1]):
            val = min(abs(x-loc1) + abs(loc1-loc2),
                      abs(x-loc2) + abs(loc1-loc2))
            ret = min(ret, val)
    print(ret)


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

typedef long int lint;
typedef long long int llint;
typedef pair<int, int> pii;
typedef pair<int, string> pis;
typedef pair<long, long> pll;

#define EACH(i, c) for (__typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define ALL(c) (c).begin(), (c).end()
#define FOR(i, s, e) for (int i = (s); i < (int)(e); ++i)
#define REP(i, n) FOR(i, 0, n)
#define endl '\n'
#define mod 1000000007
#define INF 100000000
#define fk first
#define sv second

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

template<typename T>
void print(const std::vector<T>& v, char sep=' ') {
  for (int i = 0; i < (int)v.size(); i++) {
    if (i != 0) cout << sep;
    cout << v[i];
  }
  cout << endl;
}

int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  int a, b;
  a = b = 0;
  cin >> n;

  REP(i, n){
    string s1, s2;
    cin >> s1 >> s2;
    if (s1 > s2) a += 3;
    else if (s1 < s2) b += 3;
    else {
      a++;
      b++;
    }
  }
  cout << a << ' ' << b << endl;
}

Measured memory_bytes: 3184
using System;

class Program
{
    static void Main(string[] args)
    {
        var n = ReadInt();
        var aList = ReadInts();

        var x = 0;
        foreach (var a in aList)
        {
            x ^= a;
        }

        foreach (var a in aList)
        {
            Console.WriteLine(x ^ a);
        }
    }


    private static string Read() => Console.ReadLine();
    private static char[] ReadChars() => Array.ConvertAll(Read().Split(), a => a[0]);
    private static int ReadInt() => int.Parse(Read());
    private static long ReadLong() => long.Parse(Read());
    private static double ReadDouble() => double.Parse(Read());
    private static int[] ReadInts() => Array.ConvertAll(Read().Split(), int.Parse);
    private static long[] ReadLongs() => Array.ConvertAll(Read().Split(), long.Parse);
    private static double[] ReadDoubles() => Array.ConvertAll(Read().Split(), double.Parse);
}

Measured memory_bytes: 53376
#include <iostream>
#include <string>
#include <math.h>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <set>
#include <queue>
#include <deque>
#include <map>
#include <stack>
#include <cmath>
using namespace std;

#define mod 1000000007
#define ten5 100005
#define ten52 200005
#define ten6 1000005
#define PI 3.1415926
#define pb(x) push_back(x)
#define all(x) x.begin(),x.end()
#define mkpr(x1,x2) make_pair(x1,x2)
typedef long long int ll;


//stack<char> stk;
//set<ll> sll;
//set<pair<ll,ll>> spll;
//map<string,ll> mp;
//map<pair<ll,ll>,ll>::iterator iter;
//map<ll,ll> mp;
//deque<ll> deq;
//vector<ll> vll;
ll num[ten52];
//priority_queue<ll> pq;          //decreasing

int main(void)
{
    ll m,n,i,j,k=0,d,pre=0,now;
    string s,s1,s2;
    cin>>n;
    for(i=1;i<=n;i++)
    {
        cin>>m;
        num[i]=m;
        pre+=m;
    }
    cin>>m;
    for(i=0;i<m;i++)
    {
        cin>>k>>d;
        cout<<pre-num[k]+d<<endl;
    }
}


Measured memory_bytes: 3580
import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Vector;

public class Main {
	public static void main(String args[]) {
		Scanner in = new Scanner(System.in);
		long yen = in.nextLong();
		long temp = yen%1000;
		if (temp!=0) {
			System.out.println(1000-temp);
		}else {
			System.out.println(temp);
		}
		
	}
}

Measured memory_bytes: 27020
#include <iostream>
#include <string>
using namespace std;
int main(void){
    
    string str;
    int sum;
    
    while(cin >> str && str!="0"){
        sum=0;
        for(int i=0,l=str.size();i<l;i++)sum += str[i] - '0';
        cout << sum <<endl;
    }
    
    return 0;
    
}


Measured memory_bytes: 3196
#include<stdio.h>

int main(){
   int A,B,C,D;
   scanf("%d %d %d %d",&A,&B,&C,&D);
   while((A > 0) && (C > 0)){
      C -= B;
      if(C <= 0){
         break;
      }
       A -= D;
      if(A <= 0){
         break;
      }
   }
   if(A > 0){
      printf("Yes\n");
   } else {
      printf("No\n");
   }
}


Measured memory_bytes: 1624
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
typedef long double ld;
const ll INF = 1e+14;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back

void Yes(){
	cout<<"Yes"<<endl;
	exit(0);
}
 
void No(){
	cout<<"No"<<endl;
	exit(0);
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
    int N; cin >> N;
    int a[110];
    rep(i, N) cin >> a[i];
    int c = a[0], cnt = 1, ans = 0;
    rep1(i, N) {
        if(i == N || c != a[i]) {
            ans += cnt / 2;
            cnt = 1;
            c = a[i];
        } else {
            cnt ++;
        }
    }
    cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
 
#define endl '\n'
#define loop(i, m, n) for (ll i = m; i < n; i++)
#define loope(i, m, n) for (ll i = m; i <= n; i++)
#define epool(i, m, n) for (ll i = m; i >= n; i--)
#define mod 1000000007
#define mod2 998244353
#define vi vector<ll>
#define pll pair<ll, ll>
#define fi first
#define se second
#define pb push_back
#define MP make_pair
#define empf emplace_front
#define empb emplace_back
#define ret(x) return cout << x,0;
#define all(v) v.begin(),v.end()
#define maxheap priority_queue<ll>
#define minheap priority_queue<ll,vector<ll>,greater<ll>>
const ll INF=1e18;
const double PI=4*atan(1);

#define SpeedForce                    \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
using namespace std;

ll mpow(ll base,ll exp,ll M);
ll POW(ll base,ll exp);
ll gcd(ll a,ll b);
ll lcm(ll a,ll b);
ll modInverse(ll n);
ll nCr(ll n, ll r);

void solve(){
    ll n,k;
    cin >> n >> k;
    ll a[n];
    loop(i,0,n) cin >> a[i];

    ll l=0;
    ll r=k;
    while(r<n){
        if(a[l++]<a[r++]) cout << "Yes" << endl;
        else cout << "No" << endl;
    }

}

int32_t main(){
    SpeedForce
    ll i = 0,j = 0;

    int t;
    t=1;
    //cin >> t;
    //ll cnt=1;
    while (t--){
        //cout << "Case #" << cnt << ": ";
        //cout << fixed << setprecision(10);
        solve();
        //cout << endl;
        //cnt++;
    }
}

ll POW(ll base,ll exp){
    ll result = 1;
    while (exp > 0){
        if (exp & 1)
            result = ((ll)result * base);
        base = ((ll)base * base);
        exp >>= 1;
    }
    return result;
}

ll mpow(ll base, ll exp,ll M){
    base %= M;
    ll result = 1;
    while (exp > 0){
        if (exp & 1)
            result = ((ll)result * base) % M;
        base = ((ll)base * base) % M;
        exp >>= 1;
    }
    return result%M;
}

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

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

ll modInverse(ll n) { 
    return mpow(n, mod-2,mod); 
}
 
ll nCr(ll n, ll r){ 
   if (r==0) 
      return 1; 
    ll fac[n+1]; 
    fac[0] = 1; 
    for (int i=1 ; i<=n; i++) 
        fac[i] = (fac[i-1]*i)%mod; 
    return ((fac[n]* modInverse(fac[r]) % mod * 
            modInverse(fac[n-r]) % mod)%mod)%mod; 
}

Measured memory_bytes: 5180
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inpl(): return list(map(int, input().split()))
def inpl_str(): return list(input().split())

def Find(x):    #xの根を返す
    global table

    if table[x] == x:
        return x
    else:
        table[x] = Find(table[x])    #親の更新(根を直接親にして参照距離を短く)
        size[x] = size[table[x]]
        return table[x]

def Unite(x,y):    #xとyを繋げる
    global size
    global rank
    x = Find(x)
    y = Find(y)
    sx = Size(x)
    sy = Size(y)

    if x == y:
        return

    if rank[x] > rank[y]:
        table[y] = x
        size[x] = sx + sy
    else:
        table[x] = y
        size[y] = sx + sy
        if rank[x] == rank[y]:
            rank[y] += 1

def Check(x,y):
    if Find(x) == Find(y):
        return True
    else:
        return False

def Size(x):
    return size[Find(x)]

table = [i for i in range(10**5+1)]    #木の親 table[x] == x なら根
rank  = [1 for i in range(10**5+1)]    #木の長さ
size  = [1 for i in range(10**5+1)]    #集合のサイズ


N = int(input())
xys = [inpl() for _ in range(N)]
xys.sort()
tatedict = defaultdict(list)
xx = set()
for x,y in xys:
    tatedict[x].append(y)
    xx.add(x)

for x in xx:
    s = tatedict[x][0]
    for t in tatedict[x]:
        if not Check(s,t):
            Unite(s,t)

ans = 0
for x in xx:
    s = tatedict[x][0]
    ans += Size(s) - len(tatedict[x])

print(ans)


Measured memory_bytes: 43412
<?php
  list($n, $k) = explode(" ", trim(fgets(STDIN)));
  $a = array_map('intval', explode(" ", trim(fgets(STDIN))));

  for($i=$k; $i<$n;$i++){
    if($a[$i-$k] < $a[$i]){
      echo "Yes";
    }else{
      echo "No";
    }
    echo PHP_EOL;
  }
  

Measured memory_bytes: 38220
### SNIPPET
  # n = gets.split.map(&:to_i)
  # array = n.times.map { gets.split.map(&:to_i) }
  # [].all?(&:even?)
  # a = [*1..m].repeated_combination(n).to_a
  # [1,2,3,4,5].select { |num| num.even? }  # => [2, 4]
  # ["a","a","b"].group_by(&:itself).map{|k,v| [k, v.count]}.to_h #=> {"a"=>2, "b"=>1}
  # 切り捨て: .floor(2).to_f ,切り上げ： .ceil(2).to_f,四捨五入: round(2)
  # 3.upto(6) do |i|, 6.downto(3) do |i|
  # 公約数125.gcd(100)、公倍数125.lcm(100)
  # PI = Math::PI
  # 高さ = a * Math.sin(w / 180.0 * Math::PI), 底辺 = a * Math.cos(w / 180.0 * Math::PI)
  # def chmax(a, b) a > b ? a : b end
  # INF = Float::INFINITY
  # def chmin(a, b) a < b ? a : b end

n = gets.to_i
a = gets.split.map(&:to_i)

ary =  a.each_with_index.sort

tmp = []
ary.each do |x|
  tmp.push(x[1]+1)
end

puts tmp.join(" ")

Measured memory_bytes: 25412
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define rep(i,n) for (ll i = 0; i < (n); ++i)
ld eps = 1.0e-14;

int main() {
  ld a,b,c;
  cin >> a >> b >> c;
  if(sqrt(a) + sqrt(b) + eps < sqrt(c)){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  
  return(0);
}

Measured memory_bytes: 3732
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define int ll
using namespace std;
typedef long long ll;
signed main(){
  int n;
  cin >> n;
  
  int a[n], sum = 0;
  rep(i,n){ cin >> a[i]; sum += a[i]; }
  
  int ans = 1001001001001001;
  int snuke = 0;
  rep(i,n-1){
    snuke += a[i];
    int arai = sum - snuke;
    ans = min(ans,abs(snuke-arai));
  }
        
  cout << ans << endl;
  
  return 0;
}

Measured memory_bytes: 1792
//四則演算 #pragma GCC target("avx")
//並列計算 #pragma GCC optimize("O3")
//条件分岐を減らす #pragma GCC optimize("unroll-loops")
//浮動小数点演算 #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using VI = vector<int>;
using VL = vector<ll>;
using VS = vector<string>;
template<class T> using PQ = priority_queue<T, vector<T>, greater<T>>;
#define FOR(i,a,n) for(int i=(a);i<(n);++i)
#define eFOR(i,a,n) for(int i=(a);i<=(n);++i)
#define rFOR(i,a,n) for(int i=(n)-1;i>=(a);--i)
#define erFOR(i,a,n) for(int i=(n);i>=(a);--i)
#define each(i, a) for(auto &i : a)
#define SORT(i) sort(i.begin(),i.end())
#define rSORT(i) sort(i.rbegin(),i.rend())
#define fSORT(i,a) sort(i.begin(),i.end(),a)
#define all(i) i.begin(),i.end()
#define out(y,x) ((y)<0||h<=(y)||(x)<0||w<=(x))
#define line cout << "-----------------------------\n" 
#define ENDL(i,n) ((i) == (n) - 1 ? "\n" : " ")
#define stop system("pause")
constexpr ll INF = 1000000000;
constexpr ll LLINF = 1LL << 60;
constexpr ll mod = 1000000007;
constexpr ll MOD = 998244353;
constexpr ld eps = 1e-10;
constexpr ld pi = 3.1415926535897932;
template<class T>inline bool chmax(T& a, const T& b) { if (a < b) { a = b; return true; }return false; }
template<class T>inline bool chmin(T& a, const T& b) { if (a > b) { a = b; return true; }return false; }
inline void init() { cin.tie(nullptr); cout.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); }
template<class T>inline istream& operator>>(istream& is, vector<T>& v) { for (auto& a : v)is >> a; return is; }
template<class T>inline istream& operator>>(istream& is, deque<T>& v) { for (auto& a : v)is >> a; return is; }
template<class T, class U>inline istream& operator>>(istream& is, pair<T, U>& p) { is >> p.first >> p.second; return is; }
template<class T>inline vector<T> vec(size_t a) { return vector<T>(a); }
template<class T>inline vector<T> defvec(T def, size_t a) { return vector<T>(a, def); }
template<class T, class... Ts>inline auto vec(size_t a, Ts... ts) { return vector<decltype(vec<T>(ts...))>(a, vec<T>(ts...)); }
template<class T, class... Ts>inline auto defvec(T def, size_t a, Ts... ts) { return vector<decltype(defvec<T>(def, ts...))>(a, defvec<T>(def, ts...)); }
inline void print() { cout << "\n"; }
template<class T, class... Ts>inline void print(const T& a, const Ts&... ts) { cout << a << " "; print(ts...); }
template<class T>inline void print(const vector<T>& v) { for (int i = 0; i < v.size(); ++i)cout << v[i] << (i == v.size() - 1 ? "\n" : " "); }
template<class T>inline void print(const vector<vector<T>>& v) { for (auto& a : v)print(a); }
inline string reversed(const string& s) { string t = s; reverse(all(t)); return t; }


int n;
void dfs(string s, int a) {
    if (s.length() == n)cout << s << "\n";
    else {
        FOR(i, 0, a)dfs(s + char('a' + i), a);
        dfs(s + char('a' + a), a + 1);
    }
}
int main() {
    init();

    cin >> n;
    dfs("", 0);

    return 0;
}

Measured memory_bytes: 1536
#include <iostream>                        
#include <stdlib.h>                        
                                           
using namespace std;                       
int main(void){                            
  int x;                                   
  cin >> x;                                
  if(x%2 == 1 && (x/2)> 0 &&(x/2) < 4){    
    cout << "YES" << endl;                 
  }                                        
  else{                                    
    cout << "NO" << endl;                  
  }                                        
  return 0;                                
}                                       

Measured memory_bytes: 256
#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>;

const long long MOD = 1000000007;
const long long INF = 1LL << 60;

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int N;
  cin >> N;
  vector<int> P(N), Q(N);
  for (int i = 0; i < N; i++)
    cin >> P[i];
  for (int i = 0; i < N; i++)
    cin >> Q[i];
  vector<int> v(N);
  iota(v.begin(), v.end(), 1);
  int i = 1;
  int a = -1, b = -1;
  do
  {
    bool A = true, B = true;
    for (int j = 0; j < N; j++)
    {
      if (v[j] != P[j])
        A = false;
      if (v[j] != Q[j])
        B = false;
    }
    if (A)
      a = i;
    if (B)
      b = i;
    i++;
  } while (next_permutation(v.begin(), v.end()));
  cout << abs(a - b) << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <cmath>
#include <iomanip>
#include <iterator>
#include <unordered_map>

using namespace std;

using LL = long long;
using ULL = unsigned long long;
using PII = pair<int, int>;
using PIL = pair<int, LL>;
using PLL = pair<LL, LL>;
// const int mod = 1e9 + 7;

#define mem(a, b) memset(a, b, sizeof(a))
#define REP(i, a) for (int i = 0; i < a; ++i)
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define ALL(a) a.begin(), a.end()

inline void quickread() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    cout << fixed << setprecision(10);
}

inline void print_vector(vector<int> &A){
    for (auto&& x : A){
        cout << x << " ";
    }
    cout << endl;
}

inline void print_array(const int A[], int n) {
    REP(i, n) {
        if (i < n - 1) {
            cout << A[i] << " ";
        } else {
            cout << A[i] << endl;
        }
    }
}

inline void solve() {
    string s, t;
    cin >> s >> t;

    int ls = (int)s.size();
    int ts = (int)t.size();

    int res = INT_MAX;

    REP(i, ls - ts + 1) {
        int cur = 0;

        for (int j = 0; j < ts; ++j) {
            if (s[i + j] != t[j]) cur++;
        }

        res = min(res, cur);
    }

    cout << res << endl;

}

int main() {
    // freopen("input.txt", "r", stdin);
    quickread();
    int t = 1;
    // cin >> t;

    for (int _ = 0; _ < t; _++) {
        solve();
    }

    return 0;
}


Measured memory_bytes: 3520
import functools
import itertools
import numpy as np
import sys
MAX_INT = int(10e10)
MIN_INT = -MAX_INT
mod = 1000000007
sys.setrecursionlimit(1000000)
def IL(): return list(map(int,input().split()))
def SL(): return input().split()
def I(): return int(sys.stdin.readline())
def S(): return input()

X,Y,Z = IL()
ans = (X-Z)//(Y+Z)
print(ans)

Measured memory_bytes: 12476
a=Array.new(4,nil)
4.times{|i|
a[i]=Array.new(3,nil)
3.times{|j| a[i][j] = Array.new(10,0)}}
gets.to_i.times{
b,f,r,v=gets.split.map &:to_i
a[b-1][f-1][r-1]+=v
}
4.times{|i|
3.times{|j| puts" #{a[i][j]*' '}"}
if i!=3
puts"#"*20
end
}

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

int main(){
    string S;
    cin >> S;
    int N = (int)S.size();
    vector<int> a(N+1,-1);
    long long large_count = 0;
    long long small_count = 0;
    char before = S[0];
    int target_index = 0;
    rep(i, N){
        char now = S[i];

        if(before == '<' && now == '>'){
            target_index = i;
        }else if ( before == '>' && now == '<' ){
            a[target_index] = max({large_count, small_count});
            if(a[target_index] == large_count){
                a[target_index + 1] = small_count - 1;
            }
            a[i] = 0;
            large_count = 0;
            small_count = 0;
        }else if( now == '>' && i == (N-1) ){
            a[target_index] = max({large_count, small_count + 1});
            if(a[target_index] == large_count){
                a[target_index + 1] = small_count - 1;
            }
        }

        if(now == '<'){
            large_count+=1;
        }else{
            small_count+=1;
        }

        before = now;
    }

    before = S[0];
    if(a[0]==-1)a[0]=0;
    rep(i, N){
        char now = S[i];
        if(now == '<' && a[i+1] == -1){
            a[i+1] = a[i] + 1;
        }
        if(now == '>'&& a[i+1] == -1){
            a[i+1] = a[i] - 1;
        }
    }

    long long ans = 0;
    rep(i, (N+1)){
        ans += a[i];
    }

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

Measured memory_bytes: 5848
#include<iostream>
#include<cstdlib>
#include<string>
#include<vector>
#include<map>
#include<unordered_map>
#include<queue>
#include<algorithm>
#include<iomanip>
#include<typeinfo>
#include<complex>
using namespace std;
using ll = long long int;
const int mod = 1e9 + 7;
#define rep(i, a, b) for(ll i = a;i < b; i++)
const long double PI = (acos(-1));


int main() {

	int n; cin >> n;
	
	vector<double> x(n);
	vector<string> u(n);
	double ans = 0;

	rep(i, 0, n) {
		cin >> x[i] >> u[i];
		if (u[i] == "JPY") ans += x[i];
		if (u[i] == "BTC") ans += x[i] * 380000;
 	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 3768
#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 n;
    cin >> n;
    map<int,int> mp;
    for (int i = 1; i <= n; i++) {
        int a;
        cin >> a;
        mp[a] = i;
    }
    for (int i = 1; i <= n; i++) {
        printf("%d ", mp[i]);
    }
    printf("\n");
    return 0;
}

Measured memory_bytes: 8420