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

typedef pair<int, int> pii;
typedef long long ll;
typedef pair<ll, int> pli;
typedef vector<int> vi;

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define ALL(c) (c).begin(),(c).end()

inline void add(ll &x, ll y, ll M) { x += y; if (x >= M) x -= M; }

int N, K;
ll M;
ll dp[310][310];
ll sub[310][310]; //divide into i block, put j  

int main() {
	cin >> N >> K >> M;
	dp[0][0] = 1;
	sub[0][0] = 1;

	for (int i = 0; i <= N; ++i) {
		for (int j = 0; j <= N; ++j) {
			if (sub[i][j] == 0) continue;
			add(sub[i][j+1], sub[i][j] * (i + 1) % M, M);
			add(sub[i+1][j], sub[i][j], M);
		}
	}

	for (int i = 1; i <= K; ++i) {
		for (int j = 0; j <= N; ++j) {
			if (dp[i-1][j] == 0) continue;
			for (int c = 0; j + c <= N; ++c) {
				add(dp[i][j+c], dp[i-1][j] * sub[j][c] % M, M);
			}
		}
	}
	cout << dp[K][N] << endl;

	return 0;
}

Measured memory_bytes: 1664
function Main(input){
    input = input.split(" ").map(Number);
    var sum = 0;
    for(var i=1;i<=input[0];i++){
        var p = nsum(i);
        if(p>=input[1]&&p<=input[2]){
            sum += i;
        }
    }
    console.log(sum);
}

Main(require("fs").readFileSync("/dev/stdin","utf8").trim());

function nsum(str){
    str = String(str);
    str = str.split("").map(Number);
    var sum = 0;
    for(var i=0;i<str.length;i++){
        sum += str[i];
    }
    return sum;
}

Measured memory_bytes: 23564
#include<cstdio>
#include<algorithm>
using namespace std;
typedef long long ll;
ll D, G;
ll d[16][1024];
int main()
{
	scanf("%lld%lld", &D, &G);
	int ptot = 0;
	for (int i = 1; i <= D; i++)
	{
		int p; ll c;
		scanf("%d%lld", &p, &c);
		for (int k = 0; k <= ptot; k++)
		{
			for (int t = 0; t <= p; t++)
			{
				ll score = (t < p) ? t * (i * 100) : t * (i * 100) + c;
				d[i][k + t] = max(d[i][k + t], d[i - 1][k] + score);
			}
		}
		ptot += p;
	}
	int ans = ptot;
	while (ans > 0 && d[D][ans - 1] >= G) ans--;
	printf("%d\n", ans);
	return 0;
}


Measured memory_bytes: 384
def main():
    A, B, C, D = map(int, input().split())
    t = C // B
    if C % B != 0 :
        t = t + 1
    a = A // D
    if A % D != 0 :
        a = a + 1
    if t <= a :
        print("Yes")
    else :
        print("No")


if __name__ == '__main__':
    main()


Measured memory_bytes: 9180
//問題URL
//

//解き方メモ
//
    
#include<iostream>
#include<map>
#include<queue>
using namespace std;

int main(){
  int n,k;
  map<int,int> m;
  int a;
  int num;
  int result;

  //ボールの数が少ない順の優先度付きキュー
  priority_queue<int,vector<int>,greater<int>> q;

  cin >> n >> k;

  for (int i = 0; i < n; i++) {
    cin >> a;
    if(m[a] == 0){
      m[a] = 1;
    } else {
      m[a]++;
    }
  }

  //種類数
  num = m.size();

  //キューに入れる
  for(auto itr = m.begin(); itr != m.end(); ++itr) {
    q.push( itr->second );
  }

  //登場数の少ない順に１種類ずつ取り出す
  result = 0;
  while (num>k){
    result += q.top();
    q.pop();
    num--;
  }

  cout << result << endl;
  
  return 0;
}


Measured memory_bytes: 10748
#include <bits/stdc++.h>
using namespace std;
int main(){
  long long n;
  cin >> n;
  long long a[n];
  for(long long i=0;i<n;i++){
    cin >> a[i];
  }
  long long x=n-1;
  for(long long i=0;i<n;i++){
    if(i>0){
      cout << ' ';
    }
    cout << a[x];
    if(n%2==0){
      if(x%2==1&&x>1){
        x-=2;
      }else if(x==1){
        x--;
      }else if(x%2==0){
        x+=2;
      }
    }else if(n%2==1){
      if(x%2==0&&x>0){
        x-=2;
      }else if(x==0){
        x++;
      }else if(x%2==1){
        x+=2;
      }
    }
  }
  cout << endl;
  return 0;
}


Measured memory_bytes: 3712
n_str = input()
n = int(n_str)
n_length = len(n_str)
sum1 = 0
for i in range(n_length):
    n2 = int(n_str[i])
    sum1 = sum1 + n2

if n % sum1 == 0:
    print('Yes')
else:
    print('No')

    

Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, a, b) for(int i=a; i<b; i++)
#define LAR(a, b) ((a)=max((a), (b)))
#define SML(a, b) ((a)=min((a), (b)))

#ifdef LOCAL
#define DEBUG(...) printf(__VA_ARGS__)
#else
#define DEBUG(...)
#endif

