akhauriyash/Code-Regression huggingface dataset:
//Author : Sukarna Paul

#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/trie_policy.hpp>
#include<ext/pb_ds/detail/standard_policies.hpp>
#define pi acos(-1)
#define pb push_back
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define MAX 300005
#define INF 0x3f3f3f3f
template <class T> inline T bigmod(T p,T e,T M){ll ret = 1LL;for(; e > 0LL; e >>= 1LL){if(e & 1LL) ret = (ret * p) % M;p = (p * p) % M;}return (T)ret;}
template <class T> inline T modinverse(T a,T M){return bigmod(a,M-2,M);}   // M is prime}

using namespace std;
using namespace __gnu_pbds;

typedef trie<string,null_type,trie_string_access_traits<>,pat_trie_tag,trie_prefix_search_node_update>pref_trie;
typedef tree<ll,null_type,less<ll>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
typedef tree<pair<int, int>,null_type,less<pair<int, int>>,rb_tree_tag,tree_order_statistics_node_update> ordered_multiset;




int main(){
    IOS
    //freopen("output.txt","w",stdout);
    ll n,m;
    cin>>n>>m;

    ll ans = (m*(m-1))/2;
    ans+= (n*(n-1))/2;
    cout<<ans<<"\n";
}


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

long long gcd(long long x, long long y){
    if (y>x){
       swap(x,y); 
    }
    while (y!=0){
        long long r=x%y;
        x=y;
        y=r;
    }
    return x;
}

// 素数か判定する
int judge_prime(long long target)
{
  if (target <= 3)
  {
    return 1;
  }
  else
  {
    long long max = (long long)((int)(sqrt(target) + 1));
    for (long long i = 2; i <= max; i++)
    {
      if (target % i == 0)
        return 0;
    }
  }
  return 1;
}
 
int main(){
    ll a,b;
    cin >> a >> b;
    ll x = gcd(a,b);
    
    ll ans = 1;
    ll tmp = x;
    for(int i=2;i<=sqrt(x)+1;i++){
        if((tmp%i==0) && judge_prime(i)){
            while(tmp % i == 0){
                tmp /= i;
            }
            // cout << i << endl;
            ans++;
        }
    }
    // cout << tmp << endl;
    if(tmp > 1) ans++;

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 384
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        String s = sc.next();
        sc.close();

        int ans = -1;
        switch (s) {
        case "SUN":
            ans = 7;
            break;
        case "MON":
            ans = 6;
            break;
        case "TUE":
            ans = 5;
            break;
        case "WED":
            ans = 4;
            break;
        case "THU":
            ans = 3;
            break;
        case "FRI":
            ans = 2;
            break;
        case "SAT":
            ans = 1;
            break;
        default:
            throw new RuntimeException();
        }
        System.out.println(ans);
    }

}


Measured memory_bytes: 21844
import sys
stdin = sys.stdin
sys.setrecursionlimit(10 ** 7)

def LI(): return list(map(int, stdin.readline().split()))
def LS(): return list(stdin.readline())

import math
x = int(input())
for i in range(-200, 200):
    for j in range(-200, 200):
        if i**5-j**5==x:
            print(i, j)
            exit()

Measured memory_bytes: 9200
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <climits>
#include <boost/multiprecision/cpp_int.hpp>

using namespace std;
using boost::multiprecision::cpp_int;


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

typedef long long LL;
typedef vector<int> VI;

cpp_int X, K, D;

cpp_int myabs(cpp_int v) {
  if (v < 0) return -v;
  return v;
}

cpp_int score(cpp_int l) {
  return myabs((X-K*D) + 2*l*D);
}

int main() {
  cin >> X >> K >> D;
  cpp_int offset = X-K*D;
  cpp_int ans;
  if (offset >= 0) {
    ans = score(0);
  } else {
    cpp_int mul = (-offset) / (2*D);
    if (mul > K) {
      ans = score(K);
    } else {
      if (score(mul) < score(mul+1)) {
        ans = score(mul);
      } else {
        ans = score(mul+1);
      }
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3172
#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
#include <map>
#include <iterator>
#include <functional>
#include <set>
#include <stack>
#include <queue>
#include <deque>
#include <fstream>
#include <iomanip>
#include <numeric>
#include <cmath>
#include <list>
#include <sstream>
#include <unordered_map>
#include <complex>
#include <stdio.h>
using namespace std;
#pragma GCC optimize("O3")
#pragma GCC target("sse4")

typedef double LD;
typedef unsigned long long LL;
typedef pair<int, int> PII;
typedef pair<LD, LD> PDD;
typedef pair<LL, LL> PLL;
typedef vector<int> VI;
typedef vector<LL> VLL;
typedef vector<char> VCH;
typedef vector<LD> VLD;
typedef vector<string> VS;
typedef vector<VS> VSS;
typedef vector<VI> VVI;
typedef vector<VLL> VVLL;
typedef vector<VCH> VVCH;
typedef vector<PII> VPII;
typedef vector<PLL> VPLL;
typedef vector<PDD> VPDD;
#define MP make_pair
#define PB push_back
#define X first
#define Y second
#define next fake_next
#define prev fake_prev
#define left fake_left
#define right fake_right

#define FOR(i,a,b) for(int i = (a); i < (b); ++i)
#define RFOR(i,b,a) for(int i = (b) - 1; i >= (a); --i)
#define REP(i, t) FOR(i,0,t)
#define ALL(a) a.begin(), a.end()
#define SZ(a) (int)((a).size())

const LD PI = acos(-1.0);
const LD EPS = 1e-9;
const LL mod = 1000000007;
const LL INF = 1e9;
const LL LINF = 1e15;
const LL MAX = 2e5 + 7;
const LL MAXN = 1e5 + 1;

int n;
VVI g;

int memo[MAXN];

bool dfs0(int v, int p = -1)
{
	if (memo[v] != -1)
		return memo[v];

	if (SZ(g[v]) > 2)
		return memo[v] = 0;

	for (auto i : g[v])
		if (i != p)
			return memo[v] = dfs0(i, v);

	return memo[v] = 1;
}

int dfs2(int v, int p = -1)
{
	int res = 0;
	bool ye = 0;
	for (auto i : g[v])
		if (i != p)
			ye |= dfs0(i, v);

	for (auto i : g[v])
	{
		if (i == p)
			continue;

		res += max(1, dfs2(i, v));
	}
	
	res -= ye;
	return res;
}

int dfs(int v, int p = -1)
{
	int cnt = 0;
	bool ye = 0;

	for (auto i : g[v])
		ye |= dfs0(i, v);

	for (auto i : g[v])
		cnt += max(1, dfs2(i, v));

	return cnt - ye;
}

int main()
{
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	//freopen("In.txt", "r", stdin);
	//freopen("Out.txt", "w", stdout);

	FOR(i, 0, MAXN)
		memo[i] = -1;

	cin >> n;
	g.resize(n);
	int u, v;
	FOR(i, 0, n - 1)
	{
		cin >> u >> v;
		g[u].push_back(v);
		g[v].push_back(u);
	}

	int res = 1;
	int cnt = 0;
	bool wa = 0;
	FOR(i, 0, n)
		if (SZ(g[i]) > 1)
		{
			if (cnt > 100)
				break;

			res = max(res, max(1, dfs(i)));
			++cnt;
		}

	cout << res;
	cin >> n;
	return 0;
}

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

const ll INF = 1e18;

int main(){
  ll n;
  cin >> n;
  ll res = INF;
  for (ll i = 1; i*i <= n; i++) {
    if (n%i == 0) res = min(res, (i-1) + (n/i-1));
  }
  cout << res << endl;
  return 0;
} 

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <queue>
#include <stack>
#include <cstdlib>
#include <map>
#include <iomanip>
#include <set>
#include <stdio.h>
#include <ctype.h>
#include <random>
#include <string.h>
#include <cmath>
#include <unordered_map>
#include <cstdio>
using namespace std;
#define pie 3.141592653589793238462643383279
#define mod 998244353
#define int long long
#define P pair<int,int>
#define all(vec) vec.begin(),vec.end()

int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
int lcm(int x, int y) {
	return x / gcd(x, y)*y;
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= i; res %= mod;
	}
	return res;
}
int mod_pow(int x, int y, int m) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}

int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x, y) * mod_pow(kai(y, y), mod - 2, mod) % mod;
}

