akhauriyash/Code-Regression huggingface dataset:
let rec chars_of_string = function
  | "" -> []
  | str ->
      String.get str 0 :: chars_of_string (String.sub str 1 (String.length str - 1))

let rec string_of_chars = function
  | [] -> ""
  | c :: tail -> String.make 1 (Char.chr c) ^ string_of_chars tail

(* 比較関数を元に文字列中の文字を並び替える *)
let sort_chars f s =
  string_of_chars @@
    List.sort f @@
      List.map Char.code @@ chars_of_string s

(* 辞書順で最小の文字列に変換 *)
let to_min = sort_chars (-)

(* 辞書順で最大の文字列に変換 *)
let to_max = sort_chars (fun a b -> b - a)

let () =
  let (s, t) = Scanf.scanf "%s\n%s" (fun s t -> (to_min s, to_max t)) in
    print_string @@ if String.compare s t < 0 then "Yes" else "No"


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

typedef pair<int,int> P;
#define ll long long
#define ld long double
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define PI 3.14159265358979323846
#define sz(x) ((int)(x).size())
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)

const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;
int counter[200005];
int main()
{
    int n;
    cin >> n;
    int a;
    rep(i,n-1)
    {
        cin >> a;
        a--;
        counter[a]++;
    }
    rep(i,n)
    {
        cout << counter[i] << endl;
    }
}

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

int main() {
  double n;
  cin >> n;
  vector<double> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }

  double sum = 0.0;
  for (int i = 0; i < n; i++) {
    sum += (1.0 / a[i]);
  }
  cout << fixed << setprecision(5) << 1.0 / sum << endl;
}

Measured memory_bytes: 256
abcd = input()

a = abcd[0]
b = abcd[1]
c = abcd[2]
d = abcd[3]

for i in range(2**(4-1)):
    f = "{a}".format(a=a)
    if i>>0 & 1 == 1:
        f += "+{b}".format(b=b)
    else:
        f += "-{b}".format(b=b)
    
    if i>>1 & 1 == 1:
        f += "+{c}".format(c=c)
    else:
        f += "-{c}".format(c=c)

    if i>>2 & 1 == 1:
        f += "+{d}".format(d=d)
    else:
        f += "-{d}".format(d=d)

    result = eval(f)
    if result == 7:
        print(f + "=7")
        break


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

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

  int l = a + b, r = c + d;
  if(l == r) cout << "Balanced" << endl;
  else if(l < r) cout << "Right" << endl;
  else cout << "Left" << endl;
}


Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main(){
  int i, j, n, s, t, u;

  cin >> n;

  for(i=0; i<n; ++i){
    cin >> s;
    cout << "Case " << i+1 << ":" << endl;

    for(j=0; j<10; ++j){
      s *= s;
      s /= 100;
      t = s/10000;
      s = s - t*10000;
      cout << s << endl;
    }
  }

  return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
typedef pair<int, int> P;
int main(){
    int H, W, M;
    cin >> H >> W >> M;
    vector<int> h(M), w(M);
    set<P> s;
    for(int i = 0; i < M; i++) {
        cin >> h[i] >> w[i];
        s.insert(P(h[i], w[i]));
    }
    sort(h.begin(), h.end());
    sort(w.begin(), w.end());
    int hmax = 1, wmax = 1;
    int numh = 0, numw = 0;
    int cnth = 0, cntw = 0;
    for(int i = 1; i < M; i++){
        if(cnth < hmax) {
            numh = h[i];
            cnth = hmax;
        }
        if(cntw < wmax){
            numw = w[i];
            cntw = wmax;
        }
        if(h[i - 1] == h[i]){
            hmax++;
            if(cnth < hmax){
                numh = h[i];
                cnth = hmax;
            }
        }
        else hmax = 1;
        if(w[i - 1] == w[i]){
            wmax++;
            if(cntw < wmax){
                numw = w[i];
                cntw = wmax;
            }
        }
        else wmax = 1;
    }
    if(cnth == 1 && cntw == 1){
        cout << 2 << endl;
        return 0;
    }
    long long ans = 0;
    for(int i = 1 ; i <= W; i++){
        long long temp = cnth;
        long long ko = upper_bound(w.begin(), w.end(), i) - lower_bound(w.begin(), w.end(), i);
        temp += ko;
        if(s.count(P(numh, i))) temp--;
        ans = max(ans, temp);
    }
    for(int i = 1; i <= H; i++){
        long long temp = cntw;
        long long ko = upper_bound(h.begin(), h.end(), i) - lower_bound(h.begin(), h.end(), i);
        temp += ko;
        if(s.count(P(i, numw))) temp--;
        ans = max(temp, ans);
    }
    cout << ans << endl;
}

Measured memory_bytes: 19452
import java.util.*;

public class Main {
	public static void main (String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		ArrayList<Integer> front = new ArrayList<>();
		ArrayList<Integer> rear = new ArrayList<>();
		StringBuilder sb = new StringBuilder();
		for (int i = 0; i < n; i++) {
		    int type = sc.nextInt();
		    if (type == 0) {
		        if (sc.nextInt() == 0) {
		            front.add(sc.nextInt());
		        } else {
		            rear.add(sc.nextInt());
		        }
		    } else if (type == 1) {
		        int idx = sc.nextInt();
		        if (front.size() - 1 < idx) {
		            sb.append(rear.get(idx - front.size()));
		        } else {
		            sb.append(front.get(front.size() - idx - 1));
		        }
		        sb.append("\n");
		    } else {
		        if (sc.nextInt() == 1) {
		            if (rear.size() > 0) {
		                rear.remove(rear.size() - 1);
		            } else {
		                front.remove(0);
		            }
		        } else {
		            if (front.size() > 0) {
		                front.remove(front.size() - 1);
		            } else {
		                rear.remove(0);
		            }
		        }
		    }
		}
		System.out.print(sb);
	}
}



Measured memory_bytes: 300468
#include <iostream>
#include <vector>
#include <deque>
#include <algorithm>
#include <numeric>
#include <string>
#include <cstring>
#include <list>
#include <unordered_set>
#include <tuple>
#include <cmath>
#include <limits>
#include <type_traits>
#include <iomanip>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <set>
#include <bitset>
#include <regex>
#include <random>
#include<bits/stdc++.h>

using namespace std;

typedef long long ll;
#define rep(i,n)for(ll i=0;i<n;++i)
#define exout(x) printf("%.10f\n", x)
const double pi = acos(-1.0);
const ll MOD = 1000000007;
const ll INF = 1e10;
const ll MAX_N = 1010;

//最大公約数
ll gcd(ll x, ll y) {
	return y ? gcd(y, x % y) : x;
}

ll lcm(ll x, ll y) {
	if (x == 0 || y == 0)return 0;
	return (x / gcd(x, y) * y);
}

bool dp[1010101];
ll dx[4] = { 0,0,-1,1 };
ll dy[4] = { -1,1,0,0 };
ll a[303];

//long longしか使わない
//素数は1より大きい
int main() {
	ll n;
	cin >> n;
	if (n % 2 != 0) {
		cout << 0 << endl;
	}
	else {
		ll target = n;
		ll keta = -1;
		while (target > 0) {
			keta++;
			target /= 10;
		}
		ll ans = 0;
		ll five = 10;
		while (n / five > 0) {
			ans += n / five;
			five *= 5;
		}
		cout << ans << endl;
	}
	return 0;
}

Measured memory_bytes: 3624
import sys
sys.setrecursionlimit(700000)

def s_in():
    return input()

def n_in():
    return int(input())

def l_in():
    return list(map(int, input().split()))

def print_l(l):
    print(' '.join(map(str, l)))

class Interval():
    def __init__(self, li):
        self.li = li
        self.n = len(li)
        self.sum_li = [li[0]]
        for i in range(1, self.n):
            self.sum_li.append(self.sum_li[i-1] + li[i])

    def sum(self, a, b=None):
        if b is None:
            return self.sum(0, a)

        res = self.sum_li[min(self.n-1, b-1)]
        if a > 0:
            res -= self.sum_li[a-1]
        return res

n = s_in()
k = n_in()

res = 0
d = len(n)

def comb(a,b):
    if b == 0:
        return 1
    if b == 1:
        return a
    if b == 2:
        return a*(a-1)//2
    if b == 3:
        return (a)*(a-1)*(a-2)//6

    return 0
    

# 手前まで完全一致でii桁以降でl回非ゼロの時の場合の数
def calc(i, l):
    m = int(n[i])

    if i == d-1:
        if l == 0:
            if m == 0:
                return 1
            else:
                return 0
        elif l == 1:
            if m == 0:
                return 0
            else:
                return m
        else:
            return 0
            
        
    if m == 0:
        return calc(i+1, l)
    else:
        tmp = calc(i+1, l-1) # i桁めがmの場合
        tmp += (m-1)*comb(d-i-1, l-1)*int(9**(l-1)) # 1..(m-1)
        tmp += comb(d-i-1,l)*int(9**l)

        return tmp

print(calc(0,k))



Measured memory_bytes: 38412
#include <bits/stdc++.h>
#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 all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
template < typename T > string tost( const T& n ) { ostringstream stm; stm << n; return stm.str();}
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 const INF = 1001001001;


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

string S;
cin >> S;

int l,r;
int N = S.size();
rep(i,N) {
    if(S[i] == 'A') {
        l = i;
        break;
    }
}
drep(i,N) {
    if(S[i] == 'Z') {
        r = i;
        break;
    }
}
cout << r - l + 1 << endl;
return 0;
}

