akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<set>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep1(i, n) for(int i = 1; i < (int)(n); i++)

#include <algorithm>
using namespace std;
#include <cmath>
#include <string>
#include<vector>
#define elif else if
typedef long long ll;
#define TENNINE 1000000005
#define TENFIVE 200005
int N;

int main(){
    cin>>N;
    ll ans =0;
    rep(i,N){
        int tmp;
        cin>>tmp;
        ans+= tmp-1;
    }
    cout<<ans<<endl;


    
}

Measured memory_bytes: 256
N = int(input())
S = input()

# T[i]: i番目より左の'E'の個数
T = [0] * N
for i in range(1,N):
  T[i] = T[i-1]
  if S[i-1] == 'E':
    T[i] += 1

# U[i]: i番目より右の'W'の個数
U = [0] * N
for i in range(N-1,0,-1):
  U[i-1] = U[i]
  if S[i] == 'W':
    U[i-1] += 1

ans = N
for i in range(N):
  tmp = N- 1 - T[i] - U[i] 
  if tmp < ans:
    ans = tmp
print(ans)

Measured memory_bytes: 19600
a=int(input())
l=[a]
b=True
i=1
while b==True:
  if a%2==0:
    a=a//2
  else:
    a=3*a+1
  if a in l:
    b=False
    print(i+1)
    exit
  else:
    l.append(a)
    i+=1

Measured memory_bytes: 2940
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>

using namespace std; 

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

typedef long long ll;

int main()
{
    int n;
    cin >>n;
    char s[n];
    
    REP(i,n)
    cin >> s[i];
    int flag =0;
    REP(i,n)
    {
         if((s[i]=='A')&&(s[i+1]=='B')&&(s[i+2]=='C'))
         flag++;
    }
    cout<<flag;
    return 0;
}



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


int main() {
  int N;
  cin >> N;
  vector<string> s(N);
  vector<int> t(N);
  for(int i=0;i<N;++i){
    cin >> s.at(i) >> t.at(i);
  }
  string x;
  cin >> x;

  int j;
  for(int i=0;i<N;++i){
    if(s.at(i)==x){
      j=i;
      break;
    }
  }
  int ret;
  for(int i=j+1;i<N;++i){
    ret = ret+t.at(i);
  }
  cout << ret << endl;
}


Measured memory_bytes: 256
#include <string>
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <vector>
#include <cmath>
#define rep(i,n) for(int i = 0; i < (n); i++)
using namespace std;

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

int main()
{
    int n;
    cin >> n;
    long long tot = 0;
    for(int i = 1; i <= n; i++){
        for(int j = i; j <= n; j++){
            for(int k = j; k <= n; k++){
                int gcdValue = gcd(i,j);
                gcdValue = gcd(gcdValue, k);
                if(i == j && j == k) tot += gcdValue;
                else if (i != j && j != k && k != i) tot += gcdValue * 6;
                else tot += gcdValue * 3;
            }
        }
    }

    cout << tot << endl;
    return 0;
}

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

long long int saiki( long long int N, long long int K, long long int S, long long int now ) {
	if( K == 0 ) {
		return S == 0;
	}
	long long int ret = 0;
	for( long long int i = now + 1; i <= N&&S - i >= 0; i++ ) {
		ret += saiki( N, K - 1, S - i, i );
	}
	return ret;
}

int main() {
	long long int N, K, S;
	while( cin >> N >> K >> S, N || K || S ) {
		cout << saiki( N, K, S, 0 ) << endl;
	}
}

Measured memory_bytes: 3080
#include<iostream>
#include<algorithm>
#include<limits>
#include<iomanip>
#include<string>
#include<map>
#include<vector>
#include<string.h>

using namespace std;

int main(void) {
    int n;
    double z=0, tmp;
    cin >> n;
    double a[n];
    for(int i=0;i<n;i++) { 
      cin >> a[i];
      z+= a[i];
    }
    
    int ll = (int)(z/(double)n+0.5);
    z=0;
    for(int i=0;i<n;i++) { 
      z+= (a[i]-(double)ll)*(a[i]-(double)ll);
    }
    cout << z << endl;
}

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

vector<int> con[100002];

bool vs[100002][2];
queue<pair<int, int>> q;

int main(){
  int N, M; scanf("%d%d", &N, &M);
  for(int i = 0; i < M; i++){
    int x, y; scanf("%d%d", &x, &y);
    con[x].push_back(y);
    con[y].push_back(x);
  }

  long long ans = 0;

  for(int n = 1; n <= N; n++){
    if(vs[n][0] || vs[n][1]) continue;

    q.push({ n, 0 }); vs[n][0] = true;
    int c0 = 0, c1 = 0;

    while(!q.empty()){
      int x = q.front().first, c = q.front().second;
      q.pop();

      (c ? c1 : c0)++;

      for(int y : con[x]){
        if(!vs[y][!c]){
          q.push({ y, !c }); vs[y][!c] = true;
        }
      }
    }

    if(vs[n][0] && vs[n][1]){ // no bipartite
      ans += 1LL * c0 * (c0 - 1) / 2;
    }
    else ans += 1LL * c0 * c1;
  }

  printf("%lld\n", ans - M);
  return 0;
}

Measured memory_bytes: 6400
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.Comparator;
import java.util.List;
import java.util.Map;
import java.util.StringTokenizer;
import java.util.TreeSet;

import javax.swing.*;

import static java.util.Arrays.binarySearch;
import static java.util.Arrays.copyOfRange;

public class Main {

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

        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);

        Task solver = new Task();
        solver.solve(1, in, out);
        out.close();
    }
}

class Task {

    private static int mod = 998244353;

    public void solve(int testNumber, InputReader in, PrintWriter out) {
        int a = in.nextInt();
        int b = in.nextInt();
        int c = in.nextInt();
        out.println(a == b && b == c ? "Yes" : "No");

    }

}


class InputReader {

    private final BufferedReader reader;
    private StringTokenizer tokenizer;

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

    public String nextLine() {
        try {
            return reader.readLine();
        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }

    public String next() {
        while (tokenizer == null || !tokenizer.hasMoreTokens()) {
            tokenizer = new StringTokenizer(nextLine());
        }
        return tokenizer.nextToken();
    }

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

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

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

}

Measured memory_bytes: 20820
import java.util.Scanner;
class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        while(true){
            int a = sc.nextInt();
			String op = sc.next();
			int b = sc.nextInt();
			
