akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <chrono>
using namespace std;
typedef long long ll;
#define tr(container, it) \
        for (auto it = container.begin(); it != container.end(); it++)
#define scontains(c, x) ((c).find(x) != (c).end())   //O(log n)
#define contains(c, x) (find((c).begin(),(c).end(),x) != (c).end()) //O(n)
#define ill(_x)  ll _x;scanf("%lld",&_x);
#define idb(_x)  double _x;scanf("%lf",&_x);
#define all(x) (x).begin(),(x).end()
#define pll pair<ll,ll>
#define mll map<ll,ll>
#define vll vector<ll>
#define sll set<ll>
#define vs vector<string>
#define in0(x, a, b)((x)>=a && (x)<=b    )
#define in1(x, a, b)((x)>a && (x)<b)
#define  rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
const double pi = 3.14159265358979323846;
const int INF = 0x3f3f3f3f;
const int X10=1024,X11=2048,X12=4096,X13=8196,X14=16392,X15=32786,X16=65536,X17=131072,X18=262144,X19=524288,X20=1048576;

pair<int,int> f(int a1,int a2,int a3){
    return {a1-a2,a2-a3};
};
int A[263];
void _(){
   int a1, a2, a3, a4, a5, a6, a7,a8, a9;
   cin >> a1 >> a2 >> a3 >> a4 >> a5 >> a6>> a7 >> a8 >> a9;
   if(f(a1,a2,a3)==f(a4,a5,a6) && f(a4,a5,a6)==f(a7,a8,a9))cout << "Yes";
   else cout << "No";
}






int main() {
#ifdef Debug
    freopen("/home/joduskame/Desktop/cpp/IO/Input.txt", "r", stdin);
    freopen("/home/joduskame/Desktop/cpp/IO/Output.txt", "w", stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    _();
    return 0;

}








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

using namespace std;

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

	int ans = 0;

	for (int i = 0; i < S.length(); ++i) {
		if (S[i] != 'J') continue;
		int lenj = 1, leno = 0, leni = 0;
		
		while (S[i] == 'J') lenj++, i++;
		while (lenj && S[i] == 'O') leno++, i++;
		while (leno && S[i] == 'I') leni++, i++;

		if (leno <= lenj && leno <= leni) ans = max(ans, leno);
	}

	cout << ans << endl;
}

Measured memory_bytes: 2048
#include <iostream>
using namespace std;
int main(void){
   int k,n,c,min,m,j;
   cin >> n;
   c=0,min=100;
   int A[n];
    for(int i=0;i<n;i=i+1){
        cin >> A[i];
    }
//
    for(int i=0;i<n&&n>1;i=i+1){
      
        for(int j=i;j<n;j=j+1){
        if(A[j]<min){
            min=A[j];
            m=j;
        }
        }
        
        if(A[m]<A[i]){
            k=A[i];
            A[i]=A[m];
            A[m]=k;
            c=c+1;
        }
        min=100;
    }
//
   for(int i=0;i<n;i=i+1){
            if(i==n-1){
                cout << A[i] <<endl;
            }else{
                cout << A[i] <<" ";
            }
                
            }
            cout << c <<endl;

}


Measured memory_bytes: 3132
package main

import "fmt"

func main() {
	var s string
	var i int
	fmt.Scan(&s)
	if s[0] == '1' {
		i++
	}
	if s[1] == '1' {
		i++
	}
	if s[2] == '1' {
		i++
	}
	fmt.Println(i)
}


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

using namespace std;

int main() {
	ios_base::sync_with_stdio(false);
    int n;
    cin >> n;
    for (int i = n; i >= 1; i--){
        int x = sqrt(i);
        if ((x * x) == i){
            cout << i << endl;
            return 0;
        }
    }
}


Measured memory_bytes: 256
let a,b,c = Scanf.scanf "%s %s %s" (fun a b c -> a,b,c)
in
    if (a.[String.length a - 1] = b.[0] && b.[String.length b - 1] = c.[0]) 
    then 
        Printf.printf "YES\n"
    else
        Printf.printf "NO\n";;

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define FORD(i,a,b) for(int i=a;i>=b;i--)
#define ALL(a)  (a).begin(),(a).end()
#define SZ(a) int((a).size())
#define SORT(c) sort((c).begin(),(c).end())
#define PB push_back
#define MP make_pair
#define MEMSET(v, h) memset((v), h, sizeof(v))
#define endl "\n"
using Edge = pair<int,ll>;
using Graph = vector<vector<Edge>>;
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; }
// ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
// ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

int main(void){
  int n, r; cin >> n >> r;
  if(n<10) r += 100 * (10-n);
  cout << r << endl; 
}




Measured memory_bytes: 256
#include <iostream>
using namespace std;
typedef long long ll;
ll T,A,B,C,D;

ll gcd(ll a,ll b){
	if(a%b==0) return b;
	else return gcd(b,a%b);
}

int main(){
	cin >> T;
	for(int i=0;i<T;i++){
		cin >> A >> B >> C >> D;
		if(A<B) cout << "No" << endl;
		else if(D<B) cout << "No" << endl;
		else if(B<=C) cout << "Yes" << endl;
		else{
			ll g = gcd(B,D);
			if(B-g+(A%g)<=C) cout << "Yes" << endl;
			else cout << "No" << endl;
		}
	}
}

Measured memory_bytes: 256
/************************************************
 * Au: Hany01
 * Prob: run
 * Email: hany01dxx@gmail.com & hany01@foxmail.com
 * Inst: Yali High School
************************************************/

#include<bits/stdc++.h>

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef pair<int, int> PII;
#define Rep(i, j) for (register int i = 0, i##_end_ = (j); i < i##_end_; ++ i)
#define For(i, j, k) for (register int i = (j), i##_end_ = (k); i <= i##_end_; ++ i)
#define Fordown(i, j, k) for (register int i = (j), i##_end_ = (k); i >= i##_end_; -- i)
#define Set(a, b) memset(a, b, sizeof(a))
#define Cpy(a, b) memcpy(a, b, sizeof(a))
#define X first
#define Y second
#define PB(a) push_back(a)
#define MP(a, b) make_pair(a, b)
#define SZ(a) ((int)(a).size())
#define ALL(a) a.begin(), a.end()
#define INF (0x3f3f3f3f)
#define INF1 (2139062143)
#define debug(...) fprintf(stderr, __VA_ARGS__)
#define y1 WoXiHuanNiA