Measured memory_bytes: 720
#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<array>
#include<map>
#include<iomanip>
#include<assert.h>
#include<bitset>
#include<stack>
#include<memory>
using namespace std;
using namespace std::chrono;
typedef long long int llint;
typedef double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
/*cout<<fixed<<setprecision(20);cin.tie(0);ios::sync_with_stdio(false);*/
const llint mod=998244353;
const llint big=2.19e17+1;
const long double pai=3.141592653589793238462643383279502884197;
const long double eps=1e-15;
template <class T,class U>bool mineq(T& a,U b){if(a>b){a=b;return true;}return false;}
template <class T,class U>bool maxeq(T& a,U b){if(a<b){a=b;return true;}return false;}
llint gcd(llint a,llint b){if(a%b==0){return b;}else return gcd(b,a%b);}
llint lcm(llint a,llint b){if(a==0){return b;}return a/gcd(a,b)*b;}
template<class T> void SO(T& ve){sort(ve.begin(),ve.end());}
template<class T> void REV(T& ve){reverse(ve.begin(),ve.end());}
template<class T>llint LBI(vector<T>&ar,T in){return lower_bound(ar.begin(),ar.end(),in)-ar.begin();}
template<class T>llint UBI(vector<T>&ar,T in){return upper_bound(ar.begin(),ar.end(),in)-ar.begin();}


int main(void){
	string s;cin>>s;
	cout<<((s[0]==s[1]||s[1]==s[2]||s[2]==s[3])?"Bad":"Good")<<endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
	Scanner sc = new Scanner(System.in);
	int h, w;
	long bl = 0, wh = 0;
	void doIt() {
		h = sc.nextInt();
		w = sc.nextInt();
		String s[] = new String[h];
		long ans = 0;
		for(int i = 0; i < h; i++) {
			s[i] = sc.next();
		}
		char c[][] = new char[h][w];
		for(int j = 0; j < w; j++) {
			for(int i = 0; i < h; i++) {
				c[i][j] = s[i].charAt(j);
			}
		}
		for(int j = 0; j < w; j++) {
			for(int i = 0; i < h; i++) {
				if(c[i][j] != '!') {
					change(i, j, c);
					ans += bl * wh;
					bl = 0; wh = 0;
				}
			}
		}
		System.out.println(ans);
	}
	
	void change(int i, int j, char[][] c) {
		if(c[i][j] == '!') return;
		else if(c[i][j] == '#') bl++;
		else if(c[i][j] == '.') wh++;
		char cp = c[i][j];
		c[i][j] = '!';
		//System.out.println(i +" "+ j);
		if(i - 1 >= 0 && cp != c[i - 1][j]) change(i - 1, j, c);
		if(i + 1 < h && cp != c[i + 1][j]) change(i + 1, j, c);
		if(j - 1 >= 0 && cp != c[i][j - 1]) change(i, j - 1, c);
		if(j + 1 < w && cp != c[i][j + 1]) change(i, j + 1, c);
	}
	
	public static void main(String[] args) {
		new Main().doIt();
	}
}


Measured memory_bytes: 47368
n=int(input())
h=list(map(int,input().split()))
ans=0
cnt=0

for i in range(n-1):
  if h[i]>=h[i+1]:
    cnt+=1

  else:
    ans=max(ans,cnt)
    cnt=0
    
ans=max(ans,cnt)
    
print(ans)

