akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>
#include <sstream>
#include <iomanip>
using namespace std;
typedef long long int ll;

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define YES cout << "YES" << endl
#define Yes cout << "Yes" << endl
#define yes cout << "yes" << endl
#define NO cout << "NO" << endl
#define No cout << "No" << endl
#define no cout << "no" << endl

const int INF = 1001001001;
const int mod = 1000000007;
#define PI 3.14159265359;

void P(int x) {cout << x << endl;}
void P(long x) {cout << x << endl;}
void P(double x) {cout << x << endl;}
void P(ll x) {cout << x << endl;}
void P(string x) {cout << x << endl;}
void P(char x) {cout << x << endl;}

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


int ans(string s, int i, int now) {
  if (i == 0 && now == 7) {
    cout << s[i];
    return 1;
  } else if (i == 0 && now != 7) {
    return 0;
  }
  int tmp = s[i] - '0';
  if (ans(s, i - 1, now + tmp)) {
    cout << "+" << s[i];
    return 1;
  } else if (ans(s, i - 1, now - tmp)) {
    cout << "-" << s[i];
    return 1;
  }
  return 0;
}


int main() {
  string s;
  cin >> s;
  if (ans(s, 3, s[0] - '0')) {
    cout << "=7" << endl;
  }
  return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define bits_count __builtin_popcountll
#define ld long double
#define FOR(i,a,n) for (ll i=(a);i<(n);++i)
#define RFOR(i,a,n) for (ll i=(n);i>=(a);--i)
#define ZERO(a) memset((a),0,sizeof((a)))
#define MINUS(a) memset((a),-1,sizeof((a)))
#define fi first
#define se second
#define pb push_back
#define mk make_pair
#define all(g) g.begin(),g.end()
#define sz(x) (ll)x.size()
#define pr pair<int,int>



int main()
{
	
	ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    int x,y;
    cin>>x>>y;
    if(y%2)
    {
        cout<<"No"<<endl;
    }
    else
    {
        int a=y/2 - x;
        int b=2*x - y/2;
        
        if(a>=0 && b>=0)
        cout<<"Yes"<<endl;
        else
        cout<<"No"<<endl;
    }
}


Measured memory_bytes: 3596
n = int(input())
a_b_list_kai = [list(map(int,input().split())) for x in range(n)]

a_b_list_kai = sorted(a_b_list_kai,key = lambda x:x[1])
limit = 0
result = 0
sum_task = 0
for x in a_b_list_kai:
    sum_task += x[0]
    limit = max(limit,x[1])
    if sum_task > limit:
        result = 1

if result == 1:
    print('No')
else:
    print('Yes')


Measured memory_bytes: 55252
#include <stdio.h>
#include <string.h>
int main()
{
    int count = 0;
    char w[11], t[1001];
    scanf("%s", w);
    do
    {
        scanf("%s", t);
        if (strcmp(t, "END_OF_TEXT") != 0)
        {
            for (int i = 0; i < strlen(t); i++)
            {
                if (t[i] >= 'A' && t[i] <= 'Z')
                {
                    t[i] = t[i] + 32;
                }
            }
        }
        if (strcmp(t, w) == 0)
        {
            count = count + 1;
        }

    } while (strcmp(t, "END_OF_TEXT") != 0);
    printf("%d\n", count);
    return 0;
}


Measured memory_bytes: 2112
#include <bits/stdc++.h>
#define all(a) (a).begin(), (a).end()
#define REP(i, n) for(int (i)=0; (i)<(n); (i)++)
#define RREP(i, n) for(int (i)=(n)-1, (i)>=0; (i)--)
#define ios() cin.tie(0), ios::sync_with_stdio(false)
typedef long long ll;
typedef unsigned long long ull;
ll const MOD = 1e9+7;
ll const INF = 1e18;
using namespace std;

int main(){
    int n;
    cin >> n;
    cout << (n < 1200 ? "ABC" : "ARC") << endl;
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
import java.util.Arrays;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int H = sc.nextInt();
        int W = sc.nextInt();
        String[] s = new String[H];
        for(int i = 0;i <  H;i++){
            s[i] = sc.next();
        }
        System.out.println();
        for(int i = 0;i < H;i++){
            System.out.println(s[i]);
            System.out.println(s[i]);
        }
    }
}


Measured memory_bytes: 24020
#include<iostream>
using namespace std;
long long gcd( long long m, long long n )
{
	// 引数に０がある場合は０を返す
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	// ユークリッドの方法
	while( m != n )
	{
		if ( m > n ) m = m - n;
		else         n = n - m;
	}
	return m;
}//gcd
//*********************************************************
// 最小公倍数（Least Common Multiple）を返す。
// 引数に０がある場合は０を返す。
//*********************************************************
long long lcm( int m, int n )
{
	// 引数に０がある場合は０を返す
	if ( ( 0 == m ) || ( 0 == n ) )
		return 0;
	
	return ((m / gcd(m, n)) * n); // lcm = m * n / gcd(m,n)
}//lcm
int main(){
  long long a,b,c;
  cin >> a >> b;
  cout << lcm(a, b);
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef long double ld;
template <typename T> 
using lim = numeric_limits<T>;
template <typename T>
using indexed_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
template <typename T>
using indexed_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;

struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

const int N = 12;
int A[N][N];
int C[N];
int total[N];
int n, m, x;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cin >> n >> m >> x;

    for (int i = 0; i < n; i++){
        cin >> C[i];
        for (int j = 0; j < m; j++){
            cin >> A[i][j];
            total[j] += A[i][j];
        }
    }


    int hi = 1 << n;
    int ans = 1e9;
    for (int i = 0; i < hi; i++){
        memset(total, 0, sizeof total);
        int cost = 0;
        for (int j = 0; j < n; j++){
            if ((1 << j)&i){
                cost += C[j];
                for (int k = 0; k < m; k++){
                    total[k] += A[j][k];
                }
            }
        }
        bool valid = 1;
        for (int k = 0; k < m; k++){
            valid &= total[k] >= x;
        }

        if(valid){
            ans = min(ans, cost);
        }
    }
    cout << (ans == 1e9 ? -1 : ans) << "\n";
}

Measured memory_bytes: 3608
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define REP(i, n) for(int i = 1; i < n; i++)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(), v.rend()
#define P pair<int, int>
typedef long long ll;
const ll mod = 1e9+7;

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