#define E(a, b) (s[(a)][(b)]!='.')
#define N 1005
inline int B(int a){
	int ret=0;
	REP(i, 8){
		ret*=10;
		if(a&1) ret+=1;
		a>>=1;
	}
	return ret;
}
int h, w;
char s[N][N], m[N][N];
int dx[8]={-1,-1,-1, 0, 1, 1, 1, 0,};
int dy[8]={ 1, 0,-1,-1,-1, 0, 1, 1,};
int memo[N][N][32];
int DP(int, int, int);
inline int dp(int p, int q, int r){
	// DEBUG(" (%d, %d, %02x)\n", p, q, r);
	r&=m[p][q];
	if(~memo[p][q][r]) return memo[p][q][r];
	else return memo[p][q][r]=DP(p, q, r|0xe0);
}
#define INF 1000000000
int DP(int p, int q, int r){
	int ret=0;
	if(p==h+1 && q==w){
		ret=0;
		ret=0;
	}else if(p>h || q>w){
		ret=INF;
	}else{
		ret=INT_MAX;
		int d, t;
		bool ok=false;
		for(int i=1; i<10; i+=2){
			if(i==9 && ok) break;
			d=0; t=r;
			if(i<8){
				if(!(r&(1<<i))) continue;
				if(!E(p+dy[i], q+dx[i])) continue;
				for(int j=1; j<8; j+=2){
					if(i==j) continue;
					if(!(r&(1<<j))) continue;
					int a=p+dy[j], b=q+dx[j];
					if(!E(a, b)) continue;
					t^=(1<<j);
					d+=s[a][b];
				}
			}
			int c;
			c=0x10; //2=false, 4=true
			if(t&(1<<7)) c|=1<<0;
			if(t&(1<<3)) c|=1<<2;
			if(t&(1<<4)) c|=1<<3;
			SML(ret, d+((t&(1<<5))&&E(p, q+1)?s[p][q+1]:0)+dp(p, q+1, c));
			DEBUG(" (%d, %d, %08d)-(%d, R):%d+%d+%d(%d, %d, %08d)\n", p, q, B(r), i,
					d, ((t&(1<<5))&&E(p, q+1)?s[p][q+1]:0), dp(p, q+1, c), p, q+1, B(c));
			c=0x01; //3=false, 0=true
			if(t&(1<<0)) c|=1<<1;
			if(t&(1<<1)) c|=1<<2;
			if(t&(1<<5)) c|=1<<4;
			SML(ret, d+((t&(1<<7))&&E(p+1, q)?s[p+1][q]:0)+dp(p+1, q, c));
			DEBUG(" (%d, %d, %08d)-(%d, U):%d+%d+%d(%d, %d, %08d)\n", p, q, B(r), i,
					d, ((t&(1<<7))&&E(p+1, q)?s[p+1][q]:0), dp(p+1, q, c), p+1, q, B(c));
			ok=true;
		}
	}
	DEBUG("DP(%d, %d, %08d)=%d\n", p, q, B(r), ret);
	return ret;
}

int main(){
	scanf("%d%d", &h, &w);
	REP(i, w+2) s[0][i]=s[h+1][i]='.';
	REP(i, h){
		scanf("%s", s[i+1]+1);
		REP(j, w){
			char &t=s[i+1][j+1];
			if(t!='.') t-='0';
		}
		s[i+1][0]=s[i+1][w+1]='.';
	}
	FOR(i, 1, h+1){
		FOR(j, 1, w+1){
			m[i][j]=0;
			REP(k, 5){
				if(E(i+dy[k], j+dx[k])) m[i][j]|=(1<<k);
			}
		}
	}
	REP(i, N) REP(j, N) REP(k, 32) memo[i][j][k]=-1;
	printf("%d\n", dp(1, 1, 0x1f));
}

Measured memory_bytes: 131628
#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007
#define PI acos(-1.0)
typedef long long ll;
typedef unsigned long long ull;
#define gcd __gcd
const int INF=0x3f3f3f3f;
const ll LINF=1000000000000000000;
//priority_queue<int, vector<int>, greater<int> >p;
//#define N 200005
//ll d[4][2]={1,0,-1,0,0,1,0,-1};
int main()
{
//    ios_base::sync_with_stdio(0);
//    cin.tie(0);
    int a, b, c;
    cin >> a >> b >> c;
    if(a == b && b == c)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }
    return 0;
}


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

using VS = vector<string>;    using LL = long long;
using VI = vector<int>;       using VVI = vector<VI>;
using PII = pair<int, int>;   using PLL = pair<LL, LL>;
using VL = vector<LL>;        using VVL = vector<VL>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
#define debug(x) cerr << #x << ": " << x << endl
const int INF = 1e9;                          const LL LINF = 1e16;
const LL MOD = 1000000007;                    const double PI = acos(-1.0);
int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };

/* -----  2018/02/23  Problem: 080_arc_a / Link: https://abc069.contest.atcoder.jp/tasks/arc080_a?lang=en  ----- */
/* ------問題------

長さ N の数列 a=(a1,a2,…,aN) があります。 各 ai は正の整数です。
すぬけ君の目標は、a の要素を自由に並べ替え、次の条件が成り立つようにすることです。
各 1≤i≤N−1 について、ai と ai+1 の積は 4 の倍数である。
すぬけ君が目標を達成できるか判定してください。

-----問題ここまで----- */
/* -----解説等-----

4を奇数番目に置いて、2を4の隣に敷き詰められないときはこれを満たすことができない。

----解説ここまで---- */

LL N;

LL ans = 0LL;

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

	cin >> N;
	VL a(N);
	int cnt4 = 0;
	int cnt2 = 0;
	FOR(i, 0, N) {
		cin >> a[i];
		if (a[i] % 4 == 0) {
			cnt4++;
		}
		else if (a[i] % 2 == 0) {
			cnt2++;
		}
	}
	int f = 0;
	if (cnt4 * 2 + 1 >= N) {
		f = 1;
	}
	else if (cnt4 * 2 + cnt2  >= N) {
		f = 1;
	}


		string s[2] = { "No","Yes" };
	cout << s[f] << "\n";

	return 0;
}