			if(op.equals("?")){
            break;
        }else if(op.equals("+")){
            System.out.println(a + b);
        }else if(op.equals("-")){
            System.out.println(a - b);
        }else if(op.equals("*")){
            System.out.println(a * b);
        }else if(op.equals("/")){
            System.out.println(a / b);
        }

        }
    }
}


Measured memory_bytes: 26208
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define repr(i, n) for (int i = (n); i >= 0; --i)
#define FOR(i, m, n) for (int i = (m); i < (n); ++i)
#define FORR(i, m, n) for (int i = (m); i >= (n); --i)
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
const ll mod2 = 998244353;

int main() {
  vector<int> a(1000005);
  vector<bool> e(1000005);
  cin >> a[0];
  e[a[0]] = true;
  rep(i, 1000005) {
    if (a[i] % 2 == 0) {
      a[i+1] = a[i] / 2;
    }
    if (a[i] % 2 == 1) {
      a[i+1] = 3 * a[i] + 1;
    }
    if (e[a[i+1]]) {
      cout << i+2 << endl;
      break;
    }
    if (!e[a[i+1]]) {
      e[a[i+1]] = true;
    }
  }
}

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

#define ll long long int
#define tc(t) int t;cin >> t; while(t--)
#define pb push_back
#define fi first
#define se second
#define debug1(x) cerr << #x << " = " << x << '\n';
#define debug2(x, y) cerr << #x << " = " << x << "   " << #y << " = " << y << "\n";
#define _ ios_base::sync_with_stdio(0);cin.tie(NULL);

int main() {_
    ll n;
    cin >> n;
    ll w;
    cin >> w;
    ll val[n] = {}, wt[n] = {};
    for(int i = 0; i<n; i++) {
        cin >> wt[i] >> val[i];
    }

    ll dp[n+1][w+1] = {};

    for(int i = 0; i<=n; i++) {
        for(int j = 0; j<=w; j++) {
            if(i == 0 || j == 0) dp[i][j] = 0;
            else if(wt[i-1] <= j) dp[i][j] = max(val[i-1] + dp[i-1][j-wt[i-1]], dp[i-1][j]);
            else dp[i][j] = dp[i-1][j];
            //cout << dp[i][j] << ' ' ;
        }
        //cout << '\n';
    }
    cout << dp[n][w] ;
}


Measured memory_bytes: 79232
#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 <time.h>
#define int long long
#define endl '\n'
#define INF 1000000000000000000
#define EPS 1e-10
#define all(a) a.begin(),a.end()
#define rep(i, n) for (int i = 0; i < (n); i++)
#define fi first
#define se second
#define pb push_back
#define double long double
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<ll, P> PP;
template<class T, class S> bool chmax(T &a, const S &b) { if (a < b) { a = b; return 1; } return 0; }
template<class T, class S> bool chmin(T &a, const S &b) { if (a > b) { a = b; return 1; } return 0; }
ll gcd(ll n, ll m) { return (m ? gcd(m, n%m) : n); }
ll lcm(ll n, ll m) { return n / gcd(n, m)*m; }
 
int dp[70000];

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(20);
	//modcalc();

	int n;
	cin >> n;
	vector<vector<int>> a(n, vector<int>(n));
	rep(i, n) rep(j, n) cin >> a[i][j];
	rep(i, (1 << n)) {
		rep(j, n) {
			rep(k, n) {
				if ((i >> j)&(i >> k) & 1) {
					dp[i] += a[j][k];
				}
			}
		}
		dp[i] /= 2;
	}
	rep(i, (1 << n)) {
		for (int c = (i - 1)&i; c > 1; c = (c - 1)&i) {
			chmax(dp[i], dp[c] + dp[i - c]);
		}
	}
	cout << dp[(1 << n) - 1] << endl;
}

Measured memory_bytes: 768
import java.util.LinkedList;
import java.util.Scanner;

/**
 * 
 */

/**
 * @author kawakami
 *
 */
class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		StringBuilder sb = new StringBuilder();
        Scanner as = new Scanner(System.in);
        int T[];
        int n,q;
        int C = 0;
        String test="";
        
        n = Integer.parseInt(as.next());
        T = new int[n];
        
        for(int i=0;i<n;i++){
        	
        	 sb.append(":").append(Integer.parseInt(as.next())).append(":");
        	
        }
        
        q = Integer.parseInt(as.next());
        
        for(int i=0;i<q;i++){
        	
        	
        	if(sb.indexOf(test = ":"+as.next()+":") != -1){
        		
        		//System.out.println(test);
        		C++;
        		
        	}
        	
        }
        
        sb.setLength(0);
        sb.append(String.valueOf(C));
        System.out.println(sb);
       
	}

}

Measured memory_bytes: 38420
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ll long long
ll gcd(ll x, ll y) { return (x % y)? gcd(y, x % y): y; }    //最大公約数
ll lcm(ll x, ll y) { return x / gcd(x, y) * y; }     //最小公倍数
using Graph = vector<vector<ll>>;
ll inf=300000000000000000;
const double PI = 3.14159265358979323846;
int main(){
  int n,k;
  cin >> n >> k;
  if(k>(n-2)*(n-1)/2){
    cout << -1 << endl;
    return 0;
  }
  //vector<vector<int>> v(n,vector<int>(n,0));
  Graph v(n);
  rep(i,n-1){
    v[0].push_back(i+1);
  }
  int left=1;
  int right=2;
  cout << n-1+(n-2)*(n-1)/2-k << endl;
  while(k!=(n-2)*(n-1)/2){
    k++;
    v[left].push_back(right);
    if(right<n-1)right++;
    else{
      left++;
      right=left+1;
    }
  }
  rep(i,n){
    for(int h: v[i]){
      cout << i+1 << " " << h+1 << endl;
    }
  }
}   


Measured memory_bytes: 384
n = int(input())
if n <600:
  print(8)
elif n < 800:
  print(7)
elif n < 1000:
  print(6)
elif n < 1200:
  print(5)
elif n < 1400:
  print(4)
elif n < 1600:
  print(3)
elif n < 1800:
  print(2)
elif n < 2000:
  print(1)

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

int main(void)
{
	int a, b;
	cin >> a >> b;
	
	int count = 0;
	int amount = 1;
	
	while(amount < b){
		amount -= 1;
		amount += a;
		count++;
	}
	
	cout << count << endl;
	return 0;
}

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

