akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

 using namespace std;

 int main() {
   int N;

   cin >> N;

   vector<double> x(N);
   vector<string> u(N);

   double sum = 0.0;

   for (int i = 0;i < N; i++) {
     cin >> x.at(i) >> u.at(i);
     if (u.at(i) == "BTC") sum += 380000.0 * x.at(i);
     else sum += x.at(i);
   }

   cout << fixed << setprecision(8) << sum << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int a,b,c,i;
int main()
{
    scanf("%d%d%d",&a,&b,&c);
    for(i=1;i<=b;i++)
    {
        if((a*i)%b==c){printf("YES\n");return 0;}
    }
    printf("NO\n");
    return 0;
}

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

int main() {
    int a,b,c,k;
    cin>>a>>b>>c>>k;
    cout<< max({a,b,c})*(pow(2,k)-1)+a+b+c<<endl;
    return 0;
    
   
}


Measured memory_bytes: 892
#define _CRT_SECURE_NO_WARNINGS

#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
//#include <tchar.h>
//#include <intrin.h>

#define F first
#define S second
#define LL long long
#define MOD 1000000007
#define INF 2000000000
#define LINF 1000000000000000000

using namespace std;

const int N = 2e5 + 10;

LL a[N];

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

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

	sort(a + 1, a + n + 1, greater<LL>());

	LL ans = 0;
	for (int i = 2;i <= n;i++)
		ans += a[i - i / 2];

	cout << ans << endl;
	cin >> n;
}

Measured memory_bytes: 4712
n = int(input())
c = []
for i in range(n):
    a, b = map(int, input().split())
    c.append((a+b,a,b))
c.sort(key = lambda x: x[0], reverse = True)
ascore = 0
bscore = 0
for i in range(n):
    if i % 2 == 0:
        ascore += c[i][1]
    else:
        bscore += c[i][2]
print(ascore - bscore)


Measured memory_bytes: 22132
anslist = []

while True:
    n, m = map(int, input().split())
    if n == 0 and m == 0:
        break
    a = list(map(int, input().split()))

    ans = 0
    for i in range(n):
        for j in range(n):
            if i != j and a[i] + a[j] <= m:
                ans = max(ans, a[i] + a[j])

    if ans == 0:
        anslist.append("NONE")
    else:
        anslist.append(ans)

for i in anslist:
    print(i)


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

namespace cShaprTest
{
    class Program
    {
        static void Main(string[] args)
        {
            var s = Console.ReadLine();

            var stack = new Stack<char>();
            int sum = 0;
            foreach(var c in s)
            {
                if (stack.Count == 0)
                {
                    stack.Push(c);
                    continue;
                }

                var value = stack.Peek();
                if (value == c)
                {
                    stack.Push(c);
                    continue;
                }

                stack.Pop();
                sum += 2;
            }
            Console.WriteLine(sum);
        }
    }
}


Measured memory_bytes: 13268
#include<bits/stdc++.h>
using namespace std;
long long mod = 1e9+7;
int mark[200003] = {};
int limit = 0;
long long dp[200005] = {};
long long getSum(long long n)
{
    if(dp[n] != -1 && n >= 0)
    {
        return dp[n];
    }
    if(n == 0)
    {
        return 1;
    }
    if(n < 0)
    {
        return 0;
    }
    long long res = 0;
    for(int i = 1; i <= limit; i++)
    {
        if(n-mark[i] >= 0)
        {
            res =(res+getSum(n-mark[i]))%mod;
        }
    }
    return dp[n] = res%mod;
}
void solve()
{
    long long n; cin >> n;
    for(int i = 3; i <= n; i++)
    {
        limit++;
        mark[limit] = i;
    }
    long long sum = getSum(n)%mod;
    cout << sum << endl;
}
int main()
{
    memset(dp, -1, sizeof(dp));
    solve();
    return 0;
}


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

#define ll long long
#define vecll vector<long long>
#define vec2ll vector<vector<long long>>
#define vecbool vector<bool>
#define vecpairll vector<pair<long long,long long>>
#define forll(s,a,b) for(long long s = a;s < b;s++)
#define forllde(s,a) for(long long s = a;s > 0;s--)