Measured memory_bytes: 1024
#define _CRT_SECURE_NO_WARNINGS
#define ll long long
#define vi vector<int>
#define LLMAX 4000000000000000000LL
#include <bits/stdc++.h>
#include <unordered_set>
using namespace std;
struct edge
{
	int t, f, w;
	bool operator < (const edge& e) const
	{
		return w > e.w;
	}
	edge(int from, int to, int weight)
	{
		t = to;
		f = from;
		w = weight;
	}
};
#define ii pair<int,int>
#define MOD 1000000007
const double EPS = (1e-5);
long long binpow(long long a, long long b){long long res = 1;while (b > 0){if (b & 1)res = res * a;a = a * a;b >>= 1;}return res;}
int findXOR(int n){switch (n % 4){case 0:return n;case 1:return 1;case 2:return n + 1;case 3:return 0;}}
int rangeXOR(int l, int r){return (findXOR(l - 1) ^ findXOR(r));}
int getbit(int mask, int bit){return (mask & (1 << bit));}void setbit(int& mask, int bit, int val){if (val)mask |= (1 << bit);else mask &= ~(1 << bit);}
//ll gcd(ll a, ll b){return b == 0 ? a : gcd(b, a % b);}
//ll lcm(ll a, ll b){return a * (b / gcd(a, b));}
const int N = 1e5+10;
const int M = 101;
const ll INF = 1e9;
int w[M],v[M];
ll dp[M][N];
void solve()
{
	int n, W;
	cin >> n >> W;
	for (int i = 0; i < n; ++i)
		cin >> w[i] >> v[i];
	for (int i = 0; i < n; ++i)
		dp[i][w[i]] = v[i];
	for (int i = 1; i < n; ++i)
	{
		for (int j = 0; j <= W; ++j)
		{
			if (j + w[i] <= W)
			{
				dp[i][j + w[i]] = max(dp[i][j + w[i]], v[i] + dp[i - 1][j]);
			}
			dp[i][j] = max(dp[i][j],dp[i - 1][j]);
		}
	}
	ll ans = 0;
	for (int i = 0; i <= W; ++i)
		ans = max(ans, dp[n - 1][i]);
	cout << ans << '\n';

}
int main(void)
{
	//freopen("commandos.in", "r", stdin);
	//freopen("output.txt", "w", stdout);
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int tc = 1;
	//cin >> tc;
	//scanf("%d", &tc);
	while (tc--)
	{
		solve();
	}
}

Measured memory_bytes: 77568
#include<bits/stdc++.h>
#include <math.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define lper(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9;
const ll INF=4e18;
const ll dy[4]={1,0,-1,0};
const ll dx[4]={0,-1,0,1};
int main() {
int A;
  int B;
  cin >>A>>B;
  int x=A;
  int y=B;
  int z=A+B;
  if ( ((x%3)==0) || ((y%3)==0) || ((z%3)==0)) {
    cout << "Possible" << endl;
  }
else {
 cout << "Impossible" << endl;
}
}

  
  

Measured memory_bytes: 384
n = int(input())
a = list(map(int,input().split()))

x = [0] * n

for i in range(n-1):
    x[i+1] = a[i] - x[i]

d = ((x[0] + x[n-1]) - a[n-1]) // 2

for j in range(n):
    x[j] = x[j] - ((-1) ** j) * d

ans = [0] * n
for j in range(n):
    ans[j] = 2 * x[j]

print(" ".join(map(str,ans)))

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

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

  int d = 0;
  for (int i = 0; i < n; ++i) {
    d += a[i]-1;
  }
  cout << d << endl;

  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main(){
  int n;cin>>n;
  vector<int> a(n);
  for(int i = 0; n > i; i++){
    cin>>a[i];
  }
  sort(a.begin(),a.end());
  cout << a[n/2]-a[n/2-1] << endl;
}

Measured memory_bytes: 640
unittest
{
	assert( [ "8 12 2" ].parse.expand.solve == 2 );
	assert( [ "100 50 4" ].parse.expand.solve == 5 );
	assert( [ "1 1 1" ].parse.expand.solve == 1 );
}



import std.algorithm;
import std.conv;
import std.range;
import std.stdio;
import std.typecons;

void main()
{
	stdin.byLineCopy.parse.expand.solve.writeln;
}

auto parse( Range )( Range input )
if( isInputRange!Range && is( ElementType!Range == string ) )
{
	auto abk = input.front.split.to!( long[] );
	return tuple( abk[ 0 ], abk[ 1 ], abk[ 2 ] );
}

auto solve( long a, long b, long k )
{
	auto c = 0L;
	for( auto i = min( a, b ); 0 < i; i-- )
	{
		c += ( a % i == 0 && b % i == 0 );
		if( c == k ) return i;
	}
	
	assert( false );
}


Measured memory_bytes: 256
def main():
    N, M, V, P = (int(i) for i in input().split())
    A = [int(i) for i in input().split()]
    A.sort(reverse=True)

    def is_ok(x):
        # x問目が選ばれるか判定
        if x <= P-1:
            return True
        elif A[x-1] + M < A[P-1]:
            return False
        voted = (P-1)*M + (N-x)*M + M
        for i in range(P, x):
            voted += min(max((A[x-1] + M - A[i-1]), 0), M)
        if M*V <= voted:
            return True
        else:
            return False

    def binary_search_meguru():
        ng = N+1
        ok = P
        while abs(ok - ng) > 1:
            mid = ng + (ok - ng) // 2
            if is_ok(mid):
                ok = mid
            else:
                ng = mid
        return ok

    print(binary_search_meguru())


if __name__ == '__main__':
    main()


Measured memory_bytes: 62704
#pragma GCC optimize("O3")
#pragma GCC target("sse4")

#include <bits/stdc++.h>

#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <typeinfo>

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef long double ld;
typedef complex<ld> cd;

typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef pair<ld, ld> pd;

typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
typedef vector<pi> vpi;
typedef vector<pl> vpl;
typedef vector<cd> vcd;

template <class T>
using Tree =
    tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define FOR(i, a, b) for (int i = a; i < (b); i++)
#define F0R(i, a) for (int i = 0; i < (a); i++)
#define FORd(i, a, b) for (int i = (b)-1; i >= a; i--)
#define F0Rd(i, a) for (int i = (a)-1; i >= 0; i--)

