akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define gc getchar_unlocked
#define fo(i,n) for(i=0;i<n;i++)
#define Fo(i,k,n) for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll long long
#define si(x)	scanf("%d",&x)
#define sl(x)	scanf("%lld",&x)
#define ss(s)	scanf("%s",s)
#define pi(x)	printf("%d\n",x)
#define pl(x)	printf("%lld\n",x)
#define ps(s)	printf("%s\n",s)
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)
#define PI 3.1415926535897932384626
typedef pair<int, int>	pii;
typedef pair<ll, ll>	pl;
typedef vector<int>		vi;
typedef vector<ll>		vl;
typedef vector<pii>		vpii;
typedef vector<pl>		vpl;
typedef vector<vi>		vvi;
typedef vector<vl>		vvl;
int mpow(int base, int exp); 
void ipgraph(int m);
const int mod = 1000000007;
const int N = 3e5, M = N;
//=======================

vi g[N];
int visited[N],co=1;
vector<int> adj[N];

void dfs(int v){
    visited[v]=1;
    for(int x:adj[v]){
        if(!visited[x]){
            co++;
            dfs(x);
        }
    }
}

void solve(){
	int i, j, k, p, q, r, x, y, u, v, n, m,ans=1;
    cin>>n>>m;
    for(i=0;i<m;i++){
        cin>>p>>q;
        adj[p].pb(q);
        adj[q].pb(p);
    }
    for(i=1;i<=n;i++){
        if(!visited[i]){
            co=1;
            dfs(i);
            ans=max(ans,co);
           // deb(p);
        }
    }
    cout<<ans<<endl;
}

int main() {
	ios_base::sync_with_stdio(0);
	int i,t=1;
	//cin>>t;
	for(i=1;i<=t;i++){
		solve();
	}
	return 0;
}

int mpow(int base, int exp) {
	base %= mod;
	int result = 1;
	while (exp > 0) {
		if (exp & 1) result = ((ll)result * base) % mod;
		base = ((ll)base * base) % mod;
		exp >>= 1;
	}
	return result;
}

void ipgraph(int n, int m){
	int i, u, v;
	while(m--){
		cin>>u>>v;
		g[u-1].pb(v-1);
		g[v-1].pb(u-1);
	}
}






Measured memory_bytes: 30860
l,r=map(int,input().split())
if r-l+1>=2019:
  print(0)
  exit()
else:
  l=l%2019
  r=r%2019  
  if l>=r:
    print(0)
    exit()
    
ans=10000000
for i in range(l,r+1):
  for j in range(i+1,r+1):
    ans=min(ans,(i*j)%2019)
print(ans)

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

int main(){
    ll N,K;
    string S;
    cin >> N >> K >> S;
    ll sum = 0;
    for(ll i=1;i<N;i++){
        if(S[i-1]==S[i]) sum++;
    }
    sum = min(sum + 2*K, N-1);
    cout << sum << endl;
    return 0;
}

Measured memory_bytes: 768
import java.math.BigDecimal
import java.math.BigInteger
import kotlin.math.abs

fun main() {
  val (X, K, D) = readLongs() // 初期値e15, 移動回数e15, 移動量e15
  val x = BigInteger.valueOf(abs(X))
  val k = BigInteger.valueOf(K)
  val d = BigInteger.valueOf(D)

  if (x > k * d) {
    println(x - k * d)
    return
  }

  val a = x / d // over しない最小回数
  val b = a + BigInteger.valueOf(1) // over する最小回数
  val da = x - d * a // over しない距離
  val db = d * b - x // over する距離

  if (K % 2 == 0L) {
    if (a % BigInteger.valueOf(2) == BigInteger.valueOf(0)) {
      println(da)
    } else {
      println(db)
    }
  } else {
    if (a % BigInteger.valueOf(2) == BigInteger.valueOf(1)) {
      println(da)
    } else {
      println(db)
    }
  }
}

fun readString() = readLine()!!
fun readStrings() = readString().split(" ")
fun readInt() = readString().toInt()
fun readLong() = readString().toLong()
fun readInts() = readStrings().map { it.toInt() }
fun readLongs() = readStrings().map { it.toLong() }


Measured memory_bytes: 36568
/*input
6 8
1 2
2 3
1 4
4 3
1 5
5 3
1 6
6 3
*/
#include <bits/stdc++.h>
#pragma GCC optimize("unroll-loops,no-stack-protector")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<double,double> pdd;
#define IOS ios_base::sync_with_stdio(0); cin.tie(0)
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define F first
#define S second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define pb push_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
template<typename T1,typename T2>
ostream& operator<<(ostream& out,pair<T1,T2> P){
	out<<'('<<P.F<<','<<P.S<<')';
	return out;
}

//}}}
const ll maxn=300005;
const ll maxlg=__lg(maxn)+2;
const ll INF64=8000000000000000000LL;
const int INF=0x3f3f3f3f;
const ll MOD=ll(1e9+7);
const double PI=acos(-1);
//const ll p=880301;
//const ll P=31;

ll mypow(ll a,ll b){
	ll res=1LL;
	while(b){
		if(b&1) res=res*a%MOD;
		a=a*a%MOD;
		
		b>>=1;
	}
	return res;
}
int deg[maxn];
vector<int> edge[maxn];
int vis[maxn];
bool f=0;
void dfs(int u,int bye,int pre){
	// cout<<u<<' '<<bye<<'\n';
	vis[u]=-1;
	for(int v:edge[u]) if(v!=bye&&v!=pre){
		if(vis[v]==-1){
			f=1;
		}
		else if(vis[v]==1);
		else dfs(v,bye,u);
	}
	vis[u]=1;
}

int main()
{
	IOS;
	int n,m;
	cin>>n>>m;
	if(m<n+2){cout<<"No\n";return 0;}
	REP(i,m){
		int u,v;
		cin>>u>>v;
		u--;v--;
		deg[u]++;deg[v]++;
		edge[u].pb(v);
		edge[v].pb(u);
	}

	REP(i,n) if(deg[i]%2){
		cout<<"No\n";
		return 0;
	}
	if(m==n+2){
		int cnt=0;
		vector<int> tmp;
		REP(i,n) if(deg[i]==4){
			tmp.pb(i);
		}
		if(SZ(tmp)==2){
			dfs(tmp[0],tmp[1],-1);
			if(!f){
				cout<<"No\n";
				return 0;
			}
		}
	}
	cout<<"Yes\n";
	return 0;
}


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