//繰り返し自乗法による累乗計算
//a**n
ll pow(ll a, ll n){
  if(n == 0) return 1;
  if(n%2 == 0){
    ll res = pow(a, n/2);
    return res * res;
  }
  return a * pow(a, n-1);
}
//繰り返し自乗法によるmod累乗計算
//a**n (mod)
ll modpow(ll a, ll n){
  if(n == 0) return 1;
  if(n%2 == 0){
    ll res = modpow(a, n/2);
    return res * res % mod;
  }
  return a * modpow(a, n-1) % mod;
}
//組み合わせ
//nCa
ll com(ll n, ll a){
  ll x = 1, y = 1;
  rep(i,a){
    x *= n-i;
    y *= i+1;
  }
  ll res = x / y;
  return res;
}
//組み合わせ(mod)
//nCa (mod)
ll modcom(ll n, ll a){
  ll x = 1, y = 1;
  rep(i, a){
    x = x * (n-i) % mod;
    y = y * (i+1) % mod;
  }
  ll ans = x * modpow(y, mod-2) % mod;
  return ans;
}
//gcd 最大公約数
ll gcd(ll x, ll y){
  if(x % y == 0) return y;
  return gcd(y, x%y);
}
//lcm 最小公倍数
ll lcm(ll x, ll y){
  return x * y / gcd(x, y);
}
//ngcd n個の最大公約数
ll ngcd(vector<ll> a){
  ll res;
  res = a[0];
  for(ll i = 1; i < a.size() && res != 1; i++) {
    res = gcd(a[i], res);
  }
  return res;
}
//nlcm n個の最小公倍数
ll nlcm(vector<ll> a) {
  ll res;
  res = a[0];
  for (ll i = 1; i < a.size(); i++) {
    res = lcm(res, a[i]);
  }
  return res;
}
// 素数判定
bool isprime(ll x){
  ll i;
  if(x < 2) return false;
  else if(x == 2) return true;
  if(x % 2 == 0) return false;
  for(i = 3; i*i <= x; i += 2){
    if(x % i == 0) return false;
  }
  return true;
}
// 桁和
ll digsum(ll x){
  ll res = 0;
  while(x > 0){
    res += x % 10;
    x /= 10;
  }
  return res;
}


int main(){
  int a, b, c;
  cin >> a >> b >> c;
  int ans = a*b / 2;
  cout << ans << endl;
} 






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

typedef long double ld;                                   // XD
#define int long long   
#define PB push_back 
#define all(x) (x).begin(),(x).end()
#define ii pair <int,int>
#define mii map <int,int>
#define vi vector<int> 
#define vii vector< ii >
#define F first
#define S second 
#define rep(i,a,b)  for(int i=a;i<b;i++)
#define repd(i,a,b) for(int i=a; i>=b; --i)
#define sz(x) (int)((x).size())
const double pi=2*acos(0.0);
inline void io(){
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);         
#endif
}

const int mod = 1e18+7;
const int maxn = 2e5+5;

void solve(){
	int n, d; cin>>n>>d;
	int cnt = 0;
	rep(i, 0, n){
		int a, b; cin>>a>>b;
		double s = sqrt(a*a+b*b);
		if(ceil(s) <= d) ++cnt;
	}
	cout<<cnt;
}
signed main() 
{
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); //io();
    cout<<setprecision(16);
    
    int tc=1;// cin>>tc; 
    while(tc--){
        solve();cout<<'\n';
    }
    return 0;
}



Measured memory_bytes: 3632
N = int(input())

s = []
t = []

for i in range(N):
    temp = input().split()
    s.append(temp[0])
    t.append(int(temp[1]))

X = input()

ind = s.index(X)


if ind == len(s):
    print(0)
else:
    print(sum(t[ind + 1 : ]))

Measured memory_bytes: 3060
#include<bits/stdtr1c++.h>
#include<list>
#include<algorithm>
#include<cstdlib>
using namespace std;

int main(){
    int N,A,B;
    cin >> N >> A >> B;
    if (B<=A*N){
        cout << B << endl;
    }
    else{
        cout << A*N << endl;
    }
}

Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#define min(a,b) (a<b?a:b)
int N,D,P[51][51],dp[51][51],path[51][51],mc[51],i,j,k,r=0;

int s(int d,int p)
{
	int i,r=1000000,pos=-1,t=51;
	if(d==D)
		return 0;
	if(dp[d][p]!=-1)
		return dp[d][p];
	for(i=0;i<N;i++)
	{
		if(P[i][d]!=mc[d])
			continue;
		t=min(t,s(d+1,i)+(i==p?0:1));
		if(t<r)
		{
			r=t;
			pos=i;
		}
	}
	path[d][p]=pos;
	return dp[d][p]=r;
}

void di(int d,int p)
{
	if(d==D)return;
	printf("%d\n",path[d][p]+1);
	di(d+1,path[d][p]);
}

int main()
{
	scanf("%d%d",&N,&D);
	memset(dp,-1,sizeof(dp));
	for(i=0;i<N;i++)
		for(j=0;j<D;j++)
			scanf("%d",&P[i][j]);
	for(i=0;i<D;i++)
	{
		for(j=0,k=1000000;j<N;j++)
			k=min(k,P[j][i]);
		mc[i]=k;
		r+=k;
	}


	printf("%d %d\n",r,s(0,50)-1);
	di(0,50);
	return 0;
}

Measured memory_bytes: 636
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
using namespace std;

int main() {
	set<int> x;

	int n;
	cin >> n;
	for(int i = 0; i < n; i++) {
		int flag = 0;
		cin >> flag;
		int value;
		cin >> value;
		if(flag == 0) {
			x.insert(value);
			cout << x.size() << endl;
		}
		else if(flag == 1) {
			set<int>::iterator itr = x.find(value);
			if(itr != x.end()) {
				cout << 1 << endl;
			}
			else {
				cout << 0 << endl;
			}
		}
		else {
			x.erase(value);
		}
	}

	return 0;
}



Measured memory_bytes: 12360
from collections import defaultdict

N = int(input())
l = [list(map(int, input().split())) for _ in range(N)]