#define sz(x) (int)(x).size()
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define lb lower_bound
#define ub upper_bound
#define all(x) x.begin(), x.end()
#define shandom_ruffle random_shuffle

const int MOD = 1000000007;
const ll INF = 1e18;
const int MX = 100001;  // check the limits, dummy

typedef long long ll;
const int inf = INT_MAX / 2;
const ll infl = 1LL << 60;
template <class T>
bool chmax(T &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <class T>
bool chmin(T &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}

template <class T>
void print(const vector<T> v) {
  cout << "[ ";
  F0R(i, v.size()) { cout << v[i] << ' '; }
  cout << "]" << '\n';
}

int mod(int i, int j) {
  return (i % j) < 0 ? (i % j) + 0 + (j < 0 ? -j : j) : (i % j + 0);
}

// --------------------------------------------------------
// This is tool
// --------------------------------------------------------
void Main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);

  string S, T;
  int a = 0;
  cin >> S >> T;
  // cout << S.size() << T.size();
  FOR(i, 0, S.size()) {
    if (S[i] != T[i]) {
      a = 1;
    }
    // cout << a << endl;
  }
  if (T.size() - S.size() != 1) {
    a = 1;
  }
  // cout << a << endl;

  if (a == 0) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
}

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

Measured memory_bytes: 3644
import java.io.BufferedReader;
import java.io.Closeable;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.LinkedHashMap;
import java.util.LinkedList;
import java.util.ListIterator;
import java.util.Map.Entry;

import java.util.PriorityQueue;
import java.util.Random;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;


public class Main {
	
	public static void main(String[] args) throws IOException {	
		try(final Scanner sc = new Scanner(System.in)){
			final int N = sc.nextInt();
			
			long[] counts = new long[N + 1];
			for(int A = 1; A <= N; A++) {
				for(int B = 1; (long)(A) * B <= N; B++) {
					counts[A * B]++;
				}
			}
			
			long answer = 0;
			for(int C = 1; C <= N; C++) {
				answer += counts[N - C];
			}
			
			System.out.println(answer);
		}
	}

	public static class Scanner implements Closeable {
		private BufferedReader br;
		private StringTokenizer tok;

		public Scanner(InputStream is) throws IOException {
			br = new BufferedReader(new InputStreamReader(is));
		}

		private void getLine() throws IOException {
			while(!hasNext()){
				tok = new StringTokenizer(br.readLine());
			}
		}

		private boolean hasNext() {
			return tok != null && tok.hasMoreTokens();
		}

		public String next() throws IOException {
			getLine();
			return tok.nextToken();
		}

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

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}
		

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public int[] nextIntArray(int n) throws IOException {
			final int[] ret = new int[n];
			for(int i = 0; i < n; i++){
				ret[i] = this.nextInt();
			}
			return ret;
		}

		public long[] nextLongArray(int n) throws IOException {
			final long[] ret = new long[n];
			for(int i = 0; i < n; i++){
				ret[i] = this.nextLong();
			}
			return ret;
		}

		public void close() throws IOException {
			br.close();
		}
	}
}


Measured memory_bytes: 40628
import java.util.*;

/*
問題文
ジャンボ高橋君はゴルフの練習をすることにしました。
ジャンボ高橋君の目標は飛距離を K の倍数にすることですが、ジャンボ高橋君の出せる飛距離の範囲は 
A 以上 B 以下です。

目標の達成が可能であれば OK と、不可能であれば NG と出力してください。

制約
入力はすべて整数
1≤A≤B≤1000
1≤K≤1000

*/

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

        Scanner sc = new Scanner(System.in);
        int k = sc.nextInt();
        int a = sc.nextInt();
        int b = sc.nextInt();

        boolean flg = false;
        for (int i = a; i <= b; i++) {
            if (i % k == 0) {
                flg = true;
            }
        }

        if (flg) {
            System.out.println("OK");
        } else {
            System.out.println("NG");
        }
    }
}

Measured memory_bytes: 35888
import math


def permutation(n, elems):
    if n == 0:
        return []
    elif n == 1:
        return [elems]
    else:
        result = []
        for q in elems:
            new_p = list(elems)
            new_p.remove(q)
            ac = permutation(n - 1, new_p)
            result += [[q] + a for a in ac]
        return result


def calc(N, xlist):
    d = {}
    for i in range(N):
        x = xlist[i]
        d[i] = {}
        for j in range(N):
            y = xlist[j]
            d[i][j] = math.sqrt((x[0] - y[0]) ** 2 + (x[1] - y[1]) ** 2)
    perms = permutation(N, list(range(N)))
    result = 0
    for p in perms:
        for i in range(N - 1):
            result += d[p[i]][p[i + 1]]
    result /= len(perms)
    return result


N = int(input())
x = [tuple(int(s) for s in input().split()) for _ in range(N)]
print(calc(N, x))

Measured memory_bytes: 9972
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
const int MAX = 2e3 + 10;
vector <int> g[MAX];
int d[MAX][MAX];
void bfs(int s) {
	d[s][s] = 0;
	queue <int> q;
	q.push(s);
	while(!q.empty()) {
		int u = q.front(); q.pop();
		for(int v : g[u]) {
			if(d[s][v] == -1) {
				q.push(v);
				d[s][v] = d[s][u] + 1;
			}
		}
	}
}
int main() {
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	for(int i = 1; i < MAX; i ++) for(int j = 1; j < MAX; j ++) d[i][j] = -1;
	int n, x, y;
	cin >> n >> x >> y;
	for(int i = 1; i < n; i ++) {
		g[i].push_back(i + 1);
		g[i + 1].push_back(i);
	}
	g[x].push_back(y);
	g[y].push_back(x);
	for(int i = 1; i <= n; i ++) bfs(i);
	int ans[n] = {0};
	for(int i = 1; i <= n; i ++) {
		for(int j = i + 1; j <= n; j ++) {
			ans[d[i][j]] ++;
		}
	}
	for(int i = 1; i < n; i ++) cout << ans[i] << "\n";
	return 0;
}