template <typename T> inline bool chkmax(T &a, T b) { return a < b ? a = b, 1 : 0; }
template <typename T> inline bool chkmin(T &a, T b) { return b < a ? a = b, 1 : 0; }
template <typename T> inline T read() {
	register T _, __; register char c_;
    for (_ = 0, __ = 1, c_ = getchar(); c_ < '0' || c_ > '9'; c_ = getchar()) if (c_ == '-') __ = -1;
    for ( ; c_ >= '0' && c_ <= '9'; c_ = getchar()) _ = (_ << 1) + (_ << 3) + (c_ ^ 48);
    return _ * __;
}
//EOT


const int MAXN = 2e6 + 5, MOD = 1e9 + 7;

inline void inc(int &x, int y) {
	if ((x += y) >= MOD) x -= MOD;
}
inline int add(int x, int y) {
	return (x += y) >= MOD ? x - MOD : x;
}

int n, v[MAXN], pos[MAXN];

void Input() {
	static PII a[MAXN];
	static vector<int> kp;

	n = read<int>();
	For(i, 1, n) {
		a[i].X = read<int>();
		kp.PB(a[i].Y = read<int>());
	}
	sort(a + 1, a + 1 + n);
	sort(ALL(kp));
	kp.resize(unique(ALL(kp)) - kp.begin());
	For(i, 1, n) {
		v[i] = lower_bound(ALL(kp), a[i].Y) - kp.begin() + 1;
		pos[v[i]] = i;
	}
}

struct Segment {
	int l, r;
	bool operator < (const Segment &rhs) const {
		return r != rhs.r ? r < rhs.r : l < rhs.l;
	}
}seg[MAXN];

struct BIT {
	int c[MAXN];
	void update(int x, int dt) {
		++ x;
		for ( ; x <= n + 1; x += (x & -x))
			inc(c[x], dt);
	}
	int query(int x) {
		++ x;
		if (x < 0) return 0;
		int ans = 0;
		for ( ; x; x -= (x & -x))
			inc(ans, c[x]);
		return ans;
	}
	int query(int l, int r) {
		return add(query(r), MOD - query(l - 1));
	}
}bit;

void Solve() {
	static int dp[MAXN];
	int mx = 0, mn = INF;

	For(i, 1, n)
		chkmax(mx, v[i]), seg[i].r = mx;
	Fordown(i, n, 1)
		chkmin(mn, v[i]), seg[i].l = mn;
	sort(seg + 1, seg + 1 + n);

	bit.update(0, 1);
	For(i, 1, n) {
		int dt = bit.query(seg[i].l - 1, seg[i].r);
		inc(dp[seg[i].r], dt);
		bit.update(seg[i].r, dt);
	}
	printf("%d\n", dp[n]);
}

int main() {

	Input();

	Solve();

	return 0;
}

Measured memory_bytes: 16244
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

bool check(long long n, long long d)
{
    while(n%d==0) n/=d;
    n=n%d;
    return n==1;
}

main()
{
    int x,y,z; cin>>x>>y>>z;
    swap(x,y); swap(x,z);
    cout << x << " " << y << " " << z << "\n";
}

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

using namespace std;

	int n, m;
	int dist[1000];
	int wea[1000];
	static int dp[1000][1000];
	long int result;

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

	for (int a = 0; a < n; a++)
	{
		cin >> dist[a];
	}
	for (int a = 0; a < m; a++)
	{
		cin >> wea[a];
	}

	for (int a = 0; a < n; a++)
	{
		for (int b = 0; b < m; b++)
		{
			if (b < a)
			{
				dp[a][b] = -1;
			}
			else if (a == 0)
			{
				if (b == 0)
				{
					dp[a][b] = dist[b] * wea[a];
				}
				else
				{
					dp[a][b] = min(dp[a][b - 1], dist[a] * wea[b]);
				}
			}
			else
			{
				if (dp[a][b - 1] != -1)
				{
					dp[a][b] = min(dp[a - 1][b - 1] + dist[a] * wea[b], dp[a][b - 1]);
				}
				else
				{
					dp[a][b] = dp[a - 1][b - 1] + dist[a] * wea[b];
				}
			}
		}
	}

	cout << dp[n - 1][m - 1] << endl;

	return 0;
}

Measured memory_bytes: 4340
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <utility>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <functional>

using namespace std;

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

#define fst first
#define scd second
#define PB push_back
#define MP make_pair
#define rep(i,x) for(int i=0;i<(x);++i)
#define rep1(i,x) for(int i=1;i<=(x);++i)
#define rrep(i,x) for(int i=(x)-1;i>=0;--i)
#define rrep1(i,x) for(int i=(x);i>=1;--i)
#define FOR(i,a,x) for(int i=(a);i<(x);++i)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()

template<typename T>bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<typename T>bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}
template<typename T>T get(){T a;cin>>a;return a;}
template<typename T>T rev(T a){reverse(all(a));return a;}
template<typename T>istream&operator>>(istream&is,vector<T>&vec){rep(i,vec.size())is>>vec[i];return is;}
template<typename T>vector<T>&sort(vector<T>&a){sort(all(a));return a;}

const int inf = 1e9;
const ll linf = 3e18;

signed main()
{
    int a = 0, b = 0;

    int L, N; cin >> L >> N;

    rep(i, N) {
        int x, w; cin >> x >> w;
        (x > 0 ? a : b) += abs(x) * w;
    }

    printf("%d\n", abs(a - b));
    rep(i, abs(a - b)) {
        printf("%d 1\n", (a < b ? 1 : -1));
    }
}

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

Measured memory_bytes: 5176
#include<stdio.h>
#include<vector>
#include<algorithm>
using namespace std;
bool m[2020][2020];
bool dp[2][2020][2020];
int main()
{
	int num;
	scanf("%d", &num);
	for (int i = 0; i < num; i++)
	{
		for (int j = 0; j < i; j++)
		{
			char z;
			scanf(" %c", &z);
			bool t = z - '0';
			m[i][j] = t, m[j][i] = !t;
		}
	}
	for (int i = 0; i < num; i++)dp[0][i][i] = dp[1][i][i] = true;
	for (int k = 1; k < num; k++)
	{
		for (int i = 0; i < num - k; i++)
		{
			int j = i + k;
			bool f1 = false, f2 = false;
			for (int l = i; l < j; l++)f1 |= dp[1][i][l] & dp[0][j - 1][l] & m[j][l];
			for (int l = i + 1; l <= j; l++)f2 |= dp[1][i + 1][l] & dp[0][j][l] & m[i][l];
			dp[0][j][i] = f2, dp[1][i][j] = f1;
		}
	}
	int c = 0;
	for (int i = 0; i < num; i++)c += dp[1][0][i] & dp[0][num - 1][i];
	printf("%d\n", c);
}