int n;
string s;
int r, g, b, rg, rb, gb;
int ans = 1;

signed main() {
	cin >> n >> s;
	for (int i = 0; i < 3 * n; i++) {
		if (s[i] == 'R') {
			if (gb) {
				ans *= gb;
				gb--;
			}
			else if (g) {
				ans *= g;
				g--;
				rg++;
			}
			else if (b) {
				ans *= b;
				b--;
				rb++;
			}
			else r++;
		}
		else if (s[i] == 'G') {
			if (rb) {
				ans *= rb;
				rb--;
			}
			else if (r) {
				ans *= r;
				r--;
				rg++;
			}
			else if (b) {
				ans *= b;
				b--;
				gb++;
			}
			else g++;
		}
		else {
			if (rg) {
				ans *= rg;
				rg--;
			}
			else if (r) {
				ans *= r;
				r--;
				rb++;
			}
			else if (g) {
				ans *= g;
				g--;
				gb++;
			}
			else b++;
		}
		ans %= mod;
	}
	for (int i = 2; i <= n; i++)ans = ans * i%mod;
	cout << ans << endl;
}

Measured memory_bytes: 900
N, M = map(int, input().split())

inf = 10 ** 10

dp = [inf] * (1 << N)
dp[0] = 0

for _ in range(M):
    a, b = map(int, input().split())
    c = sum([2 ** (i - 1) for i in map(int, input().split())])

    for j in range(1 << N):
      dp[j | c] = min(dp[j] + a, dp[j | c])

res = dp[-1] if dp[-1] != inf else -1
print(res)

Measured memory_bytes: 3188
x1, y1, x2, y2 = gets.split.map(&:to_i)
x3 = x2 - (y2 - y1)
y3 = y2 + (x2 - x1)
x4 = x1 - (y2 - y1)
y4 = y1 + (x2 - x1)
puts "#{x3} #{y3} #{x4} #{y4}"

Measured memory_bytes: 1788
#include<bits/stdc++.h>
using namespace std;
#define ll unsigned long long int
int main()
{
ios_base::sync_with_stdio(false);
  cin.tie(NULL);
#ifndef ONLINE_JUDGE
//  freopen("input.txt","r",stdin);
#endif

  ll n;
  cin>>n;
  ll sum=0;

  vector<ll> count(n+1,1);
count[0] = count[1] = 1;
for (ll i = 2; i <= n; i++) {
    for(ll j=i;j<=n;j+=i)
    {
        count[j]++;
    }
}

for(ll i=1;i<=n;i++)
{
  sum+=i*count[i];
}

cout<<sum<<endl;


  
  
  return 0;
}

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

int main(void)
{
  int N,i,j;
  double d,*a;
  scanf("%d",&N);
  for(i=0;i<N;i++){
    a=malloc(sizeof(double)*6);
    for(j=0;j<6;j++)
      scanf("%lf",&a[j]);
    d=sqrt((a[0]-a[3])*(a[0]-a[3])+(a[1]-a[4])*(a[1]-a[4]));
    
    if(a[2]>d+a[5])
      printf("2\n");
    else if(a[5]>d+a[2])
      printf("-2\n");
    else if(a[2]+a[5]<d)
      printf("0\n");
    else 
      printf("1\n");
    free(a);
  }


  return 0;
}

Measured memory_bytes: 620
#include <stdio.h>
#include <vector>
#include <algorithm>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define MOD (1000003LL)
typedef long long Int;

int n, mi, memo[60000*4], cs[60000][2];
vector<int> g[60000];
bool has[60000];

void add(int p, int q) {
    if (p > q) swap(p, q);
    g[p].push_back(q);
}

int pre(int p, int q) {
    if (p+1 == q) return -1;
    const int k = mi++;
    has[k] = false;
    if (g[p].back() == q) {
        has[k] = true;
        g[p].pop_back();
    }
    const int r = g[p].back();
    rep (b, 4) memo[k*4|b] = -1;
    cs[k][0] = pre(p, r);
    cs[k][1] = pre(r, q);
    return k;
}

int rec(int k, int x, int y) {
    if (k == -1) return x == y;
    const int sig = k*4|x*2|y;
    if (memo[sig] != -1) return memo[sig];
    const int p = cs[k][0], q = cs[k][1];
    Int ans = 0;
    rep (i, 2) ans = (ans + (Int)rec(p, x, i)*rec(q, 1-i, y)) % MOD;
    if (x && y && has[k]) {
        rep (i, 2) ans = (ans + (Int)rec(p, 0, i)*rec(q, 1-i, 0)) % MOD;
    }
    return memo[sig] = ans;
}

int main() {
    for (;;) {
        int m, a, b;
        scanf("%d%d", &n, &m);
        if (n == 0) return 0;
        rep (_, m) {
            scanf("%d%d", &a, &b);
            add(a-1, b-1);
        }
        rep (i, n) add(i, (i+1)%n);
        rep (i, n) sort(g[i].begin(), g[i].end());
        mi = 0;
        pre(0, n-1);
        printf("%d\n", rec(0, 1, 1));
    }
}

Measured memory_bytes: 12592
A=[]
for i in range(3):
  A=A+list(map(int,input().split()))
Ad={}
for i in range(9):
  Ad[A[i]]=i

n=int(input())
for i in range(n):
  b=int(input())
  if b in A:
    A[Ad[b]]=-1

for i in range(3):
  if A[i*3]==-1 and A[i*3+1]==-1 and A[i*3+2]==-1:
    print('Yes')
    exit()

for i in range(3):
  if A[i]==-1 and A[i+3]==-1 and A[i+6]==-1:
    print('Yes')
    exit()
    
if A[0]==-1 and A[4]==-1 and A[8]==-1:
  print('Yes')
  exit()
  