for x, y, h in l:
    if h == 0:
        continue
    for Cx in range(0, 101):
        for Cy in range(0, 101):
            H = abs(Cx-x) + abs(Cy-y) + h
            if all([hh == max(H - abs(Cx-xx) - abs(Cy-yy), 0) for xx, yy, hh in l]):
                print(Cx, Cy, H)
                exit()

Measured memory_bytes: 3316
// #include {{{
#include <iostream>
#include <cassert>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <ctime>
#include <queue>
#include <set>
#include <map>
#include <stack>
#include <string>
#include <bitset>
#include <vector>
#include <complex>
#include <algorithm>
using namespace std;
// }}}
// #define {{{
typedef long long ll;
typedef double db;
typedef pair<int,int> pii;
typedef vector<int> vi;
#define de(x) cout << #x << "=" << x << endl
#define rep(i,a,b) for(int i=a;i<(b);++i)
#define per(i,a,b) for(int i=(b)-1;i>=(a);--i)
#define all(x) (x).begin(),(x).end()
#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define fi first
#define se second
// }}}

const int N = 3030 , P = 1e9 + 7;
int f[N][2] , g[N][2] , n , m;
inline void pp(int &x,int d){if((x+=d)>=P)x-=P;}

int main(){
  scanf("%d%d",&n,&m);
  rep(i,0,n+1) f[i][0] = 1;
  rep(i,0,m) {
    rep(i,0,n+1) rep(j,0,2) g[i][j] = 0;
    rep(i,0,n+1) rep(j,0,2) if(f[i][j]) {
      if(i) {
        pp(g[i][j||(i==1)] , f[i][j]);
        pp(g[i-1][j||(i==1)] , f[i][j]);
      }
      if(i!=n) {
        pp(g[i][j||(i==0)] , f[i][j]);
        pp(g[i+1][j||(i==0)] , f[i][j]);
      }
    }
    rep(i,0,n+1) rep(j,0,2) f[i][j] = g[i][j];
  }
  int ans=0;
  rep(i,0,n+1) pp(ans,f[i][1]);
  printf("%d\n",ans);
  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public final class Main {
    public static void main(String[] args){

        Scanner stdIn = new Scanner(System.in);

        int R = stdIn.nextInt();
        int G = stdIn.nextInt();
        int B = stdIn.nextInt();
        int N = stdIn.nextInt();

        int counter = 0;

        for(int r=0; r<=(N/R)+1; r++){
            if(r*R>N || R == 0){
                break;
            }
            for(int g=0; g<=(N/G)+1; g++){
                if(r*R+g*G>N || G == 0){
                    break;
                }
                if((N-(r*R+g*G))%B == 0){
                    counter++;
                }
            }
        }

        System.out.println(counter);
    }
}


Measured memory_bytes: 22996
#include <bits/stdc++.h>
     
using namespace std;
typedef long long ll;
      
int main(void){
    int s, w;
    
    cin >> s >> w;
    //cout << sqrt(a) << " " << sqrt(b) << " " << sqrt(c) << endl;
    if (s<=w) {
        cout << "unsafe";
    } else {
        cout << "safe";
    }
    return 0;
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
#define fast() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define ll long long int
using namespace std;
 
int main() {
    fast();
    // ll t;
    // cin>>t;
    // while(t--)			
    // {
               
    // }
    ll n,m;
    cin>>n>>m;
    ll h[n];
    for(ll i=0;i<n;i++)
    cin>>h[i];
    vector<set<ll>>v(n);
    for(ll i=0;i<m;i++)
    {
      ll x,y;
      cin>>x>>y;
      v[x-1].insert(y-1);
      v[y-1].insert(x-1);
    }
    ll cnt=0;
    for(ll i=0;i<n;i++)
    {
       int flag=1;
        set<ll>::iterator it;
        for(it=v[i].begin();it!=v[i].end();it++)
        {
            if(h[i]<=h[*it])
            flag=0;
        }
        if(flag)
        cnt++;
    }
    cout<<cnt;
}
#include <bits/stdc++.h>
#define fast() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

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

int main()
{
    ll a, b, c;
    cin >> a >> b >> c;
    if (a < b && b < c)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 3092
//In The Name of Allah
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const int N = 2e5 + 10;
const ll mod = 1e9 + 7;

ll fact[N], inv[N];

ll Pow(ll a, ll b){
    ll res = 1;
    for (; b; b = b >> 1)
        res = res * (b & 1 ? a : 1) % mod, a = a * a % mod;
    return res;
}

ll C(ll n, ll m){
    if (m < 0 || n < m)
        return 0;
    return fact[n] * inv[m] % mod * inv[n - m] % mod;
}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
    ll h, w, a, b;
    cin >> h >> w >> a >> b;
    fact[0] = inv[0] = 1;
    for (ll i = 1; i < N; i ++)
        fact[i] = fact[i - 1] * i % mod, inv[i] = Pow(fact[i], mod - 2);
    ll ans = C(h + w - 2, h - 1);
    for (ll i = 1; i <= b; i ++)
        ans = (ans - C(w - i + a - 1, a - 1) * C(h - a + i - 2, i - 1) % mod) % mod;
    ans = (ans + mod) % mod;
    cout << ans;
    return 0;
}


Measured memory_bytes: 6772
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const double EPS = 1e-9;
typedef vector<int> vint;
typedef pair<int, int> pint;
#define rep(i, n) REP(i, 0, n)
#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++)
template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }


int main(){
    int A, B;
    cin >> A >> B;
    if(A>=13){
        cout << B << endl;
    }else if(A>=6)
    {
        cout << B / 2 << endl;
    }else{
        cout << 0 << endl;
    }
    
    return 0;
}

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

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


int main(){
    int n;
    cin >> n;
    ll count = 0;
    for(int i = 1;i<n+1;++i){
        if(i%3 != 0 && i%5 != 0) count += i;
    }
    cout << count << endl;

    return 0;
}


Measured memory_bytes: 3632
#include <bits/stdc++.h>
 
using namespace std;
 
#define INF 1001000100010001000
#define MOD 1000000007
#define EPS 1e-10
#define int long long
#define rep(i, N) for (int i = 0; i < N; i++)
#define Rep(i, N) for (int i = 1; i < N; i++)
#define For(i, a, b) for (int i = (a); i < (b); i++)
#define pb push_back
#define mp make_pair
#define i_i pair<int, int>
#define vi vector<int>
#define vvi vector<vi >
#define vb vector<bool>
#define vvb vector<vb >
#define vp vector< i_i >
#define all(a) (a).begin(), (a).end()
#define Int(x) int x; scanf("%lld", &x);
#define int2(x, y) int x, y; scanf("%lld %lld", &x, &y);
 
//int dxy[5] = {0, 1, 0, -1, 0};
// assign
 
signed main()
{
    Int(s);

    while (s--) {
        int2(p, q);
        int cnt = 0;
        rep(i, 301) {
            rep(j, 301) {
                int m = i - 150, n = j - 150;
                if (m*m + n*n < 2) continue;
                if (!((m*p+n*q)%(m*m+n*n)) && 
                    !((m*q-n*p)%(m*m+n*n))) {
                    //cout << m << " " << n << endl;
                    cnt++;
                }
            }
        }
        if (cnt == 4) {
            cout << 'P' << endl;
        } else {
            cout << 'C' << endl;
        }
    }

    return 0;
}

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

const int inf = numeric_limits<int>::max(),
          MAX = 1e6,
          MOD = 1e9 + 7;


int32_t main() {
    ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);

    int n; cin >> n;
    vector<int> h(n);

    for (auto &i : h)
        cin >> i;

    vector<int> ans(n, 0);
    ans[1] = abs(h[1] - h[0]);

    for (int i = 2; i < n; ++i)
        ans[i] = min(ans[i - 1] + abs(h[i] - h[i - 1]), ans[i - 2] + abs(h[i] - h[i - 2]));

    cout << ans.back() << "\n";

    return 0;
}

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