int main()
{
  vecll a(3);
  forll(i, 0, 3)
	cin >> a[i];
  sort(a.begin(), a.end());
  if ((2 * a[2] - a[0] - a[1]) % 2 == 0)
	cout << (2 * a[2] - a[0] - a[1]) / 2 << endl;
  else
	cout << (2 * a[2] - a[0] - a[1] + 1) / 2 + 1<< endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstring>
#include<cstdio>
#define MAIN 200010
using namespace std;
const long long p=1000000007;
long long fact[MAIN]={1},inv[MAIN]={1};
long long Lucas(long long a,long long m)
{
    long long ans=fact[a];
    ans=(ans*inv[a-m]%p)*inv[m]%p;
    return ans;
}
long long power(long long a,long long b)
{
    long long ans=1;
    while (b)
    {
        if (b&1) ans=(ans*a)%p;
        b=b>>1;
        a=(a*a)%p;
    }
    return ans;
}
int main()
{
    long long h,w,a,b;
    scanf("%lld%lld%lld%lld",&h,&w,&a,&b);
    for (int i=1; i<=200000; i++)
    {
        fact[i]=(fact[i-1]*i)%p;
        inv[i]=power(fact[i],p-2);
    }
    long long ans=0;
    for (long long i=1; i<=w-b; i++)
        ans=(ans+Lucas(a+i-2,i-1)*Lucas(h-a+w-i-1,w-i))%p;
    printf("%lld\n",ans);
    return 0;
}

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

vector<int> vct(26, 0);

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

    int sz = str.size();

    for (int i = 0 ; i < sz; ++i) {
        vct.at(str.at(i) - 'a') += 1;
        if (vct.at(str.at(i) - 'a') > 1) {
            cout << "no" << endl;
            return 0;
        }
    }
    cout << "yes" << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int read(){
	int x=0;char c=getchar();
	while(c<=32) c=getchar();
	while(c>32) x=10*x+c-'0',c=getchar();
	return x;
}
#define pii pair<int,int>
#define mkp make_pair
const int N=6e5+10;
int n,m,npcnt;
struct edge{
	int a,b,t;
	bool operator <(const edge& x)const {return t<x.t;}
}e[N];
vector<int> to[N<<1];
bool vis[N];
int fa[N];
pii Q[N];int qcnt;
int findf(int x){return fa[x]==x? x:fa[x]=findf(fa[x]);}
void add(int l,int r){
	npcnt++;
	for(int i=l;i<=r;i++)
		to[Q[i].second].push_back(npcnt),to[npcnt].push_back(Q[i].second);
}
void find(int el,int er){
	for(int i=el;i<=er;i++)  
		fa[e[i].a]=e[i].a,fa[e[i].b]=e[i].b;
	for(int i=el;i<=er;i++){
		int f1=findf(e[i].a),f2=findf(e[i].b);
		if(f1!=f2) fa[f1]=f2;
	}
	for(int i=el;i<=er;i++)  {
		if(!vis[e[i].a]) Q[++qcnt]=mkp(findf(e[i].a),e[i].a),vis[e[i].a]=1;
		if(!vis[e[i].b]) Q[++qcnt]=mkp(findf(e[i].b),e[i].b),vis[e[i].b]=1;
	}
	sort(Q+1,Q+qcnt+1);
	for(int l=1,i=2;i<=qcnt+1;i++)
		if(Q[i].first!=Q[i-1].first){add(l,i-1);l=i;}
	for(int i=el;i<=er;i++)  vis[e[i].a]=vis[e[i].b]=0;
	qcnt=0;
}
int dist[N<<1],st[N<<1],top;
void BFS(){
	top=0,st[++top]=1,dist[1]=0,vis[1]=1;
	for(int i=1;i<=top;i++){
		int x=st[i];
		for(int i=to[x].size()-1;i>=0;i--){
			int v=to[x][i];
			if(!vis[v]) {vis[v]=1,dist[v]=dist[x]+1;st[++top]=v;}
			if(v==n) break;
		}
	}
}
int main()
{
	n=read(),m=read();
	npcnt=n;
	for(int i=1;i<=m;i++) e[i].a=read(),e[i].b=read(),e[i].t=read();
	sort(e+1,e+m+1);
	for(int l=1,r=2;r<=m+1 ;r++) if(e[r].t!=e[r-1].t){find(l,r-1);l=r;}
	BFS();
	if(!dist[n]) printf("-1");
	else printf("%d",dist[n]/2);
	return 0;
}

Measured memory_bytes: 52352
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
typedef pair<ll, ll> Pll;
#define debug(var)  do{std::cout << #var << " : ";view(var);}while(0)
template<typename T> void view(T e){std::cout << e << std::endl;}
template<typename T> void view(const std::vector<T>& v){for(const auto& e : v){ std::cout << e << " "; } std::cout << std::endl;}
template<typename T> void view(const std::vector<std::vector<T> >& vv){ for(const auto& v : vv){ view(v); } }
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; }

const int MOD = 1000000007;
const int INF = 1e9;

const int mod = 1000000007;
const int inf = 1e9;
#define PI acos(-1);
int dx[4] = {1,-1,0,0};
int dy[4] = {0,0,1,-1};
int ddx[8] = {1,1,1,-1,-1,-1,0,0};
int ddy[8] = {0,1,-1,0,1,-1,1,-1};


int main(){
    int n, k;
    cin >> n >> k;
    vector<int> a(n);
    for(int i = 0; i < n; i++) cin >> a[i];
    int dp[k+1];
    for(int i = 0; i <= k; i++) dp[i] = 0;
    for(int i = 0; i <= k; i++){
        for(int j = 0; j < n; j++) {
            if(i - a[j] >= 0 && dp[i-a[j]] == 0) dp[i] = 1;
        }
    }
    cout << (dp[k] == 1? "First":"Second");

}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) for(int i=0;i < (n);i++)
#define ALL(obj) (obj).begin(),(obj).end()
#define SCANF(i) int i;scanf("%d",&i)
typedef long long ll;
using namespace std;
using P = pair<int,int>;
const long long INF = 1LL << 60;
const int IINF=100000000;
const int MOD = (int)1e9 + 7;
//約数列挙
vector<long long> divisor(long long n) {
    vector<long long> ret;
    for (long long i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            ret.push_back(i);
            if (i * i != n) ret.push_back(n / i);
        }
    }
    //sort(ret.begin(), ret.end()); // 昇順に並べる
    return ret;
}
vector<int> dx={1,0,-1,0};vector<int> dy={0,-1,0,1};

signed main () {
    ll n,m,k;cin >> n >> m >> k;
    vector<ll> alist(n+1,0);
    vector<ll> blist(m+1,0);
    REP(i,n){
        ll tmp;cin >> tmp;
        alist[i+1]=alist[i]+tmp;
    }
    REP(i,m){
        ll tmp;cin >> tmp;
        blist[i+1]=blist[i]+tmp;
    }
    ll ans = 0;
    FOR(i,1,n+1){
        ll target=alist[i];
        if(k-target<0)continue;
        auto bitr=upper_bound(ALL(blist),k-target);
        ll it=bitr - blist.begin()-1;
        ans=max(ans,(ll)i+it);
    }
    FOR(i,1,m+1){
        ll target=blist[i];
        if(k-target<0)continue;
        auto aitr=upper_bound(ALL(alist),k-target);
        ll it=aitr-alist.begin()-1;
        ans=max(ans,(ll)i+it);
    }
    cout << ans << endl;
}//https://atcoder.jp/contests/abc172/tasks/abc172_c

Measured memory_bytes: 6380
//#include <boost/multiprecision/cpp_dec_float.hpp>
//#include <boost/multiprecision/cpp_int.hpp>
#include <stdio.h>
#include <iostream>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <math.h>
#include <algorithm>
#include <bitset>
#include <iomanip>
using namespace std;
//namespace mp = boost::multiprecision;
//using llll = mp::cpp_int;
// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)
//using Real = mp::number<mp::cpp_dec_float<1024>>;
using ll = long long;
const double EPS = 1e-10;
const ll MOD = 7+(1e+9);

