akhauriyash/Code-Regression huggingface dataset:
//____________________________________________________________________\\
  //________________________________NAMAN_________________________________\\
 //________________________________TALAYCHA________________________________\\
//__________________________________________________________________________\\

#include <bits/stdc++.h>
#define ll long long
#define what_is(x)  cerr << #x << " is " << x << endl;
#define pmin priority_queue <int, vector<int>, greater<int> >
#define pmax priority_queue <int>
typedef long double ld;
#define sz(a) int((a).size())
 #define tr(container, it) \
for(typeof(container.begin()) it = container.begin(); it != container.end(); it++)
#define pb push_back
#define ppb pop_back
#define endl '\n'
#define mii map<ll , ll >
#define mis map<ll int, string>
#define msi map<string, ll int>
#define pii pair<ll int, ll int>
#define vi vector<ll>
#define st set<ll>
#define vii vector<pair<ll int, ll int>>
#define vs vector<string>
#define all(a) (a).begin(), (a).end()
#define F first
#define S second
#define mp make_pair
#define INF (1ll << 60)
#define DEBUG    cerr<<"/n>>>I'm Here<<</n"<<endl;
#define rep(i, a, b )   for (ll i = a; i < b; i++)
#define tep(i, a, b )   for (ll i = a; i < b; i = i + 2)
#define rrep(i, a, b)  for (ll i = a; i >= b; i--)
#define bs binary_search
#define mp make_pair
#define present(c, x) ((c).find(x) != (c).end())
#define cpresent(c, x) (find(all(c), x) != (c).end())
ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return a * (b / gcd(a, b)); }
#define N 200200
#define mod 998244353


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

using namespace std;
 /*

 ll fun (ll a,ll b , int m )
 {
   if(b==0)
   return 1;
   else if(b%2==0)
   {
     return fun((a*a)%m,b/2,m);
   }
   else
   return a*fun((a*a)%m,(b-1)/2,m)%m;
 
 }
 */

 //___________________________________________________________________________
//-------------------------START----------------------------------------------

//int s;


void solve()
{
  ll n,m=0,mi=INT_MIN,z=0;
int x;
 cin>>x;
  if(x>=30)
  {
  cout<<"Yes";
  return ;
  }
  cout<<"No";
  return ;
}


   //___________________________________________________________________________
//---------------------------END----------------------------------------------




int main() {

  // int t=1000000;
   //sieve(N);
    #ifndef ONLINE_JUDGE 
  freopen("input.txt" , "r", stdin);
  freopen("out12.txt" , "w", stdout);
    #endif  

  ios int TESTS = 1;
  //cin>>TESTS;
  while (TESTS--) {
    solve();
  }
  
  return 0;
}


Measured memory_bytes: 3548
N = int(input())
A = [int(input()) for i in range(N)]
A.sort()
B = []
for i in range(N):
    B.append(i)
C = dict(zip(B,A))
if N == 1:
    x = 1
else:
    for i in range(N-1):
        if C[i] == C[i+1]:
            del C[i]
print(len(C))

Measured memory_bytes: 3064
#include<stdio.h>
#include<math.h>
int main(){

  int a,b,C;
  scanf("%d %d %d", &a, &b, &C );

  double S,L,h;
  double rad;
  rad = 1.0 * C * M_PI / 180;
  

  S = 0.5 * a * b * sin( rad );
  
  L = 1.0 * a + b + sqrt( 1.0 * a * a + b * b - 2 * a * b * cos( rad ) );

  h = 2.0 * S / a;

  printf("%lf\n%lf\n%lf\n", S, L, h );

  return 0;

}

Measured memory_bytes: 636
#include<iostream>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<string>
#include<stack>
#include<queue>
#include<vector>
#include<algorithm>
#include <functional>
#include <iomanip>
typedef long long int ll;
using namespace std;
#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define REP(i,n) for (int i=0;i<(n);i++)
#define EREP(i,n) for (int i=1;i<=(n);i++)
#define EVEL 1

#ifndef EVEL
#define DEB(X) cout << #X << ":" <<X<<" " ;
#define TF(f) f ? cout<<"true  " : cout<<"false ";
#define END cout<<"\n";
#else
#define DEB(X) {X;}
#define TF(f) {f;}
#define END {}
#endif
const int MOD = 1000000007;
const int INF = 1000000;
#define NMAX 50
#define MAX 10

int N, A, B;
priority_queue<ll> v;
vector<ll> mo;
ll temp = 0, id = 0, mem, yui = 1, sum = 0;
long double ans, av = 0;
int TR[1000] = { 0 }, bf;
ll C[200][200];
bool fir = true;

void Conb(int N) {
	for (int i = 0; i <= N; i++) {
		for (int j = 0; j <= i; j++) {
			if (j == 0 || j == i)C[i][j] = 1;
			else {
				C[i][j] = C[i - 1][j - 1] + C[i - 1][j];
			}
		}
	}
}



int main() {
	ios_base::sync_with_stdio(false);
	cin >> N >> A >> B;
	REP(i, N) {
		cin >> temp;
		v.push(temp);
		mo.push_back(temp);
	}
	sort(mo.begin(), mo.end(), greater<ll>());
	ll bu = 0;
	for (int j = A; j>0; j--) {
		bu += v.top();
		v.pop();
	}
	av = (double)bu / (double)A;

	int count = 0;
	int lo = 0;
	Conb(N);
	yui = 0;
	REP(i, N) {
		if (mo[i] == mo[A - 1]) {
			count++;
			if (i <= A - 1)lo++;
		}
		DEB(count)DEB(lo)DEB(mo[i])DEB(mo[A - 1])END
	}
	if (mo[0] == mo[A - 1]) {
		for(int32_t num = A;num <= B;++num) {
			yui += C[count][num];
		}
	}
	else {
		yui = C[count][lo];
	}

	cout << fixed << av << setprecision(10) << endl << yui << endl;
}
//ABC057 Maximum Average Sets

Measured memory_bytes: 384
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<string>
#include<cstring>

using namespace std;
int n,k,a[60];
long long h;
bool cmp(int x,int y)
{
	return x>y;
}
int main()
{
	cin>>n>>k;
	for(int i=1;i<=n;i++)
		scanf("%d",&a[i]);
	sort(a+1,a+1+n,cmp);
	for(int i=1;i<=n;i++)
	{
		if(i<=k)h+=a[i];
		else break;
	}
	cout<<h<<endl;
return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <cassert>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <iostream>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using namespace std;

typedef unsigned long ul;
typedef pair<ul, ul> P;
map<int, int> dp;
#define REP(i, n) for (int i = 0; i < n; i++)
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};
ul H, W;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  vector<int> N(4, 0);
  cin >> N[0] >> N[1] >> N[2] >> N[3];
  sort(N.begin(), N.end());
  if (N[0] == 1 && N[1] == 4 && N[2] == 7 && N[3] == 9) {
    cout << "YES" << endl;
    return 0;
  }

  cout << "NO" << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <math.h>