template <typename T> T load() { T r; cin >> r; return r; }
template <typename T> vector<T> loadMany(int n) { vector<T> rs(n); generate(rs.begin(), rs.end(), &load<T>); return rs; }

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	auto n = load<int>();
	auto target = loadMany<int>(1 << n);
	auto rem = multiset<int>(target.begin(), target.end());
	auto curr = vector<int>({*prev(rem.end())});
	rem.erase(prev(rem.end()));
	for (auto i=0; i<n; ++i) {
		auto step = vector<int>();
		for (auto c : curr) {
			auto it = rem.lower_bound(c);
			if (it != rem.begin()) {
				step.push_back(*prev(it));
				rem.erase(prev(it));
			} else {
				cout << "No\n";
				return 0;
			}
		}
		for (auto s : step)
			curr.push_back(s);
	}
	cout << "Yes\n";
}


Measured memory_bytes: 15036
#include <bits/stdc++.h>
using namespace std;
int n,a[101];
int main(){
    scanf("%d",&n);
    for(int i=1;i<=n;i++) scanf("%d",&a[i]);
    int cnt = 0; int ans = 0;
    for(int i=1;i<=n;i++){
        if(a[i]!=a[i-1]){
            ans = (ans+cnt/2);
            cnt=1;
        }
        else cnt++;
    }
    if(cnt) ans = (ans+cnt/2);
    printf("%d\n",ans);
    return 0;
}


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

int main(){
    std::array<int, 4> a;
    std::array<int, 4> b;
    while(std::cin >> a[0] >> a[1] >> a[2] >> a[3]){
        std::cin >> b[0] >> b[1] >> b[2] >> b[3];
        int hit = 0, blow = 0;
        for(int i = 0; i < a.size(); ++i){
            for(int j = 0; j < b.size(); ++j){
                if(a[i] == b[j] && i == j)
                    ++hit;
                else if (a[i] == b[j])
                    ++blow;
            }
        }
          std::cout << hit << " " << blow << std::endl;
    }
      return 0;
}

Measured memory_bytes: 1160
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cmath>
#define MX 17
#define MOD 1000000007
#define mov(x) (1<<(x))

using namespace std;

typedef long long ll;

template <typename T> void read(T& x)
{
	x = 0; char c = getchar(); bool f = 0;
	while(!isdigit(c) && c!='-') c = getchar();
	if(c == '-') f = 1, c = getchar();
	while(isdigit(c)) x = x*10+c-'0', c = getchar();
	if(f) x = -x;
}

template <typename T> void add(T& x, const T &y)
{
	x += y;
	if(x >= MOD) x %= MOD;
}

template <typename T> void mns(T& x, const T &y)
{
	x = ((x-y)%MOD + MOD) % MOD;
}

int N, M, A[MX];
ll f[MX][mov(MX)];
ll fac[mov(MX)], faci[mov(MX)];

ll qpow(ll x, ll t)
{
	ll ans = 1;
	while(t)
	{
		if(t & 1) ans = ans * x % MOD;
		x = x * x % MOD;
		t >>= 1;
	}
	return ans;
}

ll inv(ll x)
{
	return qpow(x, MOD-2);
}

ll C(int n, int m)
{
	if(n<0 || m<0 || m>n) return 0;
	else return fac[n] * faci[m] % MOD * faci[n-m] % MOD;
}

void init()
{
	fac[0] = 1;
	for(int i=1; i<mov(MX); i++) fac[i] = fac[i-1] * i % MOD;
	faci[mov(MX)-1] = inv(fac[mov(MX)-1]);
	for(int i=mov(MX)-1; i>=1; i--) faci[i-1] = faci[i] * i % MOD;
}

int main()
{
	read(N); read(M);
	init();
	for(int i=1; i<=M; i++) read(A[i]);
	sort(A+1, A+M+1, greater<int>());
	f[0][0] = 1;
	for(int i=1; i<=M; i++)
		for(int s=0; s<mov(N); s++)
		{
			add(f[i][s], f[i-1][s]);
			for(int j=0; j<N; j++)
				if(!(s&mov(j)))
					add(f[i][s|mov(j)], f[i-1][s] * C(mov(N)-A[i]-s, mov(j)-1) % MOD * fac[mov(j)]);
		}
	ll ans = 0;
	for(int s=0; s<mov(N); s++)
	{
		//cout<<s<<" "<<f[M][s]*fac[mov(N)-1-s]<<endl;
		if(__builtin_popcount(s) & 1) mns(ans, f[M][s] * fac[mov(N)-1-s]);
		else add(ans, f[M][s] * fac[mov(N)-1-s]);
	}
	printf("%lld\n", ans * mov(N) % MOD);
	return 0;
}

Measured memory_bytes: 19200
import sys
input = sys.stdin.readline


def read():
    N = int(input().strip())
    S = input().strip()
    return N, S


def solve(N, S):
    x = 0
    xmax = 0
    for s in S:
        if s == "I":
            x += 1
            xmax = max(xmax, x)
        else:
             x -= 1
    return xmax


if __name__ == '__main__':
    inputs = read()
    print(solve(*inputs))


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

void Main() {
	int N, M;
	cin >> N >> M;
	set<int> s;
	long long* H = new long long[N + 1];
	for (int i = 1; i < N + 1; i++) {
		cin >> H[i];
		s.insert(i);
	}
	int tmp, tmp2;
	for (int i = 1; i < M + 1; i++) {
		cin >> tmp >> tmp2;
		if (H[tmp] > H[tmp2]) {
			if (s.find(tmp2) != s.end()) {
				s.erase(tmp2);
			}
		} else if (H[tmp] < H[tmp2]){
				if (s.find(tmp) != s.end()) {
					s.erase(tmp);
				}
		}
		else {
			if (s.find(tmp) != s.end()) {
				s.erase(tmp);
			}
			if (s.find(tmp2) != s.end()) {
				s.erase(tmp2);
			}
		}
	}
	cout << s.size() << endl;
}

int main() {
	std::cout << std::fixed << std::setprecision(15);
	Main();
}

Measured memory_bytes: 9072
#include <stdio.h>