Measured memory_bytes: 12160
import java.util.Scanner;

class Main {
    public static void main(String[] args) {
        int n, k;
        int [] a;
        try (Scanner cin = new Scanner(System.in)) {
            n = cin.nextInt();
            k = cin.nextInt();
            a = new int[n];
            for (int i = 0; i < n; i++) {
                a[i] = cin.nextInt();
            }
        }

        int r = (n - 1) / (k - 1);
        if ((n - 1) % (k - 1) > 0) r++;

        System.out.println(r);
    }
}

Measured memory_bytes: 49824
#include<bits/stdc++.h>
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
#define pb push_back
int dy[]={0, 0, 1, -1, 1, 1, -1, -1};
int dx[]={1, -1, 0, 0, 1, -1, -1, 1};

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define mp make_pair
#define fi first
#define sc second
ll n;
ll a[400000];
int main(){
	cin >> n;
	REP(i,3*n) {
		cin >> a[i];
	}

	sort(a,a+3*n);

	ll sum = 0;
	REP(i,n){
		sum += a[n + i * 2];
	}
	cout << sum << endl;
	return 0;
}


Measured memory_bytes: 2560
#!/usr/bin/env python3
import sys
import numpy as np


def solve(N: int, M: int, A: "List[int]", B: "List[int]"):
    parent = [-1] * (N+1)
    rank = [0] * (N+1)
    
    def find(x):
        if parent[x]<0:
            return x
        else:
            parent[x] = find(parent[x])
            return parent[x]
    
    def same(x, y):
        return find(x)==find(y)

    def unite(x, y):
        x = find(x)
        y = find(y)

        if x==y:
            return 0

        if rank[x]>rank[y]:
            parent[x] += parent[y]
            parent[y] = x
        else:
            parent[y] += parent[x]
            parent[x] = y
            if rank[x]==rank[y]:
                rank[y] += 1

    for i in range(M):
        unite(A[i], B[i])

    parent = parent[1:]
    rank = rank[1:]

    ans = 0
    for i in range(len(parent)):
        ans = max(ans, -parent[i])

    print(ans)
    return


# Generated by 1.1.7.1 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    M = int(next(tokens))  # type: int
    A = [int()] * (M)  # type: "List[int]"
    B = [int()] * (M)  # type: "List[int]"
    for i in range(M):
        A[i] = int(next(tokens))
        B[i] = int(next(tokens))
    solve(N, M, A, B)

if __name__ == '__main__':
    main()


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

a.sort(reverse=True)

a.pop(0)
for i in range(n):
    a.pop(-1)

count = 0
for i in range(len(a)):
    if i % 2 == 0:
        count += a[i]
    else:
        continue

print(count)

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

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repi(i, a, b) for (int i = (a); i < int(b); i++)
#define all(a) (a).begin(), (a).end()
#define bit(b) (1ull << (b))

using namespace std;
using i32 = int;
using i64 = long long;
using f64 = double;
using vi32 = vector<i32>;
using vi64 = vector<i64>;
using vf64 = vector<f64>;
using vstr = vector<string>;

template<typename T, typename S> void amax(T &x, S y) { if (x < y) x = y; }
template<typename T, typename S> void amin(T &x, S y) { if (y < x) x = y; }

i32 n;
vi64 a, S;