typedef long long ll;

#define MOD 1000000007
#define INF LLONG_MAX
#define decimDigits(n) fixed << setprecision(n)
#define all(x) (x).begin(),(x).end()
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define irep(it, arr) for(auto it = begin(arr); it != end(arr); it++)

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

int main(){

    vector<int> isBeautiful(26, 1);
    string w;

    cin >> w;

    irep(it, w)
        isBeautiful[*it - 97] *= -1;

    rep(i, 26)
        if(isBeautiful[i] != 1){
            cout << "No" << endl;
            return 0;
        }
    
    cout << "Yes" << endl;

    return 0;
}

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

using namespace std;

int main(){
	int min_A;
	int max_Z;

	int max_length;

	string s;

	cin >> s;

	int end_of_string = (int)s.length() - 1;

	for(int i = 0; i < (int)s.length(); i++){
		if(s.at(i) == 'A'){
			min_A = i;
			break;
		}
	}

	for(int j = end_of_string; j > min_A; j--){
		if(s.at(j) == 'Z'){
			max_Z = j;
			break;
		}
	}

	max_length = max_Z - min_A + 1;

	cout << max_length << endl;

	return 0;
}

Measured memory_bytes: 640
main(i,n,c,s,d,l){
  for(;scanf("%d",&n),n;printf("%s\n",a)){
    scanf("%s",a);
    for(;n;n--){
      for(p=b,i=d=s=0,l=strlen(a);i<=l;i++){
        c=a[i];
        if(!s)s=c;
        if(s!=c){
          p+=sprintf(p,"%d",d);
          *(p++)=s;
          d=0;s=c;
        }
        d++;
      }
      *p=0;
      strcpy(a,b);
    }
  }
  return 0;
}

Measured memory_bytes: 0
a, b = map(int, input().split())