int main(void) {
  int h, w, ans = 0;
  char s[51][51];

  if(scanf("%d %d", &h, &w) == 1);

  for(int i = 0; i < h; i++) {
    if(scanf("%s", s[i]) == 1);
  }

  for(int i = 0; i < h; i++) {
    for(int j = 0; j < w; j++) {
      if(s[i][j] == '.') {
        for(int k = i - 1; k <= i + 1 && k < h; k++) {
          if(k < 0) {
            continue;
          }
          for(int l = j - 1; l <= j + 1 && l < w; l++) {
            if(l < 0) {
              continue;
            }
            if(s[k][l] == '#') {
              ans++;
            }
          }
        }
        s[i][j] = ans + '0';
        ans = 0;
      }
    }
    printf("%s\n", s[i]);
  }

  return 0;
}


Measured memory_bytes: 128
//Soccer
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main() {
    int N, a, b, c, d;
    vector<int> v;
    cin >> N;
    int S[N + 1];
    for(int i = 1; i < N + 1; i++) S[i] = 0;
    for(int i = 0; i < (N * (N - 1) / 2); i++) {
        cin >> a >> b >> c >> d;
        if(c > d) S[a] += 3;
        else if(c < d) S[b] += 3;
        else {S[a]++; S[b]++;}
    }
    for(int i = 1; i < N + 1; i++) {
        v.push_back(S[i]);
    }

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

    for(int i = 1; i < N + 1; i++) {
        cout << 1 + int(distance(upper_bound(v.begin(), v.end(), S[i]), v.end())) << endl;
    }
}


Measured memory_bytes: 3128
#include <cstdio>
#include <map>
#include <queue>
#include <cstring>

#define PRINTF(...) 

using namespace std;

map<int, int> mp;
int goal[8] = {0, 1, 2, 3, 4, 5, 6, 7};

static inline int encode(int arg[8]) {
    int ret = 0;
    for (int i = 0; i < 8; i++) {
        ret += arg[i] * (1 << (3 * (7 - i)));
    }
    return ret;
}

void decode(int e, int *ret) {
    for (int i = 0; i < 8; i++) {
        ret[7 - i] = (e >> (3 * i)) & 7;
    }
}

int egoal = encode(goal);