i32 idx(i32 a, i32 b) {
  i32 l = a, r = b;
  while (true) {
    i32 m = (l + r) / 2;
    i64 x = abs((S[b] - S[m - 1]) - (S[m - 1] - S[a]));
    i64 y = abs((S[b] - S[m]) - (S[m] - S[a]));
    i64 z = abs((S[b] - S[m + 1]) - (S[m + 1] - S[a]));
    if (x >= y && y <= z) return m;
    if (x <= y) r = m;
    else l = m;
  }
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(16);
  cin >> n;
  a = vi64(n); rep(i, n) cin >> a[i];
  S = vi64(n + 1);
  partial_sum(all(a), S.begin() + 1);
  i64 ans = 1e18;
  repi(k, 2, n - 1) {
    i32 a = idx(0, k);
    i32 b = idx(k, n);
    vi64 v = {S[a], S[k]-S[a], S[b]-S[k], S[n]-S[b]};
    sort(all(v));
    amin(ans, v[3]-v[0]);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3456
import java.io.*;
import java.text.*;
import java.util.*;

public class Main {

    static InputReader sc = new InputReader(System.in);
    static PrintWriter out = new PrintWriter(System.out);

    public static void main(String[] args) throws IOException {
        solver s = new solver();
        int t = 1;
        while (t > 0) {
            s.solve();
            t--;
        }
        out.close();
    }

    static class InputReader {

        public BufferedReader br;
        public StringTokenizer token;

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

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

        public int ni() {
            return Integer.parseInt(sn());
        }

        public String snl() throws IOException {
            return br.readLine();
        }

        public long nlo() {
            return Long.parseLong(sn());
        }

        public double nd() {
            return Double.parseDouble(sn());
        }

        public int[] na(int n) {
            int a[] = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = sc.ni();
            return a;
        }

        public long[] nal(int n) {
            long a[] = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = sc.nlo();
            return a;
        }
    }

    static int inf = 5000013;

    static class solver {
        DecimalFormat df = new DecimalFormat("0.00000000");
        long maxi = Integer.MAX_VALUE;

        void solve() {
            int n = sc.ni();
            long a[][] = new long[n][3];
            for (int i = 0; i < n; i++) {
                a[i][0] = sc.nlo();
                a[i][1] = sc.nlo();
                a[i][2] = sc.nlo();
            }
            long dp[][] = new long[n][3];
            dp[0][0] = a[0][0];
            dp[0][1] = a[0][1];
            dp[0][2] = a[0][2];
            for (int i = 1; i < n; i++) {
                for (int j = 0; j < 3; j++) {
                    int x = (j + 1) % 3;
                    int y = (j + 2) % 3;
                    dp[i][j] = Math.max(dp[i][j], a[i][j] + Math.max(dp[i - 1][x], dp[i - 1][y]));
                }
            }
            out.println(Math.max(dp[n - 1][0], Math.max(dp[n - 1][1], dp[n - 1][2])));
        }
    }
}


Measured memory_bytes: 52116
#include<bits/stdc++.h>
using namespace std;
#define maxn 100020
#define rep(i,l,r) for(register int i = l ; i <= r ; i++)
#define repd(i,r,l) for(register int i = r ; i >= l ; i--)
#define rvc(i,S) for(register int i = 0 ; i < (int)S.size() ; i++)
#define rvcd(i,S) for(register int i = ((int)S.size()) - 1 ; i >= 0 ; i--)
#define fore(i,x)for (register int i = head[x] ; i ; i = e[i].next)
#define pb push_back
#define prev prev_
#define stack stack_
#define mp make_pair
#define fi first
#define se second
#define inf 0x3f3f3f3f
typedef long long ll;
typedef pair<int,int> pr;

int id,n,a[maxn];
double sum;

int main(){
	scanf("%d",&n);
	rep(i,0,n - 1) scanf("%d",&a[i]) , sum += a[i];
	sum /= n;
	int id = 0;
	rep(i,1,n - 1){
		if ( abs(sum - a[i]) < abs(sum - a[id]) ) id = i;
	}
	cout<<id<<endl;
}


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

using lint = int64_t;
#define bit(n) ((lint)1 << n);
const int INF = 1e9;
const lint LINF = 1e18;

const lint MOD = 1e9 + 7;
// const lint MOD = 998244353;

class IoSetup {
    public:
    IoSetup() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(12);
        cerr << fixed << setprecision(12);
    }
} iosetup;

template <typename T, typename U>
T power(T n, U p) {
    T res = 1;
    while (p > 0) {
        if (p % 2 == 1) res *= n;
        n *= n; p /= 2;
    }
    return res;
}

template <lint mod>
class ModInt {
    lint val;
    public:
    ModInt(): val(0) {}
    ModInt(lint init_val):
        val((init_val % mod + mod) % mod) {}

    ModInt operator -() {return ModInt(-val);}
    bool operator !() {return val == 0;}
    ModInt& operator ++() {this->val = (this->val + 1) % mod; return *this;}
    ModInt operator ++(int) {ModInt temp = *this; this->val = (this->val + 1) % mod; return temp;}
    ModInt& operator --() {
        this->val = ((this->val - 1) % mod + mod) % mod; return *this;}
    ModInt operator --(int) {
        ModInt temp = *this; this->val = ((this->val - 1) % mod + mod) % mod; return temp;}
    
    ModInt& operator += (const ModInt that) {val = (val + that.val) % mod; return *this;}
    ModInt& operator -= (const ModInt that) {val = ((val - that.val) % mod + mod) % mod; return *this;}
    ModInt& operator *= (const ModInt that) {val = (val * that.val) % mod; return *this;}
    ModInt& operator /= (const ModInt that) {
        lint res = 1, n = that.val, p = mod - 2;
        while (p > 0) {
            if (p % 2 == 1) res = res * n % mod;
            n = n * n % mod; p /= 2;
        }
        val = val * res % mod; return *this;
    }

    bool operator == (const ModInt& that) {return val == that.val;}
    bool operator != (const ModInt& that) {return val != that.val;}
    ModInt operator + (const ModInt& that) {return ModInt(*this) += that;}
    ModInt operator - (const ModInt& that) {return ModInt(*this) -= that;}
    ModInt operator * (const ModInt& that) {return ModInt(*this) *= that;}
    ModInt operator / (const ModInt& that) {return ModInt(*this) /= that;}

    friend istream& operator >> (istream& is, ModInt& a) {
        lint val; cin >> val; a = ModInt(val); return is;}
    friend ostream& operator << (ostream& os, const ModInt& a) {
        return os << a.val;}
};
using mint = ModInt<MOD>;
// using mint = double;

int main() {
    string s;
    cin >> s;
    int n = s.size();

    mint ans = 0;
    int one = 0;
    for (int i = 0; i < n; i++) {
        if (s[i] == '1') {
            ans += power((mint)2, one) * power((mint)3, n - i - 1);
            one++;
        }
    }
    ans += power((mint)2, one);

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

Measured memory_bytes: 512
D=int(input())
c=list(map(int,input().split()))
s=[]
for _ in range(D):
    ss=list(map(int,input().split()))
    s.append(ss)
pl=-1
for i in range(D):
    sss=s[i]
    a=sss.index(max(sss))
    if a == pl:
      tekito = sorted(sss)[-2]
    pl = a
    print(a+1)


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

int main(){
	int n,i,a[55],count=0;
	scanf("%d",&n);
	for(i=1;i<=n;i++){
		scanf("%d",&a[i]);
		if(a[i]!=i)count++;
	}
	if(count==0||count==2)printf("YES\n");
	else printf("NO\n");
	return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<algorithm>
using namespace std;
typedef long long ll;
ll fx,fy,num=0,siz=0,r,n,x,y,lim,l,z,i,m,q,c[2][100005],tot=0,dsu[100005],vis[100005];
ll getf(ll x){return dsu[x]==x?x:dsu[x]=getf(dsu[x]);}
ll wan(ll x){return x*(x-1LL)/2LL;}
int main()
{
	scanf("%lld%lld%lld",&n,&m,&q);
	for(i=1;i<=n;i++)dsu[i]=i;
	for(i=1;i<=q;i++)
	{
		scanf("%lld%lld%lld",&x,&y,&z);
		x++;y++;
		if(z==0)
		{
			vis[x]=vis[y]=1;
			fx=getf(x);
			fy=getf(y);
			if(fx!=fy)dsu[fx]=fy;
		}
		else
		{
			tot++;
			c[0][tot]=x;
			c[1][tot]=y;
		}
	}
	for(i=1;i<=tot;i++)
	{
		fx=getf(c[0][i]);fy=getf(c[1][i]);
		if(fx==fy)
		{
			printf("No\n");
			return 0;
		}
	}
	for(i=1;i<=n;i++)
	{
		if(vis[i])siz++;
		if(vis[i]&&getf(i)==i)num++;
	}
	if(m==n-1)
	{
		if(tot==0)printf("Yes\n");
		else printf("No\n");
		return 0;
	}
	lim=siz-num+wan(num+n-siz);
	if(m<=lim)printf("Yes\n");
	else printf("No\n");
	return 0;
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
 
int main () {
  int n;
  cin >> n;
  
  vector<int>vec(n);
  for(int i=0;i<n;i++){
    cin >> vec[i] ;
  }
    
    sort(vec.begin(),vec.end());
    
    cout << vec[n-1]-vec[0] << endl;
}

Measured memory_bytes: 256
from collections import Counter

N=input()
list1=list(map(int,input().split()))
dict1=Counter(list1)

key1=list(dict1.keys())
value1=list(dict1.values())

ans=0
for i in range(len(key1)):
    x=value1[i]
    y=key1[i]
    if x>=y:
        ans+=x-y
    else:
        ans+=x

print(ans)

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

using ll = long long;
using ld = long double;
using vi = vector<int>;
using vll = vector<ll>;
using P = pair<int, int>;

constexpr int INF = 1e9;
constexpr ll INFLL = 1e18;
constexpr int MOD = 1e9 + 7;
const ld PI = acosl(-1);

#define rep(i,n) for(int i=0; i<(n); ++i)
#define all(n) n.begin(),n.end()

int main(){
    ios::sync_with_stdio(false); cin.tie(nullptr);
    //cout << fixed << setprecision(6);
    char c; cin >> c;
    if(c >= 'A' && c <= 'Z'){
        cout << "A" << endl;
    } else {
        cout << "a" << endl;
    }
    return 0;
}

Measured memory_bytes: 3608
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		
		N *= 4;
		
		if(Q * 2 < H) H = Q * 2;
		if(H * 2 < S) S = H * 2;
		if(S * 2 < D) D = S * 2;
		
		long ans = 0;
		ans += (N/8) * D;
		N %= 8;
		ans += (N/4) * S;
		N %= 4;
		ans += (N/2) * H;
		N %= 2;
		ans += N * Q;
		Console.WriteLine(ans);
		
		
	}
	long Q,H,S,D;
	long N;
	public Sol(){
		var d = rla();
		Q = d[0]; H = d[1]; S = d[2]; D = d[3];
		N = rl();
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}


Measured memory_bytes: 11092
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;typedef vector<ll> vll;
#define fill(a) memset(a, 0, sizeof (a))
#define all(v) (v).begin(),(v).end()
#define sp(k) cout<<setprecision(k)<<fixed;
#define rep(i,a) for(int i=0; i<a;i++)
#define rep1(i,a,b) for(int i=(a);i<=(b);++i)
#define irep(i,b,a) for(int i=(b);i>=(a);--i)
#define minv(v) *min_element(v.begin(),v.end())
#define maxv(v) *max_element(v.begin(),v.end())
#define each(it,s) for(auto it = s.begin(); it != s.end(); ++it)
#define unq(v) sort(all(v)),(v).erase(unique((v).begin(),(v).end()),(v).end())
#define getpos(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define _ios ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define ff first
#define ss second
#define pb push_back

const double pi = acos(-1.0);
const int mod = 1000000007; // (int)1e9+7
const int maxn = 2000100;

int main(){
        _ios;
        char ch;
        cin>>ch;
        cout<<++ch<<endl;




return 0;
}







Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
template <typename T>
using indexed_set =
    tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define int long long
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define in insert
#define fi first
#define se second
#define lb lower_bound
#define ub upper_bound
#define sz(v) (int)(v.size())
#define all(x) x.begin(), x.end()
#define allr(x) x.rbegin(), x.rend()
#define mem(a, s) memset(a, s, sizeof(a))
#define rep(i, a, b) for (int i = a; i <= b; ++i)
#define repr(i, a, b) for (int i = a; i >= b; --i)
#define MAX 8000000000000000064LL
#define MIN -8000000000000000064LL
typedef vector<int> vi;
typedef stack<int> sti;
typedef queue<int> qi;
typedef pair<int, int> pii;
typedef set<int> si;
typedef map<int, int> mii;
typedef vector<pii> vpi;
const int mod = 998244353;
ll add(ll a, ll b) { return (a % mod + b % mod + ((MAX) / mod) * mod) % mod; }
ll sub(ll a, ll b) { return (a % mod - b % mod + ((MAX) / mod) * mod) % mod; }
ll mul(ll a, ll b) {
    return ((a % mod) * (b % mod) + ((MAX) / mod) * mod) % mod;
}
ll lcm(ll a, ll b) { return (a * b) / __gcd(a, b); }
ll fact[1000007] = {0};
ll expo(ll x, ll y) {
    ll res = 1;
    x = x % mod;
    while (y > 0) {
        if (y & 1)
            res = (1ll * res * x) % mod;
        y = y >> 1;
        x = (1ll * x * x) % mod;
    }
    return res;
}
void facto() {
    fact[0] = 1;
    fact[1] = 1;
    for (ll i = 2; i < 1000007; i++)
        fact[i] = (fact[i - 1] * i) % mod;
}
ll ncr(ll n, ll r) {
    ll res = 1;
    res = fact[n];
    res = (res * (expo(fact[r], mod - 2))) % mod;
    res = (res * (expo(fact[n - r], mod - 2))) % mod;
    return res;
}
ll npr(ll n, ll r) {
    facto();
    ll res = 1;
    res = fact[n];
    res = (res * (expo(fact[n - r], mod - 2))) % mod;
    return res;
}
int _x[] = {0, 0, -1, 1, -1, 1, -1, 1};
int _y[] = {-1, 1, 0, 0, 1, -1, -1, 1};
void solve();
void pre();
int32_t main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    pre();
    int t = 1;
    // cin >> t;
    rep(i, 1, t) { solve(); }
    return 0;
}
void pre() {}
void solve() {
    int n, k;
    cin >> n >> k;
    int l[k], r[k];
    rep(i, 0, k - 1) { cin >> l[i] >> r[i]; }
    int dp[n + 1];
    mem(dp, 0);
    dp[0] = 0, dp[1] = 1;
    rep(i, 2, n) {
        rep(j, 0, k - 1) {
            if ((i - l[j]) >= 1) {
                dp[i] = add(dp[i], dp[i - l[j]]);
                dp[i] = sub(dp[i], dp[max(0LL, i - r[j] - 1)]);
            }
        }
        if (i == n) {
            cout << dp[n] << " ";
            return;
        }
        dp[i] = add(dp[i], dp[i - 1]);
    }
}

Measured memory_bytes: 5196
#include<stdio.h>

int main(){
  long long K; scanf("%lld", &K);
  
  int N = 50;
  long long a[N];
  for(int i = 0; i < N; i++){
    a[i] = N + K / N - 1;
    if(i < K % N) a[i]++;
    else a[i] -= K % N;
  }
  
  printf("%d\n", N);
  for(int i = 0; i < N - 1; i++) printf("%lld ", a[i]);
  printf("%lld\n", a[N - 1]);
  
  return 0;
}

Measured memory_bytes: 128
open System.Collections.Generic
open System.Linq

let n, m = stdin.ReadLine().Split()|> fun [| n; m; |] -> int n, int m
let abArray :(int*int)[] = 
    [|1..m|] |> Array.map (fun _ -> stdin.ReadLine().Split() |> fun [| a; b; |] -> int a, int b)

/// 計算のため逆方向の道も作成
let abArray2 abArray = abArray |> Array.collect (fun (a, b) -> [| (a, b); (b, a) |] )

/// 部屋番号とそれに対応する道しるべを持つmapを作成
let makeDirectionMap (abArray2 :(int*int)[]) =
    let abLookup = abArray2.ToLookup(fun (a, b) -> a)
    let goneNo = new HashSet<int>([1])
    let notGoneNo = new HashSet<int>({2..n})
    let tmpDirectionMap = new Dictionary<int,int>()

    let rec makeDirectionMap (nos:Set<int>) =
        let nosPairs :(int*int)[] = 
            nos|> Seq.collect (fun no -> abLookup.[no]) |> Seq.filter (fun (_ , x) -> notGoneNo.Contains(x) ) |>Seq.toArray
        nosPairs |> Seq.iter (fun (x1, x2) -> 
            goneNo.Add x2 |> ignore
            notGoneNo.Remove x2 |> ignore
            tmpDirectionMap.TryAdd(x2,x1)|>ignore)
        if not (nosPairs.Any()) then tmpDirectionMap
        else makeDirectionMap (nosPairs |> Seq.map snd |> set) 

    makeDirectionMap (set [1])

let directionMap = abArray |> abArray2 |> makeDirectionMap
stdout.WriteLine "Yes"
[2..n] |> List.iter (fun i -> stdout.WriteLine(string directionMap.[i]))


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

using namespace std;

const char LIST[3] = {'7', '5', '3'};

// 再帰用
void rekkyo(vector<string> &v, string head, int n) {
	v.emplace_back(head);
	if(n == 0) {
		return;
	}

	for(char c : LIST) {
		rekkyo(v, head + c, n - 1);
	}
}

// n桁以下の3,5,7からできる文字列をvに格納する
void rekkyo(vector<string> &v, int n) {
	for(char c : LIST) {
		rekkyo(v, string({c}), n - 1);
	}
}

bool with753(string s) {
	for(char c : LIST) {
		if(s.find(c, 0) == s.npos) {
			return false;
		}
	}
	return true;
}

bool lesseq(string s, int n) {
	return stoi(s, nullptr, 10) <= n;
}

int keta(int n) {
	int result = 0;
	while(n > 0) {
		result++;
		n /= 10;
	}
	return result;
}

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

	vector<string> list;
	rekkyo(list, keta(N));

	int result = 0;
	for(const auto &s : list) {
		if(with753(s) && lesseq(s, N)) {
			result++;
		}
	}

	cout << result << endl;

	return 0;
}


Measured memory_bytes: 2172
/******************************************
* AUTHOR : GURUTEJA *
******************************************/
#include <bits/stdc++.h>
using namespace std;
#define LL long long
#define N 100005
#define MOD 1000000007
#define dd double
#define rep(i, n) for(int i = 0; i < n; i++)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define rep1(i,b) for(int i=1;i<=b;i++)
#define pb push_back
#define mp make_pair
#define clr(x) x.clear()
#define sz(x) ((int)(x).size())
#define F first
#define S second

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

}

  int main() {
    debug();
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n,t,s;
    cin>>n>>t>>s;
    if(t*s>=n){
    	cout<<"Yes"	<<endl;
    }else{
    	cout<<"No"<<endl;
    }
    return 0;
  }

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