int main(){
  int h, w;  scanf("%d %d", &h, &w);
  int field[2005][2005] = {0};
  for(int i=0; i<h; i++){
    char s[2005];  scanf("%s", s);
    for(int j=0; j<w; j++)
      if(s[j] == '#')
	field[i+1][j+1] = 1;
  }

  int tate[2020][2020] = {0};
  for(int i=1; i<=h; i++)
    for(int j=1; j<=w; j++){
      if(tate[i][j] || field[i][j])  continue;
      int stack[2020] = {0}, now = i;
      while(!field[now][j] && now<=h)
	stack[++stack[0]] = now++;
      int max = stack[0];
      while(stack[0])
	tate[stack[stack[0]--]][j] = max;
    }
  
  int yoko[2020][2020] = {0};
  for(int i=1; i<=h; i++)
    for(int j=1; j<=w; j++){
      if(yoko[i][j] || field[i][j])  continue;
      int stack[2020] = {0}, now = j;
      while(!field[i][now] && now<=w)
	stack[++stack[0]] = now++;
      int max = stack[0];
      while(stack[0])
	yoko[i][stack[stack[0]--]] = max;
    }

  int ans = 0;
  for(int i=1; i<=h; i++)
    for(int j=1; j<=w; j++){
      if(field[i][j])  continue;
      if(tate[i][j]+yoko[i][j] > ans)
	ans = tate[i][j] + yoko[i][j];
    }

  printf("%d\n", ans-1);
  return 0;
}


Measured memory_bytes: 49320
#include<bits/stdc++.h>
#define rep(i,n) for(int i = 0;i<n;i++)
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0;}


int main() {
    int x,y,z,k;
    cin >> x >> y >> z >> k;
    vector<ll>a(x),b(y),c(z);
    rep(i,x) cin >> a[i];
    rep(i,y) cin >> b[i];
    rep(i,z) cin >> c[i];
    vector<ll>e;
    rep(i,x) {
        rep(j,y) {
            e.push_back(a[i]+b[j]);
        }
    }
    sort(e.rbegin(),e.rend());
    // rep(i,x*y) cout << e[i] << endl;
    vector<ll>ans;
    rep(i,min(x*y,k)) {
        rep(j,min(z,k)) {
            ans.push_back(e[i]+c[j]);
        }
    }
    sort(ans.rbegin(),ans.rend());
    rep(i,k) cout << ans[i] << endl;
}

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

using namespace std;

const int N = 2e5+5;
const int MOD = 1e9+7;

typedef long long ll;

bitset<N> isPrime;
int n;
ll ans, pc[N];

void init(){
  isPrime.set();
  isPrime[0] = isPrime[1] = 0;
  int lim = sqrt(N);
  for(int i=2; i<=lim; i++){
    if(isPrime[i]){
      for(int j=2*i; j<N; j+=i)
        isPrime[j] = 0;
    }
  }
}

int main()
{
  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  init();
  /*for(int i=2; i<1e3; i++)
    if(isPrime[i])
      cout<<i<<" ";
  cout<<"\n";*/
  cin>>n;
  for(int i=2; i<=n; i++){
    int tmp = i;
    for(int j=2; j<=i; j++){
      if(isPrime[j]){
          while(tmp && tmp%j==0){
            pc[j]++;
            /*if(isPrime[tmp/j] && j*j != tmp)
              pc[tmp/j]++;*/
            tmp/=j;
          }
      }
      if(!tmp)
        break;
    }
  }
  ans = 1;
  for(int i=2; i<N; i++){
    /*if(pc[i]>0)
      cout<<i<<" "<<pc[i]<<"\n";*/
    ans  = (ans * (pc[i]+1)) % MOD;
  }
  cout<<ans<<"\n";
  return 0;
}


Measured memory_bytes: 256
#ifndef _GLIBCXX_NO_ASSERT
#include <cassert>
#endif
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#if __cplusplus >= 201103L
#include <ccomplex>
#include <cfenv>
#include <cinttypes>
// #include <cstdalign>
#include <cstdbool>
#include <cstdint>
#include <ctgmath>
#include <cwchar>
#include <cwctype>
#endif

// C++
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>

#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

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

int main(){

  int n,a,b;
  cin >> n >> a >> b;

  if(a*n>b){
    cout << b << endl;
  }
  else
    cout << a * n << endl;
  return 0;
}


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

struct Node
{
    int key;
    Node *next, *prev;
};

Node *nil;

Node* listSearch(int key)
{
    Node *cur = nil->next;
    while (cur != nil && cur->key != key )
    {
        cur = cur->next;
    }
    return cur;
}

void init()
{
    nil = (Node *)malloc(sizeof(Node));
    nil->next = nil;
    nil->prev = nil;
}

void printList()
{
    Node *cur = nil->next;
    int isf = 0;
    while (true)
    {
        if (cur == nil) break;
        if (isf++ > 0) printf(" ");
        printf("%d", cur->key);
        cur = cur->next;
    }
    printf("\n");
}

inline void deleteNode(Node *t)
{
    if (t == nil) return;
    t->prev->next = t->next;
    t->next->prev = t->prev;
    free(t);
}

inline void deleteFirst()
{
    deleteNode(nil->next);
}

inline void deleteLast()
{
    deleteNode(nil->prev);
}

inline void deleteKey(int key)
{
    deleteNode(listSearch(key));
}

void insert(int key)
{
    Node *x = (Node *)malloc(sizeof(Node));
    x->key = key;
    x->next = nil->next;
    nil->next->prev = x;
    nil->next = x;
    x->prev = nil;
}

int main()
{
#ifdef local
    freopen("test.in", "r", stdin);
    freopen("test.out", "w", stdout);
#endif
    char buf[20];
    int n;
    scanf("%d", &n);
    init();
    for (int i = 0; i < n; ++i)
    {
        int key;
        scanf("%s", buf);
        if (buf[0] == 'i')
        {
            scanf("%d", &key);
            insert(key);
        }
        else
        {
            if(strlen(buf) > 6)
            {
                if (buf[6] == 'F') deleteFirst();
                else deleteLast();
            }
            else
            {
                scanf("%d", &key);
                deleteKey(key);
            }
        }
    }
    printList();
    return 0;
}


Measured memory_bytes: 34308
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pi;
#define debug(x) cerr << #x << ": " << x << endl
#define debug2(x, y) debug(x), debug(y)
#define repn(i, a, b) for(int i = (int)(a); i < (int)(b); i++)
#define rep(i, a) for(int i = 0; i < (int)(a); i++)
#define all(v) v.begin(), v.end() 
#define mp make_pair
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define sq(x) ((x) * (x))
const int mxN = 1005;
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};