Measured memory_bytes: 16128
object Main extends App{
  import scala.io.StdIn._
  var a=0;var b=0
  val n=readInt()
  val x=readLine().split(" ").map(_.toInt)
  val s=x.sum/x.length
  for{i <- (0 until n)}{
    a+=(x(i)-s)*(x(i)-s)
    b+=(x(i)-(s+1))*(x(i)-(s+1))
  }
  println(Math.min(a,b))
}

Measured memory_bytes: 27312
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a, b, c, k; cin >> a >> b >> c >> k;
if(k <= a) cout << k << endl;
 else if(k <= a + b) cout << a << endl;
 else cout << a - (k - a - b) << endl;
 return 0;
}


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


int main(){
    
    int n,q;
    string s;
    cin >> n >> s >> q;
    vector<set<int>> is(26);

    rep(i,n) is[s[i] - 'a'].insert(i);
    rep(qi,q){
        int ty;
        cin >> ty;
        if(ty == 1){
            int i; char c;
            cin >> i >> c;
            --i;
            is[s[i] - 'a'].erase(i);
            s[i] = c;
            is[s[i]-'a'].insert(i);
        }else{
            int l, r;
            cin >> l >> r;
            --l;
            int ans = 0;
            rep(i,26){
                auto itr = is[i].lower_bound(l);
                if(itr!= is[i].end() && *itr < r) ++ ans;
            }
            cout << ans << endl;
        }
    }

    return 0;

}

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

int main() {
    ll n; cin >> n;
    if(n==1){
        cout << 2 << endl;
        return 0; 
    }

    if(n%2==0){
        cout << n << endl;
    }
    else{
        cout << 2*n << endl;
    }
    
}


Measured memory_bytes: 256
from math import gcd
from functools import reduce
from sys import exit

# O(NlogA+AloglogA)解
MAX_A = 1000000
lowerst_prime = [0] * (MAX_A + 1) # 最小の素因数をいれる(2以上をみていけばいい)
count = [0] * (MAX_A + 1) # 約数として出てくる回数を数える

for i in range(2, MAX_A + 1): # エラトステネスの篩
    if lowerst_prime[i] != 0:
        continue
    lowerst_prime[i] = i
    for j in range(i * i, MAX_A + 1, i): # i * iスタートでいいのは、i * bはbの約数でもあるため
        if lowerst_prime[j] == 0:
            lowerst_prime[j] = i
# 入力
N = int(input())
A = [*map(int, input().split())]

if reduce(gcd, A) != 1:
    print("not coprime")
    exit(0)

for i in range(N):
    while A[i] > 1:
        divide = lowerst_prime[A[i]]
        count[divide] += 1
        while A[i] % divide == 0: # 割れるだけ割る
            A[i] //= divide

for i in range(MAX_A + 1):
    if count[i] >= 2:
        print("setwise coprime")
        exit(0)
print("pairwise coprime")

Measured memory_bytes: 208388
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp> 
const double PI=acos(-1);
using namespace std;
using boost::multiprecision::cpp_int;
#define ll long long
#define ull unsigned long long
#define ul unsigned long
#define ci cpp_int
#define MOD 1000000007

long findmin(long a,long b) {
	return a<b?a:b;
}
long findmax(long a,long b) {
	return a>b?a:b;
}
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n;long W;
	cin>>n>>W;
	long w[n+1],v[n+1];
	for(long i=1;i<=n;i++) {
		cin>>w[i]>>v[i];
	}
	vector<vector<ll>> dp(n+1, vector<ll>(W+1,0));
	for(int i=1;i<=n;i++) {
		for(int j=1;j<=W;j++) {
			dp[i][j]=dp[i-1][j];
			if(j>=w[i]) {
				dp[i][j]=findmax(dp[i-1][j-w[i]] + v[i], dp[i][j-1]);
				dp[i][j]=findmax(dp[i-1][j],dp[i][j]);
			}
		}
	}
	cout<<dp[n][W]<<"\n";
	cout.flush();
	return 0;
}


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

int main() {
    ll X; cin >> X;

    for (ll i = -1000; i < 1000; i++)
    {
        for (ll j = -1000; j < 1000; j++)
        {
            if(i*i*i*i*i-j*j*j*j*j == X){
                cout << i << " " << j << endl;
                return 0;
            }
        }
        
    }
    return -1;
}

Measured memory_bytes: 3584
#include<stdio.h>
#define N 40

int n,pos;
int A[N],B[N];

void solve(int, int);

void solve(int l,int r){
  int x,i;

  x = A[pos];
  if( l > r ) return;
  if( l == r ){
    if( B[l] == A[0] ) printf("%d", B[l]);
    else printf("%d ", B[l]);
    pos++;

    return;
  }
  pos++;

  for( i = l ; i <= r ; i++){
    if( B[i] == x ) break;
  }
  solve( l, i-1);
  solve( i+1, r);

  if( x == A[0]) printf("%d", x);
  else printf("%d ", x);
}


int main(){
  int i;

  scanf("%d", &n);
  for( i = 0 ; i < n ; i++){
    scanf("%d", &A[i]);
  }
  for( i = 0 ; i < n ; i++){
    scanf("%d", &B[i]);
  }
  pos = 0;
  solve( 0, n-1);
  printf("\n");

  return 0;
}