if A[2]==-1 and A[4]==-1 and A[6]==-1:
  print('Yes')
  exit()
  
print('No')

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

#define ff first
#define ss second
#define pb push_back
#define int long long

signed main(){


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

  string a,b;
  cin >> a >> b;
  
  int n=a.size();
  int m=b.size();
  int dp[n+1][m+1];
  
  for(int i=0;i<=n;i++){
    for(int j=0;j<=m;j++){
      if(i==0 || j==0)
        dp[i][j]=0;
      
      else if(a[i-1]==b[j-1]){
        dp[i][j]=1+dp[i-1][j-1];
      }
      else{
        dp[i][j]=max(dp[i-1][j],dp[i][j-1]);
      }
    }
  }
 
  int i=n;
  int j=m;
  string ans;
  while(i>0 && j>0){

    if(a[i-1]==b[j-1]){
      ans+=a[i-1];
      i--; j--;
    }
    
    else if(dp[i][j-1]>=dp[i-1][j]){
      j--;
    }
    else{
      i--;
    }
    
  }
  
  
    reverse(ans.begin(), ans.end()); 
cout<<ans;
  
    return 0;
}




Measured memory_bytes: 73972
cnt = [0 for i in range(31)]

n = int(input())
lis = list(map(int,input().split()))

for num in lis:
  s = format(num,'b').zfill(31)
  for i in range(31):
    cnt[i] += int(s[i])

if n % 3 == 0:
  for nu in cnt:
    if nu != 0 and nu * 3 != n * 2:
      print("No")
      exit()
  print("Yes")
else:
  for nu in cnt:
    if nu != 0:
      print("No")
      exit()
  print("Yes")

Measured memory_bytes: 14116
import math
n, k = list(map(int, input().split()))

trees = [0] * n
for i in range(n):
    trees[i] = int(input())
sorted_trees = sorted(trees)

minh = sorted_trees[0]
maxh = sorted_trees[k-1]
mind = maxh - minh
for i in range(k, n):
    maxh = sorted_trees[i]
    minh = sorted_trees[i-k+1]
    if mind > maxh - minh:
        mind = maxh - minh

print(mind)


Measured memory_bytes: 8240
#include <bits/stdc++.h>
#include <vector> 
# include <cstdint>
#define FOR(i,l,r) for(int i=(l);i<(r);++i)
#define RFOR(i,l,r) for(int i=(l);i>=(int)(r);i--)
#define rep(i,n)  FOR(i,0,n)
#define rrep(i,n)  RFOR(i,n-1,0)

#define int long long
using namespace std;
const int MX = 1e6;
const int inf = 1e9;
const int mod = 998244353;
using ll = long long;
using P = pair<ll, ll>;
double PI = acos(-1);

signed main(){
    int n,p;
    cin >> n>>p;
    string str;
    cin >> str;
    vector<int> x(n+1,0);
    if(p%2==0 || p%5==0) {
        int ans = 0;
        rep(i,n) {
            x[i]=(int)(str[i]-'0')%p;
            if(x[i]%p==0) ans+=i+1;
        }
        cout << ans << endl;
        return 0;
    }

    x[n]= 1;
    rrep(i,n) {
        x[i]= x[i+1]*10%p;
        //cout << x[i] << endl;
    }
    rrep(i,n) {
        x[i]*= (int)(str[i]-'0');
        //cout << x[i] << endl;
        x[i] %= p;
        // x[i] +=x[i+1];
        // x[i] %= p;
        //cout << x[i] << endl;
    }
    int ans = 0;
    vector<int> sum(n+1,0);
    sum[n] = 0;
    
    map<int, int> ma;
    rrep(i,n) {
        sum[i] = (sum[i+1]+x[i])%p;        
        ma[sum[i]]++;
    }

    ma[0]++;
    for(auto num:ma) {
        //cout << num.first<<" " <<num.second << endl;
        ans += (num.second)*(num.second-1)/2;
    }
    cout << ans << endl;

    return 0;
}



Measured memory_bytes: 7080
#include <iostream>

using namespace std;

#define repd(i,a,b) for (int i=(a);i<(b);++i)
#define rep(i,n) repd(i,0,n)
typedef long long ll;

int main(){
  int n, a, b;
  cin >> n >> a >> b;
  string s;
  cin >> s;
  int count_a = 0, count_b = 0;
  rep(i, n){
    if(s[i] == 'a' && count_a + count_b < a+b){
      cout << "Yes" << endl;
      count_a++;
    }else if(s[i] == 'b' && count_a + count_b < a+b && count_b < b){
      cout << "Yes" << endl;
      count_b++;
    }else{
      cout << "No" << endl;
    }
  }

  return 0;
}


Measured memory_bytes: 832
s = input()

n = len(s)
ans = 0
for i in range(n):
    x = s[i]
    count = 0
    if x == 'A' or x == 'C' or x == 'G' or x == 'T':
        count += 1
        for j in range(i+1,n):
            x = s[j]
            if x == 'A' or x == 'C' or x == 'G' or x == 'T':
                count += 1
            else:
                break
    ans = max(count,ans)
print(ans)

Measured memory_bytes: 3064
h,w,k=map(int,input().split())
c=[]
ans=0
for i in range(h):
    c.append(list(input()))
for i in range(2**(h+w)):
    lh=[]
    lw=[]
    num=0
    for j in range(h):
        if (i >> j) & 1:
            lh.append(j)
    for j in range(h,h+w):
        if (i >> j) & 1:
            lw.append(j-h)
    for j in range(len(lh)):
        for kk in range(len(lw)):
            if c[lh[j]][lw[kk]]=="#":
                num+=1
    if num==k:
        ans+=1
print(ans)


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

int main(void){
    int n=0, y=0, add=0, year=0, month=0, date=0, sum=0;
    y = (20+19)*5;
    add = 5;
    cin >> n;
    for(int i=0;i<n;i++){
        sum=0;
        cin >> year >> month >> date;
        sum += (999-year)*y;
        if(month!=10){
            if(month%2==0) sum += (10-month)*20-(10-month)/2;
            else sum += (10-month)*20-(10-month)/2-1;
        }
        if(month%2==1) sum += 21-date;
        else sum += 20-date;
        sum += (999-year)/3*add+add;
        if(year%3==0){
            if(month%2==0) sum += -month/2+1;
            else sum += -month/2;
        }
        cout << sum << endl;
    }
}


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

#define int long long

#define ii pair<int,int>
#define fi first
#define sc second

#define all(x) (x).begin(),(x).end()

void MAIN() {
  int n; cin >> n;
  vector<int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
    a[i] -= i + 1;
  }
  sort(all(a));
  int t = a[(n + 1) / 2 - 1];
  int ans = 0;
  for (int i = 0; i < n; i++) {
    ans += abs(a[i] - t);
  }
  cout << ans << '\n';
}

signed main() {
#ifdef _DEBUG
  // freopen("in" , "r", stdin );
#endif
  ios::sync_with_stdio(0); cin.tie(0);
  int T = 1;
  // cin >> T;
  while (T--) MAIN();
}