void solve_all() {
    queue<int> q;
    int count = 0;

    int e = encode(goal);
    q.push(e);
    mp[e] = 0;

    while (q.size()) {
        int cp[8];
        int ce = q.front(); q.pop();
        decode(ce, cp);
        int cn = mp[ce];

        PRINTF("now cp: \n");
        for (int j = 0; j < 8; j++) {
            PRINTF("%d", cp[j]);
            if (j == 3) 
                PRINTF("\n");
        }
        PRINTF("\n");

        // Find zero
        int z = 0;
        for (int i = 0; i < 8; i++) {
            if (cp[i] == 0) {
                z = i;
                break;
            }
        }
        PRINTF("zero is %d\n", z);

        int zy = (z >= 4);
        int zx = z % 4;
        //PRINTF("    z: %d, zy: %d, zx: %d\n", z, zy, zx);
        int dirs[4][2] = {{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
        for (int i = 0; i < 4; i++) {
            int ny = zy + dirs[i][0];
            int nx = zx + dirs[i][1];
            int nz = z + dirs[i][0] * 4 + dirs[i][1];
            if (nx >= 0 && nx < 4 && ny >= 0 && ny < 2) {
                int np[8];
                memcpy(np, cp, sizeof(np));

                // Swap
                //PRINTF("    swapping %d:[%d, %d] %d:[%d, %d]\n", z, zy, zx, nz, ny, nx);
                int tmp = np[z];
                np[z] = np[nz];
                np[nz] = tmp;
                //PRINTF("    swapped \n    ");
                for (int j = 0; j < 8; j++) {
                    //PRINTF("%d", np[j]);
                }
                //PRINTF("\n");

                int ne = encode(np);
                auto itr = mp.find(ne);
                if (itr == mp.end() || cn + 1 < itr->second) {
                    //PRINTF("   not found or not min. cn:%d, sec:%d\n", cn, itr->second);
                    q.push(ne);
                    mp[ne] = cn + 1;
                } else {
                    //PRINTF("   found or min. cn:%d\n", cn);
                    if (itr != mp.end()) {
                        //PRINTF("    sec:%d\n", itr->second);
                    }
                }
            }
        }

    }
}

int main() {
    solve_all();
    while (true) {
        int puzzles[7];
        for (int i = 0; i < 8; i++) {
            if (scanf(" %d", &puzzles[i]) == EOF) 
                return 0;
        }
        PRINTF("solving: ");
        for (int i = 0; i < 8; i++) {
            PRINTF("%d ", puzzles[i]);
        }
        PRINTF("\n");
        printf("%d\n", mp[encode(puzzles)]);
    }
}

Measured memory_bytes: 3612
#include <bits/stdc++.h>
#define ll long long
#define elif else if
#define endl "\n"
#define _  <<" "<<
#define eb(x) emplace_back(x)
#define maxelem(v) *max_element(v.begin(),v.end())
#define minelem(v) *min_element(v.begin(),v.end())
#define FOR(a,b) for(int i=int(a);i<int(b);++i)

using namespace std;

const int mod = 1e9+7;

void izlaz(string br)
{
  if(!br.size())
    exit(EXIT_SUCCESS);
  cout<<br;
  exit(EXIT_SUCCESS);

}

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

  int n,i;
  cin>>n;
  int ans=0;
  for(i=1;i<n;i++)
    ans+=floor((n-1)/i);
  cout<<ans;

 return 0;
}


Measured memory_bytes: 3632
#include<bits/stdc++.h>
#define ff(i, x, y) for(int i = x;i <= y;i++)
using namespace std;
typedef long long ll;
int n, pre[100010], mes[100010], ans, bit[200010], cnt;
ll sum;
//map<int, int>mp;
int lowbit(int x)
{
    return x&(-x);
}
void add(int i,int x)
{
    while(i<=n + 100005)
    {
        bit[i]+=x;
        i+=lowbit(i);
    }
	return;
}
void sub(int i,int x)
{
    while(i<=n + 100005)
    {
        bit[i]-=x;
        i+=lowbit(i);
    }
	return;
}
int qsum(int i)
{
    int s=0;
    while(i>0)
    {
        s+=bit[i];
        i-=lowbit(i);
    }
    return s;
}
bool check(int x) {
	ll tmp = 0;
	ff(i, 1, n) {
		if(mes[i] <= x)
			pre[i] = -1;
		else
			pre[i] = 1;
		pre[i] += pre[i - 1];
	//	bit[i] = bit[i + 100005] = 0;
	}
	ff(i, 1, 200005)
		bit[i] = 0;
	add(100005, 1);
	ff(i, 1, n) {
		tmp = tmp + i - qsum(pre[i] + 100005);
		add(pre[i] + 100005, 1);
	//	cout << tmp << endl;
	}
	//cout << "     " << x << "     " << tmp << endl;
	//cout << tmp << endl;
	if(tmp >= sum / 2 + 1)
		return true;
	return false;
}
int main() {
	scanf("%d", &n);
	sum = (n + 1);
	sum = sum * n / 2;
	ff(i, 1, n) {
		scanf("%d", &mes[i]);
		//pre[i] = mes[i];
	}
	int l = 0, r = 1e9 + 7, mid = (l + r) / 2;
	//cout << mid << endl;
	while(l <= r) {
		mid = (l + r) / 2;
		if(check(mid)) {
			ans = mid;
			r = mid - 1;
		}
		else 
			l = mid + 1;
	}
	printf("%d\n", ans);
	return 0;	
}

Measured memory_bytes: 1792
#include<stdio.h>

int main(){
	
	int a,b,c,d;
	
	scanf("%d %d %d %d",&a,&b,&c,&d);
	
	if((a*b)>=(c*d)){
		
		printf("%d\n",a*b);	
	}
	
	else{
		printf("%d\n",c*d);
	}
	
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define FOR(i, a, n) for(int (i) = (int)(a); (i) < (int)(n); ++(i))
#define FORe(i, a, n) for(int (i) = (int)(a); (i) <= (int)(n); ++(i))
#define rFOR(i, a, n) for(int (i) = (int)(n)-1; (i) >= (int)(a); --(i))
#define rFORe(i, a, n) for(int (i) = (int)(n); (i) >= (int)(a); --(i))
#define REP(i, n) FOR((i), 0, (n))
#define REPe(i, n) FORe((i), 1, (n))
#define REPo(i, n) FORe((i), 0, (n))
#define rREP(i, n) rFOR((i), 0, (n))
#define rREPe(i, n) rFORe((i), 1, (n))
#define rREPo(i, n) rFORe((i), 0, (n))
#define rep(i, n) FOR((i), 0, (n))
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define fi first
#define se second
#define dup(x, y) (((x)+(y)-1)/(y))
#define vc(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
using ll = long long;
using P = pair<int,int>;
using T = tuple<int,int,int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vs = vector<string>;
using vp = vector<P>;
using vt = vector<T>;

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

int main() {
  string s,t;
  cin>>s>>t;
  t.pop_back();
  if(s==t) cout << "Yes" << endl;
  else cout << "No" << endl;

  return 0;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <bitset>
#include <math.h>

typedef long long ll;
typedef unsigned long long ull;

#define vi std::vector<int>
#define vl std::vector<ll>
#define floop(n) for(int i = 0; i < n; ++i)
#define print(x) std::cout << x << std::endl;

const ll INF = 1e18;

int main()
{
    int N;
    std::cin >> N;
    ll a, res = 1;
    bool flag = false;
    
    floop(N)
    {
        std::cin >> a;

        if(a == 0)
        {
            res = 0;
            break;
        }

        else if(flag)
            continue;

        else
        {
            if(INF/a < res)
            {
                res = -1;
                flag = true;
                continue;
            }
            res *= a;
        }
    }
        
    print(res);

    return 0;
}

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

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

  int min = x - (k - 1);
  int max = x + (k - 1);
  for (int i = min; i <= max; i++)
  {
    cout << i << " ";
  }
  cout << endl;
}


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

int main()
{
int a;
int cnt=0;
	cin>>a;
	map<string,int>mp;
	for(int i=0;i<a;i++){
	string ss;
	cin>>ss;
	mp[ss]++;
	cnt=max(cnt,mp[ss]);
	}
	for(auto p:mp){
	if(p.second==cnt)cout<<p.first<<endl;
	}





  return 0;
}



Measured memory_bytes: 25216
//#include "bits/stdc++.h"
#include <iostream>
#include <vector>
#include <map>
#include <utility>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <stack>
#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <numeric>
#include <complex>
#include <bitset>
#include <functional>
#include <stack>
#include <regex>
#include <tuple>
#include <iomanip>

#define int long long
#define REP(i,l,r) REPEAT(i,l,r,true) // [l, r)
#define rep(i,n) REP(i,0,n)           // [0, n)
#define REPEAT(i,l,r,condition) for(int i=(condition)?l:r-1;(condition)?i<r:i>=l;(condition)?++i:--i) // false<-[l, r)->true
#define all(e) e.begin(),e.end()
#define rall(e) e.rbegin(),e.rend()
#define pb push_back
#define fs first
#define sc second
#define show(...) cerr<<#__VA_ARGS__<<" = ";_DEBUG(__VA_ARGS__)
#define showlr(n,l,r) cerr<<#n<<" = ";for(int i=l;i<r;i++){cerr<<n[i]<<", ";}cerr<<endl // [l, r)

#define yes puts("Yes")
#define no puts("No")
#define case(i) printf("Case #%lld: ",i)

using namespace std;

using vi=vector<int>;
using pint=pair<int,int>;

struct io{io(){cin.tie(0);ios::sync_with_stdio(false);cout.tie(0);cout<<fixed<<setprecision(20);}}io;

template<class T> istream& operator >>(istream &is, vector<T> &v){for(T &e:v)is>>e;return is;}
template<class T> ostream& operator <<(ostream &os, vector<T> v){os<<"{";for(T &e:v)os<<e<<(v.size()-(int)(&e-&v[0])>1?", ":"");os<<"}";return os;}

void _DEBUG(){}
template<typename H,typename... T> void _DEBUG(H a,T...b){cerr<<a<<(sizeof...(b)?",":"\n");_DEBUG(b...);}

inline void in(){}
template<typename H,typename... T>void in(H &a, T&... b){cin>>a;in(b...);}
inline void out(){}
template<typename H,typename... T> void out(H a, T... b){cout<<a<<(sizeof...(b)?" ":"\n");out(b...);}

template<class T> void resz(int n,T& v){v.resize(n);}
template<class H,class... T> void resz(int n,H& a,T&... b){a.resize(n);resz(n,b...);}

const int INF=1LL<<55;
const int MOD=1000000007;
const double EPS=1e-8;

int n;
vi x;

signed main(){

    in(n);
    resz(n,x);
    in(x);
    sort(all(x));
    out(accumulate(all(x)-1,0LL)>x[n-1]?"Yes":"No");

    return 0;
}


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

using P = pair<int,int>;

// ←↓→↑
int dx[4] = {-1,0,+1,0};
int dy[4] = {0,1,0,-1};
int Y,X;
vector<string> s;
vector<P> loop;
int cost[50][50];

bool space(int y, int x){
    if(!(y>=0 && x>=0 && y<Y && x<X)) return false;
    if(s[y][x] == '#') return false;
    return true;
}

void dfs(int y,int x,int dir,int depth){
    if(x==0 && y==0 && cost[0][0]) return;
    if(cost[y][x]){
        loop.push_back({cost[y][x],depth});
    }
    cost[y][x] = depth;
    for(int turn : {-1,0,+1,+2}){
        int nd = (dir+turn+4)%4;
        int ny = y + dy[nd];
        int nx = x + dx[nd];
        if(space(ny,nx)){
            dfs(ny,nx,nd,depth+1);
            return;
        }
    }
}

bool solve(){
    s.clear();
    s.resize(Y);
    loop.clear();
    rep(y,50)rep(x,50) cost[y][x] = 0;
    rep(y,Y) cin>>s[y];
    dfs(0,0,1,1);
    int corner[] = {cost[Y-1][0], cost[Y-1][X-1], cost[0][X-1]};
    rep(i,3) if(!corner[i]) return false;
    for(P lp : loop){
        rep(i,3){
            if(lp.first<=corner[i] && corner[i]<=lp.second){
                return false;
            }
        }
    }
    return true;
}

int main(void){
    while(cin>>Y>>X, Y|X){
        cout<<((solve()) ? "YES" : "NO")<<endl;
    }
    return 0;
}



Measured memory_bytes: 3248
A, B, C, X, Y = map(int,input().split())

if A + B <= 2 * C:
    ans = A * X + B * Y
else:
    if X <= Y:
        ans = 2 * C * X + (Y - X) * B
    else:
        ans = 2 * C * Y + (X - Y) * A
    
    if ans > 2 * C *(max(X, Y)):
        ans = 2 * C *(max(X, Y))

print(ans)


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


int main() {
	string today;
	cin >> today;
	if (today == "Sunny")
	{
		cout << "Cloudy";
	}
	else if (today == "Cloudy")
	{
		cout << "Rainy";
	}
	else if(today== "Rainy")
	{ 
		cout << "Sunny";
	}
}

Measured memory_bytes: 256
MM = input().split()
N = int(MM[0])
M = int(MM[1])
X = int(MM[2])
Y = int(MM[3])
xx = input().split()
yy = input().split()
xxx =[]
yyy =[]
for i in xx:
  xxx.append(int(i))
for i in yy:
  yyy.append(int(i))
xxx.sort()
yyy.sort()
count =0
for i in range(X+1,Y+1):
  if xxx[-1] < i and yyy[0] >= i:
    count +=1
    
if count == 0:
  print('War')
else:
  print('No War')

Measured memory_bytes: 9108
import java.util.Scanner;

public class Main {

	public static void main(final String[] args) {
		Scanner sc = new Scanner(System.in);
		Character character = sc.next().charAt(0);
		if (character >= 'a' && character <= 'z') {
			System.out.println("a");
		}else {
			System.out.println("A");
		}
	}
}


Measured memory_bytes: 35696
#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <string>
#include <bitset>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <sstream>
#include <fstream>
//#include <tuple>
#include <set>
#include <string.h>
#include <functional>

#define X first
#define Y second
#define MP make_pair
//#define MT make_tuple
#define REP(i, a, n) for(int (i) = (a); (i) < (n); ++(i))
#define FOR(i, n) REP(i, 0, n)
typedef long long ll;
using namespace std;
const int MAX = 500;
const double eps = 0.0000001;

template<class T, class U>
void convert(T &t, U &u)
{
	stringstream ss;
	ss << t;
	ss >> u;
}

int main()
{
	ll q;
	while( cin >> q ){
		if( q == -1 ) break;
		double x = double( q ) / double( 2 );
		while(  abs( x * x * x - double( q ) ) >= 0.00001 * double( q ) ){
			x = x - ( x * x * x - double( q ) ) / ( 3 * x * x );
		}
		printf("%.06f\n", x);
	}
	return 0;
}

Measured memory_bytes: 1192
//大文字->小文字 tolower(),逆はtoupper()
//int a = stoi(c); 文字列をintへ
//途中の出力をそのまま残さない
//数値計算 個数以外はdouble
//map<キー,値> p は辞書。p[キー] = 値
//map 全探索
//auto begin = p.begin(), end = p.end();
//for (auto it = begin; it != end; it++) {}
//mapのキー：it->first mapのバリュー：it->second
//絶対値 abs()
//入力は空白で切れる
//大文字判定 isupper(文字) 小文字判定 islower(文字)
//do{}while(next_permutation(ALL(配列)))
//while(N)で回すとき、Nはコピーを作っておく
//小文字に対応する文字コード：S[i] - 'a'
//文字コード→小文字：(char)(数字+'a')
//グラフの距離:隣接行列で扱う
#include <bits/stdc++.h>
#define rep(i,N) for(int i = 0; i < N;i++)
#define ALL(a) (a).begin(),(a).end()
#define ll long long int
using namespace std;

// K進数でのNの桁数
ll dig(ll N,ll K) {
	ll dig = 0;
	while (N) {
		dig++;
		N /= K;
	}
	return dig;
}
// x,yの最大公約数
ll gcd(ll x, ll y) {
	ll r;
	while (x%y) {
		r = x % y;
		x = y;
		y = r;
	}
	return y;
}

//nC2の計算
ll C(ll N) {
	return N * (N - 1) / 2;
}

//円周率
const double PI = 3.14159265358979323846;

int main() {
	ll n, m; cin >> n >> m;

	cout << (n - 1) * (m - 1) << endl;
}

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

#define REP(i, n ,N) for(ll i = (n); i < (N); i++)
#define RREP(i, n ,N) for(ll i = (N-1); i >= (n); i--)
#define p(s) cout<<(s)<<endl
#define p2(a, b) cout<<(a)<<" "<<(b)<<endl
using namespace std;
typedef long long ll;
ll mod = 1e9+7;
ll inf = 1e18;

ll N, M, K;
ll A[200010];
map<ll, ll> mp;
ll ans;
int main(){
	cin >> N;
	REP(i,0,N){
		cin >> A[i];
		mp[A[i]]++;
	}
	for(auto m: mp){
		ans += max<ll> (0, m.second * (m.second - 1) / 2);
	}
	REP(i,0,N){
		ll now = mp[A[i]];
		if(now >= 2){
			p(ans - now * (now - 1) / 2 + max<ll> (0, (now-1) * (now-2) / 2));
		}else{
			p(ans);
		}
	}

	return 0;
}

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

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

using namespace std;

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

    ans = A[N-1]-A[0];

    for(int i=1;i<N;i++){
        ans = min(ans,K-A[i]+A[i-1]);
    }

    cout << ans << endl;
}

Measured memory_bytes: 1792
#include <iostream>
#include <string>
#include <cmath>
#include <algorithm>
//#include <cassert>
//#include <array>
//#include <queue>
//#include <stack>
#include <vector>
//#include <map>
//#include <set>
#include <unordered_map>
//#include <unordered_set>
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REP1(i, n) for (int i = 1; i <= (int)(n); i++)

std::vector<int> sieve_of_eratosthenes(int n) {
	std::vector<int> primes(n + 1);
	for (int i = 2; i <= n; ++i)
		primes[i] = i;
	for (int i = 2; i*i <= n; ++i)
		if (primes[i])
			for (int j = i * i; j <= n; j += i)
				primes[j] = 0;
	return primes;
}
unsigned int pow_mod(unsigned long long x, unsigned int k, unsigned int mod) { //x^k (mod mod) 
	if (k == 0)     return 1;
	if (k % 2 == 0) return pow_mod(x*x % mod, k / 2, mod);
	else            return x * pow_mod(x, k - 1, mod) % mod;
}

std::vector<unsigned int> get_fact(unsigned int n, unsigned int mod) {
	std::vector<unsigned int> fact(n + 1);
	fact[0] = 1;
	for (unsigned int i = 1; i <= n; i++)
	{
		fact[i] = (long long)fact[i - 1] * i % mod;
	}
	return fact;
}

std::vector<unsigned int> get_rev_fact(unsigned int n, unsigned int mod, unsigned int fact_n_mod) {
	std::vector<unsigned int> rev_fact(n + 1);
	rev_fact[n] = pow_mod(fact_n_mod, mod - 2, mod);
	for (int i = n - 1; i >= 0; i--)
	{
		rev_fact[i] = (long long)rev_fact[i + 1] * (i + 1) % mod;
	}
	return rev_fact;
}

std::vector<unsigned int> get_rev_fact(unsigned int n, unsigned int mod, std::vector<unsigned int> fact) {
	return get_rev_fact(n, mod, fact[n]);
}

unsigned int combination_mod_precalculation(unsigned int n, unsigned int r, unsigned int mod, std::vector<unsigned int> fact, std::vector<unsigned int> rev_fact) {
	return (long long)fact[n] * rev_fact[r] % mod * rev_fact[n - r] % mod;
}

#define MOD 1000000007
#define M_MAX 1000000000

using namespace std;

int N, M;
unordered_map<int, int> um;

void solve() {
	cin >> N >> M;

	for (int factor = 2; factor*factor <= M; factor++)
	{
		if (M%factor == 0) {
			um[factor]++;
			M /= factor;
			if (M == 1) {
				break;
			}
			else {
				factor--;
			}
		}
	}
	if (M != 1) {
		um[M]++;
	}

	const int exponent_max = (int)log2(M_MAX);
	vector<unsigned int> fact = get_fact(N - 1 + exponent_max, MOD);
	vector<unsigned int> rev_fact = get_rev_fact(N - 1 + exponent_max, MOD, fact);
	unsigned long long ans = 1;
	for (const auto &e : um) {
		ans *= combination_mod_precalculation(N - 1 + e.second, e.second, MOD, fact, rev_fact);
		ans %= MOD;
	}

	cout << ans << endl;

	return;
}

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


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

int count = 0;

int main()
{
  int n;
  cin >> n;
  multiset<int> s;
  rep(i, pow(2, n))
  {
    int t;
    cin >> t;
    s.insert(-t);
  }
  vector<int> created;
  created.push_back(*s.begin());
  s.erase(s.begin());
  rep(i, n)
  {
    int sz = created.size();
    rep(j, sz)
    {
      auto itr = s.upper_bound(created[j]);
      if (itr == s.end())
      {
        puts("No");
        return 0;
      }
      created.push_back(*itr);
      s.erase(itr);
    }
  }
  puts("Yes");
  return 0;
}

Measured memory_bytes: 13692
import sys
from operator import itemgetter
import copy
sys.setrecursionlimit(10**9)
input = sys.stdin.readline

def ii(): return int(input())
def mi(): return map(int, input().split())
def lmi(): return list(map(int, input().split()))
def lmif(n): return [list(map(int, input().split())) for _ in range(n)]
def ss(): return input().split()

def main():
    h, w, K = mi()
    c = [list(input().rstrip()) for _ in range(h)]
    count = 0
    for i in range(h):
        for j in range(w):
            if c[i][j] == "#":
                c[i][j] = 1
                count += 1
            else:
                c[i][j] = 0
    
    ans = 0
    for i in range(1<<h):
        for j in range(1<<w):
            tmp = copy.deepcopy(c)
            for k in range(h):
                if i>>k & 1:
                    for l in range(w):
                        tmp[k][l] = 0
            for k in range(w):
                if j>>k & 1:
                    for l in range(h):
                        tmp[l][k] = 0
            s = 0
            for t in tmp:
                s += sum(t)
            if s == K:
                ans += 1

    print(ans)

    return

main()


Measured memory_bytes: 9356
#include <bits/stdc++.h>
#define rep(i,n) for (long long i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using T = tuple<ll,ll,ll>;
const ll MOD = 1000000007;
const ll INF = 10000000000000;
#define all(v) v.begin(), v.end()

int main(){
  ll N,T,m=INF,x=0,y=0;
  cin >> N >> T;
  vector<ll> A(N);
  rep(i,N) cin >> A.at(i);
  rep(i,N){
    if(m>A.at(i)){
      m=A.at(i);
    }else{
      if(A.at(i)-m>y){
        x=1;
        y=A.at(i)-m;
      }else if(A.at(i)-m==y){
        x++;
      }
    }
  }
  cout << x << endl;
}

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

using namespace std;
using ll = long long;

#define REP(i, n) for (ll i = 0; i < n; i++)
#define INF 9223372036854775807
#define all(x) (x).begin(), (x).end()

ll ts = 1000000007;

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

  ll n;
  cin >> n;

  cout << (n % 2 == 0 ? n / 2 : n / 2 + 1) << "\n";
}

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