int main() {
    // int a, a1, a2, a3, a4;
    // cin >> a;
    // a1 = a % 10;
    // a2 = a % 100;
    // a3 = 
    string s;
    cin >> s;
    if ((s[0]==s[1]&&s[0]==s[2])||(s[1]==s[2]&&s[1]==s[3])) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 3604
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define speed ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long long 
#define ull unsigned long long
#define db double
#define vi vector<ll>
#define vvi vector<vector<int> >
#define vvii vector<vector<pii> >
#define rep(i,a,b) for(int i=a;i<b;i++)
#define endl "\n"
#define pii pair<ll,ll>
#define piii pair<ll,pair<ll,ll> >
#define mem(a,b) memset(a , b , sizeof a ) ; 
#define pb push_back
#define pf push_front
#define F first 
#define S second 
#define mp make_pair
#define all(v) v.begin(),v.end()

#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
	cerr << *it << " = " << a << endl;
	err(++it, args...);
}



#define deb1(a) cout<<#a<<"=*"<<a<<endl;
#define deb2(a) cout<<#a<<"=@"<<a<<endl;
#define deb3(a) cout<<#a<<"=#"<<a<<endl;
#define deb4(a,b) cout<<#a<<"="<<a<<" and "<<#b<<"="<<b<<endl;
#define deb5(a,b) cout<<#a<<"="<<a<<" and "<<#b<<"="<<b<<endl;


typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;


ll mod=1000000007;
ll vis[212345]={0};
vvi v(212345);
ll d[212345]={0};


ll pow(ll a, ll b, ll m)
{
	ll ans=1;
	while(b)
	{
		if(b&1)
			ans=(ans*a)%m;
		b/=2;
		a=(a*a)%m;
	}
	return ans;
}


//extended euclidean algorithm( x is inverse of a wrt b onlt if gcd!=1)
ll gcd(ll a,ll b,ll &x,ll &y)
{
	if(b==0)
	{
		x=1;
		y=0;
		return a;
	}
	ll x1,y1;
	ll d=gcd(b,a%b,x1,y1);
	x=y1;
	y=x1-y1*(a/b);
	return d;

}
ll sz=0;

void dfs(ll k)
{
	sz++;
	vis[k]=1;
	rep(i,0,v[k].size()) if(!vis[v[k][i]]) dfs(v[k][i]);
}
int main()
{
speed
ll n,m;
cin>>n>>m;
rep(i,0,m)
{
	ll a,b;
	cin>>a>>b;
	v[a].pb(b);
	v[b].pb(a);
}
ll mx=0;
rep(i,1,n+1)
{
	if(!vis[i])
	{	sz=0;
		dfs(i);
		mx=max(mx,sz);
	}
}
cout<<mx<<endl;
}



Measured memory_bytes: 25320
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=1505,p=1000000007;
int read(){
	int f=1,g=0;char ch=getchar();
	for (;!isdigit(ch);ch=getchar()) if (ch=='-') f=-1;
	for (;isdigit(ch);ch=getchar()) g=g*10+ch-'0';
	return f*g;
}
int n,a[N][N],s[N][N],l[N][N],r[N][N];
ll ans;
char ch[N];
void del(int x,int y){
	for (int i=y;i<=n;i++) s[x][i]-=a[x][y];
	a[x][y]=0;
	if ((a[x][y+1])&&(!a[x-1][y+1])) del(x,y+1);
	if ((a[x+1][y])&&(!a[x+1][y-1])) del(x+1,y);
}
void chkmin(int &x,int y){if (x>y) x=y;}
void chkmax(int &x,int y){if (x<y) x=y;}
int main(){
	n=read();
	for (int i=1;i<=n;i++){
		scanf(" %s",ch+1);
		for (int j=1;j<=n;j++)
		a[i][j]=(ch[j]=='#') ? 0 : (ch[j]-'0'),s[i][j]=s[i][j-1]+a[i][j];
	}
	memset(l,0x3f,sizeof(l));
	for (int i=n;i;i--)
	for (int j=n;j;j--)
	if (a[i][j]){
		int t=-a[i][j];
		l[j][i]=r[j][i]=j;
		for (int x=i;x<=n;x++){
			chkmin(l[j][x],l[j+1][x]);chkmax(r[j][x],r[j+1][x]);
			if (l[j][x]<=r[j][x]) t+=s[x][r[j][x]]-s[x][l[j][x]-1];
		}
		ans+=a[i][j]*t;
		if (a[i-1][j]+a[i][j-1]==0) del(i,j);
	}
	else{memset(l[j]+i,0x3f,(n-i+1)*4);memset(r[j]+i,0,(n-i+1)*4);}
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 35712
#include<iostream>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<utility>
#include<algorithm>
#include<cstdio>
#include<iomanip>
#include<queue>
#include<stack>

#define ll int64_t
#define Rep(i, n) for (ll i = 0; i < n; i++)

using namespace std;

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

    ll N;
    cin >> N;
    vector<ll> B(N-1);
    Rep (i, N) {
        cin >> B[i];
    }

    B.push_back(1e6);
    ll ans = B[0];
    Rep (i, N-1) {
        ans += min(B[i], B[i+1]);
    }

    cout << ans << endl;

}

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

#define ll long long
#define pb push_back

using namespace std;