def f_0(b):
    # f(0,b)を返す
    if b == 0:
        return 0
    if b % 2 == 1:
        res = 1 if (b // 2) % 2 == 0 else 0
        return res
    else:
        res = f_0(b - 1) ^ b
        return res


if a == b:
    ans = a
else:
    fa = f_0(a-1)
    fb = f_0(b)
    ans = fa ^ fb
print(ans)


Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
bool f[30];
int main(){
    for(int i=0;i<28;i++){
        int a;cin>>a;--a;
        f[a]=true;
    }

    for(int i=0;i<30;i++){
        if(!f[i])cout<<i+1<<endl;
    }
    return 0;
}

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

int main() {
	double a, b, x;
	cin >> a >> b >> x;
	// 3D-2D(平面)にする時 立方体の面積=横x横x縦 -> 立方体の面積/横 = 横x縦
	double s = x / a;	// 平方cmにした時の水の面積

	// atan2で角度(ラジアン)が求まる
	double rad;
	if (s >= a * b /2) {
		// 水筒の中の水が半分より多い時
		// 傾けた時の水が無い部分の面積(三角形)に注目する
		// 水が無い部分(三角形)の面積 a:横 x b:縦 - s:水の面積
		// 上記のイコールになる角度が知りたい三角形の面積 a:横 x h:縦 / 2
		double h = (a * b - s) * 2 / a;	// 上記の式を変形する
		rad = atan2(h, a);	// 横と縦で角度が求まる
	} else {
		// 半分より少ない場合
		// 水の部分(三角形)の面積 w:横 b:縦 / 2 = s
		double w = 2 * s / b;	// 上記の式を変形する
		rad  = atan2(b, w);
	}

	double PI = acos(-1);
	double deg = rad / (2 * PI) * 360;	// ラジアンから角度に変換

	printf("%.10f\n", deg);
	return 0;
}

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

struct node{
  int key;
  struct node *next;
  struct node *prev;
};

typedef struct node * NodePointer;

NodePointer nil;

NodePointer listSearch(int);
void init(void);
void printList(void);
void deleteFirst(void);
void deleteLast(void);
void delete(int);
void insert(int);

int main(){
  int n,i,num,np,nd,size;
  char order[11];

  init();
  size = np = nd = 0;

  scanf("%d" ,&n);
  for(i = 0 ; i < n ; i++){
    scanf("%s %d" ,order ,&num);

    if(order[0] == 'i'){
      insert(num);
      np++; 
      size++;
    }else if(order[0] == 'd'){
      if(strlen(order) > 6){
	if(order[6] == 'F'){
	  deleteFirst();
	}else if(order[6] == 'L'){
	  deleteLast();
	}
      }else{
	delete(num);
	nd++;
      }
      size--;
    }
  }
  printList();

  return 0;
}

NodePointer listSearch(int key){
  NodePointer x,y;

  y = nil;
  x = y->next;

  while(x != nil){
    if(x->key == key){
      return y;
    }
    y = x;
    x = y->next;
  }
  return NULL;
}

void init(){
  nil = malloc(sizeof(struct node));
  nil->next = nil;
  nil->prev = nil;
  nil->key = -1;
}

void printList(){
  NodePointer cur = nil->next;
  int isf = 1;

  while(1){
    if(cur == nil) break;
    if(isf == 0) printf(" ");
    printf("%d" ,cur->key);
    cur = cur->next;
    isf = 0;
  }
  printf("\n");
}

void deleteFirst(){
  NodePointer x,y;

  x = nil->next;
  y = x->next;
  y->prev = nil;
  nil->next = y;
  free(x);
}

void deleteLast(){
  NodePointer x,y;

  x = nil->prev;
  y = x->prev;
  y->next = nil;
  nil->prev = y;
  free(x);
}

void delete(int key){
  NodePointer x,y,z;

  if(nil->next->key == key){
    deleteFirst();
    return;
  }

  x = listSearch(key);
  if(x == NULL){
    return;
  }
  z = x->next;

  y = x->next->next;
  x->next = y;
  y->prev = x;
  
  free(z);
}

void insert(int key){
  NodePointer x,y;
  x = malloc(sizeof(struct node));
  x->key = key;
  
  y = nil->next;
  nil->next = x;
  x->prev = nil;
  x->next = y;
  y->prev = x;
}

Measured memory_bytes: 31788
#include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-8;
const ll mod=1e9+7;
const int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

ll n,t=0,res=0;
vl a,b;

bool f(int i){
	int L=b[(i+n-1)%n],R=b[(i+1)%n];
	return L<b[i]&&b[i]>R&&L+R<=b[i]&&b[i]>=a[i];
}

int main(){
	cin>>n;
	a=b=vl(n);
	for(int i=0;i<n;i++) cin>>a[i];
	for(int i=0;i<n;i++){
		cin>>b[i];
		if(a[i]==b[i]) t++;
	}
	queue<int> q;
	for(int i=0;i<n;i++) if(f(i)) q.push(i);
	while(!q.empty()){
		ll i=q.front();q.pop();
		if(!f(i)) continue;
		ll L=b[(i+n-1)%n],R=b[(i+1)%n],s=L+R,tmp=min((b[i]-a[i])/s,(b[i]-max(L,R)-1)/s+1);
		res+=tmp;
		b[i]-=tmp*s;
		if(b[i]==a[i]) t++;
		if(f((i+n-1)%n)) q.push((i+n-1)%n);
		if(f((i+1)%n)) q.push((i+1)%n);
	}
	if(t<n) res=-1;
	cout<<res<<endl;
}

Measured memory_bytes: 3840
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <deque>
#include <list>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>

using namespace std;

//typedef
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef vector<string> VS;
typedef pair<LL, LL> PLL;

//conversion
inline LL toLong(string s) {LL v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

//math
//-------------------------------------------
template<class T> inline T sqr(T x) {return x*x;}

//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) LL((a).size())
#define EACH(i,c) for(auto i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
#define FOR(i,a,b) for(LL i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define UNTIL(p) while(!(p))

//constant
const double EPS = 1e-5;
const double PI  = acos(-1.0);

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

#define PUTS(x) cout << (x) << endl;

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    LL n;
    cin>>n;
    VL a(n+1),b(n);
    REP(i,n+1)cin>>a[i];
    REP(i,n)cin>>b[i];
    LL ans = 0;
    REP(i,n){
        LL x = min(a[i], b[i]);
        ans += x;
        b[i] -= x;
        a[i] -= x;
        if(b[i] > 0){
            LL y = min(a[i+1], b[i]);
            b[i] -= y;
            a[i+1] -= y;
            ans += y;
        }
    }
    PUTS(ans);
}

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

#define rep(i, n) REP(i, 0, n)
#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()
{
    int n, m, q;
    cin >> n >> m >> q;

    vector<vector<int>> a(n + 1, vector<int>(n + 1, 0));
    rep(i, m)
    {
        int L, R;
        cin >> L >> R;
        a[L][R]++;
    }
    for (int i = 1; i <= n; i++)
        for (int j = 1; j <= n; j++)
            a[i][j] += a[i][j - 1];
    for (int i = 1; i <= n; i++)
        for (int j = 1; j <= n; j++)
            a[i][j] += a[i - 1][j];

    rep(i, q)
    {
        int l, r;
        cin >> l >> r;
        OP(a[r][r] - a[l - 1][r] - a[r][l - 1] + a[l - 1][l - 1]);
    }
    return 0;
}

Measured memory_bytes: 1920
n,m = map(int,input().split())
l,r = [0] * m, [0] * m
for i in range(m):
    l[i], r[i] = map(int, input().split())

lmax = 0
rmin = 10 ** 5
for i in range(m):
    lmax = max(lmax,l[i])
    rmin = min(rmin,r[i])

if lmax <= rmin:
    print(rmin - lmax + 1)
else:
    print("0")

Measured memory_bytes: 10868
#include <stdio.h>
#include <string.h>
#define N 1001

char x[N], y[N];
int n, dp[N][N], h, w;

main(){
  int t, i, j;
  scanf("%d", &n);
  getchar();
  for(t=0;t<n;t++){
    scanf("%s%s", x, y);
    h = strlen(y);
    w = strlen(x);
    for(i=0;i<=h;i++) dp[i][0] = 0;
    for(i=0;i<=w;i++) dp[0][i] = 0;
    for(i=1;i<=h;i++){
      for(j=1;j<=w;j++){
        dp[i][j] = dp[i-1][j-1];
        if(y[i-1] == x[j-1]) dp[i][j]++;
        if(dp[i][j] < dp[i-1][j]) dp[i][j] = dp[i-1][j];
        if(dp[i][j] < dp[i][j-1]) dp[i][j] = dp[i][j-1];
      }
    }
    printf("%d\n", dp[h][w]);
  }
  return 0;
}

Measured memory_bytes: 4340
#include <bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
using namespace std;
typedef pair<int,int>P;
bool used[200];
int main(){
	int n,m,x,y;
	while(cin>>n>>m,n){
		memset(used,0,sizeof(used));
		vector<P>v[109];
		char c;
		while(m--){
			cin>>c;
			if(c=='w'){
				cin>>x;
				if(v[x].size()){
					for(int i=v[x][0].first;i<v[x][0].second;i++)used[i]=0;
					v[x].clear();
				}
			}
			else{
				cin>>x>>y;
				int f=0,l,r;
				for(int i=0;i<n;i++){
					int F=0;
					for(int j=i;j<min(i+y,n);j++)if(!used[j])F++;
					if(F==y){
						f++;
						l=i;
						r=i+y;
						goto L;
					}
				}L:;
				if(!f)cout<<"impossible"<<endl;
				else{
					cout<<l<<endl;
					for(int i=l;i<r;i++)used[i]=1;
					v[x].push_back(P(l,r));
				}
			}
		}
		cout<<"END"<<endl;
	}
}


Measured memory_bytes: 3008
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)
#define VL vector<ll>
#define VS vector<string>
#define ALL(v) (v).begin(), (v).end()
ll MOD=1000000007;
ll mod=998244353;
int inf=1000001000;
ll INF=1e18+5;
//cout << std::fixed << std::setprecision(15) << y << endl;