template<class T> T gcd(T a, T b){ return ((b == 0) ? a : gcd(b, a % b)); }

int dist[mxN][mxN];
int h, w;

bool valid(int i, int j){
	return (i >= 0 && i < h && j >= 0 && j < w);
}

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	//freopen("input.in", "r", stdin);
	//freopen("output.out", "w", stdout);
	cin >> h >> w;
	int ch, cw, dh, dw;
	cin >> ch >> cw;
	cin >> dh >> dw;
	vector<string> s(h);
	rep(i, h) cin >> s[i];
	rep(i, h) rep(j, w) dist[i][j] = 1e9;
	dist[ch - 1][cw - 1] = 0LL;
	set<pair<int, pi>> q;
	q.insert(mp(0LL, mp(ch - 1, cw - 1)));
	while(!q.empty()){
		pair<int, pi> cur1 = *q.begin();
		pi cur = cur1.se;
		q.erase(q.begin());
		if(cur.fi == dh - 1 && cur.se == dw - 1){
			cout << cur1.fi << endl;
			return 0;
		}
		rep(i, 4){
			int x = cur.fi + dx[i], y = cur.se + dy[i];
			if(valid(x, y) && dist[cur.fi][cur.se] < dist[x][y] && s[x][y] == '.'){
				q.erase(mp(dist[x][y], mp(x, y)));
				dist[x][y] = dist[cur.fi][cur.se];
				q.insert(mp(dist[x][y], mp(x, y)));
			}
		}
		for(int i = -2; i <= 2; i++){
			for(int j = -2; j <= 2; j++){
				int x = cur.fi + i, y = cur.se + j;
				if(valid(x, y) && (dist[cur.fi][cur.se] + 1) < dist[x][y] & s[x][y] == '.'){
					q.erase(mp(dist[x][y], mp(x, y)));
					dist[x][y] = dist[cur.fi][cur.se] + 1;
					q.insert(mp(dist[x][y], mp(x, y)));
				}
			}
		}
	}
	if(dist[dh - 1][dw - 1] == 1e9) dist[dh - 1][dw - 1] = -1;
	cout << dist[dh - 1][dw - 1] << endl;
	return 0;
}
/*
Things to look out for:
	- Integer overflows
	- Array bounds
	- Special cases
Be careful!
*/


Measured memory_bytes: 8816
N = int(input())
A = list(map(int, input().split()))
B = []
cnt = 0

for i in range(N-1,-1,-1):
    x = 2
    j = (i+1)*x-1
    while j <= N-1:
        A[i] = (A[i]-A[j])%2
        x += 1
        j = (i+1)*x-1
        

    if A[i] == 1:
        B.append(i+1)
        cnt +=1
B = [str(b) for b in B]

print(cnt)
if len(B) >= 1:
    print(' '.join(B))


Measured memory_bytes: 17536
#include <stdio.h>
#include <stdlib.h>

int compare(const void *a,const void *b)
{
  return *(int*)a - *(int*)b;
}

int main()
{
  int n;
  scanf("%d",&n);
  int d[n];
  for(int i=0;i<n;i++) scanf("%d",&d[i]);

  qsort(d,n,sizeof(int),compare);
  printf("%d\n",d[n/2]-d[(n/2)-1]);
  return 0;
}


Measured memory_bytes: 892
#include<bits/stdc++.h>
using namespace std;
#define arep(i,x,n) for(int i=int(x);i<(int)(n);i++)
#define rep(i,n) for(long long i = 0;i < n;++i)
#define rrep(i,n) for(int i=int(n-1);i>=0;i--)
#define fs first
#define sc second
#define all(x) (x).begin(), (x).end()
#define pi 3.141592653589793
#define eps 0.00000001
#define INF 1e9+5  
using ll = long long; 
using P=pair<int,int>;
using lP=pair<ll,ll>;
using fP=pair<double,double>;
using PPI=pair<P,int>;
//ll const mod=998244353;
ll const mod=1e9+7;
const ll MAX=1000005;
using vi=vector<int>;
using vl=vector<ll>;
using vc=vector<char>;
using vd=vector<double>;
using vs=vector<string>;
using vp=vector<P>;
using vb=vector<bool>;
using vvi =vector<vector<int>>;
using vvl =vector<vector<ll>>;
using vvd=vector<vector<double>>;
using vvc=vector<vector<char>>;
using vvp =vector<vector<P>>;
using vvb=vector<vector<bool>>;
template <typename T>
bool chmax(T &a, const T b){if(a < b){a = b; return true;} return false;}
template <typename T>
bool chmin(T &a, const T b){if(a > b){a = b; return true;} return false;}


//////////////////////////////////////
ll dp[2005][2005];

int main(){
    int n,m;
    cin>>n>>m;
    vi s(n+1),t(m);
    rep(i,n)cin>>s[i];
    rep(i,m)cin>>t[i];
    rep(i,n+1)dp[i][0]=1;
    rep(i,m+1)dp[0][i]=1;
    rep(i,n){
        rep(j,m){
            
            
            dp[i+1][j+1]+=dp[i+1][j]+dp[i][j+1]-dp[i][j];
            dp[i+1][j+1]%=mod;
            //cout<<i+1<<" "<<j+1<<" "<<dp[i+1][j+1]<<endl;
            if(s[i]==t[j]){
                dp[i+1][j+1]+=dp[i][j];
                dp[i+1][j+1]%=mod;
            }
            
            //cout<<i+1<<" "<<j+1<<" "<<dp[i+1][j+1]<<endl<<endl;;
        }
    }
    if(dp[n][m]<0)dp[n][m]+=mod;
    cout<<dp[n][m]<<endl;
    return 0;
}

Measured memory_bytes: 34928
#include <bits/stdc++.h>
#define mod 1000000007
#define sp ' '
#define intmax 2147483647
#define llmax 9223372036854775807
#define mkp make_pair
typedef long long ll;
using namespace std;


int N, x, c[500];
pair<int, int>p[500];
vector<int>v;