const int N=1e5+100;
ll n,x,even,odd,m=0;

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

    cin>>n;
    for(int i=0;i<n;i++)
    {
        cin>>x;
        if(x%2==0) { even++; }
        else       { odd++;  }
    }

    if( n!=1 &&  odd%2==1)
    {
        cout<<"NO";
        return 0;
    }


    cout<<"YES";
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
vector<tuple<string,int,int>> S;
int main(){
    int n,t,i;
    cin>>n;
    for(i=0;i<n;i++){
     string s;
     cin>>s>>t;
     S.emplace_back(s,-t,i);
    }
  sort(S.begin(),S.end());
  for(auto x: S) cout<<get<2>(x)+1<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <cmath>
#include <queue>
#include <deque>
#include <set>
#include <iomanip>
#include <utility>
#define ll long long
#define ld long double
using namespace std;

pair<ll, ll> p[100010];
pair<int, int> ord[100010];
int dp[100010];

int main() {
	int N;
	cin >> N;
	for(int i=0; i<N; ++i){
		ll X, L;
		cin >> X >> L;
		p[i]=make_pair(X-L, X+L);
	}
	sort(p, p+N);
	for(int i=0; i<N; ++i){
		int ng=i, ok=N;
		while(ng+1<ok){
			int mid=(ng+ok)/2;
			if(p[i].second<=p[mid].first) ok=mid;
			else ng=mid;
		}
		ord[i]=make_pair(ok, i);
	}
	sort(ord, ord+N, greater<pair<int, int>>());
	int ch=N, now=0;
	for(int i=0; i<N; ++i){
		while(ord[i].first<ch){
			--ch;
			now=max(now, dp[ch]);
		}
		dp[ord[i].second]=now+1;
	}
	int ans=0;
	for(int i=0; i<N; ++i) ans=max(ans, dp[i]);
	cout << ans << endl;
	return 0;
}

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

using namespace std;

int n, k;
int main() {
    scanf("%d%d", &n, &k);
    int tmp = 0, mx = 0, x;
    for(int i = 0; i < n; i++) {
        scanf("%d", &x);
        tmp = __gcd(tmp, x);
        mx = max(mx, x);
    }
    if(k % tmp || k > mx)
        printf("IMPOSSIBLE\n");
    else
        printf("POSSIBLE");
    return 0;
}


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

using namespace std;

struct Union_Find {
	vector<int> rank, par;
	int independent_tree;
	int N;

	Union_Find(int n) {
		N = n;
		for (int i = 0; i < N; i++)rank.push_back(1), par.push_back(i);
		independent_tree = N;
	}

	int getroot(int X) {
		if (par[X] == X)return X;
		return par[X] = getroot(par[X]);
	}

	bool issame(int A, int B) {
		return getroot(A) == getroot(B);
	}

	void unite(int A, int B) {
		A = getroot(A), B = getroot(B);
		if (A == B)return;
		if (rank[A] > rank[B]) {
			par[B] = A;
		}
		else if (rank[A] == rank[B]) {
			par[B] = A;
			rank[A]++;
		}
		else {
			par[A] = B;
		}
	}

};

int N, M;

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

	Union_Find uf(200000 + 1000);
	for (int i = 0; i < N; i++) {
		int K;
		cin >> K;
		for (int j = 0; j < K; j++) {
			int L;
			cin >> L;
			L--;
			uf.unite(i, N + L);
		}
	}

	int root = uf.getroot(0);
	for (int i = 0; i < N; i++) {
		if (uf.getroot(i) != root) {
			cout << "NO" << endl;
			return 0;
		}
	}
	cout << "YES" << endl;
	return 0;
}

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

using namespace std;

int main(void)
{
	int n,x,t;
	int sum=0;
	vector <int> v;

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

	cin >> n >> x;

	for(int i=0;i<n;i++)
	{
		cin >> t;
		v.push_back(t);
		sum+=t;
	}

	int res = n;
	x-=sum;

	sort(v.begin(),v.end());
	res += (x/v[0]);

	cout << res << '\n';
	return 0;
}

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

using namespace std;
typedef long long ll;

const int P=1e9+7;
int n,m,K,U;
ll f[1<<19],ans;
bool vis[20][20],pos[20][20];

#define lowbit(x) ((x)&-(x))

int main(){
	scanf("%d%d%d",&n,&m,&K);
	for(int i=1,a,b,c;i<=K;i++)scanf("%d%d%d",&a,&b,&c),a--,b--,vis[a][b]=true,pos[a][b]=c;
	U=1<<--n,f[0]=1;
	for(int p=0;p<m;p++){
		for(int i=0;i<n;i++){
			if(!vis[p][i]||pos[p][i])
				for(int j=0,l=1<<i;j<U;j+=l<<1)for(int k=0;k<l;k++)if(f[j+k])f[j+k+l-lowbit(j)]+=f[j+k];
			if(vis[p][i])
				for(int j=0,l=1<<i,k=pos[p][i]?0:l;j<U;j+=l<<1)memset(f+j+k,0,l<<3);
		}
		for(int i=0;i<U;i++)if(f[i]>=P)f[i]%=P;
	}
	for(int i=0;i<U;i++)ans+=f[i];
	printf("%lld\n",ans%P);
	return 0;
}

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

vector<long long int> num;

void solve(long long int n){
    if(n >= 1e10) return;
    num.push_back(n);
    int d = n % 10;
    for(int i = max(0, d-1); i <= min(9, d+1); i++){
        solve(10 * n + i);
    }
}

int main() {
    int k;
    cin >> k;
    for(int i = 1; i <= 9; i++){
        solve(i);
    }
    sort(begin(num), end(num));
    cout << num[k-1] << endl;
    return 0;
}

Measured memory_bytes: 2420
#include <bits/stdc++.h>
#define FAST ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
typedef long long ll;
typedef long double ld;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second

#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds; 

#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update> 

using namespace std;

int main()
{
   FAST/**/
   
   string s;
   cin>>s;
   
   ll n = s.length();
   
   
   ll cnt = 0;
   for(ll i=0;i<n/2;i++)
   {
       if(s[i]!=s[n-1-i])
            cnt++;
   }
   
   cout<<cnt;
   
   
   return 0;
}  
   

Measured memory_bytes: 256
#include<bits/stdc++.h>							
typedef long long ll;
#define pb push_back
#define mod 1000000007ll
const ll maxn = 9e18;
using namespace std;
const ll maxsize = 100000009;


void solve() {
	int n; 
	cin >> n; 
	int arr[n]; 
	for(int i = 0; i < n; ++i) {
		cin >> arr[i];
		}
		ll ans = 0; 
		for(int i = 0; i < n - 1; ++i) {
			for(int j = i + 1; j < n; ++j) {
				ans += (arr[i] * arr[j]);
				}
			}
			cout << ans << endl;
}


int main() {
	ios_base :: sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	cout.precision(35);
	solve();
	return 0;
}
 
 
 



Measured memory_bytes: 3624
import Control.Applicative
import Data.ByteString.Char8 (ByteString)
import qualified Data.ByteString.Char8 as B
import Data.List
import Data.Char (isSpace)

main :: IO ()
main = do
  getLine
  solve <$> f >>= print
  where
    f = readil B.readInt <$> B.getLine

solve :: [Int] -> Int
solve xs = case f 1 [] xs of
            [x] -> x
            [x,y] -> x + y
            ys -> g 0 ys
  where
    f n as [_] = n : as
    f n as (x:y:ys)
      | x /= y = f (n + 1) as (y:ys)
      | otherwise = f 1 (n : as) (y:ys)
    g mx (x:y:z:zs) = g (max mx (x + y + z)) (y:z:zs)
    g mx _ = mx
    