Measured memory_bytes: 20460
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
using namespace std;
const int maxn=1e5+7;
#define NIL -1
struct Node
{
    int parent,left,right;
}tree[maxn];
int n,Depth[maxn];
void init()
{
    for(int i=0;i<n;i++)tree[i].parent=tree[i].left=tree[i].right=NIL;
}
void calc_depth(int root,int depth)
{
    Depth[root]=depth;
    if(tree[root].right!=NIL)calc_depth(tree[root].right,depth);
    if(tree[root].left!=NIL)calc_depth(tree[root].left,depth+1);
}
void print(int node)
{
    printf("node %d: parent = %d, depth = %d, ",node,tree[node].parent,Depth[node]);
    if(tree[node].parent==NIL)printf("root, ");
    else if(tree[node].left==NIL)printf("leaf, ");
    else printf("internal node, ");
    putchar('[');
    for(int i=0,tmp=tree[node].left;tmp!=NIL;i++,tmp=tree[tmp].right)
    {
        if(i)printf(", ");
        printf("%d",tmp);
    }
    printf("]\n");
}
int main()
{
    cin>>n;
    init();
    for(int i=0;i<n;i++)
    {
        int node_index,a,bro;
        scanf("%d%d",&node_index,&a);
        for(int j=0;j<a;j++)
        {
            int node;
            scanf("%d",&node);
            if(j==0) tree[node_index].left=node;
            else tree[bro].right=node;
            bro=node;
            tree[node].parent=node_index;
        }
    }
    int root;
    for(int i=0;i<n;i++)if(tree[i].parent==NIL)root=i;
    calc_depth(root,0);
    for(int i=0;i<n;i++)print(i);
}


Measured memory_bytes: 7808
// #include C/C++ {
#include <bits/stdc++.h>
// }
using namespace std;
// #typedef {
typedef long long int64;
typedef pair <int, int> PII;
typedef pair <int64, int64> PLL;
// }

// #parameter{
#ifdef _DEBUG

#define TYPE decltype
#define RF(filename) {freopen((filename), "r", stdin);}
#define WF(filename) {freopen((filename), "w", stdout);}
#define DF(filename) {freopen((filename), "w", stderr);}
#define eprintf printf

#else

#define TYPE __typeof
#define RF(filename) {;}
#define WF(filename) {;}
#define DF(filename) {;}
#define eprintf(...)
#define fprintf(...)

#endif

// #define {
#define SZ(a) ((int)(a).size())
#define X first
#define Y second
#define MP make_pair
#define L(x) ((x)<<1)
#define R(x) ((x)<<1 | 1)
#define max3(x, y, z) (max(max((x), (y)), (z)))
#define min3(x, y, z) (min(min((x), (y)), (z)))
#define BIT(x, i) (((x) >> (i)) & 1)
#define ALL(it) (it).begin(), (it).end()
#define FILL(__space, __val) memset(__space, __val, sizeof(__space))
#define MOVE(__spaceTo, __spaceFrom) memmove(__spaceTo, __spaceFrom, sizeof(__spaceTo))
#define UNIQUE(__vector) sort(ALL(__vector)), __vector.resize(unique(ALL(__vector)) - __vector.begin())
#define FOR(it, c) for( TYPE((c).begin()) it = (c).begin(); it != (c).end(); it++)
/////////////////////////////////////////////////////////////
const double PI = acos(-1.0);
const double EPS = 1e-6;

#define MAX_N 55
#define MAX_M 55
#define MOD (int)(1e9+7)
#define INF ((1 << 30) - 1)
#define BINF ((1LL << 62) - 1LL)
#define NONE -1
#define NIL 0
// }

/////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////
int main() {
	RF("input.txt");
	// WF("output.txt");
	DF("err.txt");
	
	string S;
	cin >> S;
	vector <int> dp;
	int s = 0;
	for (int i = 0; i < S.length(); i++) if (S[i] != S[s]) {
		dp.push_back(i - s);
		s = i;
	}
	dp.push_back(S.length() - s);
	vector <int> res;
	for (int i = 1; i < dp.size(); i += 2) {
		int total = dp[i] + dp[i - 1];
		for (int k = 0; k < dp[i - 1] - 1; k++) res.push_back(0);
		if (total & 1 ^ 1) {
			res.push_back(total >> 1);
			res.push_back(total >> 1);
		}
		else {
			if (dp[i - 1] & 1) {
				res.push_back((total >> 1) + 1);
				res.push_back(total >> 1);
			}
			else {
				res.push_back(total >> 1);
				res.push_back((total >> 1) + 1);
			}
		}
		for (int k = 0; k < dp[i] - 1; k++) res.push_back(0);
	}
	for (int i = 0; i < res.size(); i++) printf("%d ", res[i]);
	puts("");
	return 0;
}

Measured memory_bytes: 1592
#include <bits/stdc++.h>
using namespace std;
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i : x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
#define fast ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define ll long long
#define int long long
#define vll vector<long long>
#define pii pair<long long ,long long >
#define vvi vector< vector<long long > >
#define vpii vector<pair<int,int>>
#define pll  pair<long long ,long long >
#define pb  push_back
#define ff  first
#define sec second
#define SORT(a) sort(a.begin(),a.end())
#define SORTR(a) sort(a.rbegin(),a.rend())
#define m_p make_pair
#define all(x) (x.begin(),x.end())
#define sz(v) ((int)(v.size()))
#define endl '\n'
typedef vector< long long > vi ;
const int MOD = 1e9 + 7 ;
int size = 10000000;


void solve() {

	int n ; cin >> n;

	int ans ;

	if (n >= 400 && n <= 599 ) ans = 8;
	else if (n >= 600 && n <= 799 ) ans = 7;
	else if (n >= 800 && n <= 999 ) ans = 6;
	else if (n >= 1000 && n <= 1199 ) ans = 5;
	else if (n >= 1200 && n <= 1399 ) ans = 4;
	else if (n >= 1400 && n <= 1599 ) ans = 3;
	else if (n >= 1600 && n <= 1799 ) ans = 2;
	else if (n >= 1800 && n <= 1999 ) ans = 1;


	cout << ans << endl;


}


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

	int T = 1; //cin>>T;
	while (T--) {
		solve();
	}

	return 0;
}



Measured memory_bytes: 3668
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define int long long
int mod=1e9+7;

bool bfs(int s,int d,vector<vector<int>> &v,vector <bool> &vis)
{
    for (int i=0;i<vis.size();++i)
        vis[i]=false;
    queue<int> q;
    if (s==d)
        return true;
    vis[s]=true;
    q.push(s);

    while(!q.empty()){
        int x=q.front();
        q.pop();
        for (auto it:v[x]){
            if (it==d)
                return true;
            if (vis[it])
                continue;
            vis[it]=true;
            q.push(it);
        }

    }
    return false;
}