int main() {
	cin >> N;
	for (int i = 0; i != N; ++i) {
		cin >> x;
		c[i] = 0;
		p[i] = mkp(x - 1, i);
	}
	sort(p, p + N);
	for (int i = 0; i != N*N; ++i) {
		bool b = true;
		for (int j = 0; j != N; ++j) {
			if (c[p[j].second] == p[j].second&&i == p[j].first) {
				++c[p[j].second];
				v.push_back(p[j].second);
				b = false;
				break;
			}
		}
		if (b) {
			for (int j = 0; j != N; ++j) {
				if (c[p[j].second] < p[j].second&&i < p[j].first) {
					++c[p[j].second];
					v.push_back(p[j].second);
					b = false;
					break;
				}
			}
			if (b) {
				for (int j = 0; j != N; ++j) {
					if (c[p[j].second] < N&&c[p[j].second] > p[j].second&&i > p[j].first) {
						++c[p[j].second];
						v.push_back(p[j].second);
						break;
					}
				}
			}
		}
	}
	if (v.size() != N*N) {
		cout << "No" << endl;
	}
	else {
		cout << "Yes" << endl;
		for (int i = 0; i != N*N; ++i) {
			cout << v[i]+1 << sp;
		}
		cout << endl;
	}
	return 0;
}

Measured memory_bytes: 2292
import java.util.BitSet;
import java.util.LinkedList;
import java.util.Queue;
import java.util.Scanner;

public class Main{
	public static final int[] dx = {1, 0, -1, 0};
	public static final int[] dy = {0, 1, 0, -1};
	public static int w, h;
	public static void main(String[] args){
		Scanner in = new Scanner(System.in);
		while(true){
			w = in.nextInt();
			h = in.nextInt();
			if(w == 0) break;
			in.nextLine();
			int tw = w*2-1;
			int th = h*2-1;
			int[][] table = new int[th][tw];
			for(int i=0; i<th; i++){
				char[] line = in.nextLine().toCharArray();
				for(int j=0; j<line.length; j++){
					table[i][j] = line[j]==' ' ? 0 : line[j]-'0';
				}
			}
			int[][] map = new int[h][w];
			for(int i=0; i<h; i++){
				for(int j=0; j<w; j++){
					for(int d=0; d<4; d++){
						int tx = 2*j + dx[d];
						int ty = 2*i + dy[d];
						if(tx < 0 || tx >= tw || ty < 0 || ty >= th) continue;
						if(table[ty][tx] == 0) map[i][j] |= 1<<d;
					}
				}
			}
			Queue<Pos> qu = new LinkedList<Pos>();
			qu.add(new Pos(0, 0, 1));
			BitSet used = new BitSet(h*w);
			int res = 0;
			while(!qu.isEmpty()){
				Pos p = qu.poll();
				if(used.get(p.id)) continue;
				if(p.id == h*w-1){
					res = p.dist;
					break;
				}
				used.set(p.id);
				for(int i=0; i<4; i++){
					if((map[p.y][p.x] & 1<<i) == 0) continue;
					int nx = p.x + dx[i];
					int ny = p.y + dy[i];
					qu.add(new Pos(nx, ny, p.dist+1));
				}
			}
			System.out.println(res);
		}
	}
	
	public static String dump(int[][] map, int h, int w){
		StringBuilder sb = new StringBuilder();
		for(int i=0; i<h; i++){
			for(int j=0; j<w; j++){
				sb.append(map[i][j]+" ");
			}
			sb.append("\n");
		}
		return sb.toString();
	}
}

class Pos{
	int x, y, dist, id;
	public Pos(int x, int y, int d){
		this.x = x;
		this.y = y;
		dist = d;
		id = y*Main.w + x;
	}
}

Measured memory_bytes: 48992
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <cctype>
#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
using ll = long long;
using vl = vector<long long>;
using vs = vector<string>;
using ii = vector<vector<long long>>;
int main() {
	ll a;
	cin >> a;
	vl x(a);
	ll count = 0;
	for (int i = 0; i < a; i++) {
		cin >> x[i];
	}
	for (int i = 0; i < a; i++) {
		count += x[i] - 1;
	}
	cout << count << endl;
}

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

int main() {
  int H1, M1, H2, M2, K;
  cin >> H1 >> M1 >> H2 >> M2 >> K;
  if (H1 > H2) H2 += 24;
  int m = M2 - M1;
  int h = H2 - H1;
  cout << 60 * h + m - K << endl;
}

Measured memory_bytes: 3632
#include <stdio.h>
#include <stdlib.h>

int main(){
	char *string;
	string = (char *)malloc(sizeof(char)*100002);
	scanf(" %s", string);
	int i = 0, j, k, result = 1, limit = 0;
	while(string[i] != '\0'){
		if(string[i+0] == 'd'){
			if(string[i+1] == 'r' && string[i+2] == 'e' && string[i+3] == 'a' && string[i+4] == 'm'){
				if(string[i+5] == 'd' || string[i+5] == '\0'){
					i += 5;
				}
				else if(string[i+5] == 'e' && string[i+6] == 'r'){
					if(string[i+7] == '\0' || string[i+7] == 'e' || string[i+7] == 'd'){
						i += 7;
					}
					else if(string[i+7] == 'a'){
						i += 5;
					}
					else{
						result = 0;
						break;
					}
				}
				else{
					result = 0;
					break;
				}
			}
			else{
				result = 0;
				break;
			}
		}
		else if(string[i+0] == 'e'){
			if(string[i+1] == 'r' && string[i+2] == 'a' && string[i+3] == 's' && string[i+4] == 'e'){
				if(string[i+5] == 'd' || string[i+5] == 'e' || string[i+5] == '\0'){
					i += 5;
				}
				else if(string[i+5] == 'r'){
					if(string[i+6] == '\0' || string[i+6] == 'e' || string[i+6] == 'd'){
						i += 6;
					}				
				}
				else{
					result = 0;
					break;
				}
			}
			else{
				result = 0;
				break;
			}
		}
		else{
			result = 0;
			break;
		}
	}
	if(result == 1){
		printf("YES");
	}
	else{
		printf("NO");
	}

	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
// #include <ext/pb_ds/detail/standard_policies.hpp>
using namespace std;
using namespace __gnu_pbds;
#define pb push_back
// #define INT_MAX 1000000000 this is wrong as INT_MAX is already included in header<climits> and  2147483647  
// #define INT_MIN -1000000000
#define INF 1000000000
#define LL_MAX 1000000000000000000
#define LL_MIN -1000000000000000000
#define mod1 1000000007
#define ll long long 
#define ld long double
#define vi vector <int>
#define vvi vector <vector<int>>
#define vll vector<long long>
#define vvl vector <vector<long long>>
#define pii pair<int,int>
#define pll pair<long,long>
#define vpii vector<pair<int,int>>
#define pld pair<ld,ld>
#define vpll vector<pair<ll,ll>>
#define vpld vector<pair<ld,ld>>
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define ff first
#define ss second
#define lb lower_bound
#define ub upper_bound
#define sz(a) (int)a.size()
#define ordered_set tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>

template<class T> bool ckmin(T& a, const T& b) { 
	return b < a ? a = b, 1 : 0; }
template<class T> bool ckmax(T& a, const T& b) { 
	return a < b ? a = b, 1 : 0; } 
constexpr int pct(int x) { return __builtin_popcount(x); } 
constexpr int bits(int x) { return 31-__builtin_clz(x); } // floor(log2(x))

template<class T>
T binpow(T a, T b, T m) {
    a %= m;
    long long res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a % m;
        a = a * a % m;
        b >>= 1;
    }
    return res;
}
int n,m;
vvi ar;
bool vis[200000];
int cc_size;
int dfs(int node){
    vis[node]=1;
    int cc=1;
    for(int child:ar[node]){
        if(!vis[child])cc+=dfs(child);
    }
    return cc;
}
int main(){
    cin>>n>>m;
    ar.resize(n);
    while(m--){
        int x,y;
        cin>>x>>y;
        --x,--y;
        ar[x].pb(y),ar[y].pb(x);
    }
    int mx=0;
    for(int i=0;i<n;i++){
        if(!vis[i]){
            mx=max(mx,dfs(i));
        }
    }
    cout<<mx;
}
/* stuff you should look for
    * int overflow, array bounds
    * special cases (n=1?), set tle
    * do smth instead of nothing and stay organized
*/