#define INF INT_MAX
typedef long long ll;

using namespace std;

int main(void){
	string s;
	cin >> s;

	bool flag = false;
	for(int i = 0;i < s.size() - 1;i++){
		if(s[i] == 'A' && s[i+1]== 'C'){
			flag = true;
		}
	}

	if(flag){
		cout << "Yes" << endl;
	}else{
		cout << "No" << endl;
	}
	return 0;
}

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

bool search_x(int x, vector<int> p){
    for (int i = 0; i < p.size(); i++) {
        if (x == p.at(i))
            return true;
    }
    return false;
}

int main()
{
    int x, n;
    cin >> x >> n;
    vector<int> p(n);
    for (int i = 0; i < n; i++) {
        cin >> p[i];
    }
    int i = 0, j = 0;
    if (n == 0) {
        cout << x << endl;
        return 0;
    }

    while (search_x(x + i, p)) {
        i++;
    }
    while (search_x(x - j, p)) {
        j++;
    }
    if (i == j)
        cout << x - j << endl;
    else if (i < j)
        cout << x + i << endl;
    else
        cout << x - j << endl;
}

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

int main(){
    int N,A;
    cin >> N >> A;
    int ans = N % 500;
    if(A >= ans){
        cout << "Yes" << '\n';
    }else{
        cout << "No" << '\n';
    }
    return 0;
}