Measured memory_bytes: 4656
/*  -*- coding: utf-8 -*-
 *
 * d.cc: D: 756
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

const int MAX_N = 100;
const int PN = 25;
const int DN = 75;

/* typedef */

typedef long long ll;

/* global variables */

bool primes[MAX_N + 1];
int pnums[PN], pds[PN];
int dp[PN + 1][DN + 1];

/* subroutines */

int gen_primes(int maxp, int pnums[]) {
  memset(primes, true, sizeof(primes));
  primes[0] = primes[1] = false;

  int p, pn = 0;
  for (p = 2; p * p <= maxp; p++)
    if (primes[p]) {
      pnums[pn++] = p;
      for (int q = p * p; q <= maxp; q += p) primes[q] = false;
    }
  for (; p <= maxp; p++)
    if (primes[p]) pnums[pn++] = p;
  return pn;
}

void prime_decomp(int n, int pn, int pnums[], int pds[]) {
  for (int i = 0; i < pn; i++) {
    int &pi = pnums[i];
    while (n % pi == 0) n /= pi, pds[i]++;
  }
}

/* main */

int main() {
  int pn = gen_primes(MAX_N, pnums);
  //printf("pn=%d\n", pn);
  //for (int i = 0; i < pn; i++) printf("%d ", pnums[i]); putchar('\n');

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

  for (int i = 2; i <= n; i++)
    prime_decomp(i, pn, pnums, pds);
  //for (int i = 0; i < pn; i++) printf("%d ", pds[i]); putchar('\n');

  dp[0][1] = 1;
  for (int i = 0; i < pn; i++) {
    int pdi = pds[i] + 1;
    for (int j = 1; j <= DN; j++)
      if (dp[i][j] > 0)
	for (int k = 1; k <= pdi && j * k <= DN; k++)
	  dp[i + 1][j * k] += dp[i][j];
  }

  printf("%d\n", dp[pn][DN]);
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define dbg1(x) cerr<<#x<<"="<<(x)<<" "
#define dbg2(x) cerr<<#x<<"="<<(x)<<"\n"
#define dbg3(x) cerr<<#x<<"\n"
using namespace std;
#define reg register
inline int read()
{
	int x=0,f=1;char ch=getchar();
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=(x<<3)+(x<<1)+ch-'0';ch=getchar();}
	return x*f;
}
const int MN=1e5+5;
int N,K,P;
int main()
{
	N=read(),K=read();
	reg int i,ans=N;
	for(i=1;i<=N;++i) read()==1?P=i:0;
	for(i=1;i<=K;++i)if(P>=i&&P+K-i<=N)
		ans=min(ans,1+(P-i+K-2)/(K-1)+(N-P-K+i+K-2)/(K-1));
	printf("%d\n",ans);
}

Measured memory_bytes: 256
//#pragma GCC optimize("03", "unroll-loops")
//#pragma GCC target("avx2")

#include <bits/stdc++.h>

#define fast() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define FOR(i,n) for(i=0;i<n;i++)
#define FORn(i,j,n) for(i=j;i<n;i++)
#define pb push_back
#define unique_sort(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define vprint(v) for(auto t:v)cout<<t<<" "
#define endl "\n"

using namespace std;

typedef long long int lli;
typedef long int li;
typedef vector<lli> vli; 
typedef vector<int> vi; 
typedef vector<string> vs; 


const lli mod=1000000007;
const lli limit=1000000;


void fc(lli &x)
    {
        bool neg=false;
        register char c;
        x =0;
        c=getchar();
        if(c=='-')
        {
            neg = true;
            c=getchar();
        }
        for(;(c>47 && c<58);c=getchar())
            x = (x<<1) + (x<<3) +c -48;
        if(neg)
            x *=-1;
    }

int main() {

    fast()
    lli n,q,t;
    lli temp,temp1,temp2,temp3;
    lli i,j,k;
    cin>>n>>k;
    if(n+1==k){
        cout<<1<<endl;
        exit(0);
    }
    lli ans=0;
    while(n+1>=k){
        temp=0;
        temp=(k*(k-1))/2;
        temp1=0;
        temp2=n-k;
        temp1=(n*(n+1))/2-(temp2*(temp2+1))/2;
        ans+=(temp1-temp+1);
        ans%=mod;
        k++;
        //cout<<ans<<endl;
    }
    cout<<ans<<endl;
 
}

Measured memory_bytes: 3652
import sys
sys.setrecursionlimit(10**7)
mo=998244353
n=int(input())
dp=list(map(int,input().split()))#[0,0,0]
for i in range(1,n):
    a,b,c=list(map(int,input().split()))
    dp=[a+max(dp[1],dp[2]),b+max(dp[0],dp[2]),c+max(dp[0],dp[1])]
print(max(dp))


Measured memory_bytes: 47576
import sys
S=sys.stdin.readline().strip()
T=sys.stdin.readline().strip()

ans=float("inf")
for i in range(len(S)-len(T)+1):
    temp_ans=0
    for s,t in zip(S[i:],T):
        if s!=t:
            temp_ans+=1
    ans=min(ans,temp_ans)
print ans

Measured memory_bytes: 73496
import sys

read = sys.stdin.buffer.read
input = sys.stdin.buffer.readline
inputs = sys.stdin.buffer.readlines


# mod=10**9+7
# rstrip().decode('utf-8')
# map(int,input().split())
# import numpy as np

def main():
	data=[list(map(int,input().split())) for _ in range(3)]
	
	ans="Yes"
	for i in range(-1,2,1):
		s=set()
		for j in range(3):
			s.add(data[i][j]-data[i+1][j])
			if len(s)!=1:
				ans="No"
	
	for i in range(-1,2,1):
		s=set()
		for j in range(3):
			s.add(data[j][i]-data[j][i+1])
			if len(s)!=1:
				ans="No"
	
	print(ans)
	
	
	
	
if __name__ == "__main__":
	main()


Measured memory_bytes: 38384
from collections import defaultdict as dd
N,X,Y = map(int,input().split())

pdic = dd(lambda:0)

# count = 0

for i in range(1,N):
    for j in range(i+1,N+1):

#         count += 1

        # no shortcut
        d1 = j-i
        # with shortcut
        i2x = abs(X-i)
        y2j = abs(Y-j)
        d2 = i2x + y2j + 1

        dist = min(d1,d2)
        pdic[str(dist)] += 1

for n in range(1,N):
    print(pdic[str(n)])

# print("count:",count)

Measured memory_bytes: 50780
import sys
mod=10**9+7 ; inf=float("inf")
from math import sqrt, ceil
from collections import deque, Counter, defaultdict #すべてのkeyが用意されてる defaultdict(int)で初期化
input=lambda: sys.stdin.readline().strip()
sys.setrecursionlimit(11451419)
from decimal import ROUND_HALF_UP,Decimal  #変換後の末尾桁を0や0.01で指定
  #Decimal((str(0.5)).quantize(Decimal('0'), rounding=ROUND_HALF_UP))