Measured memory_bytes: 23464
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#define rep(i,a,n) for(int i =(a);i<(n);i++)
#define urep(i,a,n) for(int i = (a);i>(n);i--)
#define all(x) (x).begin(),(x).end()
typedef long long ll;
using namespace std;

int N,M;
int A[1000000];
int ans;
int main(){
	cin >> N >> M;
	if (N > 8 || M > 8)cout << ":(";
	else cout << "Yay!";
	return 0;
}

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

#define mod 1000000007
/*ll ebob(ll a, ll b){
	if(a == 0) return b;
	return ebob(b%a, a);
}
ll ekok(ll a, ll b){
	return (a*b)/ebob(a,b);
}*/
int main(){
	ios_base::sync_with_stdio(false); cin.tie(NULL);
	int a; cin>>a;
	double sum = 0;
	forloop(a){
		int sayi; cin>>sayi;
		sum += 1.0/sayi;
	}
	cout<<setprecision(10)<<1.0/sum;
	return 0; 
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i, s, n) for(int i = s; i < (int)n; i++)
#define per(i, n) for(int i = n; i >= 0; i--)
#define ROF(i, s, n) for(int i = s; i >= (int)n; i--)
#define FORIT(i, A) for (auto i : A)
#define PRINT(x) cout << (x) << "\n"
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define MP make_pair
#define EACH(i, n) for (__typeof((n).begin()) i = (n).begin(); i != (n).end(); ++i)
#define SZ(a) int((a).size())
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define CLR(a) memset((a), 0 ,sizeof(a))
#define NCLR(a) memset((a), -1 ,sizeof(a))
#define dump(x) cout << #x << " = " << (x) << "\n";
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << "\n";
#define sq(n) (n) * (n)
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef priority_queue<int> maxpq;
typedef priority_queue< int, vector<int>, greater<int> > minpq;
typedef complex<double> P;
static const double EPS = 1e-10;
static const double PI = acos( -1.0 );
static const int mod = 1000000007;
static const int INF = 1 << 29;
static const LL LL_INF = 1152921504606846976;
static const int dx[] = { -1, 0, 1, 0, 1, -1, 1, -1 };
static const int dy[] = { 0, -1, 0, 1, 1, 1, -1, -1 };
 
 
int main() {
#ifdef _DEBUG
    printf( "debug\n" );
#endif
    for ( int i = 1; i < 10; i++ ) {
        for ( int j = 1; j < 10; j++ ) {
            printf( "%dx%d=%d\n", i, j, i * j );
        }
    }
    return 0;
}