Measured memory_bytes: 3568
import java.util.Scanner;

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

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

		if (b - a <= 0) {
			System.out.print("delicious");
		} else if (b - a > 0 && b - a <= x) {
			System.out.print("safe");
		} else {
			System.out.print("dangerous");
		}

	}
}

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

const ll INF = 1e18;
const ll MOD = 1000000007;
const ll MX = 0; //最大値

ll dp[MX][MX];
inline void chmax(ll& a, ll b) {
  a = max(a, b);
}

#define rep(i,n) for(ll i=0; i<(ll)(n); i++)
#define ALL(x) (x).begin(),(x).end()
#define SIZE(x) ((ll)(x).size()) //sizeをsize_tからllに直しておく
#define MAX(x) *max_element(ALL(x))
#define PB push_back


int main() {
    ll n,k;
    cin >> n >> k;
    vector<ll> a(n), b;
    rep(i, n) {
        cin >> a.at(i);
    }
    set<ll>st;
    ll cnt = 1, c = 1;
    
    while(bool ans = true){
        st.insert(c);
        if (cnt == st.size()){
            b.PB(c);
            cnt++;
        }
        else break;
        c = a.at(c-1);
    }
    

    auto itr = find(b.begin(), b.end(), c);
	ll index = distance(b.begin(), itr);
	
	ll z = -1;
	if (b.size() <= k) {
	   z = (k-index) % (cnt - 1 - index);
	   z = b.at(z+index);
	}
	else z = b.at(k);
	cout << z << endl;
}