from functools import lru_cache
from bisect import bisect_left as bileft, bisect_right as biright
#メモ化再帰defの冒頭に毎回 @lru_cache(maxsize=10**10)
#引数にlistはだめ
#######ここまでテンプレ#######
import sys
import heapq
mod=10**9+7 ; inf=float("inf")
from math import sqrt, ceil
from collections import deque, Counter, defaultdict #すべてのkeyが用意されてる defaultdict(int)で初期化
input=lambda: sys.stdin.readline().strip()
sys.setrecursionlimit(11451419)
from decimal import ROUND_HALF_UP,Decimal  #変換後の末尾桁を0や0.01で指定
  #Decimal((str(0.5)).quantize(Decimal('0'), rounding=ROUND_HALF_UP))
from functools import lru_cache
from bisect import bisect_left as bileft, bisect_right as biright
#メモ化再帰defの冒頭に毎回 @lru_cache(maxsize=10**10)
#引数にlistはだめ
#######ここまでテンプレ#######
#ソート、"a"+"b"、再帰ならPython3の方がいい
#######ここから天ぷら########
#######ここから天ぷら########
n,m,s,t=map(int,input().split())
s-=1;t-=1
def dijkstra(s,G):
    dist=[inf for i in range(n)] #sからの距離のリスト
    dist[s]=0
    mirai=[True for i in range(n)] #Trueなら未確定
    mirai[s]=False

    queue=[] #こいつがheapqになる
    for kyori,to in G[s]:
        heapq.heappush(queue , kyori*10**6+to)  #重みと行先を1つの変数で表してる！
    while queue:
        minedge= heapq.heappop(queue)
        #miraiがTrueのやつ(未確定なやつ)から最小距離のものをさがす
        if not mirai[minedge%(10**6)]: continue
        #距離が小さいものから"確定"していく
        v=minedge%(10**6) #最小距離の頂点
        dist[v] = minedge//(10**6) #その距離
        mirai[v]=False
        for kyori,to in G[v]:
            if mirai[to]:
                heapq.heappush(queue, (kyori+dist[v])*(10**6)+to)
                #queueに入る数は、必ず「sからの」距離と行先を持っている
    return dist

G1= [[] for i in range(n)]
G2= [[] for i in range(n)]
for  i in range(m):
    a,b,y,p=map(int,input().split())
    a-=1;b-=1
    G1[a].append((y,b))
    G1[b].append((y,a))
    G2[a].append((p,b))
    G2[b].append((p,a))
A=dijkstra(s,G1)
B=dijkstra(t,G2)
C=[i+j for i,j in zip(A,B)]
ANS=[0]*(n) ; ANS[-1]=C[-1]
for i in range(n-2,-1,-1):
    ANS[i]= min(ANS[i+1], C[i])
for i in range(n):
    print(10**15-ANS[i])


Measured memory_bytes: 147696
#include<iostream>
#include<cstdio>
#include<cstring>

const int N=105;

void put(int G[N/2][N],int x)
{
	if(!x)return;
	for(int i=2;i<=50;i+=2)
		for(int j=2;j<=100;j+=2)
		{
			G[i][j]=1;
			x--;
			if(!x)return;
		}
}

int f[N/2][N],g[N/2][N];

int A,B;

int main()
{
	scanf("%d%d",&A,&B);
	put(f,B-1),put(g,A-1);
	printf("%d %d\n",100,100);
	for(int i=1;i<=50;i++,printf("\n"))
		for(int j=1;j<=100;j++)printf("%c",f[i][j]?'#':'.');
	for(int i=1;i<=50;i++,printf("\n"))
		for(int j=1;j<=100;j++)printf("%c",g[i][j]?'.':'#');
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#define ll long long
#define rep(i, a, b) for(int i = a; i < b; i++)
using namespace std;

int main() {
  int a, b;
  cin >> a >> b;
  if(a*b % 2 == 0) cout << "Even\n";
  else cout << "Odd\n";
}


Measured memory_bytes: 3564
import core.bitop;
import std.algorithm;
import std.ascii;
import std.bigint;
import std.conv;
import std.functional;
import std.math;
import std.numeric;
import std.range;
import std.stdio;
import std.string;
import std.random;
import std.typecons;

alias sread = () => readln.chomp();
alias Point2 = Tuple!(long, "y", long, "x");

T lread(T = long)()
{
    return readln.chomp.to!T();
}

T[] aryread(T = long)()
{
    return readln.split.to!(T[])();
}

void scan(TList...)(ref TList Args)
{
    auto line = readln.split();
    foreach (i, T; TList)
    {
        T val = line[i].to!(T);
        Args[i] = val;
    }
}

void minAssign(T, U = T)(ref T dst, U src)
{
    dst = cast(T) min(dst, src);
}

void maxAssign(T, U = T)(ref T dst, U src)
{
    dst = cast(T) max(dst, src);
}

void main()
{
    auto s = sread();
    writeln(s.map!(c => cast(long)(c - '0')).sum());
}


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

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

  std::vector<int> a(n);
  int max1 = 0;
  int max2 = 0;
  for (auto&& ai : a) {
    std::cin >> ai;
    if (ai > max1) {
      max2 = max1;
      max1 = ai;
    } else if (ai > max2) {
      max2 = ai;
    }
  }

  for (auto&& ai : a) std::cout << (ai == max1 ? max2 : max1) << std::endl;
}

Measured memory_bytes: 2432
//#pragma GCC optimize(3)
//#pragma comment(linker,"/stack:16777216")
#include<iostream>
#include<cstdio>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<list>
#include<stack>
#include<queue>
#include<deque>
#include<functional>
#include<utility>
#include<algorithm>
#include<sstream>
#include<cstring>
#include<cmath>
#include<cctype>
#include<exception>
#include<climits>
#include<cfloat>
#include<iomanip>
#include<bitset>
#include<streambuf>
#include<cstdlib>
#include<ctime>
//#include"functions.h"
//#include"highprecision.h"
#define pb push_back
#define pf push_front
#define ppb pop_back
#define mp make_pair
#define np next_permutation
#define fi first
#define sc second
#define vi vector<int>
#define vll vector<long long>
#define vvi vector<vector<int> >
#define vpi vector<pair<int,int> >
#define pii pair<int,int>
#define pll pair<long long,long long>
#define pff pair<float,float>
#define pdd pair<double,double>
#define psi pair<string,int>
#define pis pair<int,string>
#define ppi pair<pii,int>
#define pdi pair<pii,pii>
#define LN 84757
#define INF 1e9
#define LLINF 1e18
#define MAXINT 0x7fffffff
#define MAXLL 0x7fffffffffffffff
#define EPS 1e-5
#define DEPS 1e-9
#define LDEPS 1e-13
#define MOD 1000000007
#define E 2.7182818284
#define PI 3.1415926535
#define rep(a,b) for(int a=0;a<b;a++)
#define forn(a,n) for(int a=1;a<=n;a++)
#define forr(a,n) for(int a=n;a>=1;a--)
#define repn(a,n,p) for(int a=0;a<n;a+=p)
#define repr(a,n) for(int a=n-1;a>=0;a--)
#define foreach(a,b) for(__typeof(b.begin())a=b.begin();a!=b.end();a++)
#define fillemp(a) memset(a,0,sizeof(a))
#define fillinf(a) memset(a,0x3f,sizeof(a))
#define frestream freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
#define stdf(a,b) freopen(a,"r",stdin);freopen(b,"w",stdout);
#define inputf(a) freopen(a,"r",stdin);
#define outputf(a) freopen(a,"w",stdout);
#define sz(a) a.size()
#define all(a) a.begin(),a.end()
#define MOD 1000000007
typedef long long ll;
typedef long double ld;
using namespace std;