int main(){
  //cout<<fixed<<setprecision(10);
  ll n,k,ans=0;
  cin>>n>>k;
  vector<ll>v(n,0);
  for(ll i=0;i<k;i++){
    ll d;
    cin>>d;
    for(ll j=0;j<d;j++){
      ll a;
      cin>>a;
      a--;
      v[a]=1;
    }
  }
  for(ll i=0;i<n;i++){
    if(v[i])ans++;
  }
  ans=n-ans;
  cout<<ans<<endl;
}


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

#define rep(i, n) REP(i, 0, n)
#define repr(i, n) for (int i = (n); i >= 0; i--)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
#define OP(m) cout << m << endl
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;

int main()
{
    ll n, k, x, y;
    cin >> n >> k >> x >> y;

    OP(x * min(k, n) + y * max(n - k, 0LL));

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cmath>

using namespace std;

int main(){
    // Your code here!
    double a,b,C;
    cin>>a>>b>>C;
    double S,l,h;
    double pi=acos(-1);
    
    S = (a*b*sin((C/180)*pi))/2;
    l = a + b + sqrt( a*a + b*b - 2*a*b*cos((C/180)*pi) );
    h = (2*S)/a;
    
    printf("%.8f\n", S);
    printf("%.8f\n", l);
    printf("%.8f\n", h);
    
}


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

typedef long long ll;
typedef pair<int, pair<int, int>> piii;
//loop
#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define REPD(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i <= (ll)(b); i++)
#define FORD(i, a, b) for (ll i = a; i >= (ll)(b); i--)
//STL
#define ALL(x) (x).begin(), (x).end()
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element(ALL(x))
#define MIN(x) *min_element(ALL(x))

//const
#define MOD 1000000007 //10^9+7:合同式の法

//acronym
#define PB push_back //vectorヘの挿入
#define MP make_pair //pairのコンストラクタ
#define F first      //pairの一つ目の要素
#define S second     //pairの二つ目の要素

const int INF = 1e9;

void Main()
{
    int N, K;
    cin >> N >> K;
    vector<int> p(N);
    REP(i, N)
    {
        cin >> p.at(i);
    }
    sort(ALL(p));
    int ans = 0;
    REP(i, K)
    {
        ans += p.at(i);
    }
    cout << ans << endl;
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    Main();
    return 0;
}


Measured memory_bytes: 3636
#include<bits/stdc++.h>
using namespace std;
int main()
{
  double ans=0;
  int n;
  cin>>n;
  for(int i=0;i<n;i++){
    double x;
    string u;
    cin>>x>>u;
    if(u=="JPY") ans+=x;
    else ans+=380000*x;
  }
  cout<<ans;
}
  

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


#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define MOD 1000000007
#define pii pair<int,int>
#define pli pair<long long,int>
#define pil pair<int,long long>
#define ll long long
#define el '\n'

using namespace std;

ll r, c;

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

    cin >> r >> c;
    // ll ans = 0;
    ll item, putih;
    item = ((r + 1) / 2) * ((c + 1) / 2) + (r / 2) * (c / 2);
    putih = r * c - item;
    
    if (r == 1 || c == 1) cout << 1 << el;
    else cout << item << el;

    return 0;
}

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

const ll INF = (1LL<<60);

int main(){

  ll t[60][60];
  for(int i=0;i<60;i++)
    for(int j=0;j<60;j++)
      t[i][j]=(i==j?0:INF);

  
  for(int i=0;i<=50;i++){
    for(int j=1;j<=i;j++){
      t[i][ i%j ]=min(t[i][i%j], (1LL<<j));
    }
  }
  
  for(int k=0;k<=50;k++){
    for(int i=0;i<=50;i++){
      for(int j=0;j<=50;j++){
        if(t[i][k]!=INF && t[k][j]!=INF)
          t[i][j]=min(t[i][j],t[i][k]+t[k][j]);
      }
    }
  }
  
  int N;
  cin>>N;
  vector<int> a(N),b(N);
  for(int i=0;i<N;i++){
    cin>>a[i];
  }
  for(int i=0;i<N;i++){
    cin>>b[i];
  }
  
  if(a==b){
    cout<<0<<endl;
    return 0;
  }
  
  ll ex=0;
  ll ans=0;
  
  for(int tc=0;tc<51;tc++){
    int n=a.size();
    ll maxm=0;
    for(int i=0;i<n;i++){
      ll v=t[ a[i] ][ b[i] ];
      if(v>maxm){
        maxm=v;
      }
    }
    if(maxm==0)break;
    if(maxm>=INF){
      cout<<-1<<endl;
      return 0;
    }
    for(int i=60;i>=0;i--){
      if( (maxm>>i) & 1LL ){
        ex|=(1LL<<i);
        break;
      }
    }
    ans|=ex;   
    
  
    for(int i=0;i<=50;i++){
      for(int j=1;j<=i;j++){
        ll ncost=(1LL<<j);
        if( ncost & ex )ncost=0;
        t[i][ i%j ]=min(t[i][i%j], ncost);
      }
    }
  
    for(int k=0;k<=50;k++){
      for(int i=0;i<=50;i++){
        for(int j=0;j<=50;j++){
          t[i][j]=min(t[i][j],t[i][k]+t[k][j]);
        }
      }
    }
    
  }
  
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,a,b) for (int i=a; i<=b; i++)
#define per(i,a,b) for (int i=a; i>=b; i--)
using namespace std;
typedef long long LL;

inline int read() {
    int x=0,f=1; char ch=getchar();
    while (!(ch>='0'&&ch<='9')) {if (ch=='-')f=-1;ch=getchar();}
    while (ch>='0'&&ch<='9') {x=x*10+(ch-'0'); ch=getchar();}
    return x*f;
}

int n,tmp;
int sn=0;

int main() {

	#ifndef ONLINE_JUDGE
	//	freopen("data.in","r",stdin);
	//	freopen("data.out","w",stdout);
	#endif

	tmp=n=read();
	
	while (tmp) {sn+=tmp%10; tmp/=10;}
	
	if (n%sn) puts("No"); else puts("Yes");

	return 0;
}


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