void fun(int k){
        int n;
        cin>>n;
        string a,b;
        cin>>a;
        cin>>b;
        int ans[55][55]={0};

        vector<vector<int>> v(55);
        vector<bool> vis(55);

        for (int i=0;i<n;++i)
        {
            for (int j=0;j<n;++j)
            {
                if (i==j)
                    continue;
                if (b[i]=='Y' && a[j]=='Y' && abs(i-j)==1)
                    v[i+1].push_back(j+1);
            }
        }

        for (int i=1;i<=n;++i)
        {
            for (int j=1;j<=n;++j)
            {
                if (bfs(i,j,v,vis))
                    ans[i][j]=1;
            }
        }
        
        cout<<"Case #"<<k<<":"<<endl;
        for (int i=1;i<=n;++i)
        {
            for (int j=1;j<=n;++j)
            {
                if (ans[i][j])
                    cout<<"Y";
                else
                    cout<<"N";
            }
            cout<<endl;
        }
}

signed main()
{

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

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);

   int n;
   cin>>n;
  if (n>=400 && n<=599)
      cout<<8<<endl;
  else if (n>=600 && n<=799)
      cout<<7<<endl;
  else if (n>=800 && n<=999)
      cout<<6<<endl;
  else if (n>=1000 && n<=1199)
      cout<<5<<endl;
  else if (n>=1200 && n<=1399)
      cout<<4<<endl;
  else if (n>=1400 && n<=1599)
      cout<<3<<endl;
  else if (n>=1600 && n<=1799)
      cout<<2<<endl;
  else if (n>=1800 && n<=1999)
      cout<<1<<endl;

}


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

// 度->ラジアンの変換
#define DEGtoRAD(X) (X*PI)/180.0
// 円周率
const double PI = 2 * acos(0.0);
// 許容誤差.問題によって変える
const double EPS = 1e-9;

struct point{
    double x, y;
    point(){ x = y = 0.0;}
    point(double _x, double _y) : x(_x), y(_y) {}

    // 不等号のオーバーロード.x座標,y座標で昇順ソート
    bool operator < (const point other) const{
        if(fabs(x - other.x) > EPS)
            return x < other.x;
        else
            return y < other.y;
    }

    // 等号のオーバーロード.
    bool operator == (const point other) const{
        return fabs(x - other.x) < EPS &&
                fabs(y - other.y) < EPS;
    }
};

// ベクトル
struct vec{
    double x, y;
    vec(double _x, double _y) : x(_x), y(_y) {}
};

// 2つのpoint a,b をvec a->b に変換
vec toVec(point a, point b){
    return vec(b.x - a.x, b.y - a.y);
}

// vecの外積
double cross(vec v1, vec v2){
    return v1.x * v2.y - v1.y * v2.x;
}

// !未確認!(特に辺上の判定が正しいかどうか怪しい)
// point rが3つのpointからなる三角形の内部に存在するかどうかの判定
// 三角形の内側に点があるとき、外積によるベクトルは同じ方向を向くことを利用
// -1...内側 0...辺上 1...外側
int inTriangle(point r, point a, point b, point c){
    double c1 = cross(toVec(a,b), toVec(b,r));
    double c2 = cross(toVec(b,c), toVec(c,r));
    double c3 = cross(toVec(c,a), toVec(a,r));

    if(c1 == 0 || c2 == 0 || c3 == 0)           return 0;
    else if( (c1 > 0 && c2 > 0 && c3 > 0) || 
        (c1 < 0 && c2 < 0 && c3 < 0)        )   return -1;
    else                                        return 1;
}

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

    double input[10];
    for(int i = 0; i < n; i++){
        for(int j = 0; j < 10; j++){
            cin >> input[j];
            input[j] += 1000.0;
        }

        point p1(input[0], input[1]);
        point p2(input[2], input[3]);
        point p3(input[4], input[5]);
        point k(input[6], input[7]);
        point s(input[8], input[9]);

        int kengyu = inTriangle(k, p1, p2, p3);
        int orihime = inTriangle(s, p1, p2, p3);

        if(kengyu * orihime == -1)  cout << "OK" << endl;
        else                        cout << "NG" << endl;
        
    }
    return 0;
}


Measured memory_bytes: 3060
fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    println(getSumOfArithmeticSequence(1,n,n) - getSumOfArithmeticSequence(3,n/3*3,n/3) - getSumOfArithmeticSequence(5,n/5*5,n/5) + getSumOfArithmeticSequence(15,n/15*15, n/15))
}

private fun getSumOfArithmeticSequence(beginning: Int, ending: Int, length: Int) : Long = (beginning + ending) * length.toLong() / 2

Measured memory_bytes: 34336
// "header" {{{
#pragma GCC optimize("Ofast")

#include <cassert>
#include <iostream>
#include <algorithm>
#include <vector>
#include <cstring>
#include <string>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <tuple>
#include <iomanip>
#include <climits>
#include <cstdlib>

using namespace std;

#define rep(i,n) for(int i=0;i<(n);++i)
#define reps(i,n) for(int i=1;i<=(n);++i)
#define all(x) (x).begin(),(x).end()
#define pii pair<int,int>
#define int int64_t
#define double long double
#define Fixed fixed << setprecision(10)
#define moke_pair make_pair

constexpr int INF = 0x3f3f3f3f;
constexpr int64_t LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int64_t mod1 = 1000000007;
constexpr int64_t mod2 = 998244353;

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

template <class A, class B> inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); }
template <class A, class B> inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); }

template <class T> using min_heap = priority_queue<T,vector<T>,greater<T> >;
template <class T> using max_heap = priority_queue<T>;
template <class T,class U> using umap = unordered_map<T,U>;

inline int64_t updiv(int64_t n,int64_t d){ return ((n + d -1) / d); }
inline int square(int a){ return a * a; }

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

signed main(){
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);

    int x,y;
    cin >> x >> y;

    int res = 0;
    while(x <= y){
        x += x;
        ++res;
    }

    cout << res << '\n';

    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		sc.close();

		if (b % a == 0) {
			System.out.println(a + b);
		} else {
			System.out.println(b - a);
		}
	}
}


Measured memory_bytes: 23764
#include <bits/stdc++.h>
using namespace std;
#define long long long
#define itn int

string s, t;
int dp[3030][3030];