#define int long long
int n,m,v,p;
int a[100010];
bool check(int pos){
	int sum=0,k=n-p;
	forr(i,n){
		if(!k)break;
		if(i!=pos){
			if(a[pos]-a[i]>m)return 0;
			sum+=max(a[pos]-a[i],0ll);
			k--;
		}
	}
	return sum<=m*v;
}
signed main(){
	cin>>n>>m>>v>>p;v=n-v;
	rep(i,n){
		cin>>a[i+1];
		a[i+1]=1e9-a[i+1];
	}
	sort(a+1,a+n+1);
	int l=1,r=n,mid=0;
	while(l<r){
		mid=(l+r+1)/2;
		if(check(mid)){
			l=mid;
		}
		else{
			r=mid-1;
		}
	}
	cout<<l;
	return 0;
}

Measured memory_bytes: 1024
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<queue>
#include<stack>
#include<iomanip>

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

using namespace std;

#define debug(x) cout<<(#x)<<"="<<(x)<<", ";
#define debug1(x) debug(x) cout<<'\n';
#define debug2(x1, x2) debug(x1) debug(x2) cout<<'\n';
#define debug3(x1, x2, x3) debug(x1) debug(x2) debug(x3) cout<<'\n';
#define debug4(x1, x2, x3, x4) debug(x1) debug(x2) debug(x3) debug(x4) cout<<'\n';
#define debug5(x1, x2, x3, x4, x5) debug(x1) debug(x2) debug(x3) debug(x4) debug(x5) cout<<'\n';

#define fcout cout<<fixed<<setprecision(15)
#define repp(i,j,k) for(int i=j; i<k; ++i)
#define rep(i,j) repp(i,0,j)
#define rrep(i,j,k) for(int i=j; i>=k; --i)
#define all(x) (x).begin(), (x).end()
#define sort(x) sort(x.begin(), x.end())
#define lb(x,val) lower_bound(x.begin(), x.end(), val)
#define ub(x,val) upper_bound(x.begin(), x.end(), val)
#define pb(x) emplace_back(x);

typedef long long int lli;
typedef pair<int,int> pii;
typedef pair<lli,lli> pll;
typedef vector<int> vi;
typedef vector<lli> vl;
typedef tuple<int, int, lli> tiil;

//const lli M=998244353ll;
const lli M=1000000007ll;
const double D=1.0;

int main(){
	fast_io
	int n; cin>>n;
	if(n&1) cout<<n*2;
	else cout<<n;
	return 0;
}

Measured memory_bytes: 256
def pr(sequence):
    string = ''
    for i in sequence[:-1]:
        string += str(i) + ' '
    string += str(sequence[-1])
    print(string)


n = int(input())
a = list(map(int, input().split()))

for i in range(1,n):
    pr(a)
    key = a[i]
    j = i -1
    while (j >=0) and (a[j] > key):
        a[j+1] = a[j]
        j = j-1
    a[j+1] = key
pr(a)




Measured memory_bytes: 5600
/*****************
C - Replacing Integer
****************/

#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
	long long n,k;
	cin >> n >> k;
	long long ans = n % k;
	if(k - ans < ans)
		ans = k - ans;
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
//============================================================================
// Name        : AOJ.cpp
// Author      : Akari Fujii
// Version     :
// Copyright   : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
#include <cctype>
#include <string>
#include<algorithm>

using namespace std;
typedef long long ll;
int main(){


	int n,m;

	cin>>n>>m;


	cout<<(n-1)*(m-1)<<endl;



	return 0;



}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define __ <<" "<<
#define ___ <<" "
#define bash push_back
#define ALL(x) x.begin(),x.end()
//#define int long long

struct IoSetup {
    IoSetup() {
        cin.tie(0);
        ios::sync_with_stdio(false);
        cout <<fixed<<setprecision(12);
        cerr <<fixed<<setprecision(12);
    }
}IoSetup;

typedef long long ll;
typedef pair < int , int >  pii;
static constexpr const signed int INF = 0x3f3f3f3f;
static constexpr const signed long long LINF = 0x3f3f3f3f3f3f3f3fLL;
static constexpr const signed int SMOD = 1000000007;
static constexpr const signed int NMOD = 998244353;
static constexpr const signed int dx[]={1,0,-1,0,1,1,-1,-1};
static constexpr const signed int dy[]={0,-1,0,1,-1,1,-1,1};

inline bool inside(int x,int y,int w,int h){return (x>=0 && y>=0 && x<w && y<h);}
template<class T>bool chmax(T &a, const T &b){return(a=max(a,b))==b;}
template<class T>bool chmin(T &a, const T &b){return(a=min(a,b))==b;}
inline int qp(int a,ll b,int mo){int ans=1;do{if(b&1)ans=1ll*ans*a%mo;a=1ll*a*a%mo;}while(b>>=1);return ans;}

int n, m, R;
vector<pii> edge[100005];
vector<int> r;
int dist[300][300];

void dijkstra(int s) {
    dist[s][s] = 0;
    priority_queue<pii,vector<pii>,greater<pii>> que;
    que.push({0,s});

    while(!que.empty()) {
        int v = que.top().second;
        int c = que.top().first;
        que.pop();
        for(auto&&i:edge[v]) {
            int u = i.second;
            int nc = i.first;
            if(dist[s][u] > c + nc) {
                dist[s][u] = c + nc;
                que.push({dist[s][u], u});
            }
        }
    }
    return ;
}

signed main() {

    int a, b, c;
    cin >> n >> m >> R;
    r.resize(R);
    for(int i = 0; i < R; i++) {
        cin >> r[i];
    }

    for(int i = 0; i < m; i++) {
        cin >> a >> b >> c;
        edge[a].bash({c,b});
        edge[b].bash({c,a});
    }

    memset(dist,0x3f,sizeof(dist));    

    for(int i = 1; i <= n; i++)
        dijkstra(i);

    int mini = INF;
    vector<int> v;
    for(int i = 0; i < R; i++) {
        v.bash(i);
    }
    do{
        int t = 0;
        for(int i = 0; i < R-1; i++) {
            t += dist[r[v[i]]][r[v[i+1]]];
        }
        chmin(mini,t);
    }while(next_permutation(ALL(v)));

    cout << mini << endl;
    
  
    return 0;
}



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