using namespace std;
#define all(a)a.begin(),a.end()
using ll=long long;
const int INF = 1<<30;
const ll INFll =1LL<<62;
const int mod= int(1e9)+7;
using P = pair<ll,ll>;
using ld=long double;

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

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

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  cout << setprecision(20);
  int n, m;
  cin >> n >> m;
  vector<int> s(m);
  rep(i, m) {
    int k;
    cin >> k;
    int mask = 0;
    rep(j, k) {
      int shift;
      cin >> shift;
      --shift;
      mask |= 1 << shift;
    }
    s[i] = mask;
  }
  vector <int> p(m);
  rep(i, m) {
    cin >> p[i];
  }
  int ans = 0;
  rep(i, 1 << n) {
    int count = 0;
    rep(j, m) {
      bitset<32> bs(i & s[j]);
      if (bs.count() % 2 == p[j]) {
        count++;
      } else {
        break;
      }
    }
    if (count == m) ans++;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
fun readString() = readLine()!!
fun readInt() = readLine()!!.toInt()
fun readLong() = readLine()!!.toLong()
fun readIntList() = readLine()!!.split(" ").map(String::toInt)
fun readLongList() = readLine()!!.split(" ").map(String::toLong)

fun main(args: Array<String>) {
    val s = readString()
    val res = s.count { it == '1' }
    println(res)
}

Measured memory_bytes: 33716
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define debug(x)      cerr << "L" << __LINE__ << ": " << #x << " = " << (x) << endl
#define debugvec(v)   rep(i, v.size()) cerr << "L" << __LINE__ << ": " << #v << "[" << i << "] = " << v[i] << endl;
#define debugvec2(v)  cerr << "L" << __LINE__ << ": " << #v << " = { "; rep(i, v.size()) cerr << v[i] << (i + 1 == v.size() ? "" : ", "); cerr << " }" << endl;
typedef long long ll;  /* 10^18 くらいまでいける */

int main(){
  int d;
  cin >> d;
  if (d==25)
    cout << "Christmas" << endl;
  else if (d==24)
    cout << "Christmas Eve" << endl;
  else if (d==23)
    cout << "Christmas Eve Eve" << endl;
  else
    cout << "Christmas Eve Eve Eve" << endl;

  return 0;
}

Measured memory_bytes: 256
{-# OPTIONS_GHC -O2 #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE Strict #-}
{-# LANGUAGE StrictData #-}
import qualified Data.Vector.Unboxed as VU
import qualified Data.Vector.Unboxed.Mutable as VUM
import Data.Array.Unboxed
import Data.Array.ST
import qualified Data.ByteString.Char8 as BS
import Control.Monad
import Data.List
import Data.Char

main :: IO ()
main = do
    (a,b,n) <- (\vec -> (vec VU.! 0, vec VU.! 1,vec VU.! 2)) . VU.unfoldrN 3 (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine
    let x = min (b-1) n
    print $ (a*x)`div`b

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

int N,K;
//vector<int> A(200010,0);

int main(){
	while(cin >> N >> K && N>0){
		int ans = 0;
		vector<int> A(N+10,0);
		for(int i=1;i<N+1;i++){
			int a;
			cin >> a;
			A[a]++;
		}
		//for(int i=0;i<A.size();i++) cout << A[i] << endl;
		sort(A.begin(),A.end());
		reverse(A.begin(),A.end());
		for(int i=K;i<A.size();i++){
			ans += A[i];
		}
		cout << ans << endl;
	}
}


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

int prog(int y, int m, int d){
  int ret, i;
  for(i=1;i<y;i++){
    if(i % 3 == 0){
      ret += 200;
    }else{
      ret += 195;
    }
  }
  for(i=1;i<m;i++){
    if(y % 3 == 0 || i % 2 == 1){
      ret += 20;
    }else{
      ret += 19;
    }
  }
  ret += (d - 1);
  return ret;
}


int main(void){
  int n, m_day;
  cin >> n;
  m_day = prog(1000, 1, 1);
  while (0<n--){
    int y, m, d;
    cin >> y >> m >> d;
    cout << m_day - prog(y, m, d) << endl;
  }
  return 0;
}



Measured memory_bytes: 3084
import java.util.Scanner;

class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		Dice[] dice = new Dice[n];
		
		for(int i = 0; i < n; i++) {
			dice[i] = new Dice(sc);
		}
		
		boolean a = false;
		
		for(int i1 = 0; i1 < n; i1++) {
			for(int i2 = 0; i2 < n; i2++) {
				if(i1 != i2) {
					a = a || (Dice.rollCheck(dice[i1], dice[i2]));
				}
			}
		}
		
		if(a) {
			System.out.println("No");
		}else {
			System.out.println("Yes");
		}
	}
}

class Dice{
	int[] s = new int[4];
	int[] t = new int[2];
	
	Dice(Scanner sc) {
		t[0] = sc.nextInt();
		s[0] = sc.nextInt();
		s[3] = sc.nextInt();
		s[1] = sc.nextInt();
		s[2] = sc.nextInt();
		t[1] = sc.nextInt();
	}
	
	static boolean rollCheck(Dice dice1, Dice dice2) {
		boolean a1 = false;
		
		a1 = a1 || Dice.check(dice1, dice2);
		dice1.turnN();
		a1 = a1 || Dice.check(dice1, dice2);
		dice1.turnE();
		a1 = a1 || Dice.check(dice1, dice2);
		dice1.turnE();
		a1 = a1 || Dice.check(dice1, dice2);
		dice1.turnE();
		a1 = a1 || Dice.check(dice1, dice2);
		dice1.turnN();
		a1 = a1 || Dice.check(dice1, dice2);
		
		return a1;
	}
	
	static boolean check(Dice dice1, Dice dice2){
		boolean a = false;
		
		if(dice2.t[0] == dice1.t[0]) {
			for(int its = 0; its < 4; its++) {
				if(dice2.s[0] == dice1.s[its]) {
					if(dice2.s[1] == dice1.s[(its+1)%4] 
						&& dice2.s[2] == dice1.s[(its+2)%4] 
						&& dice2.s[3] == dice1.s[(its+3)%4] 
						&& dice2.t[1] == dice1.t[1]) {
						a = true;
					}
				}
			}
		}
		
		return a;
	}
	
	void turnN() {
		int x = t[0];
		t[0] = s[0];
		s[0] = t[1];
		t[1] = s[2];
		s[2] = x;
	}
	
	void turnS() {
		int x = t[0];
		t[0] = s[2];
		s[2] = t[1];
		t[1] = s[0];
		s[0] = x;
	}
	
	void turnE() {
		int x = t[0];
		t[0] = s[1];
		s[1] = t[1];
		t[1] = s[3];
		s[3] = x;
	}
	
	void turnW() {
		int x = t[0];
		t[0] = s[3];
		s[3] = t[1];
		t[1] = s[1];
		s[1] = x;
	}
}


Measured memory_bytes: 28968
/*..........AAKASH GOYAL............*/
/*............DAIICT................*/
 
#pragma GCC optimize("O3", "unroll-loops")
#pragma GCC target("avx2")
#include <bits/stdc++.h>
using namespace std;
 

#define    int                      long long int
#define    f(i,j,n)                 for(int i = j; i <= n; i++)
#define    r(i,n,j)                 for(int i = n; i >= j; i--)
#define    mod                      1110111110111
#define    speed                    ios_base::sync_with_stdio(false);
#define    upp                      cin.tie(NULL);
#define    pb                       push_back
#define    mp                       make_pair
#define    T                        int tt; cin >> tt; while(tt--)
#define    ff                       first
#define    ss                       second
#define    all(container)           container.begin() , container.end()
#define    sz(container)            (int)container.size()
#define    pii                      pair <int , int>
#define    pll                      pair <long long int , long long int>
#define    ppl                      pair < int , pll>              //pair of ll and pair ll 
#define    sp(x)                    setprecision(x)
 
int32_t main()
{       
    speed upp
    int n;
    cin>>n;
    int a[n+1],pre[n+1];
    pre[0]=0;
    f(i,1,n)
    {
        cin>>a[i];
        pre[i]=pre[i-1]+a[i];
    }
    int dp[n+1][n+1];
    memset(dp,0,sizeof(dp));
    r(i,n,1)
    {
        f(j,i,n)
        {
            int x=pre[j]-pre[i-1];
            if(i==j)
                dp[i][j]=0;
            else
                dp[i][j]=1e18;
            for(int k=i;k<j;k++)
                dp[i][j]=min(dp[i][j],dp[i][k]+dp[k+1][j]+x);
        }
    }
    cout<<dp[1][n];
}

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

typedef long long ll;

#define optimize() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define file() freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define tt int t; cin>>t; while(t--)
#define nl cout<<"\n";
#define sp cout<<" ";
#define rep(i, a, b) for(long long i=a; i<b; i++)

const int INF = 1e9 + 7;
const int MOD = 1e9 + 7;
double PI = 4*atan(1);

int main()
{
    optimize();

    int n, t, c, ti;

    cin>> n>> t;

    vector < pair <int, int> > v(n);

    for(int i=0; i<n; i++)
    {
        cin>>  c>> ti;
        v[i].first= c;
        v[i].second= ti;
    }


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

    for(int i=0; i<n; i++)
    {
        if( v[i].second<= t)
        {
            cout << v[i].first;
            return 0;
        }
    }

    cout << "TLE\n";


    return 0;
}

Measured memory_bytes: 3664
#include<bits/stdc++.h>
using namespace std;
int main()
{
	string str;
	cin>>str;
	for(int i=0;i<str.length();i++)
	{
		if(str[i]==',')cout<<" ";
		else cout<<str[i];
	}
	cout<<"\n";
	return 0;
}

Measured memory_bytes: 256
import os
import sys
from collections import defaultdict, Counter
from itertools import product, permutations,combinations, accumulate
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from fractions import gcd
from math import ceil, floor, sqrt
from copy import deepcopy

def main():
    n = int(input())
    p_list = list(map(int, input().split()))
    count = 0
    for i in range(n):
        if i+1 != p_list[i]:
            count += 1
    
    if count >= 3:
        print("NO")
    else:
        print("YES")

if __name__ == "__main__":
    main()

Measured memory_bytes: 5068
#include <iostream>
#include <iomanip>
#include <cmath>
#include <algorithm>
#include <functional>
#include <stack>
#include <queue>
#include <string>
#include <unordered_map>
#include <bitset>

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

const ll mod=1000000007ll;
const ll inf=1000000000000000ll;

const ll nmax=2*100000+1;

//ll par[nmax];
//ll rank[nmax];

class unionfind{
public:
    ll par[nmax];
    ll rank[nmax];

    unionfind(ll n){
        for(ll i=0;i<n;i++){
            par[i]=i;
            rank[i]=0;
        }
    }

    ll root(ll x){
        if(par[x]==x)return x;
        else return par[x]=root(par[x]);
    }

    void unite(ll x,ll y){
        x=root(x);
        y=root(y);
        if(x==y) return;

        if(rank[x]<rank[y]) par[x]=y;
        else{
            par[y]=x;
            if(rank[x]==rank[y]) rank[x]++;
        }
    }

    bool same(ll x,ll y){
        return root(x)==root(y);
    }
};

int main()
{
    ll n,k,l,p,q;
    cin>>n>>k>>l;
//    P roots[n];

    unionfind ro(n);
    unionfind te(n);

    for(ll i=0;i<k;i++){
        cin>>p>>q;
        ro.unite(p-1,q-1);
    }
    for(ll i=0;i<l;i++){
        cin>>p>>q;
        te.unite(p-1,q-1);
    }
    unordered_map<string,ll> mp;
    for(ll i=0;i<n;i++){
        mp[to_string(ro.root(i))+" "+to_string(te.root(i))]++;
    }
    for(ll i=0;i<n;i++){
        //cout<<i<<","<<ro.root(i)<<","<<te.root(i)<<endl;
        cout<<mp[to_string(ro.root(i))+" "+to_string(te.root(i))]<<" ";
    }
    cout<<endl;

    return 0;
}


Measured memory_bytes: 28744
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <string>
#include <numeric>
#include <cmath>

#define rep(i, n) for (int i = 0; i < n; i++)
using namespace std;
typedef long long ll;
using P = pair<ll, ll>;

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

const ll MOD = 1000000007;
const int INF = 1<<30;
//const ll INF = (ll)1e18 + 1;

int main(){
  string S; cin >> S;
  map<char, int> mp;
  for(int i = 0; i < S.size(); ++i){
    mp[S[i]]++;
  }
  vector<int> res;
  for (auto itr = mp.begin(); itr != mp.end(); ++itr){
    res.push_back(itr->second);
  }
  bool ans = true;
  for (auto r: res){
    if (r != 2) ans = false;
  }
  if (ans) cout << "Yes" << endl;
  else cout << "No" << endl;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void){
        int a;
        int b;
        int k;

        scanf("%d %d %d",&k,&a,&b);

        int max =(b/k) * k;

        if (a <= max){
                printf("OK\n");
        }
        else {
                printf("NG\n");
        }
        return 0;
}


Measured memory_bytes: 1644
#include<iostream>
#include<utility>
#include<queue>
using namespace std;

void RB(int x,int y){
    int W,H;
    long count = 0;
    char area[22][22]={};
    char temp;
    using P = pair <int,int>;
    queue <P> que;
    const int direction[4][2] = {{1,0},{-1,0},{0,1},{0,-1}}; 

    W = x;
    H = y;
    for(int i=1;i<=H;i++){
        for(int j=1;j<=W;j++){
            cin >> temp;
            switch (temp){
                case '.':
                    area[i][j] = 1;
                    break;
                case '#':
                    break;
                case '@':
                    area[i][j] = 0;
                    que.push(P(i,j));
                    break;
            }
        }
    }

    while(!que.empty()){
        P temppair = que.front();
        que.pop();
        for(int i=0;i<4;i++){
            int tempx = temppair.first + direction[i][0];
            int tempy = temppair.second + direction[i][1];
            if(area[tempx][tempy]==1){
                que.push(P(tempx,tempy));
                area[tempx][tempy] = 0;
            }
        }
        count++;
    }

    cout << count << endl;

}

int main(){
    int x,y;
    while(1){
        cin >> x >> y;
        if(x == 0 && y == 0) break;
        RB(x,y);
    }
    return 0;
}


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

int main() {
    vector<int> a(3);
    cin >> a.at(0) >> a.at(1) >> a.at(2);
    sort(a.begin(),a.end());
    if (a.at(0) + a.at(1) == a.at(2)) {
        cout << "Yes" << endl;
    }
    else {
        cout << "No" << endl;
    }
}

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

#define MAX_N 2000

using namespace std;

typedef pair<int, int> P;

struct TreeDPElm
{
    // それぞれ、部分木内の
    // pieceNum: コマの個数
    // maxOpnum: 最大操作回数
    // minOpnum: 最小操作回数
    int pieceNum, maxOpnum, minOpnum;
};

int N;
string S;
vector<int> G[MAX_N];

TreeDPElm dp[MAX_N];

void dfs( int v, int par )
{
    TreeDPElm &thisDP = dp[v];

    thisDP.pieceNum = ( S[v] == '1' ) ? 1 : 0;
    thisDP.maxOpnum = 0;
    thisDP.minOpnum = 0;

    P tmp = P( 0, 0 );
    for ( auto u : G[v] )
    {
        if ( u == par ) continue;

        dfs( u, v );
        TreeDPElm e = dp[u];

        thisDP.pieceNum += e.pieceNum;
        thisDP.maxOpnum += e.maxOpnum + e.pieceNum;

        tmp = max( tmp, P( e.maxOpnum + e.pieceNum, e.minOpnum + e.pieceNum ) );
    }

    if ( tmp.second > thisDP.maxOpnum - tmp.first )
        thisDP.minOpnum = tmp.second - ( thisDP.maxOpnum - tmp.first );
    else
        thisDP.minOpnum = thisDP.maxOpnum & 1;
}

int main( int argc, char **argv )
{
    cin >> N;
    cin >> S;

    for ( int i = 0; i < N - 1; i++ )
    {
        int a, b;
        cin >> a >> b;

        G[a - 1].push_back( b - 1 );
        G[b - 1].push_back( a - 1 );
    }

    int ans = ( 1 << 30 );
    for ( int root = 0; root < N; root++ )
    {
        dfs( root, -1 );
        if ( dp[root].minOpnum == 0 ) ans = min( ans, dp[root].maxOpnum );
    }

    if ( ans == ( 1 << 30 ) )
        cout << -1 << endl;
    else
        cout << ans / 2 << endl;

    return 0;
}


Measured memory_bytes: 512
// https://atcoder.jp/contests/diverta2019-2/tasks/diverta2019_2_d
//
#![allow(unused_imports)]
use std::io::*;
use std::fmt::*;
use std::str::*;
use std::cmp::*;
use std::collections::*;

macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

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

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

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

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

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

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

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        println!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

const INF: i64 = -1;
const PAR: usize = 5000;

fn sum(n: usize, x0: usize, y0: usize, z0: usize, x1: i64, y1: i64, z1: i64) -> i64 {
    let mut dp = vec![INF; PAR*2+1];

    let mut best = n as i64;
    dp[0] = 0;
    for i in 0..n+1 {
        let fr = i % PAR;
        let base = dp[fr];
        if base != INF {
            best = max(best, base+(n-i) as i64);
            if i == n {
                break;
            }
            dp[fr+x0] = max(dp[fr+x0], base+x1);
            dp[fr+y0] = max(dp[fr+y0], base+y1);
            dp[fr+z0] = max(dp[fr+z0], base+z1);
        }

        if (i+1) % PAR == 0 {
            for j in 0..PAR {
                dp[j] = dp[PAR+j];
            }
        }
    }
    // println!("{:?}", dp);
    best
}

fn main() {
    input! {
        n: usize,
        x0: usize, y0: usize, z0: usize,
        x1: usize, y1: usize, z1: usize
    };

    let s1 = sum(n, x0, y0, z0, x1 as i64, y1 as i64, z1 as i64);
    let s2 = sum(s1 as usize, x1, y1, z1, x0 as i64, y0 as i64, z0 as i64);

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


Measured memory_bytes: 4476
import sys
import math as mt
input=sys.stdin.buffer.readline  
#t=int(input())
t=1
for __ in range(t):
    #n,k=map(int,input().split())
    n=int(input())
    l=list(map(int,input().split()))
    suma=sum(l[:])
    q=int(input())
    d=[0]*(100001)
    for i in l:
        d[i]+=1
    for ______ in range(q):
        b,c=map(int,input().split())
        suma-=(d[b]*b)
        suma+=(d[b]*c)
        d[c]+=d[b]
        d[b]=0
        print(suma)
        

Measured memory_bytes: 85060
#include<algorithm>
#include<iostream>
#include<vector>
using namespace std;
typedef long long lint;
typedef vector<int>vi;
typedef pair<int,int>pii;
#define rep(i,n)for(int i=0;i<(int)(n);++i)

int main(){
  lint n,k;
  cin>>n>>k;
  lint ans=n/11*5;
  for(lint i=n/11*77+1;i<=7*n;++i){
    if((i-1)%7>=1&&(i-1)%7<=5&&9*i%11==k)ans++;
  }
  for(lint i=2;i<=6;++i){
    if(9*i%11==k)ans--;
  }
  for(lint i=7*n-5;i<=7*n-1;++i)
    if(9*i%11==k)ans--;
  cout<<ans<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <iomanip>
#include <queue>
#include <deque>
#include <map>
#include <unordered_map>
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
#define repr(e,x) for(auto& e:x)
using namespace std;
typedef long long ll;
typedef long double ld;

ll const INF=1001001001001001001;

ll N,W;
ll w[101], v[101];
ll dp[101][100001];

int main(){
    cin>>N>>W;
    repn(i,N) cin>>w[i]>>v[i];
    fill(dp[0],dp[0]+N*1000+1,INF);
    dp[0][0]=0;

    repn(i,N){
        repn(j,N*1000){
            if(j<v[i]) dp[i][j]=dp[i-1][j];
            else dp[i][j]=min(dp[i-1][j],dp[i-1][j-v[i]]+w[i]);
        }
    }

    ll ans=0;
    rep(i,N*1000+1){
        if(dp[N][i]<=W) ans=max(ans,(ll)i);
    }
    cout<<ans<<endl;
}

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

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

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int MOD = 1000000007;

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

//main code

int main(int argc, char const* argv[])
{
    int n;
    cin >> n;
    map<int,int> a;
    for (int i = 0; i < n; i++) {
        int tmp;
        cin >> tmp;
        a[tmp]++;
    }
    LL s_side = 0,l_side = 0, ans = 0;
    for (auto&& var : a) {
        if (var.second < 2) {
            continue;
        }
        s_side = l_side;
        l_side = var.first;
        if (var.second < 4) {
            ans = max(ans,s_side * l_side);
            continue;
        }
        ans = max(ans,l_side * l_side);
    }

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


Measured memory_bytes: 4992
//Author: kaiyu
#include <iostream>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <set>
#include <unordered_set>
#include <unordered_map>
#include <cstring>
#include <string>
#include <queue>
#include <stack>
#include <numeric>
#include <iomanip>
#include <climits>
using namespace std;
typedef long long ll;
#define sz(x) ((long long)(x).size())
#define all(x)  x.begin(),x.end()
#define endl "\n"
#define ff first
#define ss second
#define mp make_pair
#define pb push_back
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define vi vector<ll>
#define vvi vector<vector<ll>>
#define pii pair<int,int>
#define tt ll t;cin >> t;while(t--)
#define int3(x,y,z) ll x,y,z;cin >> x >> y >> z;
#define int2(x,y) ll x,y;cin >> x >>y;
#define int1(x) ll x;cin>>x;
#define  fio ios::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
ll power(ll a,ll b,ll m=mod){ ll ans=1; a=a%m;  while(b>0) {  if(b&1)  ans=(1ll*a*ans)%m; b>>=1;a=(1ll*a*a)%m;}return ans;}

ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}


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

const int MAXN = 5 * 100000 + 10;

#define int long long

int32_t main() {
    fio
    int x;
    cin >> x;

    for (int i = -1000 ; i <= 1000; ++i) {
        for (int j = -1000; j <= 1000; ++j) {
            int a,b;
            a = pow(i,5);
            b = pow(j,5);
            if(a-b == x) {
                cout << i << " " << j;
                goto end;
            }
        }
    }
    end:
    return 0;
}






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


int main(){

	int n,max=0,x[100]={0};
	int x_max;
	
	while (scanf("%d",&n)!=EOF) {
		x[n-1]++;
	}
	
	for (int i=0; i<100; i++) {
		if (max<x[i]) {
			max=x[i];
			x_max=i;
		}
	}
	cout << x_max+1 << endl;
	
	for (int i=x_max+1; i<100; i++) {
		if (x[x_max]==x[i]) {
			cout << i+1 <<endl;
		}
	}
		
	return 0;
}

Measured memory_bytes: 0
import sys
input = sys.stdin.readline
def main():
    N = int(input())
    S = [("").join(sorted(input().rstrip())) for i in range(N)]
    DICT = {}
    ans = 0
    for i in range(N):
        if S[i] in DICT:
            DICT[S[i]][1] += DICT[S[i]][0]
            DICT[S[i]][0] += 1
        else:
            DICT.setdefault(S[i], [1,0])
    for dicts in DICT:
        ans += DICT[dicts][1]
    print(ans)

if __name__ == '__main__':
    main()

Measured memory_bytes: 27524
#include<cstdio>
#include<functional>
#include<algorithm>
#include<cmath>
using namespace std;
void func(int);
int n,cnt,x[8],y[8],zyu[8],flg[8];
double sum,avg;
int main(void)
{
	int i;
	scanf("%d",&n);
	for(i=0;i<n;i++)	scanf("%d %d",&x[i],&y[i]);
	for(i=0;i<n;i++)	flg[i]=0;
	sum=0.0;
	cnt=0;
	func(0);
	avg=sum/cnt;
	printf("%lf\n",avg);
	return 0;
}
void func(int nn)
{
	int i,x1,y1,x2,y2;
	double a;
	if(nn==n)	{
		a=0.0;
		for(i=0;i<n-1;i++)	{
			x1=zyu[i];	y1=zyu[i];
			x2=zyu[i+1];	y2=zyu[i+1];
			a+=sqrt((double)(x[x2]-x[x1])*(x[x2]-x[x1])+
				(double)(y[y2]-y[y1])*(y[y2]-y[y1]));
		}
//		printf("a=%lf\n",a);
		sum+=a;
		cnt++;
	}
	else {
		for(i=0;i<n;i++)	{
			if(flg[i]==0)	{
				flg[i]=1;
				zyu[nn]=i;
				func(nn+1);
				flg[i]=0;
			}
		}
	}
}

Measured memory_bytes: 128
#include<stdio.h>
#include<math.h>
int main(){
    int a;
    scanf("%d",&a);
    while(a--){
        double x1,y1,x2,y2,x3,y3;
        scanf("%lf%lf%lf%lf%lf%lf",&x1,&y1,&x2,&y2,&x3,&y3);
        double a1=2*(x2-x1);
        double b1=2*(y2-y1);
        double c1=x1*x1-x2*x2+y1*y1-y2*y2;
        double a2=2*(x3-x1);
        double b2=2*(y3-y1);
        double c2=x1*x1-x3*x3+y1*y1-y3*y3;
        double x=(b1*c2-b2*c1)/(a1*b2-a2*b1);
        double y=(c1*a2-c2*a1)/(a1*b2-a2*b1);
        double r=hypot(x-x1,y-y1);
        printf("%.3lf %.3lf %.3lf\n",x,y,r);
    }
}


Measured memory_bytes: 2700
#include <iostream>

using namespace std;

int main(){
	int a,b;
	cin >> a >> b;
	int ans = -1;
	for(int i = 0; i < 1010; i++){
		if((int)(i * 0.08) == a && (int)(i * 0.1) == b) {
			ans = i;
			break;
		}
	}
	
	cout << ans << endl;
}

Measured memory_bytes: 3644
#include <stdio.h>

int main(void)
{
	int i,j;
	
	for(i = 1; i < 10; i++){
		for(j = 1; j < 10; j ++){
			printf("%dx%d=%d\n",i, j, i * j);
		}
	}
	
	return 0;
}

Measured memory_bytes: 524
blue_n = int(input())
blue_card = [input() for i in range(blue_n)]
red_n = int(input())
red_card = [input() for i in range(red_n)]

set_s = set(blue_card)
max_v = 0
for s in set_s:  
  num = blue_card.count(s) - red_card.count(s)
  max_v = max(max_v, num)
print(max(0, max_v))

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

int main() {
  long n,m,x=0,ans=0;
  cin >> n >> m;
  map<long,long> aaa;
  aaa[0]=1;
  for(long i=0;i<n;i++) {
    long a;
    cin >> a;
    x+=a;
    x=x%m;
    aaa[x]++;
    ans+=aaa[x]-1;
  }
  cout << ans << endl;
}

Measured memory_bytes: 4224
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define pi M_PI
#define R cin>>
#define Z class
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(int i=(int)(n)-1;i>=0;i--)
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
template<Z A>void pr(A a){cout<<a;ln;}
template<Z A,Z B>void pr(A a,B b){cout<<a<<' ';pr(b);}
template<Z A,Z B,Z C>void pr(A a,B b,C c){cout<<a<<' ';pr(b,c);}
template<Z A,Z B,Z C,Z D>void pr(A a,B b,C c,D d){cout<<a<<' ';pr(b,c,d);}
template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}
const ll MAX=1000000007,MAXL=1LL<<61,dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};
typedef pair<int,int> P;

void Main() {
  int x,y;
  cin >> x >> y;
  set<int> s;
  s.in(4),s.in(6),s.in(9);s.in(11);
  int a=0,b=0;
  if(s.count(x)) a=1;
  if(s.count(y)) b=1;
  if(x==2) a=2;
  if(y==2) b=2;
  if(a==b) pr("Yes");
  else pr("No");
}

int main(){ios::sync_with_stdio(0);cin.tie(0);Main();return 0;}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
#include <algorithm> 
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i,n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<"\n"
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES\n" : "NO\n"  )
#define Yes(n) cout << ((n) ? "Yes\n" : "No\n"  )
#define mp make_pair
#define sz(x) (ll)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using vc = vector<char>;
using vvc = vector<vc>;
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; 
}
constexpr ll TEN(int n) { return (n == 0) ? 1 : 10 * TEN(n - 1); }
ll dx[4]={0,1,0,-1};
ll dy[4]={1,0,-1,0};
int main(){
  string s;
  cin>>s;
  ll now=0;
  rep(i,sz(s)){
    now+=(s[i]-'0');
  }
  if(now%9==0)COUT("Yes");
  else COUT("No");
}

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

#define rep(i, n) for(int i = 0; i < (n); ++i)
#define repr(i, n) for(int i = (n-1); i >= 0; --i)

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; }

typedef long long ll;
typedef pair<int, int> P;

const int MAX = 200005;
const int INF = 1001001001;
const int MOD = 1000000007;

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

    cout << R * 2 * M_PI << endl;
}

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

int main(){
  int n;
  cin >> n;
  vector<string> blue(n);
  for(int i=0; i<n; i++)
    cin >> blue.at(i);
  
  int m;
  cin >> m;
  vector<string> red(m);
  for(int i=0; i<m; i++)
    cin >> red.at(i);
  
  int val=0, max= 0;
  
  for(int i=0; i<n; i++){//青の文字列で総当たり
    val=0;
    for(int j=0; j<n; j++){
      if(blue.at(i)==blue.at(j)){
        val++;
      }
    }
    for(int j=0; j<m; j++){
      if(blue.at(i)==red.at(j)){
        val--;
      }
    }
    if(val>max){
      max=val;
    }
  }
  cout << max << endl;
  
  
}

Measured memory_bytes: 256