signed main ( ) {

    cin >> s >> t;

    for ( int i = 0; i < (int)s.size(); i++ ) {
        for ( int j = 0; j < (int)t.size(); j++ ) {
            if ( s[i] == t[j] ) {
                dp[i+1][j+1] = max ( dp[i+1][j+1], dp[i][j] + 1 );
            }
            dp[i+1][j+1] = max ( dp[i+1][j+1], dp[i+1][j] );
            dp[i+1][j+1] = max ( dp[i+1][j+1], dp[i][j+1] );
        }
    }

    string ans = "";
    int i = (int)s.size();
    int j = (int)t.size();
    while ( 0 < i && 0 < j ) {
        if ( dp[i][j] == dp[i-1][j] ) {
            i--;
        }
        else if ( dp[i][j] == dp[i][j-1] ) {
            j--;
        }
        else {
            ans = s[i-1] + ans;
            i--;
            j--;
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 35840
a, b, c, k = map(int, input().split())
if a >= k:
    print(1 * k)
else:
    if b >= (k - a):
        print(1 * a + (k - a) * 0)
    else:
        if c >= (k - a - b):
            print(1 * a + 0 * b + (-1) * (k - a - b))
        else:
            print(-1)


Measured memory_bytes: 9188
#include<bits/stdc++.h>
using namespace std;
int main(){
	string s,t;cin>>s>>t;
  vector<char >a,b;
  for(int i=0;i<s.size();i++)a.push_back(s[i]);
  for(int i=0;i<t.size();i++)b.push_back(t[i]);
  sort(a.begin(),a.end());
  sort(b.rbegin(),b.rend());
  
  int pos=-1;
 // cout<<s<<'\n'<<t<<'\n';
  for(int i=0;i<s.size() && i<t.size();i++){
   //   cout<<a[i]<<' '<<b[i]<<'\n';
  	if(a[i]<b[i]){pos=1;break;}
    if(a[i]>b[i]){pos=0;break;}
  }
  if(pos==1)cout<<"Yes\n";
  else if(pos==0) cout<<"No\n";
  else{
      if(s.size()>=t.size())cout<<"No\n";
      else cout<<"Yes\n";
      
  }
  
}

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

#ifdef LOCAL
#define debug(var) cerr << #var << " = " << var;
#else
#define debug(var)
#endif

void init() {
	ios_base::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
}

const int N = 2e5+234;

int bio[2][N];
vector<int> g[2][N];

void dfs(int u, int c, int b) {
	bio[b][u] = c;
	for (int v: g[b][u]) {
		if (bio[b][v]) continue;
		dfs(v, c, b);
	}
}

void solve() {
	int n, k, l; scanf("%d%d%d", &n, &k, &l);
	for (int i = 0; i < k; ++i) {
		int u, v; scanf("%d%d", &u, &v);
		g[0][--u].push_back(--v);
		g[0][v].push_back(u);
	}
	for (int i = 0; i < l; ++i) {
		int u, v; scanf("%d%d", &u, &v);
		g[1][--u].push_back(--v);
		g[1][v].push_back(u);
	}
	for (int b = 0; b < 2; ++b) {
		int c = 1;
		for (int i = 0; i < n; ++i) {
			if (bio[b][i]) continue;
			dfs(i, c++, b);
		}
	}
	map<pair<int, int>, int> m;
	for (int i = 0; i < n; ++i) {
		++m[make_pair(bio[0][i], bio[1][i])];
	}
	for (int i = 0; i < n; ++i) {
		printf("%d ", m[make_pair(bio[0][i], bio[1][i])]);
	}
}

int main() {
	init();
	int t = 1; //scanf("%d", &t);
	while (t--) {
		solve();
	}
	return 0;
}


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

using namespace std;

int main() {
    string s, t, u;
    cin >> s >> t;
    int a, b;
    cin >> a >> b;
    cin >> u;
    if(s == u){
        a--;
    }else{
        b--;
    }
    cout << a << " " << b << endl;
    return 0;
}

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

char s[100000][11];

bool cmp(const int& a, const int& b)
{
  if (strcmp(s[a], s[b]) > 0) return true;
  return false;
}

int
main(int argc, char *argv[])
{
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> s[i];
    sort(s[i], s[i] + 10);
  }
  vector<int> a;
  for (int i = 0; i < n; i++) a.push_back(i);

  sort(a.begin(), a.end(), cmp);
  
  long long d = 0, key = a.at(0), cnt; long long ans = 0;
  while (1) {
    cnt = 0;
    while (d < n && !strcmp(s[key], s[a.at(d)])) {
      cnt++; d++;
    }
    ans += cnt * (cnt - 1) / 2;
    if (d >= n) break;
    key = a.at(d);
  }

  cout << ans << endl;

  return 0;
}
    

  


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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

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

#define DEBUG(x) cout<<#x<<": "<<(x)<<'\n'
#define DEBUG_VEC(v) cout<<#v<<":";REP(i, v.size())cout<<' '<<v[i];cout<<'\n'
#define ALL(a) (a).begin(), (a).end()

template<typename T> inline void CHMAX(T& a, const T b) {if(a<b) a=b;}
template<typename T> inline void CHMIN(T& a, const T b) {if(a>b) a=b;}

constexpr ll MOD=1000000007ll;
// constexpr ll MOD=998244353ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

const double EPS=1e-11;
#define EQ0(x) (abs((x))<EPS)
#define EQ(a, b) (abs((a)-(b))<EPS)

constexpr int INF=1e9;

// 繰り上がりなし、あり
int dp[1252521][2];

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  // cout<<setprecision(10)<<fixed;
  string n;
  cin>>n;
  n="0"+n;
  int m=n.size();
  int ans=0;
  REP(i, m+1){
    dp[i][0]=dp[i][1]=INF;
  }
  dp[m][0]=0;
  FORR(i, 0, m){
    int x=n[i]-'0';
    if(dp[i+1][0]!=INF){
      CHMIN(dp[i][0], dp[i+1][0]+x);
      CHMIN(dp[i][1], dp[i+1][0]+10-x);
    }
    if(dp[i+1][1]!=INF){
      if(x==9){
        CHMIN(dp[i][1], dp[i+1][1]);
      }
      else{
        CHMIN(dp[i][0], dp[i+1][1]+x+1);
        CHMIN(dp[i][1], dp[i+1][1]+10-x-1);
      }
    }
  }
  // REP(i, m){
  //   REP(j, 2){
  //     cout<<dp[i][j]<<' ';
  //   }
  //   cout<<'\n';
  // }
  cout<<min(dp[0][0], dp[0][1])<<'\n';
  return 0;
}


Measured memory_bytes: 9544
h, w = map(int, input().split())
c = [list(map(int, input().split())) for _ in range(10)]
for k in range(10):
    for i in range(10):
        for j in range(10):
            if c[i][j] > c[i][k] + c[k][j]:
                c[i][j] = c[i][k] + c[k][j]
ans = 0
for i in range(h):
    a = list(map(int, input().split()))
    for j in range(w):
        if a[j] >= 0:
            ans += c[a[j]][1]
print(ans)


Measured memory_bytes: 3064
from heapq import heappush, heappop

N, M = map(int, input().split())
A, B = (
    zip(*(map(int, input().split()) for _ in range(M))) if M else
    ((), ())
)
S, T = map(int, input().split())

# 拡張グラフにダイクストラ法を適用し最適解を求める
G = [{} for _ in range(3 * N + 1)]
for x, y in zip(A, B):
    G[x][y + N] = 1
    G[x + N][y + 2 * N] = 1
    G[x + 2 * N][y] = 1
INF = 10**18


def dijkstra(G, s):
    dp = [INF for _ in range(len(G))]
    q = []
    heappush(q, (0, s))
    while q:
        c, i = heappop(q)
        if dp[i] == INF:
            dp[i] = c
            for j, w in G[i].items():
                heappush(q, (c + w, j))
    return dp


dp = dijkstra(G, S)
ans = (
    -1 if dp[T] == INF else
    dp[T] // 3
)

print(ans)


Measured memory_bytes: 122528
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <list>
#include <algorithm>
#include <queue>

using namespace std;

typedef unsigned long long		u64;

u64 Solve(const string & s, int n, int k)
{
	u64 d = 0;
	u64 m = 0;
	u64 dm = 0;
	u64 ans = 0;

	for (int i = 0; i < n; ++i)
	{
		char ch = s[i];

		if (i >= k)
		{
			if (s[i - k] == 'D')
			{
				--d;
				dm -= m;
			}
			else if (s[i - k] == 'M')
			{
				--m;
			}
		}

		if (ch == 'D')
		{
			++d;
		}
		else if (ch == 'M')
		{
			++m;
			dm += d;
		}
		else if (ch == 'C')
		{
			ans += dm;
		}
	}

	return ans;
}

int main()
{
	int n, q;
	string s;

	cin >> n >> s >> q;

	for (int loop = 0; loop < q; ++loop)
	{
		int k;
		cin >> k;
		cout << Solve(s, n, k) << endl;
	}

	return 0;
}

Measured memory_bytes: 1412
#include <cstdio>

int main(){
    int n,k,x,y,sum;
    scanf("%d%d%d%d",&n,&k,&x,&y);
    if(n<k)
        sum += x * n;
    else
        sum += x * k + y * (n - k);
    printf("%d\n",sum);

    return 0; 
}

Measured memory_bytes: 128
/*   _/                _/                 _/_/_/   _/
  _/_/_/_/   _/_/   _/_/_/_/   _/_/    _/       _/_/
   _/     _/    _/   _/     _/    _/  _/_/_/     _/
  _/     _/    _/   _/     _/    _/  _/    _/   _/
   _/_/   _/_/       _/_/   _/_/      _/_/     _/ */
#include<iostream>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<set>
#include<map>
#include<queue>
#include<vector>
using namespace std;
using ll=long long;
const int MOD=1e9+7;
const double pi=3.14159265358979323846;
const int inf=2e9;
const ll INF=1e18;
using P=pair<int,int>;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
int main() {
  cin.tie(0),cout.tie(0);
  ios::sync_with_stdio(false);
  int n,d[100005]={};
  cin >> n;
  for(int i=0; i<n; i++) {
    cin >> d[i];
  }
  if(n%2) {
    cout << 0 << endl;
    return 0;
  }
  sort(d,d+n);
  cout << d[(n/2)]-d[(n/2)-1] << endl;
}

Measured memory_bytes: 640
//header{{{
#include<bits/stdc++.h>
  
using namespace std;
 
#define rep(i,n) for(int i=0;i<(n);++i)
#define reps(i,n) for(int i=1;i<=(n);++i)
#define all(x) (x).begin(),(x).end()
#define setout(n,x) setw(n) << setfill(x)
#define Fixed fixed << setprecision(10)
#define int long long
using pii = pair<int,int>;
constexpr int INF  = 0x3f3f3f3f;
constexpr long long LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int mod = 1e9+7; 

template <class A, class B> inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); }
template <class A, class B> inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); }