int main(){
    ll N;
    cin >> N;
    VL a(N);
    rep(i,0,N) cin >> a[i];
    
    ll ans = 0;
    ll ma = 0;
    rep(i,0,N){
        ma = max(ma, a[i]);
        if(a[i] < ma) ans += ma - a[i];
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 4800
#include <bits/stdc++.h>
    #define rep(i,n) for(int i = 0; i < (n); i++)
     
    using namespace std; 
    using ll = long long;
    using P = pair<int,int>; 
    
    int main() {
     ll n;
     cin >> n;
     int a[n] = {0};
     int b;
     rep(i,n-1){
      cin >> b;
      a[b-1]++;
     }
     
     rep(i,n)  cout << a[i] << '\n';
     
     
     
     return 0;
    }
    

Measured memory_bytes: 4416
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int h = sc.nextInt();
        int w = sc.nextInt();
        String[][] board = new String[h][w];
        boolean[] chkX = new boolean[h];
        boolean[] chkY = new boolean[w];

        for (int i = 0; i < h; i++) {
            board[i] = sc.next().split("");
        }

        sc.close();

        for (int i = 0; i < h; i++) {
            for (int j = 0; j < w; j++) {
                if (board[i][j].equals("#")) {
                    chkX[i] = true;
                    chkY[j] = true;
                }
            }
        }

        for (int i = 0; i < h; i++) {
            if (chkX[i]) {
                for (int j = 0; j < w; j++) {
                    if (chkY[j]) {
                        System.out.print(board[i][j]);
                    }
                }
                System.out.println("");
            }
        }
    }
}

Measured memory_bytes: 25628
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>

using namespace std;

int main(){
    int N;
    while(cin >> N){
        vector<double> times;
        times.push_back(0);
        vector<long long> x(N), y(N);
        vector<string> d(N);
        for(int i=0;i<N;i++) cin >> x[i] >> y[i] >> d[i];
        vector<int> dx(N, 0), dy(N, 0);
        for(int i=0;i<N;i++){
            if(d[i] == "L") dx[i] = -1;
            if(d[i] == "R") dx[i] = 1;
            if(d[i] == "U") dy[i] = 1;
            if(d[i] == "D") dy[i] = -1;
        }
        auto calcArea = [&](double t){
            double minX = 1e20, maxX = -1e20, minY = 1e20, maxY = -1e20;
            for(int j=0;j<N;j++){
                double cx = x[j] + t * dx[j];
                double cy = y[j] + t * dy[j];
                minX = min(cx, minX);
                maxX = max(cx, maxX);
                minY = min(cy, minY);
                maxY = max(cy, maxY);
            }                
            return (maxX - minX) * (maxY - minY);
        };
        double res = calcArea(0);
            double l = 0, r = 1e9;
            for(int _=0;_<1000;_++){
                double midA = (2*l+r)/3;
                double midB = (l+2*r)/3;
                double areaA = calcArea(midA);
                double areaB = calcArea(midB);
                if(areaA < areaB) r = midB;
                else l = midA;
            }
            res = min(res, calcArea(0.5*(l+r)));
        // }
        printf("%.9lf\n", res);
    }
}

Measured memory_bytes: 8064
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);

        Problem solver = new Problem();
        solver.solve(0, in, out);
        out.close();
    }

    static class Digraph {
        final int V;
        List<List<Integer>> adj;

        public Digraph(int V) {
            this.V = V;
            adj = new ArrayList<>();
            for (int i = 0; i < V; i++) {
                adj.add(new ArrayList<>());
            }
        }

        public void addEdge(int u, int v) {
            adj.get(u).add(v);
        }

    }

    static class Problem {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
            int N = in.nextInt(), M = in.nextInt();
            Digraph G = new Digraph(N);
            for (int i = 0; i < M; i++) {
                int u = in.nextInt(), v = in.nextInt();
                G.addEdge(u - 1, v - 1);
            }

            int res = 0;
            boolean[] marked = new boolean[N];
            int[] dp = new int[N];
            Arrays.fill(dp, -1);
            for (int i = 0; i < N; i++) {
                if (!marked[i])
                    res = Math.max(res, dfs(G, i, marked, dp));
            }

            out.println(res);
        }

        public int dfs(Digraph G, int s, boolean[] marked, int[] dp) {
            if (dp[s] != -1)
                return dp[s];

            marked[s] = true;
            int path = 0;
            for (int v : G.adj.get(s)) {
                path = Math.max(path, 1 + dfs(G, v, marked, dp));
            }

            dp[s] = path;
            return path;
        }

    }

    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        public int nextInt() {
            return Integer.parseInt(next());
        }

    }
}




Measured memory_bytes: 69736
import std.algorithm;
import std.array;
import std.ascii;
import std.container;
import std.conv;
import std.math;
import std.numeric;
import std.range;
import std.stdio;
import std.string;
import std.typecons;
void log(A...)(A arg) { stderr.writeln(arg); }
int size(T)(in T s) { return cast(int)s.length; }

immutable double EPS = 1e-7;