#define int long long
#define sp ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define cps CLOCKS_PER_SEC
#define mod (long long)1000000007
#define f first
#define s second
#define debug1(x) cerr<<x<<"\n"
#define debug2(x,y) cerr<<x<<" "<<y<<"\n"
#define debug3(x,y,z) cerr<<x<<" "<<y<<" "<<z<<"\n"
#define nl cerr<<"\n";
#define pq priority_queue
#define inf 0x3f3f3f3f
#define test cerr<<"abcd\n";
#define pi pair<int,int>
#define pii pair<int,pi>
#define pb push_back
#define mxn 500005

int32_t main(){
sp;
string s;
cin>>s;
int n=s.size();
int w=0;
for(int i=0; i<n; ++i)w+=(s[i]=='o');
w=w+(15-n);
if(w>=8)cout<<"YES";
else cout<<"NO";
return 0;}


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

int main() {
	int n;
	cin>>n;
	int m;
	cin>>m;
	int sum= 0;
	vector<int> a(m);
	for(int i=0 ; i< m; i++){
		
		cin>> a[i];
		sum+= a[i];
	}
	if(sum>n){cout<<-1;
	return 0;}
	cout<<n-sum;
	
	// your code goes here
	return 0;
}

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

#define int long long
#define endl "\n"
#define REP(i,a,n) for(int i=a;i<n;++i)
#define REPR(i,a,n) for(int i=a;i>n;--i)
#define RUP(a,b) ((a+b-1)/(b))
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define mp make_pair
#define mt make_tuple
//#define MOD 1000000007
#define INF LLONG_MAX/2

typedef long long ll;
typedef pair<int,int> Pii;
typedef tuple<int,int,int> Tiii;
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef vector<Pii> VPii;
typedef vector<string> Vs;

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;}
template<class T> void YesNo(T a) {cout<<(a?"Yes":"No")<<endl;}
template<class T> void YESNO(T a) {cout<<(a?"YES":"NO")<<endl;}
void vin(Vi &v){REP(i,0,(v).size()) cin>>v[i];}
void vin(Vi &v,Vi &v2){REP(i,0,(v).size()) cin>>v[i]>>v2[i];}
void vout(Vi &v){for(int i=0;i<(v).size();i++) cout<<v[i]<<" ";cout<<endl;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcm(int a,int b){return a/gcd(a,b)*b;}
void uniq(Vi &v){sort(v.begin(),v.end()); v.erase(unique(v.begin(),v.end()),v.end());}
int ctoi(char c){if(c>='0'&&c<='9'){return c-'0';}return 0;}
void accum(Vi &v){REP(i,1,(v).size()) v[i]+=v[i-1];}
bool comp(Pii a,Pii b){
    if(a.second != b.second) return a.second<b.second;
    else return a.first<b.first;
}

const string YES = "Yes";
const string NO = "No";

void solve(long long n, std::string s){
    if(n%2==1){cout<<NO<<endl;return;}
    string t = s.substr(0,n/2);
    string u = s.substr(n/2);
    if(t==u) cout<<YES<<endl;
    else cout<<NO<<endl;

}

// Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
signed main(){
    long long N;
    scanf("%lld",&N);
    std::string S;
    std::cin >> S;
    solve(N, S);
    return 0;
}


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

int f ( int X ) {
	if (X < 10) {
		return X;
	}

	return f ( X / 10 ) + X % 10;
}

int main ( ) {
	int N, sum;

	cin >> N;
	sum = f ( N );

	if (N % sum == 0) {
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}
}

Measured memory_bytes: 256
import java.util.Scanner;

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

	int n = scan.nextInt();
	int flag = 1;
	String[] s = new String[n];
	for(int i = 0; i < n; i++){
	    s[i] = scan.next();
	    if(s[i].charAt(0) == 'Y'){
		flag = -1;
	    }
	}

	if(flag == 1){
	    System.out.println("Three");
	}else{
	    System.out.println("Four");
	}
    }
}
	


Measured memory_bytes: 23252
#include <stdio.h>

int main(void) {
	int num[13][11]={0,};
	int n,i,b,f,r,v;
	int j,l,y,x=-1;
	scanf("%d",&n);
	for(i=1;i<=n;i++){
		scanf("%d %d %d %d",&b,&f,&r,&v);
		if(v>=0){
		num[f+3*b-3][r-1] += v ;
		}else{
			v *= -1;
			num[f+3*b-3][r-1] -= v;
		}
	}
	
	for(j=1;j<=4;j++){
		
		for(y=1;y<=3;y++){
			x++;
			for(l=1;l<11;l++){
				printf(" %d",num[x%3+3*j-2][l-1]);
				}
			printf("\n");
			}
	if(j<4){
		printf("####################\n");
	}
	}
	return 0;
}


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

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

main()
{
    int data[10];
    int i=10;

	while(i--) scanf("%d",&data[i]);

    qsort(data, 10, sizeof(int), compare_int);
    for (i = 0; i <3; i++) {
        printf("%d\n", data[i]);
    }
	return 0;
}

Measured memory_bytes: 604
#include <iostream>

int a, b[100], num, a1, flag = 0, count = 1, c1;
float kekka, a2 = 100, a3;
int main()
{
	std::cin >> a;
	for(int i = 0; i < a; i++)
	{
		std::cin >> b[i];
		num += b[i];
	}
	kekka = (float)num / a;
	for(int i = 0; i < a; i++)
	{
		if(kekka == b[i])
		{
			a1 = i;
			flag = 1;
			break;
		}else if(b[i] < kekka)
		{
			a3 = (float)kekka - b[i];
			//std::cout << a3 << std::endl;
			if(a3 < a2)
			{
				a2 = a3;
				c1 = i;
				//std::cout << c1 << std::endl;
			}else if (a3 == a2)
			{
				count++;
			}
		}else if(kekka < b[i])
		{
			a3 = (float)b[i] - kekka;
			//std::cout << a3 << std::endl;
			if(a3 < a2)
			{
				a2 = a3;
				c1 = i;
				//std::cout << c1 << std::endl;
			}else if(a3 == a2)
			{
				count++;
			}
		}
	}

	if(flag == 1)
	{
		std::cout << a1;
	}else if(count != a)
	{
		std::cout << c1;
	}else
	{
		std::cout << 0;
	}
}

Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main(){
    int input_1,input_2;
    cin >> input_1 >> input_2;

    int x;
    x = input_1 * input_2;

    int result = x % 2;
    if(result)
        cout << "Odd";
    else
        cout << "Even";

   // cout << input_1 << input_2;
   return 0;
}

Measured memory_bytes: 256
h,w,k=map(int,input().split())
mod=10**9+7
dp=[0]*w
dp[0]=1
fib=[1,1,2,3,5,8,13,21,34,55,89]
for _ in range(h):
  t=[0]*w
  for i in range(w):
    if i>0:
      t[i]+=dp[i-1]*fib[i-1]*fib[w-i-1]
    t[i]+=dp[i]*fib[i]*fib[w-i-1]
    if i<w-1:
      t[i]+=dp[i+1]*fib[i]*fib[w-i-2]
    t[i]%=mod
  dp=t
print(dp[k-1])