Measured memory_bytes: 2096
// by adiforluls
#pragma GCC optimize ("-O2")
#include<bits/stdc++.h>
using namespace std;
#define FASTNIBBA   ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define ll          long long
#define pb          push_back
#define mp          make_pair
#define pii         pair<int,int>
#define mii         map<int,int>
#define vi          vector<int>
#define vll         vector<long long>
#define lbnd        lower_bound
#define ubnd        upper_bound
#define all(a)      (a).begin(),(a).end()
#define clz(a)      __builtin_clz(a) // count leading zeroes
#define ctz(a)      __builtin_ctz(a) // count trailing zeroes
#define popc(a)     __builtin_popcount(a) // count set bits (for ints only diff for ll)
#define lul         1000000007
#define rep(i,a,b)  for(int i=a;i<b;i++)
#define SIZE        1000005
#define F           first
#define S           second
#define debug(x)    cerr << #x << " = " << x << endl;
#define mod         998244353
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    std::cerr << name << " = " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');std::cerr.write(names, comma - names) << " = " << arg1<<" |";__f(comma+1, args...);
}
#else
#define trace(...)
#endif
#define endl        '\n'
mii m;
void solve()
{
   int n,cnt=0; cin>>n;
   while(true)
   {
     cnt++;
     if(m[n]) {cout<<cnt; return;}
     else m[n]=1;
     if(n&1) n=3*n+1;
     else n/=2;
   }
}
int main()
{
    FASTNIBBA;
   //  #ifndef ONLINE_JUDGE
     // freopen("input.txt", "r", stdin);
     // freopen("output.txt", "w", stdout);
   //  #endif
    int t; t=1;
    while(t--){
       solve();
    }
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int i,j,k,m,n,a,b,c;
int main()
{
	scanf("%d%d%d",&a,&b,&c);
	if((a<=c&&b>=c)||(a>=c&&b<=c)) printf("Yes");
	else printf("No");
}

Measured memory_bytes: 256
def main():
    S = input()
    n = len(S)
    S += '  '
    for i in range(n):
        if S[i] == S[i+1]:
            print('%d %d' %(i+1, i+2))
            return
        elif S[i] == S[i+2]:
            print('%d %d' %(i+1, i+3))
            return

    print('-1 -1')

main()

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

int H, W, K;
vector<vector<int>> original, board;

void input()
{
}

void change(int &amount, int row)
{
  int start = -1, last = -1, cnt = 0;
  rep(col, W)
  {
    if (!board.at(col).at(row))
    {
      if (start != -1 && cnt >= K)
      {
        amount += board.at(start).at(row) * cnt;
        for (int i = start; i < start + cnt; i++)
        {
          board.at(i).at(row) = -1;
        }
      }
      start = -1;
      last = -1;
      cnt = 0;
      continue;
    }
    if (board.at(col).at(row) == last)
    {
      cnt++;
    }
    else
    {
      if (start != -1 && cnt >= K)
      {
        amount += board.at(start).at(row) * cnt;
        for (int i = start; i < start + cnt; i++)
        {
          board.at(i).at(row) = -1;
        }
      }
      start = col;
      last = board.at(col).at(row);
      cnt = 1;
    }
  }
  if (start != -1 && cnt >= K)
  {
    amount += board.at(start).at(row) * cnt;
    for (int i = start; i < start + cnt; i++)
    {
      board.at(i).at(row) = -1;
    }
  }
}

void update()
{
  rep(col, W)
  {
    vector<int> new_col(H, 0);
    int index = 0;
    rep(row, H)
    {
      if (board.at(col).at(row) == 0)
      {
        break;
      }
      if (board.at(col).at(row) == -1)
      {
        continue;
      }
      new_col.at(index) = board.at(col).at(row);
      index++;
    }
    board.at(col) = new_col;
  }
}

int solve()
{
  int ans = 0;
  for (int i = 0;; i++)
  {
    int amount = 0;
    rep(row, H) change(amount, row);
    if (amount == 0)
      break;
    ans += (int)pow(2, i) * amount;
    update();
  }
  return ans;
}

int main()
{
  cin >> H >> W >> K;
  original.resize(W, vector<int>(H, 0));
  board.resize(W, vector<int>(H, 0));
  for (int row = H - 1; row >= 0; row--)
  {
    string s;
    cin >> s;
    rep(col, W)
    {
      int num = s.at(col) - '0';
      original.at(col).at(row) = num;
    }
  }
  int ans = 0;
  rep(col, W)
  {
    rep(row, H)
    {
      board = original;
      board.at(col).at(row) = -1;
      update();
      ans = max(ans, solve());
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
_ = readLine()!
let ta = readLine()!.split(separator: " ").compactMap { Double($0) }
let t = ta[0]
let a = ta[1]
let h = readLine()!.split(separator: " ").compactMap { Double($0) }

let result = h.lazy
    .map { abs((t - $0 * 0.006) - a) }
    .enumerated()
    .min { $0.1 < $1.1 }!

print(result.0 + 1)


Measured memory_bytes: 8040
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
use std::io::{Write, BufWriter};
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

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

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

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

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

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

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

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

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

fn solve() {
    let out = std::io::stdout();
    let mut out = BufWriter::new(out.lock());
    macro_rules! puts {
        ($($format:tt)*) => (write!(out,$($format)*).unwrap());
    }
    input!(a: i64);
    puts!("{}\n", 180 * (a - 2));
}

fn main() {
    // In order to avoid potential stack overflow, spawn a new thread.
    let stack_size = 104_857_600; // 100 MB
    let thd = std::thread::Builder::new().stack_size(stack_size);
    thd.spawn(|| solve()).unwrap().join().unwrap();
}


Measured memory_bytes: 8572
#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> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;
template< typename T1, typename T2 >
ostream &operator<<(ostream &os, const pair< T1, T2 >& p) {
  os << "{" <<p.first << ", " << p.second << "}";
  return os;
}
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 ll MOD = (ll)1e9+7;
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 main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    int N;
    string S;
    string cs = {'R', 'G', 'B'};
    map<char, int> mp;
    mp['R'] = 0;
    mp['G'] = 1;
    mp['B'] = 2;
    cin >> N >> S;
    vvec<ll> r(3, vec<ll>(N+1,0));
    for(int i = 0;i < N;i++){
        rep(j,3)
        r[j][i+1] += r[j][i] + (S[i] == cs[j]);
    }
    ll ans = 0;
    rep(i,N)rep(j,N){
        if(i >= j)continue;
        if(S[i] == S[j])continue;
        int hoka = 3 - mp[S[i]] - mp[S[j]];
        //[i+1,j)の他の数
        ans += r[hoka][j] - r[hoka][i+1];
        if((j - i) % 2 == 0){
            int mid = (j-i)/2 + i;
            ans -= (S[mid] == cs[hoka]);
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3736
import java.io.PrintWriter

fun main(args: Array<String>) {
    PrintWriter(System.out).use { out ->
        solve(out)
        out.flush()
    }
}

fun solve(out: PrintWriter) {
    val (x, y) = readLongList()
    var ans = 0L
    var cur = x
    while (cur <= y) {
        ans++
        cur *= 2
    }
    println(ans)
}

fun readInteger() = readLine()!!.toInt()
fun readLong() = readLine()!!.toLong()
fun readStringList() = readLine()!!.split(" ")
fun readIntegerList() = readStringList().map(String::toInt)
fun readLongList() = readStringList().map(String::toLong)
fun readDoubleList() = readStringList().map(String::toDouble)


Measured memory_bytes: 37868
#pragma GCC optimize("O3")
#include<bits/stdc++.h> 
using namespace std;
using ll=long long;
using P=pair<ll,ll>;
template<class T> using V=vector<T>; 
#define fi first
#define se second
#define all(v) (v).begin(),(v).end()
const ll inf=(1e18);
const ll mod=998244353;
ll gcd(ll a,ll b) {return b ? gcd(b,a%b):a;}
ll lcm(ll c,ll d){return c/gcd(c,d)*d;}
struct __INIT{__INIT(){cin.tie(0);ios::sync_with_stdio(false);cout<<fixed<<setprecision(15);}} __init;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
int main(){
int h,w,m;
cin>>h>>w>>m;
V<V<ll>> a(h,V<ll>(w));
for(int i=0;i<h;i++){
    string t={};
    cin>>t;
    for(int j=0;j<w;j++){
        a[i][j]=int(t[j]-'0');
    }
}
int cnt=0,ans=INT_MAX;
for(int i=0;i<(1<<(h-1));i++){
    int n=0;
    for(int j=0;j<h-1;j++)if(i&(1<<j))n++;
    V<ll> sum(n+1,0);int res=n;
    bool ok=true;
    for(int j=0;j<w;j++){
        cnt=0;V<ll> tmp(n+1,0);
        for(int k=0;k<h;k++){
            tmp[cnt]+=a[k][j];
            if(i&(1<<k)){
                cnt++;
            }
        }
        bool c=true;
        for(int k=0;k<=n;k++){
            if(tmp[k]>m){
                ok=false;
            }
            if(tmp[k]+sum[k]>m)c=false;
        }
        if(!ok)break;
        if(c){
            for(int k=0;k<=n;k++){
            sum[k]+=tmp[k];
        }
        }else{
            res++;
            sum=tmp;
        }
    }
    if(!ok)continue;
    chmin(ans,res);
}
cout<<ans<<"\n";
}


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

int main(){
    int N;
    int i,num;
    N >= 1;
    N <= 200000;
    string S[200000];
    cin >> N;
    set <string> gift; 

    for(i=0;i<N;i++){
            cin >> S[i];
        }
    for(i=0;i<N;i++){
        gift.insert(S[i]);
    }
    num = gift.size();
    cout << num <<endl;
}

Measured memory_bytes: 25452
#include <iostream>
#include <vector>
#include <list>
#include <set>
#include <queue>
#include <map>
#include <algorithm>
#include <functional>
#include <string>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;

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

typedef long long int ll;
typedef pair<int,int> pii;
typedef vector<int> vint;
typedef vector<pii> vpii;
typedef vector<vint> det1;
typedef vector<vpii> det2;

int main()
{
    int N, H, W;
    cin >> N >> H >> W;

    const int h = N - (H - 1);
    const int w = N - (W - 1);
    const int ans = h * w;

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#pragma GCC optimize("Ofast","-funroll-loops","-fdelete-null-pointer-checks")
#pragma GCC target("ssse3","sse3","sse2","sse","avx2","avx","popcnt")
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define ull unsigned long long
#define ff first
#define ss second
#define endl '\n'

const ll MOD = 1e9 + 7;

void solve() {
	string s;
	cin >> s;
	ll ans = 0ll;
	for(char c : s)
		ans += c - '0';
	if(ans%9)
		cout << "No";
	else
		cout << "Yes";
}

int32_t main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	ll t=1;
	for(ll tt=1; tt <= t; tt++) {
		//cout << "case #" << tt << ":\n";
		solve();
	}

	return 0;
}



Measured memory_bytes: 3744
#include<iostream>
#include<vector>
#include<string>
#include<array>
#include<cmath>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<numeric>
#include<iomanip>
#include<utility>
#include<cstdlib>
#include<typeinfo>
#include<stack>
#include<cassert>
#include<functional>
#define int long long int
#define double long double
using namespace std;
#define INT_MAX 1000000007
#define INF 1000000000000000007
const int MAX_N = 1 << 17;
#define REP(i,n) for(int (i)=0;(i)<(n);(i)++)
using namespace std;

bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            // 素数ではない
            return false;
        }
    }

    // 素数である
    return true;
}
int count(int num,std::vector<int> &vec){
   int sum = 0;
   for(int i = 0; i < vec.size(); i++){
       if(vec[i] >= num){
           sum++;
       }
   }
   return sum;
}

signed main()
{
    int n;
    std::cin >> n;
    std::vector<int> div(n + 1,0);
    for(int i = 2; i <= n; i++){
        int temp = i;
        for(int j = 2; j <= i; j++){
            while(IsPrime(j) && temp % j == 0){
                div[j]++;
                temp = temp / j;
            }
        }
    }
std::cout << count(74,div) + count(24,div) * (count(2,div) - 1) + count(14,div) * (count(4,div) - 1) + count(4,div) * (count(4,div) - 1) * (count(2,div) - 2)/2 << std::endl;
return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#include <boost/multiprecision/cpp_int.hpp>
//typedef boost::multiprecision::cpp_int ll;
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
ll inf=(ll)1E16;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);

ll n,m;
bool seen[100001];
ll x[100001];
struct vv{ ll to,d;};
vector<vv> v[100001];

bool hoge(ll a){
    seen[a]=true;
    if(v[a].size()==0){
        return true;
    }
    rep(i,0,v[a].size()-1){
        if(seen[v[a][i].to]){
            if(x[v[a][i].to]!=x[a]+v[a][i].d){
                //cout<<a<<' '<<v[a][i].to<<' '<<x[a]<<' '<<v[a][i].d<<' '<<x[v[a][i].to]<<endl;
                return false;
            }
        }else{
            x[v[a][i].to]=x[a]+v[a][i].d;
            if(!hoge(v[a][i].to))return false;
        }
    }
    return true;
}


int main(){
    cin>>n>>m;
    ll l,r,d;
    vv ve;
    rep(i,0,m-1){
        cin>>l>>r>>d;
        ve.to=r;
        ve.d=d;
        v[l].pb(ve);
        ve.to=l;
        ve.d=-d;
        v[r].pb(ve);
    }
    rep(i,0,n){
        x[i]=inf;
    }
    rep(i,1,n){
        if(seen[i]){
            continue;
        }
        x[i]=0;
        if(!hoge(i)){
            cout<<"No"<<endl;
            //cout<<i<<endl;
            return 0;
        }
    }
    cout<<"Yes"<<endl;
    return 0;
}


Measured memory_bytes: 16512
# -*- coding:utf-8 -*-

def solve():
    S = input()

    def func(s):
        moji_dic = {}
        for moji in s:
            if not moji in moji_dic:
                moji_dic[moji] = 0
            moji_dic[moji] += 1
        
        if len(moji_dic.keys()) != 2:
            return False
        
        for v in moji_dic.values():
            if v != 2:
                return False
        
        return True
    
    if func(S):
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    solve()


Measured memory_bytes: 2940
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <iomanip>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cassert>
#include <complex>
#include <stdio.h>
#include <time.h>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
# define ll int64_t
# define str string
# define rep(i,n) for(ll i=0;i<n;i++)
# define rrep(i,n) for(ll i=1;i<=n;i++)
# define ALL(x) (x).begin(), (x).end()
# define SZ(x) ((int)(x).size())
# define pb push_back
# define mod 1000000007
# define PI 3.141592653589793
# define vec vector
#define dump(x) cerr<<#x<<"="<<x<<endl
using namespace std;



#define INF 2000000000
#define MAX_V 10



bool compare_by_b(pair<string,ll> a,pair<string,ll> b){
    if(a.second != b.second) return a.second<b.second;
    else return a.first<b.first;
}

bool my_compare(pair<ll,ll> a,pair<ll,ll> b){
    if(a.first != b.first) return a.first<b.first;
    if(a.second != b.second) return a.second>b.second;
    else return true;
}

ll modpow(ll a,ll n,ll mod1) {
    ll res=1;
    while(n>0){
        if(n&1) res=res*a%mod1;
        a = a*a%mod1;
        n >>= 1;
    }
    return res;
}

ll factorial(ll n){
    ll x=1;
    rrep(i,n) x*=i;
    return x;
}

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

ll func(ll a,ll b,ll& ans_x,ll& ans_y){
    if(b == 0){
        ans_x = 1;
        ans_y = 0;
        return a;
    }else{
        ll ret = func(b,(a%b),ans_y,ans_x);
        ans_y -= (a/b)*ans_x;
        return ret;
    }
}

ll lcm(ll a,ll b){
   return a/gcd(a,b)*b;
}
const ll MAX = 5100000;
const ll MOD = 1000000007;
 
ll fac[MAX], finv[MAX], inv[MAX];
 
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
ll COM(ll n, ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

using graph = vector<vector<ll>>;
pair<pair<ll,ll>,ll> p[100010];

ll dp[50010];

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

    ll n,m;
    cin>>n>>m;
    vector<ll> coin(m);
    rep(i,m) cin>>coin[i];
    sort(ALL(coin));
    
    rep(i,50010) dp[i]=INF;
    dp[0]=0;
    rep(i,n){
        rep(j,m){
            if(i+coin[j]>n) break;
            dp[i+coin[j]]=min(dp[i+coin[j]],dp[i]+1);
        }
    }
    cout<<dp[n]<<endl;
    return 0;
}


Measured memory_bytes: 3576
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define N 1000000007
#define mp make_pair
#define pb push_back
#define f first
#define se second
#define MOD 1000000007
//vector<int>adj[N];
//vector<bool>vis(N,false);
//const int INF = 1e9;
ll fastpower(ll a, ll b){
    ll res = 1;
    a %= N;
    while(b){
        if(b&1) res = (res * a) % N;
        a *= a; a %= N;
        b >>= 1;
    }
    return res;
}
int main() 
{
	
	    	ll n,i,j,g,temp,sum,ans=0,k;
	    	cin>>n>>k;
	    	ll dp[k+1];
	    	for(i=k;i>=1;i--)
	    	{
	    		g=k/i;
	    		temp=fastpower(g,n);
	    		sum=0;
	    		for(j=2*i;j<=k;j+=i)
	    		{
                   sum+=(dp[j]%N);  
	    		}
	    		dp[i]=temp-sum;
	    		//cout<<sum<<" "<<temp<<" "<<dp[i]<<endl;
	    	}
	    	for(i=1;i<=k;i++)
	    		{
	    			ans+=(dp[i]*i)%N;}
	    	    cout<<ans%N<<endl;
 
}

Measured memory_bytes: 4408