struct Point {
    double x, y;
    Point opBinary(string op)(in Point p) const if (op == "+" || op == "-") {
        return Point(mixin("x" ~ op ~ "p.x"), mixin("y" ~ op ~ "p.y"));
    }
    Point opBinary(string op)(double k) const if (op == "*" || op == "/") {
        return Point(mixin("x" ~ op ~ "k"), mixin("y" ~ op ~ "k"));
    }
};
double dot(in Point a, in Point b) { return a.x * b.x + a.y * b.y; }
double cross(in Point a, in Point b) { return a.x * b.y - a.y * b.x; }
double norm(in Point a) { return sqrt(dot(a, a)); }

struct Circle {
    Point p;
    double r;
};
bool contains(in Circle c, in Point p) { return norm(c.p - p) < c.r + EPS; }
bool contains(in Circle a, in Circle b) { return b.r + norm(a.p - b.p) < a.r + EPS; }
bool intersects(in Circle a, in Circle b) {
    if (contains(a, b) || contains(b, a)) return false;
    return norm(a.p - b.p) < a.r + b.r + EPS;
}

double dist(in Circle a, in Circle b) {
    return max(0, norm(a.p - b.p) - (a.r + b.r));
}

immutable INF = 1e18;

struct Edge {
    int from, to; double cost;
}

void main() {
    Point s, t;
    readf("%s %s %s %s\n", &s.x, &s.y, &t.x, &t.y);
    int N; readf("%s\n", &N);
    auto Cs = new Circle[N];
    foreach (i; 0 .. N) {
        double x, y, r; readf("%s %s %s\n", &x, &y, &r);
        Cs[i] = Circle(Point(x, y), r);
    }
    Cs ~= Circle(s, 0);
    Cs ~= Circle(t, 0);

    auto G = new double[][](N + 2, N + 2);
    foreach (i; 0 .. Cs.size) {
        foreach (j; i + 1 .. Cs.size) {
            double d = dist(Cs[i], Cs[j]);
            G[i][j] = G[j][i] = d;
        }
    }

    int from = N;
    int to = N + 1;
    auto D = new double[Cs.size];
    D[] = INF;
    struct S {
        int v; double cost;
    }
    BinaryHeap!(Array!S, "a.cost > b.cost") PQ;
    PQ.insert(S(from, 0));
    while (! PQ.empty) {
        auto c = PQ.front; PQ.removeFront;
        foreach (nv; 0 .. N + 2) {
            if (c.v == nv) continue;
            double ncost = G[c.v][nv] + c.cost;
            if (D[nv] > ncost) {
                D[nv] = ncost;
                PQ.insert(S(nv, ncost));
            }
        }
    }
    //log(D);
    writefln("%.12f", D[to]);



}


Measured memory_bytes: 12352
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <cmath>
#include <iomanip>
#include <stack>
#include <queue>
#include <numeric>
#include <map>
#include <unordered_map>
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define mod 1000000007
typedef long long ll;
using namespace std;

/*
ll ncr(ll n, ll r){
  if(r>n)return 0;
  if(r*2>n) r=n-r;
  if(r==0) return 1;
  ll res = n;
  for(ll i=2;i<=r;i++){
    res *= (n-i+1);
    res /=i;
  }
  return res;
}

int main(){
  int N;
  cin >> N;
  vector<string> S(N);
  rep(i,N) cin >> S[i];
  rep(i,N) sort(S[i].begin(), S[i].end());
  sort(S.begin(), S.end());
  ll ans = 0;
  vector<ll> counter;
  int tmp=1;
  for(int i=1;i<N;i++){
    if(S[i-1]==S[i]) {
      tmp++;
      if(i==N-1) counter.pb(tmp);
    }
    else {counter.pb(tmp); tmp=1;}
  }
  for(int i=0;i<(int)counter.size();i++){
    ans += ncr(counter[i],2);
  }
  cout << ans << endl;
  return 0;
}
*/

int main(){
  ll N;
  cin >> N;
  vector<string> S(N);
  map<string,int> mp;
  rep(i,N) cin >> S[i];
  rep(i,N){
    sort(S[i].begin(), S[i].end());
    mp[S[i]]++;
  }
  ll ans = 0;
  for(auto x:mp){
    ans += (ll)x.second*(x.second-1)/2;
  }
  cout << ans << endl;
}


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

int main(){
  ll a,b;
  cin >> a >> b;
  if (a > 0){
    puts("Positive");
    return 0;
  }
  else if(a <= 0 && 0 <= b){
    puts("Zero");
    return 0;
  }
  else{
    if((b-a)%2 == 0){
      puts("Negative");
      return 0;
    }
    else{
      puts("Positive");
      return 0;
    }
  }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int a[100090];
int main()
{
    char ch[100099];
    int n,q;
    scanf("%d%d",&n,&q);
    scanf("%s",&ch);
    for(int i=0; i<n-1; i++)
    {
        if(ch[i]=='A' && ch[i+1]=='C')a[i+1]=1;
        a[i+1]+=a[i];
    }
    for(int i=1; i<=q; i++)
    {
        int c,b;
        scanf("%d%d",&c,&b);
        printf("%d\n",a[b-1]-a[c-1]);
    }
}



Measured memory_bytes: 1280
//code by PARTH_4399 for competitive programming
#include<bits/stdc++.h>
using namespace std;
#define l long // -2^31 to +2^31-1 (upper limit ~ 2*(10^9))
#define ul unsigned long // 0 to +2^32-1
#define ll long long // -2^63 to +2^63-1 (upper limit ~ 9*(10^18))
#define ull unsigned long long // 0 to +2^64-1
#define mod(x, m) ((((x)%(m))+(m))%(m))
#define vi vector<int>
#define pi pair<int,int>
#define F first
#define S second
#define PB push_back
#define MP make_pair
//const double pi=acos(-1.0); // cout<<fixed<<setprecision(n)<<pi; - for n decimal digits, use <iomanip.h>
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	//code
	ll int a,b;
	cin>>a>>b;
	if((a+b)%2==1)
	cout<<"IMPOSSIBLE";
	else
	{
		cout<<(a+b)/2;
	}
	return 0;
}

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

typedef long long ll;


int main()
{
	ll K, A, B;

	scanf("%lld%lld%lld", &K, &A, &B);

	ll ans = 1;

	if (B - A > 2)// 如果应该交换
	{
		if (A - 1 < K)// 如果可以达到交换
		{
			K -= A - 1;
			ans = A;
			ans += (K / 2) * (B - A);
			ans += K & 1;
			printf("%lld\n", ans);
		}
		else// 如果只能增加
		{
			printf("%lld\n", ans + K);
		}
	}
	else
	{
		printf("%lld\n", ans + K);
	}


	return 0;
}