Measured memory_bytes: 15432
#include<cstdio>
#include<iostream>
#include<cstring>
#define LL long long
#define int long long  
using namespace std;
const int MAXN = 2001;
inline LL read() {
	char c = getchar(); LL x = 0, f = 1;
	while(c < '0' || c > '9') {if(c == '-') f = -1; c = getchar();}
	while(c >= '0' && c <= '9') x = x * 10 + c - '0', c = getchar();
	return x * f;
}
LL A, B;
int a[MAXN], b[MAXN], N, M;
int Get(int x, int *a) {
	int mx = 0;
	for(int i = 0; i <= 60; i++) {
		if(x & (1ll << i)) mx = i;
		a[i] = (bool)(x & (1ll << i));
	}
	return mx;
}
main() {
	A = read(); B = read();
	if(A == B) {puts("1"); return 0;}
	N = Get(A, a); 
	M = Get(B, b);
	//for(int i = 0; i <= M; i++) 
	//	printf("%d", b[i]);
	int r = 0, p = 0;
	for(int i = M; i >= 0; i--)
		if(a[i] != b[i]) {r = i; break;}
	bool flag = 0;
	for(int i = r -1; i >= 0; i--)
		if(b[i]) {p = i; flag = 1; break;}
	//printf("%d %d\n", r, p);
	if(!flag) p = -1;
	A = 0; B = 0;
	for(int i = 0; i <= r; i++) {
		if(a[i]) A += (1ll << i);
		if(b[i]) B += (1ll << i); 		
	}
 
	int al = A, ar = (1ll << r) + (1ll << (p + 1)) - 1;
	int ll = A + (1ll << r), rr = (1ll << (r + 1)) - 1;
    if(ar < ll) cout << ar - al + 1 + rr - ll + 1;
    else cout << rr - al + 1;
    //cout << max(ar, B) - A + 1;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void){
  int a,b,c;
  cin >> a >> b >> c;
  bool ans = false;
  
  for(int i=b;i<=c;i++){
    if(i % a == 0) ans = true;
  }
  
  if(ans) cout << "OK" << endl;
  else cout << "NG" << endl;
  
  return 0;
}


Measured memory_bytes: 3636
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<functional>
#include<map>
#include<cstdlib>
#include<complex>
#include<numeric>
#include<set>
#include<deque>

using namespace std;
using Int = long long;
Int INF = 1LL << 60;
const Int MOD = 1000000000 + 7;

template<int Modulo = MOD> struct Mint {
	Int val;
	constexpr Mint(Int v = 0) noexcept : val(v% Modulo) {
		if (val < 0) v += Modulo;
	}
	constexpr int getmod() { return Modulo; }
	constexpr Mint operator - () const noexcept { return val ? Modulo - val : 0; }
	constexpr Mint operator + (const Mint& r) const noexcept { return Mint(*this) += r; }
	constexpr Mint operator - (const Mint& r) const noexcept { return Mint(*this) -= r; }
	constexpr Mint operator * (const Mint& r) const noexcept { return Mint(*this) *= r; }
	constexpr Mint operator / (const Mint& r) const noexcept { return Mint(*this) /= r; }
	constexpr Mint& operator += (const Mint& r) noexcept {
		val += r.val;
		if (val >= Modulo) val -= Modulo;
		return *this;
	}
	constexpr Mint& operator -= (const Mint& r) noexcept {
		val -= r.val;
		if (val < 0) val += Modulo;
		return *this;
	}
	constexpr Mint& operator *= (const Mint& r) noexcept {
		val = val * r.val % Modulo;
		return *this;
	}
	constexpr Mint& operator /= (const Mint& r) noexcept {
		Int a = r.val, b = Modulo, u = 1, v = 0;
		while (b) {
			Int t = a / b;
			a -= t * b; swap(a, b);
			u -= t * v; swap(u, v);
		}
		val = val * u % Modulo;
		if (val < 0) val += Modulo;
		return *this;
	}
	constexpr bool operator == (const Mint& r) const noexcept {
		return this->val == r.val;
	}
	constexpr bool operator != (const Mint& r) const noexcept {
		return this->val != r.val;
	}
	friend ostream& operator << (ostream& os, const Mint<Modulo>& x) noexcept {
		return os << x.val;
	}
	friend istream& operator >> (istream& is, Mint<Modulo>& x) noexcept {
		Int tmp; is >> tmp;
		x = Mint<Modulo>(tmp);
		return is;
	}
	friend constexpr Mint<Modulo> modpow(const Mint<Modulo>& a, Int n) noexcept {
		Mint res(1), tmp = a;
		while (n > 0) {
			if (n & 1) res *= tmp;
			tmp *= tmp;
			n >>= 1;
		}
		return res;
	}
};

using mint = Mint<>;

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	Int N;
	cin >> N;

	vector<Int> num(N + 1);
	for (Int i = 0; i < N+1; i++) {
		num[i] = i;
	}

	vector<Int> cnt(N + 1);

	Int temp;
	for (Int j = 2; j < N+1; j++) {
		if (num[j] != 1) {
			temp = num[j];
			for (Int i = j; i < N + 1; i++) {
				while (num[i] % temp == 0) {
					cnt[temp]++;
					num[i] /= temp;
				}
			}
		}
	}

	mint ans = 1;
	for (Int i = 0; i < N+1; i++) {
		if(cnt[i])ans *= (cnt[i] + 1);
	}
	cout << ans << "\n";
}

Measured memory_bytes: 256
open System
let readInt () = stdin.ReadLine() |> int
let readIntArray () = stdin.ReadLine().Split(' ') |> Array.map int

let [| N; A; B |] = readIntArray ()

let digSum n =
    n
    |> string
    |> Seq.sumBy (fun c -> int c - int '0')

[1..N]
|> Seq.sumBy (fun v -> if (digSum v >= A) && (digSum v <= B) then v else 0)
|> printfn "%d"


Measured memory_bytes: 14300
from itertools import combinations

N = int(input())
prime = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47]


def count(p, N, n=1):
    if p**n > N:
        return 0
    return N//(p**n) + count(p, N, n+1)


n_prime = [count(p, N) for p in prime]

ret = 0

## 5 x 5 x 3 = 75
gt4 = [n for n in n_prime if n >= 4]
gt2 = [n for n in n_prime if n >= 2]
ret += len(list(combinations(gt4, 2))) * (len(gt2)-2)

## 15 x 5 = 75
gt14 = [n for n in n_prime if n >= 14]
gt4 = [n for n in n_prime if n >= 4]
ret += len(gt14) * (len(gt4)-1)

## 25 x 3 = 75
gt24 = [n for n in n_prime if n >= 24]
gt2 = [n for n in n_prime if n >= 2]
ret += len(gt24) * (len(gt2)-1)

## 75 = 75
gt74 = [n for n in n_prime if n >= 74]
ret += len(gt74)

print(ret)

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

//g++ -g -o yourexe yourfile.cpp
//./yourexe < yourinput.in > youroutput.out

#define fast ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

#define M 201