Measured memory_bytes: 3180
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
ll INF = 1e18;
ll digit(ll x){ll c=0;while(x>0){x=x/10;c++;}return c;}
int main(){
  ll x, ans = INF;
  cin >> x;
  for (ll i = 1; i <= sqrt(x); i++) {
    if (x % i != 0) continue;
    ans = min(ans, digit(x / i));
  }
  
  cout << ans << endl;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.StringTokenizer;

//System.out.println();
public class Main implements Runnable { //クラス名はLowElements

	public static void main(String[] args) {
		Thread.setDefaultUncaughtExceptionHandler((t, e) -> System.exit(1));
		new Thread(null, new Main(), "", 16 * 1024 * 1024).start(); //16MBスタックを確保して実行
	}

	public void run() {
		FastScannerLowElements sc = new FastScannerLowElements(System.in);

		int N = sc.nextInt();
		List<Integer> array = new ArrayList<Integer>();
		Queue queue = new PriorityQueue();

		int count = N;

		for (int i = 0; i < N; i++) {
			int val = sc.nextInt();
			queue.add(val);
			//System.out.println(i + " " + array.get(i));
			//System.out.println(" min :" + Collections.min(array));
			if (val > (int) queue.peek()) {
				count--;
			}
		}

		System.out.println(count);

	}
}

//高速なScanner
class FastScannerLowElements {
	private BufferedReader reader = null;
	private StringTokenizer tokenizer = null;

	public FastScannerLowElements(InputStream in) {
		reader = new BufferedReader(new InputStreamReader(in));
		tokenizer = null;
	}

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

	public String nextLine() {
		if (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken("\n");
	}

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

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

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

	public int[] nextIntArray(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = nextInt();
		return a;
	}

	public long[] nextLongArray(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nextLong();
		return a;
	}
}


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

#define ll long long
#define sd(x) scanf("%d", &(x))
#define pii pair<int, int>
#define F first
#define S second


const int mod = 1e9 + 7;
inline int add(int x, int y){ x += y; if(x >= mod) x -= mod; return x;}
inline int sub(int x, int y){ x -= y; if(x < 0) x += mod; return x;}
inline int mul(int x, int y){ return (((ll) x) * y) % mod;}
inline int powr(int a, ll b){
	int x = 1 % mod;
	while(b){
		if(b & 1) x = mul(x, a);
		a = mul(a, a);
		b >>= 1;
	}
	return x;
}
inline int inv(int a){ return powr(a, mod - 2);}
int f[26];
char s[100005];
int main(){
	int ans = 1;
	int n;scanf("%d", &n);
	scanf("%s", s);
	for(int i = 0; i < n; i++) f[s[i] - 'a']++;
	for(int i = 0; i < 26; i++) ans = mul(ans, f[i] + 1);
	printf("%d\n", sub(ans, 1));
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
#define hyperspeed ios::sync_with_stdio(false);cin.tie(NULL);
#define ll long long  
#define ull unsigned long long
#define ui unsigned int
#define li long int
#define uli unsigned long int
#define pb push_back
#define ld long double
#define vi vector<int>
#define pi pair<int,int>
#define mp make_pair
const int MOD = 1e9+7;

void solve() {
    ll n;
    cin >> n;
    string res = "";
    while(n>0)
    {
        ll r = n%26;
        if(r==0)
         r = 26;
        res = char(r+'a'-1)+res;
        n = (n-r)/26;
    }
    cout << res << endl;
}

int32_t main()
{
    hyperspeed
    int test=1;
    // cin >> test;
    while(test--) {
        solve();
    }
    return 0;
}

//--n1m5


Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define all(x) (x).begin(),(x).end()
#define V vector
typedef V<int> vi;
typedef V<vi> vvi;
typedef long long ll;
typedef pair<ll,int> P;
typedef tuple<int, int, int> T;
constexpr auto INF = INT_MAX >> 1;
constexpr auto LINF = 5000000000000000;
constexpr auto MOD = 1000000007;

int main() {

	vi prime = {};
	rep1(i, 1000) {
		if (i == 1)continue;
		bool p = true;
		rep1(j, i - 1)if (j > 1 && i % j == 0)p = false;
		if (p)prime.push_back(i);
	}

	int n;
	cin >> n;

	ll ans = 1;

	for (int p : prime) {

		int pp = p;
		int div = 0;
		while (pp <= n) {
			div += n / pp;
			pp *= p;
		}

		ans *= div + 1;
		ans %= MOD;

	}

	cout << ans << endl;

}

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

#define fr(i, n)    for(int i=0; i<(int)n; ++i)
#define rfr(i, n)   for(int i=(int)n-1; i>=0; --i)
#define foor(i,a,n) for(int i=a; i<=(int)n; ++i)
#define rfoor(i,n,a)for(int i=(int)n; i>=a; --i)
#define foru(it, v) for(auto it : v)
#define si(n)       scanf("%d", &n)
#define si2(n,m)    scanf("%d%d", &n, &m)
#define si3(n,m,l)  scanf("%d%d%d", &n, &m, &l)
#define sl(n)       scanf("%lld", &n)
#define sl2(n,m)    scanf("%lld%lld", &n, &m)
#define sl3(n,m,l)  scanf("%lld%lld%lld", &n, &m, &l)
#define sd(n)       scanf("%lf", &n)
#define sld(n)      scanf("%Lf", &n)
#define sc(n)       scanf(" %c", &n)
#define sstr(n)     scanf("%s", n)
#define pi(n)       printf("%d\n", n)
#define pis(n)      printf("%d ", n)
#define pi2(n,m)    printf("%d %d\n", n, m)
#define pi3(n,m,l)  printf("%d %d %d\n", n, m, l)
#define pl(n)       printf("%lld\n", n)
#define pls(n)      printf("%lld ", n)
#define pl2(n,m)    printf("%lld %lld\n", n, m)
#define pl3(n,m,l)  printf("%lld %lld %lld\n", n, m, l)
#define pc(n)       printf("%c", n)
#define pstr(n)     printf("%s\n", n)
#define pstr2(n, m) printf("%s %s\n", n, m)
#define ff          first
#define ss          second
#define all(v)      v.begin(), v.end()
#define rall(v)     v.rbegin(), v.rend()
#define sz(v)       (int)v.size()
#define pub         push_back
#define pob         pop_back()
#define mmst(a, n)  memset(a, n, sizeof a);
#define ppcnt(n)    __builtin_popcountll(n);
#define leadingZ(n) __builtin_clz(n)
#define trailingZ(n)__builtin_ctz(n)
#define OO          0x3f3f3f3f
#define OOLL        0x3f3f3f3f3f3f3f3f
#define MOD         1000000007
#define EPS         0.000000001
#define ndl         "\n"
#define fastin      ios::sync_with_stdio(false); cin.tie(nullptr);
#define infile      freopen("input.txt", "r", stdin);
#define outfile     freopen("output.txt", "w", stdout);
#define PNO         printf("NO\n")
#define PYES        printf("YES\n")
#define pno         printf("No\n")
#define pyes        printf("Yes\n")
#define pln         printf("\n")

//#define row         vector<long long>
//#define matrix      vector<row>
//#define ROWS(v)     (v).size()
//#define COLS(v)     (v)[0].size()

#define DBG1(x)     cerr<<#x<<":"<<(x)<<'\n';
#define DBG2(x, y)  cerr<<#x<<":"<<(x)<<"  "<<#y<<":"<<(y)<<'\n';
#define DBG3(x,y,z) cerr<<#x<<":"<<(x)<<"  "<<#y<<":"<<(y)<<"  "<<#z<<":"<<(z)<<'\n';

using namespace std;

typedef long long lld;
typedef long double LD;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef vector<int> vii;
typedef vector<long long> vll;
typedef vector<pair<int, int>> vpii;
typedef vector<pair<long long , long long>> vpll;
typedef complex<double> point;

const int N = 1e5 + 9;

int t, id, n, m, x, y, k, c, xx, yy, ans;
//int a[N], f[N], cu[N], b[N];
vii v, adj[N];
bool fl, ok;
lld res, tot, sum;
char ch;
string s, z;
//char s[3][N], z[N];

int main()
{
    //infile;
    //outfile;
    //fastin;
    si(n);
    int p = OO;
    fr(i, n){
        si(x);
        if(x <= p) c += p!=OO;
        else{
            ans = max(ans, c);
            c = 0;
        }
        p = x;
    }
    pi(max(ans, c));
    return 0;
}


Measured memory_bytes: 2688