Measured memory_bytes: 256
using System;

namespace B___Exponential
{
    class Program
    {
        static void Main (string[] args)
        {
            var x = int.Parse (Console.ReadLine ());
            var ans = 1.0;
            for (var i = 1; i <= x; i++)
            {
                for (var j = 2; j <= x; j++)
                {
                    if (Math.Pow (i, j) <= x)
                    {
                        ans = Math.Max (ans, Math.Pow (i, j));
                    }
                    else
                        break;
                }
            }
            Console.WriteLine (ans);
        }
    }
}

Measured memory_bytes: 11220
/* monkukui 競技プログラミング用のテンプレート  (ここから) */
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <functional>
#include <bitset>

using namespace std;
using lint = long long int;
using ll = long long int;
using lnt = long long int;
using Graph = vector<vector<int>>;
using Wgraph = vector<vector<pair<int, long long int>>>;
constexpr long long int INF = 1001001001001001LL;
constexpr long long int MOD = 1000000007LL;
constexpr double PI = 3.1415926535897932;
constexpr long long int di[] = {-1, 0, 1, 0, -1, 1, 1, -1};
constexpr long long int dj[] = {0, 1, 0, -1, 1, 1, -1, -1};

template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
inline void yes(){ cout << "yes" << endl; }
inline void Yes(){ cout << "Yes" << endl; }
inline void YES(){ cout << "YES" << endl; }
inline void no(){ cout << "no" << endl; }
inline void No(){ cout << "No" << endl; }
inline void NO(){ cout << "NO" << endl; }
inline void possible(){ cout << "possible" << endl; }
inline void Possible(){ cout << "Possible" << endl; }
inline void POSSIBLE(){ cout << "POSSIBLE" << endl; }
inline void impossible(){ cout << "impossible" << endl; }
inline void Impossible(){ cout << "Impossible" << endl; }
inline void IMPOSSIBLE(){ cout << "IMPOSSIBLE" << endl; }

#define REP(i,n) for(int i = 0; i < (n); i++)
#define RREP(i,n) for(int i = 1; i <= (n); i++)
#define DREP(i,n) for(int i = (n)-1; i >= 0; i--)
#define SREP(i,s,t) for(int i = s; i < t; i++)
#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()
#define PB push_back

/* monkukui 競技プログラミング用のテンプレート (ここまで)*/

int main(){
  
  lint n; cin >> n;
  vector<vector<lint>> acc1(n + 1, vector<lint> (62, 0));
  vector<vector<lint>> acc0(n + 1, vector<lint> (62, 0));

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

  for(lint i = 0; i < n; i++) {
    for(lint j = 0; j < 62; j++) {
      if(a[i] >> j & 1LL) acc1[i + 1][j] = 1;
      else acc0[i + 1][j] = 1;
      acc1[i + 1][j] += acc1[i][j];
      acc1[i + 1][j] %= MOD;
      acc0[i + 1][j] += acc0[i][j];
      acc0[i + 1][j] %= MOD;
    }
  }


  lint ans = 0;
  for(lint i = 2; i <= n; i++) {
    for(lint j = 0; j < 62; j++) {
      if(a[i - 1] >> j & 1LL) {
        lint tmp = acc0[i][j] * ((1LL << j) % MOD);
        tmp %= MOD;
        ans += tmp;
        ans %= MOD;
      } else {
        lint tmp = acc1[i][j] * ((1LL << j) % MOD);
        tmp %= MOD;
        ans += tmp;
        ans %= MOD;
      }
    } 
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 316672
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
#define all(x) (x).begin(),(x).end()
#define pll pair<ll,ll>
#define pii pair<int,int>
#define rep(i,n) for(int i=0;i<n;i++)
#define For(i,a,b) for(int i=a;i<b;i++)
#define sz(x) ((ll)(x).size())
#define pb push_back
#define mp make_pair
#define bit(n) (1LL<<(n))
#define F first
#define S second
#define debug(x) cerr << x << endl
#define Complex complex<double>
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
const ll INF = 1LL<<60;
const ll mod = (int)1e9 + 7;
const ll M = 1e9 + 7;

vector<ll> fac(300001); //n!(mod M)
vector<ll> ifac(300001); //k!^{M-2} (mod M)

ll mpow(ll x, ll n){ //x^n(mod M) ←普通にpow(x,n)では溢れてしまうため，随時mod計算
    ll ans = 1;
    while(n != 0){
        if(n&1) ans = ans*x % M;
        x = x*x % M;
        n = n >> 1;
    }
    return ans;
}

ll comb(ll a, ll b){ //aCbをmod計算
    if(a == 0 && b == 0)return 1;
    if(a < b || a < 0)return 0;
    ll tmp = ifac[a-b]* ifac[b] % M;
    return tmp * fac[a] % M;
}

int main() {
    ll n,k;
    cin >> n >> k;
    fac[0] = 1;
    ifac[0] = 1;
    for(ll i = 0; i<300000; i++){
        fac[i+1] = fac[i]*(i+1) % M; // n!(mod M)
        ifac[i+1] = ifac[i]*mpow(i+1, M-2) % M; // k!^{M-2} (mod M) ←累乗にmpowを採用
    }
    ll sum=0;
    vector<int> a(n);
    rep(i,n)cin >> a[i];
    sort(all(a));
    rep(i,n){
        ll x=a[i]*comb(i,k-1)%mod;
        sum+=x;
        sum%=mod;
        ll y=a[i]*comb(n-i-1,k-1)%mod;
        sum+=mod-y;
        sum%=mod;
    }
    cout << sum;


}

/*



 */



Measured memory_bytes: 5376
import math
a,b,c,d=map(int,input().split())
def gcd(a,b):
    if b>a:
        b,a=a,b
    if b==0:
        return a
    else:
        return gcd(b,a%b)
def warikiri(n,c,d):
    koubai=(c*d)//gcd(c,d)
    return n-n//d-n//c+n//koubai
print(warikiri(b,c,d)-warikiri(a-1,c,d))

Measured memory_bytes: 3064