template <class T> using min_heap = priority_queue<T,vector<T>,greater<T> >;
template <class T> using max_heap = priority_queue<T>;
  
int gcd(int a,int b){ return b ? gcd(b,a % b) : a;}
int lcm(int a,int b){ return a / gcd(a,b) * b;}
//}}}

signed main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n,m;
	cin >> n >> m;
	vector<pii> vec(m);
	rep(i,m){
		cin >> vec[i].first >> vec[i].second;
	}
	sort(all(vec));
	bool flg = true;
	int cnt = 0,L,R;
	rep(i,m){
		if(flg){
			flg = false;		
			L = vec[i].first;
			R = vec[i].second - 1;
			++cnt;
		}
		else{
			if(chmax(L,vec[i].first)){
				if(R < L){
					flg = true;
					--i;
				}
			}
			if(chmin(R,vec[i].second - 1)){
				if(!flg && R < L){
					flg = true;
					--i;
				}
			}
		}
	//	cout << cnt + flg << ' ' << L << ' ' << R << '\n';
	}
	cout << cnt + flg << '\n';
	return 0;
}


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

namespace ConsoleApp5
{
    class Program
    {
        
        static void Main(string[] args)
        {

            while (true)
            {
               

                string[] s = Console.ReadLine().Split(' ');
                //ｓの０番目の要素をintに変換してhに代入
                var h = int.Parse(s[0]);//変換した
                var w = int.Parse(s[1]);

                if (w == 0)
                {
                    break;
                }

                for (int i = 0; i < h; i++)
                {

                    for (int j = 0; j < w; j++)
                    {
                        Console.Write("#");
                    }
                    Console.WriteLine("");
                }

                Console.WriteLine("");
            }
           
        }
    }
}



Measured memory_bytes: 15984
#include <iostream>
#include <cmath>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <cstring>
#include <iomanip>
#include <fstream>
#include <map>
#include <ctime>
#include <cstdio>
#include <set>
using namespace std;

#define LL unsigned long long int
#define SZ 110

int g[SZ];

int mex(set<int> &grnd)
{
    int i=0;
    for(const int &x:grnd){
        if(x!=i)
            return i;
        i++;
    }
    return i;
}

int grundy(int n)
{
    if(g[n]!=-1) return g[n];
    if(n<2) return g[n]=0;

    set<int> grnd;

    for(int i=1; i<=n; i++)
        if(n%(n-i)==0)
            grnd.insert(grundy(n-i));

    return g[n]=mex(grnd);
}