#define ll long long
#define ld long double
#define vi vector<ll>
#define pi pair<ll, ll>
#define vii vector<pi>
#define vvi vector<vi>
#define pb push_back
#define endl "\n"
#define ff first
#define ss second

#define REP(i, s, e) for (ll i = s; i < e; i++)
#define RREP(i, s, e) for (ll i = s; i > e; i--)

#define all(v) v.begin(), v.end()
#define print(v) REP(i,0,v.size())cout<<v[i]<<" ";


int main() {
    fast
    ll t;
    //cin>>t;
    t=1;
    while(t--){
      ll a,b;
      cin>>a>>b;
      cout<<a*b<<endl;
    }
    return 0;
}


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


int main() {
  int n;
  cin >> n;
  cout << n / 3;
  return 0;
}

Measured memory_bytes: 3628
#include <iostream>

int main ()
{
  int i = 0, o = 0;
  std::cin >> i;
  
  int d = i / 500;
  o += d * 1000;
  i %= 500;
  
  int e = i / 5;
  o += e * 5;
  // i %= 5;
  
  std::cout << o << std::endl;
  
  return 0;
}



Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] array = new int[n];
		for(int i = 0;i < n;i++) {
			array[i] = sc.nextInt();
		}
		int answer = 0;
		boolean sameFlag = false;
		for(int i = 0;i < n;i++) {
			if(i +1 == array[i]) {
				if(sameFlag) {
					sameFlag = false;
				}else {
					answer++;
					sameFlag = true;
				}

			}else {
				sameFlag = false;
			}
		}
		System.out.println(answer);
	}
}

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

int main()
{
    ll i, j, k, n, temp, sum=0;
    cin>>n;
    for(i=1;i<=n;i++)
    {
        for(j=1;j<=n;j++)
        {
            for(k=1;k<=n;k++)
            {
                temp=__gcd(i, j);
                sum+=__gcd(temp, k);
            }
        }
    }
    cout<<sum<<endl;

    return 0;
}


Measured memory_bytes: 3620
// Vicfred
// https://atcoder.jp/contests/abc161/tasks/abc161_b
// simulation
import std.algorithm;
import std.array;
import std.conv;
import std.stdio;

void main() {
    int n, m;
    readf("%s %s\n", &n, &m);

    int[] a = readln.split.map!(to!int).array;

    int s = sum(a);

    int answer = 0;
    foreach(votes; a)
        if(4*m*votes >= s)
            answer += 1;

    if(answer >= m)
        "Yes".writeln;
    else
        "No".writeln;
}



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

namespace AtCoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var S = Console.ReadLine();
            if (Test(S)) Console.WriteLine("AC");
            else Console.WriteLine("WA");
        }

        static bool Test(string S)
        {
            if (S[0] != 'A') return false;
            if (S.ToCharArray().Skip(2).Reverse().Skip(1).Where(x => x == 'C').Count() != 1) return false;
            if (!S.Replace("A", "").Replace("C", "").ToCharArray().All(x => char.IsLower(x))) return false;
            return true;
        }
    }
}


Measured memory_bytes: 13396
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<queue>
#include<map>
#include<vector>
#include<functional>
#include <random>

using namespace std;


int main(void) {
	int N, K, A[100000];
	scanf("%d %d", &N, &K);
	for (int i = 0; i < N; i++) {
		scanf("%d", &A[i]);
	}

	int ans = 0;

	while (ans * K - ans + 1 < N) {
		ans++;
	}
	printf("%d\n", ans);

}









Measured memory_bytes: 512
# D
# maspyの解答
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
from collections import deque
 
S = deque(readline().rstrip().decode())
Q = int(readline())
query = readlines()
 
rev = False
for q in query:
    if q[0] == ord('1'):
        rev = not rev
    else:
        _, f, c = q.decode().split()
        f = int(f)
        if rev ^ (f == 1):
            S.appendleft(c)
        else:
            S.append(c)
 
T = ''.join(S)
if rev:
    T = T[::-1]
print(T)

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

int main(){
    int W,H,N;
    cin>>W>>H>>N;
    int xL=0, xR=W, yL=0, yR=H;
    rep(i, N){
        int x,y,a;
        cin>>x>>y>>a;
        if(a == 1) xL = max(x, xL);
        if(a == 2) xR = min(x, xR);
        if(a == 3) yL = max(y, yL);
        if(a == 4) yR = min(y, yR);
    }

    cout << ((xR-xL)<=0 || (xR-xL)<= 0 ? 0 : (xR-xL)*(yR-yL))  << endl;
}


Measured memory_bytes: 3612
#include <cstdio>
#define N 3010
#define mod 1000000007
int n,m,f[N][N][2],ans;
int main(){
	scanf("%d%d",&n,&m);
	f[0][0][1]=1;
	for(int i=1;i<=n;++i) f[0][i][0]=1;
	for(int i=0;i<m;++i){
		for(int j=0;j<=n;++j){
			for(int k=0;k<=1;++k){
				if(j) f[i+1][j-1][k|(j==1)]=(f[i+1][j-1][k|(j==1)]+f[i][j][k])%mod;
				if(j) f[i+1][j][k|(j==1)]=(f[i+1][j][k|(j==1)]+f[i][j][k])%mod;
				if(n-j) f[i+1][j][k]=(f[i+1][j][k]+f[i][j][k])%mod;
				if(n-j) f[i+1][j+1][k]=(f[i+1][j+1][k]+f[i][j][k])%mod;
			}
		}
	}
	for(int i=0;i<=n;++i) ans=(ans+f[m][i][1])%mod;
	printf("%d",ans);
	return 0;
}

Measured memory_bytes: 70784
O=input()
E=input()
 
ans=""
if len(O)-len(E)==0:
    for i in range(len(O)):
        ans+=(O[i]+E[i])
 
else:
    ans+=O[0]
    for i in range(len(E)):
        ans+=(E[i]+O[i+1])
 
print(ans)


Measured memory_bytes: 2940
#include <bits/stdc++.h>
#define itn int
#define REP(i, n) for (ll i = 0; i < n; i++)
#define IREP(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(a, b) for (ll i = a; i < b + 1; i++)
#define all(v) v.begin(), v.end()
using namespace std;
typedef long long ll;

const ll INF = 1LL << 60;
const ll MOD = 1000000007;
template<class T> inline bool chmin(T &a, T b){if (a > b){a = b;return true;}return false;}
template<class T> inline bool chmax(T &a, T b){if (a < b){a = b;return true;}return false;}


int main(){
    ll h;
    cin >> h;
    ll ans=0;
    ll now=1;
    while(h>0){
        ans+=now;
        h/=2;
        now*=2;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256