readil :: Integral a =>  (ByteString -> Maybe (a, ByteString)) -> ByteString -> [a]
readil f = unfoldr $ \s -> do
  (n, s') <- f s
  return (n, B.dropWhile isSpace s')



Measured memory_bytes: 16356
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <list>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <bitset>
#include <random>
#include <complex>
#include <assert.h>

using namespace std;
typedef long long ll;
#define endl '\n'

template<typename T>
inline bool chmin(T& x, T a) {
	if (x >= a) { x = a; return true; }
	return false;
}

template<typename T>
inline bool chmax(T& x, T a) {
	if (x <= a) { x = a; return true; }
	return false;
}

int N, M, X, ans;
vector<int> C;
vector<vector<int>> A;

vector<int> x(12, 0);

void dfs(int n, int temp) {
	if (n == N) {
		for (int i = 0; i < M; i++) {
			if (x[i] < X) { return; }
		}
		chmin(ans, temp);
	}
	else {
		dfs(n + 1, temp);
		for (int i = 0; i < M; i++) {
			x[i] += A[n][i];
		}
		dfs(n + 1, temp + C[n]);
		for (int i = 0; i < M; i++) {
			x[i] -= A[n][i];
		}
	}
}

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

	ans = 1000000000;

	cin >> N >> M >> X;
	C.resize(N);
	A.resize(N);
	for (int i = 0; i < N; i++) {
		A[i].resize(M);
		cin >> C[i];
		for (int j = 0; j < M; j++) {
			cin >> A[i][j];
		}
	}

	dfs(0, 0);

	if (ans == 1000000000) {
		cout << "-1" << endl;
	}
	else {
		cout << ans << endl;
	}

	return 0;
}

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

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

  cout << fixed << setprecision(10);
  int num = 0;
  for(int i = 1;i <= N;i++) {
    if(i%2 != 0) num++;
  }

  cout << (double)num / N << endl;
}



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

using namespace std;

//int dirs[4][2]={{-1,0},{1,0},{0,-1},{0,1}};
//int dirs[8][2]={{-1,-1},{-1,0},{-1,1},{0,-1},{0,1},{1,-1},{1,0},{1,1}};
double inf=1e9;

double afstand(double x1, double y1, double x2, double y2)
{
    return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
}

double eps=1e-9;

int main()
{
    //ios::sync_with_stdio(false);
    //freopen("inp.in","r",stdin);
    //freopen("outp.out","w",stdout);
    int n;
    cin >> n;
    vector<double> xs(n);
    vector<double> ys(n);
    for(int i=0; i<n; i++)
    {
        cin >> xs[i] >> ys[i];
    }
    if(n==2)
    {
        double ans=afstand(xs[0],ys[0],xs[1],ys[1])/2;
        cout << fixed << setprecision(12) << ans << endl;
        return 0;
    }
    double ans=inf;
    for(int i=0; i<n; i++)
    {
        for(int j=i+1; j<n; j++)
        {
            for(int k=j+1; k<n; k++)
            {
                double ax=xs[i];
                double ay=ys[i];
                double bx=xs[j];
                double by=ys[j];
                double cx=xs[k];
                double cy=ys[k];
                double D=2*(ax*(by-cy)+bx*(cy-ay)+cx*(ay-by));
                double ux=-1;
                double uy=-1;
                if(abs(D)<=eps)
                {
                    double maxX=max(ax,max(bx,cx));
                    double minX=min(ax,min(bx,cx));
                    double maxY=max(ay,max(by,cy));
                    double minY=min(ay,min(by,cy));
                    ux=(maxX+minX)/2;
                    uy=(maxY+minY)/2;
                }
                else
                {
                    ux=((ax*ax+ay*ay)*(by-cy)+(bx*bx+by*by)*(cy-ay)+(cx*cx+cy*cy)*(ay-by))/D;
                    uy=((ax*ax+ay*ay)*(cx-bx)+(bx*bx+by*by)*(ax-cx)+(cx*cx+cy*cy)*(bx-ax))/D;
                }
                double maxx=0;
                for(int l=0; l<n; l++)
                {
                    maxx=max(maxx,afstand(ux,uy,xs[l],ys[l]));
                }
                /*if(maxx==0)
                {
                    cout << ax << " " << ay << endl;
                    cout << bx << " " << by << endl;
                    cout << cx << " " << cy << endl;
                    cout << ux << " " << uy << endl;
                    cout << D << endl;
                    cout << endl;
                }*/
                ans=min(ans,maxx);
            }
        }
    }
    for(int i=0; i<n; i++)
    {
        for(int j=i+1; j<n; j++)
        {
            double maxx=0;
            double ux=(xs[i]+xs[j])/2;
            double uy=(ys[i]+ys[j])/2;
            for(int l=0; l<n; l++)
            {
                maxx=max(maxx,afstand(ux,uy,xs[l],ys[l]));
            }
            ans=min(ans,maxx);
        }
    }
    cout << fixed << setprecision(12) << ans << endl;
    return 0;
}


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

using namespace std;

#define sqr(x) ((x) * (x))
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()

typedef vector<int> vi;
typedef long long ll;

void solve() {
  int N, L, sum = 0, eat = 0;
  cin >> N >> L;
  int R = L + N - 1;
  if (R < 0)
    eat = R;
  else if (L > 0)
    eat = L;
  else
    eat = 0;

  cout << (N * (L + R) / 2) - eat << endl;
}

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

  solve();

  return 0;
}


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

using namespace std;

#define int long long
#define all(v) (v).begin(), (v).end()
#define resz(v, ...) (v).clear(), (v).resize(__VA_ARGS__)
#define reps(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define rep(i, n) reps(i, 0, n)

template<class T1, class T2> void chmin(T1 &a, T2 b){if(a>b)a=b;}
template<class T1, class T2> void chmax(T1 &a, T2 b){if(a<b)a=b;}

using Pi = pair<int, int>;
using Tapris = tuple<int, int, int>;
using vint = vector<int>;

const int inf = 1LL << 55;
const int mod = 1e9 + 7;

signed main() {
  cin.tie(0);
  ios_base::sync_with_stdio(0);
  cout << fixed << setprecision(12);

  string s;
  cin >> s;
  cout << count(all(s), '+')-count(all(s), '-') << endl;

  return 0;
}


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

#define ll long long
#define ull unsigned long long
#define ld long double
#define Yes cout<<"Yes\n"
#define No cout<<"No\n"
#define fo(i,start,end) for(int i=start;start<end?i<end:i>end;start<end?i+=1:i-=1)
#define pb push_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define F first
#define S second
#define vll vector<ll>
#define pll pair<ll,ll>
#define vop vector<pll>
#define vov vector<vector<ll>>
#define endl "\n"
using namespace std;
const ld pi=3.14159265358979323;

const long long mod1=1e9+7;
const long long mod2=1e18;
const ll mod3=9e18;
const ll N=1e9+7;