Measured memory_bytes: 3064
#include <stdio.h>
#include <string.h>
#include <stdbool.h>

int main() {
    long long x; scanf("%lld", &x);
    long long sum = 100, ans = 0;
    while (sum < x) {
        sum += sum / 100, ans++;
    }
    printf("%d\n", ans);
}

Measured memory_bytes: 1712
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <iomanip>
#include <random>
#include <cstdio>
#include <cmath>
#include <map>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (int) n; i++)

int main() {
    int a,b; cin >> a >> b;
    if ((a+b) % 2 == 0)
    {
        cout << (a+b)/2 << endl;
    } else {
        cout << (a+b)/2+1 << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<ctime>
#include<cstdlib>
#include<algorithm>
#include<cmath>
#include<string>
#include<queue>
#include<vector>
#include<map>
#include<set>
#include<utility>
#include<iomanip>
using namespace std;
int read(){
    int xx=0,ff=1;char ch=getchar();
    while(ch>'9'||ch<'0'){if(ch=='-')ff=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){xx=xx*10+ch-'0';ch=getchar();}
    return xx*ff;
}
long long READ(){
    long long xx=0,ff=1;char ch=getchar();
    while(ch>'9'||ch<'0'){if(ch=='-')ff=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){xx=xx*10+ch-'0';ch=getchar();}
    return xx*ff;
}
char one(){
	char ch=getchar();
	while(ch==' '||ch=='\n')
		ch=getchar();
	return ch;
}
const int maxn=100010;
int N,K,vis[maxn];
struct my{
	int type,v;
	bool friend operator<(const my&A,const my&B){
		return A.v<B.v;
	}
}p[maxn];
long long sqr(long long x){return x*x;}
multiset<my>s;
int main(){
	//freopen("in","r",stdin);
	N=read(),K=read();
	for(int i=1;i<=N;i++)
		p[i].type=read(),p[i].v=read();
	sort(p+1,p+1+N);
	long long ans,now=0,cnt=0;
	for(int i=N;i>=N-K+1;i--)
		if(++vis[p[i].type]==1){
			cnt++;
			now+=p[i].v;
		}
		else{
			s.insert(p[i]);
			now+=p[i].v;
		}
	ans=sqr(cnt)+now;
	for(int i=N-K;i>=1;i--){
		if(s.empty())
			break;
		int mn=(*s.begin()).v;
		if(!vis[p[i].type]){
			cnt++;
			now-=mn-p[i].v;
			vis[p[i].type]++;
			s.erase(s.begin());
			ans=max(ans,now+sqr(cnt));
		}
	}
	printf("%lld\n",ans);
	return 0;
}


Measured memory_bytes: 3584
#include <iostream>
#include <iomanip>
#include <random>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <numeric>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <sstream>
#include <bitset>
#include <cassert>
#include <fstream>
#include <queue>

#define len(X) ((int)(X).size())

#ifdef __LOCAL
	#define DBG(X) cout << #X << "=" << (X) << '\n';
	#define SAY(X) cout << (X) << '\n';
#else
	#define DBG(X)
	#define SAY(X)
#endif
 
using namespace std;

using ll = long long int;
using ull = unsigned long long int;
using ld  = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

const int INT_INF = (int)(2e9);
const ll  LL_INF  = (ll)(2e18);

const int NIL = -1;
static mt19937 _g(time(nullptr));

inline ll randint(ll a, ll b) { ll w = (_g() << 31LL) ^ _g(); return a + w % (b - a + 1); }
inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T> inline T sign(T x) { return T(x > 0) - T(x < 0); }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for(auto el: v) cout << el << " "; return os; }
template<typename T> inline T fetch() { T ret; cin >> ret; return ret; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for(auto& elem: ret) cin >> elem; return ret; }

const int N = 100;
int T[N][N], A, B;

void solve() {
	A = fetch<int>() - 1;
	B = fetch<int>() - 1;

	for(int i = 0; i < N; ++i) {
		for(int j = 0; j < N; ++j) {
			T[i][j] = (j < N / 2);
		}
	}

	for(int i = 0; i < N; ++i) {
		for(int j = 0; j < N / 2 - 1; ++j) {
			if(i % 3 == 1 && j % 3 == 1 && A > 0) {
				T[i][j] = 0;
				--A;
			}
		}

		for(int j = N / 2; j < N; ++j) {
			if(i % 3 == 1 && (j - N / 2) % 3 == 1 && B > 0) {
				T[i][j] = 1;
				--B;
			}
		}
	}

	cout << N << ' ' << N << '\n';

	for(int i = 0; i < N; ++i) {
		string line(N, '$');

		for(int j = 0; j < N; ++j) {
			line[j] = (T[i][j] ? '#' : '.');
		}

		cout << line << '\n';
	}
}

int main() {
	fast_io();
	solve();

	return 0;
}


Measured memory_bytes: 256
package main

import (
	"container/heap"
	"fmt"
)

type Item struct {
	value    int
	priority int
}

type PriorityQueue []*Item

func (pq PriorityQueue) Len() int { return len(pq) }

func (pq PriorityQueue) Less(i, j int) bool {
	return pq[i].priority > pq[j].priority
}

func (pq PriorityQueue) Swap(i, j int) {
	pq[i], pq[j] = pq[j], pq[i]
}

func (pq *PriorityQueue) Push(x interface{}) {
	item := x.(*Item)
	*pq = append(*pq, item)
}

func (pq *PriorityQueue) Pop() interface{} {
	old := *pq
	n := len(old)
	item := old[n-1]
	*pq = old[0 : n-1]
	return item
}
func main() {
	var N, M, a, b, c, r int
	fmt.Scan(&N, &M)
	w := map[int]int{}
	for i := 0; i < N; i++ {
		fmt.Scan(&a)
		w[a]++
	}
	for j := 0; j < M; j++ {
		fmt.Scan(&b, &c)
		w[c] += b
	}
	pq := make(PriorityQueue, len(w))
	i := 0
	for priority, cnt := range w {
		pq[i] = &Item{
			priority: priority,
			value:    cnt,
		}
		i++
	}
	heap.Init(&pq)
	j := N
	for pq.Len() > 0 && j > 0 {
		item := heap.Pop(&pq).(*Item)
		r += item.priority
		item.value--
		if item.value > 0 {
			heap.Push(&pq, item)
		}
		j--
	}
	fmt.Println(r)
}


Measured memory_bytes: 14852
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <numeric>
using namespace std;
typedef long long int ll;
typedef pair<ll, ll> P; 

#define EPS (1e-7)
#define INF 1e18
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))
#define PI (acos(-1))

#define REP(i, n) for(ll i = 0; i < (ll)(n); i++)
#define rep(i, init, n) for(ll i = init; i <(ll)(n); i++)

int main() {

    string s, t;
    cin >> s;
    cin >> t;

    sort(s.begin(), s.end());
    sort(t.begin(), t.end(),  std::greater<char>());

    if (s < t) cout << "Yes" << endl;
    else cout << "No" << endl;



    return 0;
}

Measured memory_bytes: 256