int result(int n, int m)
{
    int jor=0;

    if(n&1) jor=grundy(m);

    return jor;
}

int towerBreakers(int n, int m)
{
    if(result(n, m)) return 1;
    return 2;
}

int main()
{
//    freopen("in.txt", "r", stdin);
//    freopen("out.txt", "w", stdout);
    int h, n, a, i, sum=0, d;

    cin >> h >> n;
    for(i=0; i<n; i++){
        cin >> d;
        sum+=d;
    }
    if(sum>=h) puts("Yes");
    else puts("No");


    return 0;
}
/**
2
2 2
1 4

*/


Measured memory_bytes: 256
#include<iostream>
#include <list>
#include<stack>
#include<queue>
#include <vector>
#include <set>
#include<algorithm>
#include<math.h>
#include<stdlib.h>
#include<string>
#include <functional>
#include<fstream>

#define FOR(k,m,n) for(int (k)=(m);(k)<(n);(k)++)
#define REP(i,n) FOR((i),0,(n))
#define LL long long
#define CLR(a) memset((a),0,sizeof(a))
#define SZ(x) (int((x).size()))
#define WAITING(str) int str;std::cin>>str;
#define DEBUGING(str) cout<<str<<endl
using namespace std;

const LL MOD = 1000000007;// 10^9+7
const int INF = (1 << 30);


//変数
LL N, C;
vector<pair<LL,LL>> xv;






//サブ関数
//入力
void input()
{
	cin >> N >> C;
	REP(i, N) {
		LL a, b;
		cin >> a >> b;
		xv.push_back({ a,b });
	}
}


//計算
void calc()
{
	vector<LL> nor1(1,0), nor2(1,0), rev1(1,0), rev2(1,0);

	//前計算
	REP(i, N) {
		nor1.push_back(nor1.back() + xv[i].second);;
		nor2.push_back(nor2.back() + xv[i].second);
		rev1.push_back(rev1.back() + xv[N - i - 1].second);
		rev2.push_back(rev2.back() + xv[N - i - 1].second);
	}
	REP(i, N) {
		nor1[i+1] -= xv[i].first;
		nor2[i+1] -= xv[i].first * 2;
		rev1[i+1] -= (C - xv[N - i - 1].first);
		rev2[i+1] -= (C - xv[N - i - 1].first) * 2;
	}
	vector<LL> imosNor(1,0), imosRev(1,0);
	REP(i, N) {
		imosNor.push_back(max(imosNor.back(), nor1[i + 1]));
		imosRev.push_back(max(imosRev.back(), rev1[i + 1]));
	}

	//測定
	//R→L
	LL ans = 0;
	REP(i, N + 1) {
		LL tmpS = rev2[i];
		tmpS += imosNor[nor1.size() - i-1];
		ans = max(ans, tmpS);
	}
	
	//L→R
	REP(i, N + 1) {
		LL tmpS = nor2[i];
		tmpS += imosRev[rev1.size() - i-1];
		ans = max(ans, tmpS);
	}

	cout << max(ans,0ll) << endl;
}


//出力
void output()
{

}


//デバッグ
void debug()
{
	int N;
	cin>>N;
}


//メイン関数
int main()
{
	input();
	calc();
	output();
	debug();
	
	return 0;
}


Measured memory_bytes: 8816
(setq N (read))
(setq K (read))
(setq ans 1)
(dotimes (i N)
  (if (< ans K)
      (setq ans (*
                  ans 
                  2
                  ))
      (setq ans (+
                  ans
                  K
                  ))
      )
  )
(format t "~D~%"
        ans
        )


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

int main(){
	ll n;
  	cin >> n;
  	vector<ll> a(n);
  	for(auto& i : a) cin >> i;
  	multiset<ll, greater<ll>> s;
  	for(auto& i : a){
      	auto p = s.upper_bound(i);
     	if(p != s.end()) s.erase(p);
      	s.insert(i);
    }
  	cout << s.size() << endl;
}


Measured memory_bytes: 5760
N=int(input())
#75=5*5*3=25*3=15*5=75*1
#100!=9.3*10^157
#2^74=1.8*10^12,3^74=...,140^74=
#つまり,4こ-4こ-2こ、24こ-2こ、14こ-4こ,74こ
#となる組み合わせの探査になる?
insuu=[0]*(100+1)
l=[]
sevenfour=0
twofour=0
onefour=0
four=0
two=0
for k in range(N):
    pf = {}
    m = k+1
    for i in range(2, int(m ** 0.5) + 1):
        while m % i == 0:
            pf[i] = pf.get(i, 0) + 1
            m //= i
    if m > 1: pf[m] = 1
    #print(pf)
    keys = list(pf.keys())
    values = list(pf.values())
    for i in range(len(keys)):
        insuu[keys[i]]=insuu[keys[i]]+values[i]
    # print(l)	#これでlistになった
#print(insuu)
for i in range(101):
    if insuu[i]>=74:
        sevenfour = sevenfour+1
    if insuu[i]>=14:
        onefour=onefour+1
    if insuu[i]>=24:
        twofour=twofour+1
    if insuu[i]>=4:
        four=four+1
    if insuu[i]>=2:
        two=two+1