long long power(ll  x, ll n){if(n==0)return 1;ll temp=power(x,n/2);if(n%2==0)return temp*temp;else return x*temp*temp;}

ll gcd(ll a,ll b){if(a<b) return gcd(b,a);if(b==0) return a;return gcd(b,a%b);}
ll lcm(ll a,ll b){return (a*b)/(gcd(a,b));}
void swap(int* a, int* b){int t = *a;*a = *b;*b = t;}
bool f(ll x,ll y){return x>y;}

ll MAX(ll a,ll b){return a>b?a:b;}
ll MIN(ll x,ll  y){return x>y?y:x;}

ll pmod(ll a, ll b,ll mod)//a^b%mod
{
    ll ans=1;
    while(b)
    {
        if(b&1)
            ans=(ans*a)%mod;
        b/=2;
        a=(a*a)%mod;
    }
    return ans;
}

bool cmp2( pair<ll,ll> &a,
           pair<ll,ll> &b)
{
    return a.second>b.second;
}


void solve() {
   ll n,m;
   cin>>n>>m;
   string s[n];
   fo(i,0,n)cin>>s[i];
   ll ans[n][m];
   memset(ans,0,sizeof(ans));
   if(s[0][0]=='#'){
       cout<<0;
       return;

   }

   fo(i,0,n){
       fo(j,0,m){
           if(s[i][j]=='#')ans[i][j]=-1;

       }
   }



   ll i;
   for( i=0;i<n;i++){
       if(s[i][0]=='#')break;
       else ans[i][0]=1;

   }
   for(ll j=i+1;j<n;j++){
       ans[j][0]=-1;

   }
   i=0;
    for( i=0;i<m;i++){
        if(s[0][i]=='#')break;
        else ans[0][i]=1;

    }
    for(ll j=i+1;j<m;j++){
        ans[0][j]=-1;

    }


    for(ll i=1;i<n;i++) {
        for (ll j = 1; j < m; j++) {
            if (ans[i][j] != -1) {
                if (ans[i - 1][j] >0)ans[i][j]+=ans[i-1][j];
                if(ans[i][j-1]>0)ans[i][j]+=ans[i][j-1];
                ans[i][j]%=N;


            }
        }

    }





  if(ans[n-1][m-1]>0)cout<<ans[n-1][m-1]%N;
  else cout<<0;






}

























int main() {

    ios_base::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
#ifndef ONLINE_JUDGE
    freopen("input.txt" , "r" , stdin) ;
    freopen("output.txt" , "w" , stdout) ;
    //freopen("error.txt" , "w" , stderr) ;
#endif








    ll t;
    t=1;
    //cin>>t;
    //  cin.ignore();
    while(t--){

        solve();
    }




    return 0;


}

////vll adj[100001];
////ll vis[100001];
////ll sssp[100001];

Measured memory_bytes: 12524
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <list>
#include <stack>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>

#define int long long
#define MOD 1000000007

#define rep(i, n) for (int i = 0; i < (n); i++)
#define itrep(i, a) for (auto i = (a).begin(); i != (a).end(); i++)
#define REP(i, a, n) for (int i = (a); i <= (n); i++)
#define all(a) (a).begin(), (a).end()
#define mp(a, b) make_pair((a), (b))

using namespace std;

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

template<class T> void inputVector(vector<T>& v, int n) {
    v.resize(n);
    for (int i = 0; i < v.size(); i++) cin >> v[i];
}

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

    vector<int> A;
    inputVector(A, N + 1);

    if (N == 0 && A[0] == 0) {
        cout << -1 << endl;
        return 0;
    }

    vector<int> maxNodeNum(N + 1);
    maxNodeNum[0] = 1;
    REP(i, 1, N) {
        maxNodeNum[i] = min((maxNodeNum[i - 1] - A[i - 1]) * 2, LLONG_MAX / 100);
    }

    int ret = 0;
    int prev = 0;
    for (int i = N; i >= 0; i--) {
        if (maxNodeNum[i] < A[i]) {
            cout << -1 << endl;
            return 0;
        }
        prev = min(maxNodeNum[i], A[i] + prev);
        ret += prev;
    }

    cout << ret << endl;

    return 0;
}


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

namespace Sample1
{
    class Program
    {
        static void Main(string[] args)
        {
            var age = Console.ReadLine();
            var nAge = Int32.Parse(age);
            switch (nAge)
            {
                case 1:
                    Console.WriteLine("Hello World");
                    break;
                case 2:
                    var A = Int32.Parse(Console.ReadLine());
                    var B = Int32.Parse(Console.ReadLine());
                    Console.WriteLine($"{A + B}");
                    break;
                dafault:
                    break;
            }

        }
    }
}


Measured memory_bytes: 13140
// practice with kaiboy
import java.io.*;
import java.util.*;

public class Main extends PrintWriter {
	Main() { super(System.out, true); }
	Scanner sc = new Scanner(System.in);
	public static void main(String[] $) {
		Main o = new Main(); o.main(); o.flush();
	}

	long count(long n) {
		return n < 5 ? 0 : count(n / 5) + n / 5;
	}
	void main() {
		long n = sc.nextLong();
		println(n % 2 == 1 ? 0 : count(n / 2));
	}
}


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