int main(){
	int H,W;
	int i,j;

	while(1){
		cin >> H >> W;
		if(H == 0 && W == 0) break;
		
		for(i=1;i<=H;i++){
			for(j=1;j<=W;j++){
				cout << '#' ;
				if(j == W) cout << endl;

			}

		}

		cout << endl;

	}

	return 0;

}

Measured memory_bytes: 3096
#include <cstdio>
#include <cstring>

/* -----------------------------------------------------------------------------
	型とクラス定義
----------------------------------------------------------------------------- */

/* -----------------------------------------------------------------------------
	大域データ
----------------------------------------------------------------------------- */
char s[7][10] = {"SUN","MON","TUE","WED","THU","FRI","SAT"};
char wday[10];


int main () {

	// 個数と長さの読込み
	scanf("%s", wday);

	for(int i = 0; i < 7; i++) {
		if(strcmp(wday, s[i]) == 0) {
			printf("%d\n", 7 - i);
			break;
		}
	}

	return 0;
}

Measured memory_bytes: 128
s = gets.chomp!
#pp s

n = s[0..3].to_i
t = s[5..7].to_i
h = s[7..9].to_i

if n > 2019 || (n == 2019 && t > 4) || (n == 2019 && t == 4 && h > 30)  then puts "TBD"
else puts "Heisei"
end