print(((four*(four-1))//2)*(two-2)+twofour*(two-1)+onefour*(four-1)+sevenfour)

Measured memory_bytes: 38384
#include <cstdio>
#include <vector>
#define repeat(i, n) for (int i = 0; (i) < int(n); ++(i))
#define repeat_reverse(i, n) for (int i = (n)-1; (i) >= 0; --(i))
using ll = long long;
using namespace std;
template <class T> inline void setmin(T & a, T const & b) { a = min(a, b); }

constexpr ll inf = ll(1e18)+9;
int main() {
    // input
    int n, e, t; scanf("%d%d%d", &n, &e, &t);
    vector<int> x(n); repeat (i, n) scanf("%d", &x[i]);
    // solve
    vector<ll> dp(n + 1, inf);
    dp[n] = e;
    int m = n;
    ll acc = inf;
    repeat_reverse (l, n) {
        for (; m - 1 >= l + 1 and t <= 2ll * (x[m - 1] - x[l]); -- m) {
            setmin(acc, 2ll * x[m - 1] + dp[m]);
        }
        dp[l] = min(acc - 2ll * x[l], t + dp[m]);
    }
    // output
    printf("%lld\n", dp[0]);
    return 0;
}


Measured memory_bytes: 1536
#include <bits/stdc++.h>
using namespace std;
#define rep(i,N) for(int i=0;i<int(N);++i)
#define rep1(i,N) for(int i=1;i<int(N);++i)
#define all(a) (a).begin(),(a).end()
#define print(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<_<<", "; cerr<<"]"<<endl; }
#define printpair(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<"{"<<_.first<<","<<_.second<<"}"<<", "; cerr<<"]"<<endl; }
#define dump(x) cerr<<#x<<": "<<x<<endl;
#define bit(k) (1LL<<(k))
#define Yes "Yes"
#define No "No"
#define YES "YES"
#define NO "NO"
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; }

const int INF = (ll)1e9;
const ll INFLL = (ll)1e18+1;
const double PI = acos(-1.0);
/*
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
const string dir = "DRUL";
*/
int N,P;
struct mint {
    long long x; // typedef long long long long;
    mint(long long _x=0):x((_x%P+P)%P){}
    mint operator-() const { return mint(-x);}
    mint& operator+=(const mint a) {
        if ((x += a.x) >= P) x -= P;
        return *this;
    }
    mint& operator-=(const mint a) {
        if ((x += P-a.x) >= P) x -= P;
        return *this;
    }
    mint& operator*=(const mint a) {
        (x *= a.x) %= P;
        return *this;
    }
    mint operator+(const mint a) const {
        mint res(*this);
        return res+=a;
    }
    mint operator-(const mint a) const {
        mint res(*this);
        return res-=a;
    }
    mint operator*(const mint a) const {
        mint res(*this);
        return res*=a;
    }
    mint modpow(long long t) const {
        if (!t) return 1;
        mint a = modpow(t>>1);
        a *= a;
        if (t&1) a *= *this;
        return a;
    }
    // for prime P
    mint inv() const {
        return modpow(P-2);
    }
    mint& operator/=(const mint a) {
        return (*this) *= a.inv();
    }
    mint operator/(const mint a) const {
        mint res(*this);
        return res/=a;
    }
};
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    cin>>N>>P;
    string S;
    cin>>S;
    if(10 % P == 0){//2 or 5
        ll ans = 0;
        rep(r,N){
            if ((S[r] - '0') % P == 0){
                ans += r+1;
            }
        }
        cout<<ans<<endl;
        return 0;
    }
    vector<mint> cumsum(N+1, 0);
    mint ten = 1;
    rep(_, N-1)ten *= 10;
    rep(i,N){
        cumsum[i+1] = cumsum[i] + ten * (S[i] - '0');
        ten /= 10;
    }
    vector<int> cnt(P,0);
    ll ans = 0;
    rep(i,N+1){
        ans += cnt[cumsum[i].x];
        cnt[cumsum[i].x]++;
    }
    cout<<ans<<endl;
}

Measured memory_bytes: 2196
/*Author - Shubham Gupta (@shubham107)*/
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<ll> vl;      typedef vector<int> vi;
typedef vector<vl> vvl;     typedef vector<vi> vvi;
typedef pair<ll, ll> pll;   typedef pair<int, int> pii;
#define forn(i,n) for(int i=0;i<n;i++)
#define rforn(i,n) for(int i=n-1;i>=0;i--)
#define forne(i,n) for(int i=1;i<=n;i++)
#define forse(i,s,e) for(int i=s;i<e;i++)
#define rforse(i,s,e) for(int i=e-1;i>=s;i--)
#define all(x) x.begin(),x.end()
#define sz(x) (int)x.size()
#define MOD 1000000007
#define F first
#define S second
#define pb push_back
#define mp make_pair
#define fill(a,x) memset(a,x,sizeof a);
#define trav(a,x) for(auto &a:x)
#define INF ll(1e18)
#ifdef SHUBHAM107
#include "../trace.h"
#else
#define trace(args...)
#endif

void solve() {
    int a, b;
    cin >> a >> b;
    cout << (a * b);
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
#ifdef SHUBHAM107
    freopen("inp.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    freopen("err.txt", "w", stderr);
#endif
    int t = 1;
    // cin >> t;
    while (t--) {
        solve();
    }
}


Measured memory_bytes: 3636
#include <stdio.h>
#include <vector>

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

constexpr int mod = 1e9 + 7;
std::vector<int> A, B;
// DP[i][j] := Aを i 文字, Bを j 文字使った時の答え
std::vector<std::vector<int>> DP;

int dfs(int x, int y){
    if(DP[x][y] != -1) return DP[x][y];
    DP[x][y] = dfs(x-1, y) + dfs(x, y-1);
    if(A[x-1] != B[y-1]) DP[x][y] -= dfs(x-1, y-1);
    DP[x][y] %= mod; if(DP[x][y] < 0) DP[x][y] += mod;
    return DP[x][y];
}


int main(void){
    int n, m; scanf("%d%d", &n, &m);
    A.resize(n); REP(i, n) scanf("%d", &A[i]);
    B.resize(m); REP(i, m) scanf("%d", &B[i]);

    DP.resize(n+1, std::vector<int>(m+1, -1));
    FOReq(i, 0, n) DP[i][0] = 1; FOReq(i, 1, m) DP[0][i] = 1;
    int res = dfs(n, m);
    printf("%d\n", res);
    return 0;
}

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

using namespace std;
#define  ll long long
#define ld long double
#define f first
#define s second
const int N = 1e3+5;

int n , m , a[N] , b[N] , num[N] , dp[N][1<<12];

int solve(int i , int msk)
{
    if (i > m)
    {
        int c = __builtin_popcount(msk);
        if (c==n) return 0;
        return (int)1e9;
    }

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

    int ans = solve(i+1 , msk);
    ans = min(ans , a[i] + solve(i+1,msk|num[i]));
    return dp[i][msk] = ans;
}

int main()
{
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    cin >> n >> m;
    for(int i=1; i<=m; i++)
    {
        cin >> a[i] >> b[i];
        for(int j=1; j<=b[i]; j++)
        {
            ll x;
            cin >> x;
            x--;
            num[i] |= (1<<x);
        }
    }

    memset(dp , -1 , sizeof(dp));

    int ans = solve(1,0);
    if (ans >= (int)1e9) cout << "-1\n";
    else cout << ans << "\n";
	//
  
    return 0;
}

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

void Main() {
  int N;
  cin >> N;
  set<string> prize;
  for (int i = 0; i < N; i++) {
    string s;
    cin >> s;
    prize.insert(s);
  }

  cout << prize.size() << endl;
}

int main() {
  std::cin.tie(nullptr);
  std::ios_base::sync_with_stdio(false);
  std::cout << std::fixed << std::setprecision(15);
  Main();
  return 0;
}



Measured memory_bytes: 19248