int main()
{
    int n,k,x,y,i;
    long long sum=0;
    cin>>n>>k>>x>>y;
    for(i=1;i<=n;i++)
    {
        if(i<=k)
        {
            sum+=x;
        }
        else
        {
            sum+=y;
        }
    }
    cout<<sum<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
using pint = pair<int, int>;
using vi = vector<int>;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()

template<typename T> T gcd(T a, T b) { return b ? gcd(b, a%b) : a; }
template<typename T> T lcm(T a, T b) { return a / gcd(a, b) * b; }
template<class T> void corner(bool flg, T hoge) { if (flg) { cout << hoge << endl; exit(0); } }

const int MOD = 1000000007;
const int INF = 1 << 30;

int main() {
    string S, T, U;
    int A, B;
    cin >> S >> T;
    cin >> A >> B >> U;

    if (U == S) cout << A-1 << " " << B << endl;
    else cout << A << " " << B-1 << endl;
    return 0;
}


Measured memory_bytes: 256
A, B, C, X, Y = map(int, input().split())

# A ピザ p 枚、 B ピザ q 枚、 C ピザ r 枚　（c は偶数）
# p + r // 2 >= X
# q + r // 2 >= Y
# A * p + B * q + C * r を最小にする

# r を基準にしてループを回す

max_r = max(X, Y) * 2 

cost = float('inf')

for r in range(0, max_r+2, 2):
  p = max(X - r // 2, 0)
  q = max(Y - r // 2, 0)
  tmp_cost = A * p + B * q + C * r  
  cost = min(cost, tmp_cost)
  
print(cost)

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
int main(){
  int a,b,c,x;
  cin>>a>>b>>c>>x;
  int ans=0;
  for(int i=0;i<=a;i++)
    for(int j=0;j<=b;j++)
      for(int k=0;k<=c;k++)
	if(500*i+100*j+50*k==x)ans++;
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 256
import java.text.DecimalFormat;
import java.util.stream.LongStream;
import java.util.stream.IntStream;
import java.io.*;
import java.util.*;

public class Main {
    
    public static void main(String[] args) {
        FastScanner sc = new FastScanner();
        PrintWriter out = new PrintWriter(System.out);
        
        AtCoder problem = new AtCoder(sc);
        problem.solve(out);
        
        out.flush();
    }
    
}

class AtCoder {
    int r;
    AtCoder(FastScanner sc) {
        r = sc.nextInt();
    }

    void solve(PrintWriter out) {
        out.println(3*r*r);
    }
    
}

// https://qiita.com/p_shiki37/items/a0f6aac33bf60f5f65e4
class FastScanner {
    
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        } else {
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    
    private int readByte() {
        if (hasNextByte()) {
            return buffer[ptr++];
        } else {
            return -1;
        }
    }
    
    private static boolean isPrintableChar(int c) {
        return 33 <= c && c <= 126;
    }
    
    public boolean hasNext() {
        while (hasNextByte() && !isPrintableChar(buffer[ptr])) {
            ptr++;
        }
        return hasNextByte();
    }
    
    public String next() {
        if (!hasNext()) {
            throw new NoSuchElementException();
        }
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while (isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    
    public long nextLong() {
        if (!hasNext()) {
            throw new NoSuchElementException();
        }
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while (true) {
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            } else if (b == -1 || !isPrintableChar(b)) {
                return minus ? -n : n;
            } else {
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) {
            throw new NumberFormatException();
        }
        return (int) nl;
    }
    
    public double nextDouble() {
        return Double.parseDouble(next());
    }
}


Measured memory_bytes: 21460
#include<bits/stdc++.h>
const int N=1e5+5;
int n,m,i,g;
char s[N],t[N];
int main(){
	scanf("%d%d%s%s",&n,&m,s+1,t+1);
	g=std::__gcd(n,m);
	for(i=1;i<=g;++i)if(s[n/g*(i-1)+1]!=t[m/g*(i-1)+1])return puts("-1"),0;
	printf("%lld\n",1ll*n*m/g);
	return 0;
}

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

namespace ABC068B_CS
{
    class Program
    {
        static void Main(string[] args)
        {
            var n = int.Parse(Console.ReadLine());
            var result = 0;
            var maxCount = 0;
            if(n == 1) { Console.WriteLine("1");return; }
            for (var i = 2; i <= n; i += 2)
            {
                var count = 0;
                var x = i;
                while (x % 2 == 0)
                {
                    x = x / 2;
                    count++;
                }
                if (maxCount < count)
                {
                    maxCount = count;
                    result = i;

                }
            }
            
            Console.WriteLine(result);
        }
    }
}


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

int niz[100005];
int rj[100005];

int main () {
	
	int n;
	cin>>n;
	for(int i=0; i<n; i++){
		cin>>niz[i];
	}	
	rj[0]=0;
	if(niz[1]>niz[0]){
		rj[1]=niz[1]-niz[0];
	}
	else{
		rj[1]=niz[0]-niz[1];
	}
	for(int i=2; i<n; i++){
		rj[i]=min(max(niz[i-1],niz[i])-min(niz[i],niz[i-1])+rj[i-1],max(niz[i-2],niz[i])-min(niz[i],niz[i-2])+rj[i-2]);
	}
	cout<<rj[n-1];
	
	return 0;
}

Measured memory_bytes: 1024
from heapq import heapify, heappop, heappush
N, *A = map(int, open(0).read().split())
*A, = zip(*[iter(A)]*2)
A = [(x, y, i) for i, (x, y) in enumerate(A)]
A.sort()
G = []
x0, y0, i0 = A[0]
for x, y, i in A[1:]:
    c = min(abs(x-x0), abs(y-y0))
    heappush(G, (c, i0, i))
    x0, y0, i0 = x, y, i
A.sort(key=lambda x: x[1])
x0, y0, i0 = A[0]
for x, y, i in A[1:]:
    c = min(abs(x-x0), abs(y-y0))
    heappush(G, (c, i0, i))
    x0, y0, i0 = x, y, i


class UnionFind:
    def __init__(self, n=0):
        self.d = [-1]*n
        self.u = n

    def root(self, x):
        if self.d[x] < 0:
            return x
        self.d[x] = self.root(self.d[x])
        return self.d[x]

    def unite(self, x, y):
        x, y = self.root(x), self.root(y)
        if x == y:
            return False
        if x > y:
            x, y = y, x
        self.d[x] += self.d[y]
        self.d[y] = x
        self.u -= 1
        return True

    def same(self, x, y):
        return self.root(x) == self.root(y)

    def size(self, x):
        return -self.d[self.root(x)]

    def num_union(self):
        return self.u


ans = 0
u = UnionFind(N)
while u.num_union() > 1:
    c, a, b = heappop(G)
    if u.same(a, b):
        continue
    u.unite(a, b)
    ans += c

print(ans)


Measured memory_bytes: 47992
def main ():
    antennas= [int(input()) for _ in range(5)]
    max_len     = int(input())
    print (distance_comparison(max_len,antennas))

def distance_comparison(max_len,antennas):
    if max(antennas) - min(antennas) <= max_len:
        return "Yay!"
    return ":("

main()

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

int main(){
  const long long INF = 1e18;
  int N, K;
  cin >> N >> K;
  vector<int> H(N+1);
  for(int i = 0; i < N; ++i) cin >> H[i];
  vector<int> h = H;
  sort(h.begin(), h.end());
  h.erase(unique(h.begin(), h.end()),h.end());
  int m = h.size();
  map<int,int> I;
  for(int i = 0; i < m; ++i)
    I[h[i]] = i;
  vector<vector<long long>> dp(K+1,vector<long long>(N+1,INF));
  dp[0][0] = 0;
  for(int i = 0; i < N; ++i){
    int idx = I[H[i]];
    vector<vector<long long>> dp_(K+1,vector<long long>(N+1,INF));
    for(int j = 0; j <= K; ++j){
      for(int l = 0; l < m; ++l){
        if(h[l] < h[idx])
          dp_[j][idx] = min(dp_[j][idx],dp[j][l]+h[idx]-h[l]);
        else
          dp_[j][idx] = min(dp_[j][idx],dp[j][l]);
      }
      //change i-th height
      if(j == K) continue;
      vector<long long> mi(m+1,INF);
      for(int l = m-1; l >= 0; --l){
        mi[l] = min(dp[j][l],mi[l+1]);
      }
      long long s = INF;
      for(int l = 0; l < m; ++l){
        dp_[j+1][l] = min(dp_[j+1][l],mi[l]);
        if(l > 0){
          s += h[l]-h[l-1];
        }
        s = min(s,dp[j][l]);
        dp_[j+1][l] = min(dp_[j+1][l],s);
      }
    }
    swap(dp_,dp);
  }
  long long ans = INF;
  for(int i = 0; i <= K; ++i){
    for(int j = 0; j < m; ++j){
      //cerr << i << " " << j <<  " "<< dp[i][j] << endl;
      ans = min(ans,dp[i][j]);
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 1744
n, k = map(int,(input().split()))
h = []
for i in range(n):
    h.append(int(input()))
h.sort()
min=h[-1]-h[0]
for i in range(n-k+1):
    if h[i+k-1]-h[i] < min:
        min = h[i+k-1]-h[i]
print(min)

Measured memory_bytes: 7384
w, h, n = map(int, input().split())
ls = [[int(_) for _ in input().split()] for _ in range(n)]

x1 = 0
x2 = w
y1 = 0
y2 = h

for i in range(n):
	if ls[i][2] == 1:
		if ls[i][0] >= x1:
			x1 = ls[i][0]
	elif ls[i][2] == 2:
		if ls[i][0] <= x2:
			x2 = ls[i][0]
	elif ls[i][2] == 3:
		if ls[i][1] >= y1:
			y1 = ls[i][1]
	elif ls[i][2] == 4:
		if ls[i][1] <= y2:
			y2 = ls[i][1]

if x1 >= x2 or y1 >= y2:
	print(0)
else:
	print((x2 - x1) * (y2 - y1))

Measured memory_bytes: 3064
#include<cstdio>
#include<cstring>

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

using namespace std;

bool ispali(int n){
	char s[8];
	sprintf(s,"%d",n);
	int m=strlen(s);
	rep(i,m/2) if(s[i]!=s[m-i-1]) return false;
	return true;
}

int main(){
	int n; scanf("%d",&n);

	int n1=n;
	while(!ispali(n1)) n1--;

	int n2=n;
	while(!ispali(n2)) n2++;

	printf("%d\n",n-n1<=n2-n?n1:n2);

	return 0;
}

Measured memory_bytes: 1036
import math
a,b,h,m = map(int,input().split())
print(((a*math.sin(math.pi*(h*60+m)/360)-b*math.sin(math.pi*m/30))**2+(a*math.cos(math.pi*(h*60+m)/360)-b*math.cos(math.pi*m/30))**2)**0.5)

Measured memory_bytes: 62388
//   _/                _/                 _/_/_/   _/
//_/_/_/_/   _/_/   _/_/_/_/   _/_/    _/       _/_/
// _/     _/    _/   _/     _/    _/  _/_/_/     _/
//_/     _/    _/   _/     _/    _/  _/    _/   _/
// _/_/   _/_/       _/_/   _/_/      _/_/     _/
#include<iostream>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<set>
#include<map>
#include<queue>
#include<vector>
using namespace std;
typedef long long ll;
const int MOD=1e9+7;
const double pi=3.14159265358979323846;
const int inf=2e9;
const ll INF=5e18;
typedef pair<int,int> P;
int main() {
  cin.tie(0),cout.tie(0);
  ios::sync_with_stdio(false);
  ll n,ans=1,x;
  cin >> n;
  map<int,int> m;
  for(int i=2; i<=n; i++) {
    x=i;
    for(int j=2; j<=x; j++) {
      while(x%j==0) {
        m[j]++;
        x/=j;
      }
    }
  }
  for(auto p:m) {
    ans*=p.second+1;
    ans%=MOD;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
	int n,a[1000],count=0;
	cin>>n;
	for(int i=0;i<n;i++)cin>>a[i];
	loop2:;
	for(int j=0;j<n;j++){
		if(a[j]%2==1)goto loop1;
		if(j==n-1){
			count++;
			goto loop2;
		}
		a[j]=a[j]/2;
	}
	loop1:;
	cout<<count<<endl;
}


Measured memory_bytes: 256
import java.util.*;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		Deque<Integer> s = new ArrayDeque<>();
		List<Integer> al = new ArrayList<>();
		
		while(sc.hasNext()) {
			int tmp = sc.nextInt();
			
			if(tmp == 0) {
				al.add(s.removeFirst());
			} else {
				s.addFirst(tmp);	
			}
		}
		
		for(int i = 0; i < al.size(); i++) {
			System.out.println(al.get(i));
		}
	}
}

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

using namespace std;

typedef long long LL;
typedef double LF;
typedef complex<LF> cd;

#define clr(x, y) memset(x, y, sizeof(x))
#define INF 0x7fffffff

const int MAXN = 2e5 + 15;

int a[MAXN], b[MAXN], n, m, ans, cnt = 0;
struct Node{int l, r, c;}f[MAXN];

inline int read(){
	int r = 0, z = 1; char ch = getchar();
	while(ch < '0' || ch > '9'){if(ch == '-') z = -1; ch = getchar();}
	while(ch >= '0' && ch <= '9'){r = r * 10 + ch - '0'; ch = getchar();}
	return r * z;
}

bool check(int k){ cnt = 0;
	for(int i = 1; i <= n; i ++) b[i] = (a[i] >= k ? 1 : 0);
	int i = 1;
	while(i < n){
		if(b[i] != b[i + 1]){i ++; continue;}
		f[++ cnt].l = i, f[cnt].c = b[i];
		while(i < n && b[i] == b[i + 1]) i ++;
		f[cnt].r = i; i ++;
	}
	if(!cnt) return b[1]; f[0].r = 0;
	for(int i = 1; i <= cnt; i ++){
		int l = f[i - 1].r + 1, r = f[i].l - 1;
		if(l > r) continue;
		int mid = l + r >> 1;
		f[i - 1].r = mid, f[i].l = mid + 1;
	}
	int l = f[cnt].r + 1, r = n; int mid = l + r >> 1;
	if(l <= r) f[cnt].r = mid;
	for(int i = 1; i <= n; i ++) if(f[i].l <= m && f[i].r >= m) return f[i].c;
}

void tp(){
	int l = 1, r = n;
	while(l <= r){
		int mid = l + r >> 1;
		if(check(mid)) ans = mid, l = mid + 1;
		else r = mid - 1;
	}
}

void work(){
	n = read(); m = n; n = n * 2 - 1;
	for(int i = 1; i <= n; i ++) a[i] = read();
	tp();
	printf("%d\n", ans);
}

int main(){
	work();
	return 0;
}

Measured memory_bytes: 2432
require 'prime'
Primes = (2..50000).select(&:prime?)
loop do
  n = gets.to_i
  break if n==0
  primes = Primes.dup
  l = primes.shift
  h = primes.pop
  cnt = 0
  while !primes.empty?
    case
    when l+h==n; l = primes.shift; cnt += 1
    when l+h<n; l = primes.shift
    else h = primes.pop
    end
  end
  cnt += 1 if l*2==n || h*2==n || l+h==n
  puts cnt
end

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

using namespace std;

typedef long long llong;
typedef unsigned long long ullong;
#define inf 1ll<<60
#define pqueue priority_queue
#define mp make_pair
#define pb push_back
#define fn fill_n
#define int llong
#define be(x) x.begin(), x.end()
typedef pair<int, int> P;


signed main(){
	int a, b;
	cin >> a >> b;
	if(b%a == 0)
		cout << a + b << endl;
	else
		cout << b - a << endl;

	return 0;
}

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

int main(int argc, char *argv[]) {
  ios::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);

  int s;cin>>s;

  int res=1;
  while(1){
    if(s==4||s==2||s==1){
      cout<<res+3<<endl;
      return 0;
    }
    if(s%2==0){
      s/=2;
    }else{
      s=3*s+1;
    }
    res++;
  }

  return 0;
}


Measured memory_bytes: 256
import sys
def gcd(a,b):
    if a < b:
        a,b = b,a
    if b == 0:
        return a
    r = a%b
    return gcd(b,r)

N = int(input())
A = list(map(int,input().split()))

mini = min(A)
div = 10**9
for a in A:
    div = min(div,gcd(mini,a))

print(div)


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

"""
線形探索
"""

N = int(input())
sN = list(map(int, input().split()))
Q = int(input())
tQ = list(map(int, input().split()))

sN = list(set(sN))

cnt = 0
for i in range(Q):
    for j in range(len(sN)):
        if tQ[i] == sN[j]:
            cnt += 1
            # 見つかったらiQ[i]についてこれ以上調べることない
            break
print(cnt)



Measured memory_bytes: 6556
// copied by Nurstan Duisengaliev
// skatal
#include <bits/stdc++.h>
 
#define ll long long
#define all(x) x.begin(), x.end()
#define in insert
#define mp make_pair
#define F first
#define S second
#define ppf pop_front
#define pb push_back
#define ppb pop_back
#define pf push_front
#define pii pair <int, int>
#define boost() ios_base::sync_with_stdio(0), cin.tie(0)
#define sz(x) x.size()
 
using namespace std;
 
const int N = (int)2e5 + 123;
const int mod = (int)1e9 + 7;
const ll INF = (ll)1e18 + 7;

void solve () {
	int n;
	cin >> n;
	cout << n * n;
}
 
main () {
//	freopen (".in", "r", stdin);
//	freopen (".out", "w", stdout);
	boost ();
	int TT = 1;
//	cin >> TT;
	while (TT --) {
		solve ();
	}
	return 0;	
}

Measured memory_bytes: 256
def get_digit(n, digit):
    for i in range(digit):
        n //= 3
    return n % 3


n = int(input())
A = list(map(int, input().split()))
ans = 0
for i in range(3**n):
    for j in range(len(A)):
        if (A[j]+get_digit(i, j)-1) % 2 == 0:
            ans += 1
            break
print(ans)


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

using namespace std;

int main() {
    int N;
    cin >> N;
    
    if (N % 10 == 3) {
        cout << "bon" << endl;
    } else if (N % 10 == 0 || N % 10 == 1 || N % 10 == 6 || N % 10 == 8) {
        cout << "pon" << endl;
    } else {
        cout << "hon" << endl;
    }
}

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

//qsort用降順
int cmp(const void *a,const void *b){
    if(*(int*)a>*(int*)b){return 1;}
    else if(*(int*)a<*(int*)b){return -1;}
    else {return 0;}
}


int main(void){
    int x,y;
    for(;;){
        scanf("%d %d",&x,&y);
        if(x==0&&y==0){break;}
        if(x>=y){printf("%d %d\n",y,x);}
        else{
            printf("%d %d\n",x,y);
        }
    }
return 0;
}



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

int main(){

	int answer[5];
	int datanum = 0;

	for(int dataset = 0; dataset < 5; dataset++){
	
		int input;
		int sum;

		cin >> input;
		if(input == 0) break;
		sum = input;

		for(int i = 0; i < 9; i++){
			cin >> input;
			sum -= input;
		}
	
		int m,s;

		answer[dataset] = sum;

		datanum++;
	}

	for(int dataset = 0; dataset < datanum; dataset++){
		cout << answer[dataset] << endl;
	}

	return 0;
}


Measured memory_bytes: 3000
import java.io.*;

class Main {
    
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        String str = br.readLine();
        String[] strarr = str.split(" ");
        
        int num1 = Integer.parseInt(strarr[0]);
        int num2 = Integer.parseInt(strarr[1]);
        
        if(num1 < num2) {
            System.out.println("a < b");
        } else if(num1 > num2) {
            System.out.println("a > b");
        } else {
            System.out.println("a == b");
        }
    }
    
}


Measured memory_bytes: 24184
from collections import defaultdict
n, m = map(int, input().split())
A = list(map(int, input().split()))
cards = defaultdict(int)

for a in A:
    cards[a] += 1

for i in range(m):
    b, c = map(int, input().split())
    cards[c] += b

cards = sorted(cards.items(), key=lambda x: -x[0])

ans = 0
i = 0
while n > 0:
    num, cnt = cards[i]
    ans += num * min(cnt, n)
    n -= cnt
    i += 1
print(ans)

Measured memory_bytes: 49696
#include <bits/stdc++.h>
#define rep(i,n) for (int i=0;i<(n);i++)
using namespace std;
using ll = long long;
using P = pair<int,int>;
 
 
int main() {
    int x;
    cin >> x;
    if(x==5||x==7||x==3) cout <<"YES" << endl;
    else cout << "NO" << endl;
}

Measured memory_bytes: 256