Measured memory_bytes: 3836
#include <stdio.h>
#define NUMBER 10000
int main(void){ 
	int  i,num;   int a[NUMBER];  
	scanf("%d",&num);  
	for(i=0;i<num;i++) scanf("%d ",&a[i]);  
	int min,max;
	long sum;
	min=max=sum=a[0];   
	for(i=1;i<num;i++){
		if(a[i]>max){	max=a[i];}
		if(a[i]<min){	min=a[i];} 
		sum+=a[i];   }
		printf("%d %d %ld\n",min,max,sum);
		return 0;}


Measured memory_bytes: 2048
import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as BS
import Data.List

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

main = do
    getLine
    hs <- getIntList
    print $ solve hs

solve [] = 0
solve hs = m + solve (map (flip (-) m) hsa) + solve hsb
    where hs' = dropWhile (== 0) hs
          (hsa, hsb) = span (/=0) hs'
          m | null hsa = 0
            | otherwise = minimum hsa

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

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

typedef long long ll;
using namespace std;
int mod = 1000000007;

int main(void){
    ll H; cin >> H;
    ll fac2[60];
    fac2[0] = 1;
    rep(i, 59) fac2[i+1] = fac2[i]*2;

    //HPがHの敵を倒すのに必要な攻撃数
    ll cnt = 0;
    while(H > 0){
        H /= 2;
        cnt++;
    }
    //pow(2, cnt-1)体のHP1の敵が現れる fac[0] + fac[1] + fac[2] + ... + fac[cnt-1]
    ll ans = 0;
    for(int i = 0; i <= cnt-1; i++) ans += fac2[i];
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define sz(a) (a).size() 
#define all(c) (c).begin(),(c).end()
#define rep(i,n) for(int i=0;i<n;i++)
#define forn(i,n) for(int i=1;i<=n;i++)
#define ford(i,n) for(int i=n;i>=0;i--) 
#define REP(i,a,n) for(int i=a;i<n;i++)
#define foreach(itr,c) for(__typeof((c).begin(),(c).end())itr=c.begin();itr!=c.end();itr++) 
#define fill(a,b) memset(a,b,sizeof(a))
#define re return
#define INF 1e9
#define LINF 1e18
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pi;
typedef vector<int> vi;
typedef vector<pi > vpi; 
int main(){
	char a;
	cin>>a;
	if(a>='A'&&a<='Z'){
		cout<<"A";
	} 
	else{
		cout<<"a";
	}
	re 0;
}

Measured memory_bytes: 3592
from collections import Counter
N=int(input())
listS=[]
for i in range(N):
  S=input()
  listS+=[S]
listS=Counter(listS).most_common()
ans=[]
MAX=listS[0][1]
for i in range(len(listS)):
  if listS[i][1]==MAX:
    ans+=[listS[i][0]]
  else:
    break   
ans.sort()
for i in ans:
  print(i)

Measured memory_bytes: 45032
#include<bits/stdc++.h>
using namespace std;
 
#define ll long long
#define lf long double
#define pb push_back
#define mp make_pair
#define F first
#define S second
typedef pair <ll,ll> ii;
typedef vector <ll> vi;
typedef vector <ii> vii;
typedef vector <bool> vb;
typedef vector <vector <ll> > vv;
typedef vector <vector <vector<ll> > > vvv;
typedef vector <string> vs;
typedef vector <lf> vf;
#define sz(x) (ll)(x).size()
#define tr1(x) cerr << #x << ": " << x << endl
#define tr2(x, y) cerr << #x << ": " << x << " | " << #y << ": " << y << endl
#define tr3(x,y,z) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define tr4(x,y,z,w) cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<" | "<<#w<<": "<<w<<endl
#define trv(a) cerr<<#a<<": ";for(ll zz=0;zz<sz(a);zz++) cerr<<a[zz]<<" ";cerr<<endl
#define trii(x) cerr<<#x<<": ("<<x.F<<","<<x.S<<")\n";
#define trset(s) cerr<<#s<<": ";for(auto &i:s) cerr<<i<<" ";cerr<<"\n"
#define triiset(s) cerr<<#s<<": ";for(auto &i:s) trii(i);
#define epsilon 0.000000001L
#define mod 1000000007ll
#define inf 9999999999999999ll
#define nl endl
#define all(x) x.begin(), x.end()
#define r_all(x) x.rbegin(), x.rend()
#define fast()  ios_base::sync_with_stdio(false);cin.tie(NULL)
#define modulo 998244353ll

int main()
{
    fast();
    ll n;
    cin>>n;
    if(n%2==0)
    {
        n/=2;
        ll ans=0;
        ll ele=5;
        while(n/ele>0)
        {
            ans+=n/ele;
            ele*=5;
        }
        cout<<ans<<nl;
    }
    else
    {
        cout<<0<<nl;
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
#define all(x) x.begin(),x.end()
#define rep(i,j,n) for (long long i = j; i < (long long)(n); i++)
#define _GLIBCXX_DEBUG
#define MOD 1000000007
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
//name[i][j]-> vvl name(i,vl(j))
//map<int,int>mp
//余りを切り上げる =>  (a + b - 1) / b 

signed main(){
	int x1,y1,x2,y2; cin>>x1>>y1>>x2>>y2;
	int a=y2-y1;
	int b=x2-x1;
	cout<<(x2-a)<<" "<<(y2+b)<<" "<<(x1-a)<<" "<<(y1+b)<<endl;
	
	return 0;
}

Measured memory_bytes: 3604
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define REP(i, m, n) for (ll(i) = (ll)(m); i < (ll)(n); ++i)
#define REP2(i, m, n) for (ll(i) = (ll)(n)-1; i >= (ll)(m); --i)
#define rep(i, n) REP(i, 0, n)
#define rep2(i, n) REP2(i, 0, n)
#define all(hoge) (hoge).begin(), (hoge).end()
#define en '\n'
using Edge = pair<int, long long>;
using Graph = vector<vector<Edge>>;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef vector<vector<vector<ll>>> vvvl;
typedef vector<string> vs;
typedef vector<vector<string>> vvs;
typedef pair<ll, ll> pll;
constexpr long long INF = 1LL << 60;
constexpr int INF_INT = 1 << 25;
const int MOD = 1000000007;
// constexpr long long MOD = (ll)1e9 + 7;
// constexpr long long MOD = 998244353LL;
using ld = long double;
static const ld pi = 3.141592653589793L;
template <class T> inline void print(T x) { cout << x << '\n'; }
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;
}

// ~~~~~~~~~~~~~~memo~~~~~~~~~~~~~~
// for (int i = 0; i < n; ++i)
// int型の2次元配列(h×w要素の)の宣言
// vector<vector<int>> data(h, vector<int>(w));
// rotate(s.begin(), s.begin() + 1, s.end());
// sort(all(a),greater<int>());
// s.substr(0,2) 先頭から2文字切り出す
// for (auto it = mp.rbegin();it != mp.rend(); ++it)
// vector<vector<vector<int>>> dp(n + 1, vector<vector<int>>(w + 1, vector<int>(k+1, 0)));
struct UnionFind {
    vector<int> par, w;

    UnionFind(int n) : par(n, -1), w(n, 0) {}
    void init(int n) {
        par.assign(n, -1);
        w.assign(n, 0);
    }

    int root(int x) {
        if (par[x] < 0)
            return x;
        else
            return par[x] = root(par[x]);
    }

    bool issame(int x, int y) { return root(x) == root(y); }

    bool unite(int x, int y) {
        x = root(x);
        y = root(y);
        if (x == y) {
            ++w[x];
            return false;
        }
        if (par[x] > par[y]) swap(x, y);  // merge technique
        par[x] += par[y];
        par[y] = x;
        w[x] += w[y];
        ++w[x];
        return true;
    }

    int size(int x) { return -par[root(x)]; }

    int wei(int x) { return w[root(x)]; }
};
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n,m;
    cin >> n >> m;
    UnionFind uf(n);
    uf.init(n);
    rep(i,m) {
        int a,b;
        cin >> a >> b;
        --a;--b;
        uf.unite(a,b);
    }
    set<int> s;
    rep(i,n) {
        int tmp;
        tmp = uf.root(i);
        s.insert(tmp);
    }
    int res;
    res = s.size()-1;
    print(res);
    return 0;
}


Measured memory_bytes: 7800
s = list(input())
n = len(s)
flag = True
for i in range(n//2):
  #print(i, s[i], s[n-i-1])
  if s[i]!=s[n-i-1]:
    flag = False

for i in range(n//2):
  #print(i, s[i], s[n//2-i-1], n//2-i-1)
  if s[i] != s[n//2-i-1]:
    flag = False

for i in range(n//2):
  #print(n//2+i+1, s[n//2+i+1], s[n-i-1], n-i-1)
  if s[n//2+i+1] != s[n-i-1]:
    flag = False

if flag:
  print('Yes')
else:
  print('No')

"""C問題"""


"""D問題"""


Measured memory_bytes: 3060
let () =
  Scanf.scanf "%d %d" @@ fun n w ->
  let items = Array.init n (fun _ -> Scanf.scanf " %d %d" (fun x y -> x, y)) in
  let dp = Array.make (w+1) 0 in
  for i = 0 to n-1 do
    let wi, vi = items.(i) in
    for j = w downto wi do
      dp.(j) <- max dp.(j) (dp.(j-wi) + vi)
    done;
  done;
  Printf.printf "%d\n" dp.(w)

Measured memory_bytes: 3200
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define fastio ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) ((a)*(b))/gcd((a),(b))
const int maxn = 1e9 + 5;
#define INF 1000000000
const int MOD = 1e9+7;
const double PI = 3.14159265358979323846264338;



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

//ifstream cin (".in");
//ofstream cout (".out");
int n,k;
cin >> n >> k;
int ans = 0;
int maxi = 0;
for(int i=0; i<n; i++){
	int a;
	cin >> a;
	ans+=min(a,abs(k-a));
		
  }
cout << ans*2 << "\n";
return 0;
}
	





Measured memory_bytes: 3636
// Author - Kartikeya Gupta
// Codeforces - kartikea_gupta
// Github - kartikcode

#include <iostream>
#include <bits/stdc++.h>
#include <string>
#include <stdlib.h>
#include <cmath>
#include <cstdio>
#include <algorithm>
#include <fstream>
#include <typeinfo>
#include <sstream>
#define ll long long
#define ld long double
#define vll vector<ll>
#define pll pair<ll, ll>
#define vpll vector<pll>
#define I insert
#define pb push_back
#define F first
#define S second
#define br "\n"
#define repi(i, a, b) for (ll i = a; i < b; i++)
#define repj(j, a, b) for (ll j = a; j < b; j++)
#define vi vector<int>
#define pii pair<int, int>
#define vpii vector<pii>
#define mod 1000000007
#define lim 100001
#define pi 3.14159265

using namespace std;

ll factorial(ll n)      {    return (n == 1 || n == 0) ? 1 : n * factorial(n - 1); }
ll gcd(ll a, ll b)      {    if (a == 0)  return b; else return gcd(b % a, a);}
ll power(ll a, ll n)    {    if (n == 1) return a;else if (n == 0) return 1; else{ ll r = power(a, n / 2);if (n % 2 == 0)    return r * r;    else    return r * a * r;}}
ll nCr(ll n, ll r)      {    return ((factorial(n)) / (factorial(n - r) * factorial(r))); }
double precise(double n){    return floor(pow(10, 250) * n) / pow(10, 250);}

bool anyTwo(int a, int b, int c){
    if((a>=0) and (b>=0)) return true;
    if((c>=0) and (b>=0)) return true;
    if((a>=0) and (c>=0)) return true;
    return false;
}

void solve(){
    int n;
    cin>>n;
    int h[n];
    repi(i,0,n){
        cin>>h[i];
    }
    sort(h,h+n);
    int ans=0;
    for(int i=0;i<n-2;i++){
        for(int j=i+1;j<n-1;j++){
            for(int k=j+1;k<n;k++){
                if((h[i]!=h[k]) and (h[k]!=h[j]) and (h[i]!=h[j])){
                int sum = h[i] + h[j];
                if(sum>h[k]) ans++;}
            }
        }
    }
    cout<<ans<<endl;
}

int main()
{    
    ios::sync_with_stdio(false);
    cin.tie(NULL);
/*#ifndef ONLINE_JUDGE
    // for getting input from input.
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
#endif*/
    ll t;
	t = 1;
	//cin >> t;
	while(t--){
		solve();
	}
	//cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n";
	return 0;
}  

Measured memory_bytes: 3628
#include<bits/stdc++.h>
#define rep(i,j,n) for(int i=(j);i<(n);i++)
#define per(i,n,j) for(int i=(n)-1;i>=(j);i--)
using ll=long long;
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const ll INF=1LL<<60;

ll n;
vector<ll> a(200100);
map<ll,ll> dict;

int main(){
    cin>>n;
    rep(i,0,n){
        cin>>a[i];
        dict[a[i]]++;
    }
    ll sum=0;
    rep(i,0,dict.size()) sum+=dict[i]*(dict[i]-1)/2;

    vector<ll> ans(n);
    rep(i,0,n){
        ans[i]=sum-(dict[a[i]]-1);
    }
    rep(i,0,n) cout<<ans[i]<<"\n";
    return 0;
}

Measured memory_bytes: 18808
#include <iostream>
using namespace std;
int main(){
	int i=0,j=0,w,h;
	while(1){
	cin >> w >> h;
	if(h==0&&w==0) break;
	for(i=0;i<w;i++){
		for(j=0;j<h;j++){
            if(i==0|i==w-1||j==0||j==h-1){cout << "#";
            }else{
                cout << ".";
            }
		}
		cout << endl;
	}
	cout << endl;
	}
	return 0;
}



Measured memory_bytes: 3092
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <bitset>
#include <map>
#include <unordered_map>
#include <list>
#include <numeric>
#include <utility>
#include <iterator>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <ctime>
#include <cassert>

#define INF 1000000000
#define LINF 9000000000000000000
#define mod 1000000007

#define rep(i,n) for(int i=0;i<int(n);i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define REP(i,a,b) for(int i=(a);i<int(b);i++)
#define all(x) (x).begin(),x.end()
#define pb push_back
#define mp make_pair

using namespace std;

/*
   cin.tie(0);
   ios::sync_with_stdio(false);
*/

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<long long>vll;
typedef pair<int,int> pi;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
int ddx[8]={-1,-1,0,1,1,1,0,-1};
int ddy[8]={0,1,1,1,0,-1,-1,-1};
bool debug=false;

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

bool check(ll sum, ll add,ll d){
  ll ret=0,hoge=sum;
  while(sum%100==0&&sum!=0){
    ret++;
    sum/=100;
  }
  //cout<<hoge<<" "<<ret<<endl;
  return ret==d;
}

int main(){
  ll d,n;
  cin>>d>>n;
  /*
  if(d==0){
    cout<<n<<endl;return 0;
  }
  */
  ll add=pow(100,d);
  //cout<<add<<endl;
  ll sum=0;
  for(int i=0;i<n;){
    sum+=add;
    if(check(sum,add,d)){
      i++;
      //cout<<i<<": "<<sum<<endl;
    }
  }
  cout<<sum<<endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace std;
using namespace __gnu_pbds;  
#define ordered_set tree<int, null_type , less<int> , rb_tree_tag , tree_order_statistics_node_update> 
#define ll long long
#define ull unsigned long long
#define pb push_back
#define inf 1e18
#define mk make_pair
#define ld long double
#define mod 1000000007
#define fi first
#define se second
#define fastIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define test ll t; cin>>t; while(t--)
int main()
{
    fastIO;
    ll n;
    cin>>n;
    ll a[n],i;
    set<ll>s;
    map<ll,set<ll>>m;
    for(int i=0;i<n;i++)
    {
        cin>>a[i];
        s.insert(a[i]);
        m[a[i]].insert(i);
    }
    if(*s.begin()==1)
    {
        ll x=1,val,val1,count=0,y=-1;
        while(m.find(x)!=m.end())
        {
            auto itr=m.find(x);
            val=*itr->se.lower_bound(y+1);
            if(y>val)
            {
                break;
            }
            else
            {
                y=val;
                count++;
            }
            x++;
        }
        cout<<n-count<<'\n';
    }
    else
    {
        cout<<-1<<'\n';
    }
    return 0;
}

Measured memory_bytes: 39296
#[allow(unused_imports)]
use std::cmp;

// Input macro from https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
  (source = $s:expr, $($r:tt)*) => {
    let mut iter = $s.split_whitespace();
    input_inner!{iter, $($r)*}
  };
  ($($r:tt)*) => {
    #[allow(unused_mut)]
    let mut 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")
  };
}

fn main() {
  input! {
    n: usize,
    m: usize,
    cake: [(i64, i64, i64); n],
  }
  let coef = [-1, 1];
  let mut ans = 0;
  for cx in &coef {
    for cy in &coef {
      for cz in &coef {
        let mut gains: Vec<_> = cake.iter().map(|&(x, y, z)| cx * x + cy * y + cz * z).collect();
        gains.sort();
        let gain = gains.iter().rev().take(m).sum();
        ans = cmp::max(ans, gain);
      }
    }
  }

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


Measured memory_bytes: 4352
import java.util.Scanner
import kotlin.math.*

fun main() {
	val scn = Scanner(System.`in`)
	val a = scn.nextInt()
	val b = scn.nextInt()
	val h = scn.nextInt()
	val m = scn.nextInt()
	val th = 2*PI*(h/12.0+m/(12.0*60))
	val tm = 2*PI*(m/60.0)
	println(sqrt(a*a+b*b-2*a*b*cos(th-tm)))
}

Measured memory_bytes: 36384