akhauriyash/Code-Regression huggingface dataset:
/*
このコード、と～おれ!
Be accepted!
  ∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
　　　　　　　　　　(¸.·´ (¸.·'* ☆
*/

#define rep(i, n) for(int i = 0; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printfin(a) printf(a ? "possible\n" : "inposible\n")
#define all(x) (x).begin(), (x).end()
using ll = long long;

//マクロとかここまで

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>

using namespace std;

int main() {
	
	int n, k, l[50], ans = 0;
	scanf("%d%d", &n, &k);
	rep(i, n)scanf("%d", &l[i]);
	sort(l, l + n);
	rep(i, k)ans += l[n - i - 1];
	printf("%d\n", ans);

	return 0;
}


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

int main(void) {
  string s, t;
  int count = 0;
  while (cin >> s) {
    t = s;
    reverse(t.begin(), t.end());
    if (s == t) {
      count++;
    }
  }
  cout << count << endl;
  
  return 0;
}

Measured memory_bytes: 1192
#pragma GCC optimize("Ofast")
#pragma GCC target("avx2")
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/rope>

using namespace std;
using namespace __gnu_pbds;
using namespace __gnu_cxx;
//change null_type here for map/set
typedef tree<int,null_type,less<int>,rb_tree_tag,
            tree_order_statistics_node_update> indexed_set;
typedef long long int  ll;
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define mem(a,b) memset(a,b,sizeof(a))
#define pii pair<int,int>
#define F first
#define S second

template<class T>inline bool read(T &x){
    int c=getchar();int sgn=1;
    while(~c&&c<'0'||c>'9'){if(c=='-')sgn=-1;c=getchar();}
    for(x=0;~c&&'0'<=c&&c<='9';c=getchar())x=x*10+c-'0';
    x*=sgn; return ~c;
}
///START HERE
///indexed_set pbd;
//pbd.insert()
//auto x = pbd.find_by_order(2);
//int od=pbd.order_of_key(7)
///rope<int> rp;
//rp.push_back()
//RandomAccess like vector
//mutable_begin, mutable_end()

int main(){
    ///read()+printf
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    //fast;
    ll n,d;
    cin>>n>>d;
    ll c=0;
    while(n--){
        ll x,y;
        cin>>x>>y;
        if(x*x+y*y<=d*d){
            c++;
        }
    }
    cout<<c;

    return 0;
}


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

int main() {
  
  int P, Q, R, a, b, c;
  cin >> P >> Q >> R;
  
  a = P + Q;
  b = P + R;
  c = Q + R;
  
  int kotae = min ({a, b, c});
  
  cout << kotae << endl;
  
}

Measured memory_bytes: 256
using System;

namespace SwappingTwoNumbers
{
	class MainClass
	{
		public static void Main (string[] args)
		{
			int i = 0;

			while(true)
			{
				string input = Console.ReadLine();
				char[] CharSeparators = new char[] {' '};
				string[] array = input.Split(CharSeparators);
				string array1 = array[0];
				string array2 = array[1];
				int x = int.Parse (array1);
				int y = int.Parse (array2);

				i++;
				if(x==0&&y==0)
					break;
				if (x > y)
					Console.WriteLine(y + " " + x);
				else
					Console.WriteLine(x + " " + y);
			}



		}
	}
}

Measured memory_bytes: 5784
require 'prime'
 
n = gets.chomp.to_i 
n = n.prime_division
 
count = 0
n.each do |item|
  i = 1
  loop do
#    puts "item[]: #{item}"
#    puts "count: #{count}"
#    puts "i: #{i}"
    item[1] -= i
    count += 1
    
    i += 1
    break if i > item[1]
  end
end

puts count

Measured memory_bytes: 14440
void main() {
	auto ip = readAs!(int[]), A = ip[0], B = ip[1];
	auto ip2 = readAs!(int[]), P = ip2[0], Q = ip2[1], R = ip2[2];
	writefln("%.8f", (P*B + R*B + Q*A)*1. / (R+Q));
}

// ===================================

import std.stdio;
import std.string;
import std.functional;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}


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

#define f first
#define s second

#define pb push_back
#define pp pop_back
#define mp make_pair

#define sz(x) (int)x.size()
#define sqr(x) ((x) * 1ll * (x))
#define all(x) x.begin(), x.end()
#define clr(a,v) memset(a, v, sizeof(a))

#define rep(i, l, r) for (int i = (l); i <= (r); i++)
#define per(i, l, r) for (int i = (l); i >= (r); i--)
#define reflex ios_base::sync_with_stdio(false)

#define nl '\n'
#define ioi exit(0);

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int N= (int)2e5 + 7;
const int inf = (int)1e9 + 7;
const int mod = (int)1e9 + 7;
const ll linf = (ll)1e18 + 7;

const int dx[] = {-1, 0, 1, 0, 1, -1, -1, 1};
const int dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
const int kx[] = {-1,1,2,2,1,-1,-2,-2};
const int ky[] = {2,2,1,-1,-2,-2,-1,1};

string conv(int a){
	stringstream ss;
	ss << a;
	string str = ss.str();
	return str;
}


string conv(char a){
	stringstream ss;
	ss << a;
	string str = ss.str();
	return str;
}

int conv(string a){
    stringstream geek(a); 
    int x = 0; 
    geek >> x;   
	return x;
}

int a[6];
int mini = inf;
void permute(int l, int r) 
{ 
   int i; 
   if (l == r) {
     int sum = 0;
     int next = 0;
     rep(i,1,5){
		next += a[i];
		sum = next;
		next = 10*ceil(next*1.0/10);
	 }
	 mini = min(mini, sum);
	}
   else
   { 
       for (i = l; i <= r; i++) 
       { 
          swap((a[l]), (a[i])); 
          permute(l+1, r); 
          swap((a[l]), (a[i])); //backtrack 
       } 
   } 
} 
  
int main(void) 
{	
	rep(i,1,5)
		cin>>a[i];
	permute(1,5);
	cout<<mini;	
	
	
	return 0;
} 



Measured memory_bytes: 256
#include<stdio.h>

int main() {
    while (1) {
        int i;
        int n;
	int possibility = 0;
        int sum = 0;

        scanf("%d", &n);
        if (n == 0) return 0;

        for (i=0; i<n; i++) {
	     int a;

	     scanf("%d", &a);
	     if (a >= 2) possibility = 1;
	     if (a >= 1) ++sum;
        }

	if (possibility) {
	    printf("%d\n", sum + 1);
	} else {
	    printf("NA\n");
	}
    }
}

Measured memory_bytes: 1040
#include<stdio.h>
char ch[200005];
long long num[200005],p;
int cnt[200005];
long long qmul(long long a,long long b)
{
	long long res=1;
	while(b)
	{
		if(b&1)res=res*a%p;
		a=a*a%p;
		b>>=1;
	}
	return res%p;
}
int main()
{
	int n;
	long long res=0,sum=0;
	scanf("%d%lld",&n,&p);
	scanf("%s",ch);
	for(int i=0;i<n;i++)num[i]=ch[i]-'0';
	cnt[0]=1;
	if(p!=2&&p!=5)
	for(int i=n-1;i>=0;i--)
	{
		sum=(sum+num[i]*1LL*qmul(10,n-1-i))%p;
		res+=cnt[sum];
		cnt[sum]++;
	}
	else
	{
		for(int i=0;i<n;i++)if(num[i]%p==0)res+=i+1;
	}
	printf("%lld\n",res);
}

Measured memory_bytes: 1920
//#define _GLIBCXX_DEBUG
#include "bits/stdc++.h"
//#include <intrin.h>  //AtCoder (gcc) 上ではこれがあると動かない。__popcnt用のincludeファイル。
using namespace std;

typedef long long ll;
typedef long double ld;


#define int long long
#define rep(i, n) for(long long i = 0; i < (n); i++)
#define sqrt(d) pow((long double) (d), 0.50)

const int INF = 2000000000; //2e9
const int large_P = 1000000007; //1e9 + 7



//繰り返し2乗法
//N^aの、Mで割った余りを求める。
ll my_pow(ll N, ll a, ll M) {
	ll tempo;
	if (a == 0) {
		return 1;
	}
	else {
		if (a % 2 == 0) {
			tempo = my_pow(N, a / 2, M);
			return (tempo * tempo) % M;
		}
		else {
			tempo = my_pow(N, a - 1, M);
			return (tempo * N) % M;
		}
	}
}



//N_C_a を M で割った余り
ll my_combination(ll N, ll a, ll M) {
	ll answer = 1;

	rep(i, a) {
		answer *= (N - i);
		answer %= M;
	}

	rep(i, a) {
		answer *= my_pow(i + 1, M - 2, M);
		answer %= M;
	}

	return answer;
}



ll my_gcd(ll& a, ll& b) {
	if (b == 0) return a;
	ll temp = a % b;
	return my_gcd(b, temp);
}



// base を底としたときの、n の i桁目を、v.at(i) に入れる。(桁数は n に応じて自動で設定する。)
void ll_to_vector(int base, long long n, vector<int>& v) {
	long long tempo = n;
	long long tempo2 = n;

	//ll n_digit = floor(log10(n) / log10(base)) + 1;  // 桁の計算を1行で。ただ誤差があるのでよくない。
	int n_digit = 1;
	while (tempo2 >= 10) {
		tempo2 /= 10;
		n_digit++;
	}

	v.assign(n_digit, 0);

	//ll n_digit = v.size();  // v のサイズをそのままにする場合。

	for (int i = 0; i < n_digit; i++) {
		v.at(i) = tempo / pow(base, n_digit - 1 - i);
		tempo -= v.at(i) * pow(base, n_digit - 1 - i);
	}
}



int char_to_int(char c) {
	switch (c) {
	case '0': return 0; case '1': return 1; case '2': return 2; case '3': return 3; case '4': return 4;
	case '5': return 5; case '6': return 6; case '7': return 7; case '8': return 8; case '9': return 9;
	default: return 0;
	}
}


//エラトステネスの篩で、prime で ないところに false を入れる。
//true で初期化された vector を代入する必要がある。
void prime_judge(vector<bool>& prime_or_not) {

	prime_or_not.at(0) = false;
	prime_or_not.at(1) = false;

	ll n = prime_or_not.size() - 1;
	ll region = (ll)sqrt(n) + 1;

	for (ll i = 2; i <= n / 2; i++) {
		prime_or_not.at(2 * i) = false;
	}


	for (ll i2 = 1; i2 < n / 2; i2++) {
		ll i = 2 * i2 + 1;  //ここからは奇数のみ探索
		if (i < region && prime_or_not.at(i)) {
			ll j = i * i;
			while (j < n + 1) {
				prime_or_not.at(j) = false;
				j += 2 * i;
			}
		}
	}
};



map<ll, ll> divide_to_prime(int target) {
	map<ll, ll> res;

	//sqrt(target) まで調べる。
	ll upper_lim = ceil(sqrt(target));
	vector<bool> prime_or_not(upper_lim + 1, true);

	if (upper_lim < 20) prime_or_not.assign(25, true);
	prime_judge(prime_or_not);

	ll tempo = target;
	rep(i, (upper_lim + 1)) {
		if (prime_or_not.at(i)) {
			while (tempo % i == 0) {
				tempo /= i;
				res[i]++;
			}
		}
	}

	if (tempo != 1) res[tempo]++; //sqrt(target) より大きな素因数は高々1つしかない。



	return res;
}




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


	if (S == "ABC") cout << "ARC" << endl;
	else cout << "ABC" << endl;


}

Measured memory_bytes: 3724
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <functional>
#include <utility>
#include <tuple>
#include <cctype>
#define INF 0x3f3f3f3f
#define MOD 1000000007
#define PI 4*atan(1.0)
typedef long long ll;
typedef long double ld;
using namespace std;
int dx[4]={0,0,-1,1};
int dy[4]={-1,1,0,0};
const int SIZE=200001+5000;
//int arr[SIZE]={};
 
int main(){
	int N,M;
	cin>>N>>M;
	//int a[SIZE],b[SIZE];
	vector<int> vec[SIZE];
	for(int i=0;i<M;i++){
		int a,b;
		cin>>a>>b;
		vec[a].push_back(b);
		vec[b].push_back(a);
	}
	for(int i=0;i<vec[N].size();i++){
		for(int j=0;j<vec[vec[N][i]].size();j++){
			if(vec[vec[N][i]][j]==1){
				cout<<"POSSIBLE"<<endl;
				return 0;
			}
		}
	}
	cout<<"IMPOSSIBLE"<<endl;
	return 0;
}

Measured memory_bytes: 12144
#include <iostream>
#include <iomanip>
#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>

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

using namespace std;
using i32 = long long;
using u32 = unsigned long long;
using i64 = long long;
using u64 = unsigned long long;
using f64 = double;
using vi32 = vector<i32>;
using vu32 = vector<u32>;
using vi64 = vector<i64>;
using vu64 = vector<u64>;
using vf64 = vector<f64>;
using vstr = vector<string>;
using vvi32 = vector<vi32>;
using vvu32 = vector<vu32>;
using vvi64 = vector<vi64>;
using vvu64 = vector<vu64>;
using vvf64 = vector<vf64>;

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

i64 dp[20][20];
bool board[20][20];

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout << fixed << setprecision(16);
  while (true) {
    int a, b;
    cin >> a >> b;
    if (a == 0 && b == 0) break;
    rep(i, a + 1) rep(j, b + 1) dp[i][j] = 0;
    rep(i, a + 1) rep(j, b + 1) board[i][j] = true;
    dp[1][1] = 1;
    int n;
    cin >> n;
    rep(_, n) {
      int x, y;
      cin >> x >> y;
      board[x][y] = false;
    }
    reps(i, a) reps(j, b) {
      if (board[i + 1][j]) dp[i + 1][j] += dp[i][j];
      if (board[i][j + 1]) dp[i][j + 1] += dp[i][j];
    }
    cout << dp[a][b] << endl;
  }
  return 0;
}



Measured memory_bytes: 3096
N, Q = map(int, input().split())
S = input()

t = [0] * (N)
for i in range(N-1):
    t[i+1] = t[i] + (1 if S[i:i+2]=="AC" else 0)

for j in range(Q):
    l, r = map(int, input().split())
    print(t[r-1] - t[l-1])

Measured memory_bytes: 7748
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <deque>
#include <fstream>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <vector>
using namespace std;
using ll = long long;
#define fst first
#define snd second

/* clang-format off */
template <class T, size_t D> struct _vec { using type = vector<typename _vec<T, D - 1>::type>; };
template <class T> struct _vec<T, 0> { using type = T; };
template <class T, size_t D> using vec = typename _vec<T, D>::type;
template <class T> vector<T> make_v(size_t size, const T& init) { return vector<T>(size, init); }
template <class... Ts> auto make_v(size_t size, Ts... rest) { return vector<decltype(make_v(rest...))>(size, make_v(rest...)); }
template <class T> inline void chmin(T &a, const T& b) { if (b < a) a = b; }
template <class T> inline void chmax(T &a, const T& b) { if (b > a) a = b; }
/* clang-format on */

const ll MOD = 1e9 + 7;

bool check(string mask) {
  if (mask.find("AGC") != string::npos) return false;
  for (int i = 0; i + 1 < mask.size(); i++) {
    swap(mask[i], mask[i + 1]);
    if (mask.find("AGC") != string::npos) {
      return false;
    }
    swap(mask[i], mask[i + 1]);
  }
  return true;
}

int main() {
#ifdef DEBUG
  ifstream cin("in.txt");
#endif
  int N;
  while (cin >> N) {
    const string alpha = "ATCG";
    map<string, ll> dp;
    dp["XXX"] = 1;
    for (int t = 0; t < N; t++) {
      map<string, ll> ndp;
      for (auto& entry : dp) {
        string mask = entry.fst;
        ll ways = entry.snd;
        for (char c : alpha) {
          string newMask = mask + c;
          if (check(newMask)) {
            (ndp[newMask.substr(1)] += ways) %= MOD;
          }
        }
      }
      dp = ndp;
    }
    ll res = 0;
    for (auto& entry : dp) res = (res + entry.snd) % MOD;
    cout << res << endl;
  }
  return 0;
}


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

using namespace std;

const int mxn = 2e3;

int a[mxn + 11];

int main(){
    int n;
    scanf("%d", &n);
    for (int i = 0; i < n; i++){
        scanf("%d", a + i);
    }
    sort(a, a + n);
    long long ans = 0;
    for (int i = 0; i < n - 2; i++){
        int k = i + 2;
        for (int j = i + 1; j < n - 1; j++){
            int cur = a[i] + a[j];
            while (cur > a[k] && k < n){
                k++;
            }
          ans += k - j - 1;
        }
    }
    printf("%lld\n", ans);
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <math.h>
#include <stdio.h>
#include <ctype.h>
#include <ios> 
#include <iomanip>
using namespace std;

#define N_MAX   (100000)
#define LL_MAX_NUM (1LL<<60)
#define INF 1e7

typedef long long ll;
typedef long long int lli;

int main() {
	int A, B; char op; cin >> A >> op >> B;
	cout << (op == '+'?A+B:A-B) << endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Queue;
import java.util.Scanner;
 


public class Main {
	static int a1[]= {0,-1,0,1};
	static int b1[]= {-1,0,1,0};
	private static Scanner sc = new Scanner(System.in);
	//result = Math.pow(num1, num3)
	//StringBuffer str = new StringBuffer(hoge1);
	//String hoge2 = str.reverse().toString();
	//map.containsKey(A)

	//Map<String, Integer> map = new HashMap<String, Integer>(n);
	/*for ( キーのデータ型 key : マップの名前.keySet() ) {
		データのデータ型 data = マップの名前.get( key );
		
		// keyやdataを使った処理;
	}*/
	//int i = Integer.parseInt(s);
	//Queue<String> qq=new ArrayDeque<>(); //add,poll,peek
	//Deque<String> qq=new ArrayDeque<>();//push,pop,peek
	//ArrayList<String> cc = new ArrayList<>(n);
	//Collections.sort(list);
	//Array.sort(list);   cc.contains(tmp)
	//Arrays.asList(c).contains("a")
	//list.set(1,"walk");//1 1 2 3 5
	static int K,N;
	static int mod =1000000007;
	public static void main(String[] args) {
		
		int A=sc.nextInt();
		int B=sc.nextInt();
		int C=sc.nextInt();
		int X=sc.nextInt();
		
		int ctn=0;
		for(int a=A;a>=0;a--) {
			if(a*500<=X) {
				for(int b=B;b>=0;b--) {
					if(a*500+b*100<=X&&(X-a*500-b*100)/50<=C) {
						ctn++;
					}
				}
			}
		}
		p(ctn);
		
		
	}

	
	//static ArrayList<Integer> cc = new ArrayList<>(10001);
	
	static void p(String ans) {System.out.println(ans);};
	static void p(int ans) {System.out.println(ans);};
	static void p() {System.out.println();};
	static void p(long ans) {System.out.println(ans);};
	static void p(double ans) {System.out.println(ans);};
	static String nextPermutation(String s) {
		ArrayList<Character> list=new ArrayList<>();
		for(int i=0;i<s.length();i++) {
			list.add(s.charAt(i));
		}
		int pivotPos=-1;
		char pivot=0;
		for(int i=list.size()-2;i>=0;i--) {
			if(list.get(i)<list.get(i+1)) {
				pivotPos=i;
				pivot=list.get(i);
				break;
			}
		}
		if(pivotPos==-1&&pivot==0) {
			return "Final";
		}
		int L=pivotPos+1,R=list.size()-1;
		
		
		
		int minPos=-1;
		char min =Character.MAX_VALUE;
		
		for(int i=R;i>=L;i--) {
			if(pivot<list.get(i)) {
				if(list.get(i)<min) {
					min=list.get(i);
					minPos=i;
				}
			}
		}
		
		Collections.swap(list, pivotPos, minPos);
		Collections.sort(list.subList(L, R+1));
		
		
		StringBuilder sb=new StringBuilder();
		for(int i=0;i<list.size();i++) {
			sb.append(list.get(i));
		}
		return sb.toString();
	}
}
	


Measured memory_bytes: 22996
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
int main(void){
char s[10];
  int count;
scanf("%s",s);
for(count=0;s[count]!='\0';){
if(s[count]=='9'){s[count]='1';count++;}
else if(s[count]=='1'){s[count]='9';count++;}
}
  printf("%s",s);
return 0;
}

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

namespace STDquantum {

const int N = 1e3 + 10;
char s[N];
inline void main() {
  scanf("%s", s + 1);
  int len = strlen(s + 1);
  if (s[len] == 's') {
    s[len + 1] = 'e', s[len + 2] = 's';
  } else {
    s[len + 1] = 's';
  }
  printf("%s", s + 1);
}

}  // namespace STDquantum

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("D:\\OI\\STDquantum\\test.in", "r", stdin);
  freopen("D:\\OI\\STDquantum\\test.out", "w", stdout);
#endif
#ifndef LOCAL
  freopen("a.in", "r", stdin);
  freopen("a.out", "w", stdout);
#endif
#endif
  STDquantum::main();
  return 0;
}

Measured memory_bytes: 3824
#include <bits/stdc++.h>
#define int long long
#define endl '\n'
using namespace std;

typedef long long ll;
#define READ(a) int a; cin >> a;
#define READARR(a, n) int a[(n) + 1] = {}; FOR(i, 1, (n)) {cin >> a[i];}
#define READMAT(a, n, m) int a[n + 1][m + 1] = {}; FOR(i, 1, n) {FOR(j, 1, m) cin >> a[i][j];}
#define print(a, n) FOR (i, 1, n) cout << a[i] << " "; cout << endl;
#define printmat(a, n, m) FOR (i, 1, n) {FOR (j, 1, m) cout << a[i][j] << " "; cout << endl;} cout << endl;
#define pb push_back
#define fi first
#define se second
#define vi vector <int>
#define pi pair <int, int>
#define vpi vector <pi>
#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FORD(i, a, b) for (int i = (a); i >= (b); i--)
const ll inf = 1e18;
const ll mod = 1e9 + 7;

signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	string s;
	cin >> s;
	int n = s.size(), cnt = 0;
	FOR (i, 0, n/2 - 1)
	    if (s[i] != s[n - 1 - i]) cnt++;
	cout << cnt;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
#define INF 2100000000
#define MOD 1000000007

bool dbgflag = false; //debug

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

  ll a, b, n;
  cin >> a >> b >> n;

  ll x = (ll)((n+1) / b);
  x = (x == 0) ? n : x * b - 1;

  cout << (ll) ((a * x) / b) - a * (x / b) << endl;
}

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

using namespace std;
typedef long long ll;
int k;
string s;

main(){
  cin>>k>>s;
  if(s.length() > k){
    for (int i = 0; i < k; i++) cout<<s[i];
    cout<<"...";
  }
  else cout<<s;
}


Measured memory_bytes: 3644
;; D - Handstand 2

(defun count-numbers-under (n head tail)
  "n以下で先頭桁がhead, 末尾桁がtailである正整数の個数"
  (+ (if (and (= head tail) (<= head n)) 1 0) ; 1桁
     ; 2桁以上
     (loop for m = 1 then (* m 10)             ; 10 ** i
           for lower = (+ (* head m 10) tail)  ; head 000 tail
           for upper = (+ (* (1- m) 10) lower) ; head 999 tail
           while (<= lower n)
           sum (if (<= upper n)
                   m 
                   (1+ (floor (- n lower) 10))))))

(defun solve (n)
  "n以下の正の整数の組(a,b)のうち次を満たすものの個数:
   a, bを先頭の0の付かない10進数表記で表したとき, aの末尾がbの先頭と等しく,
   aの先頭がbの末尾に等しい."
  (loop for head from 1 to 9       ; aの先頭の桁 (= bの末尾の桁)
    sum (loop for tail from 1 to 9 ; aの末尾の桁 (= bの先頭の桁)
          sum (* (count-numbers-under n head tail)     ; aの個数
                 (count-numbers-under n tail head))))) ; bの個数

(let ((n (read)))  ; n <= 2 * 10 ** 5
  (princ (solve n)))


Measured memory_bytes: 15588
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <cmath>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <iostream>
#include <random>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include <fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <bitset>
using namespace std;

using ll = long long;
using vll = vector<ll>;
using pll = pair<ll, ll>;
using qll = queue<ll>;
using vb = vector<bool>;
using mll = map<ll, ll>;
using sll = stack<ll>;
#define REP(i,n) for(ll i(0);(i)<(n);(i)++)
#define rep(i,n) for(ll i(0);(i)<(n);(i)++)
#define ALL(a) a.begin(), a.end()
#define enld endl //* missspell check
const ll INF = 1LL << 60;

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

void solve(long long K, long long X){
    if(500*K>=X)
        cout<<YES<<endl;
    else
        cout<<NO<<endl;
}

int main(){
    long long K;
    scanf("%lld",&K);
    long long X;
    scanf("%lld",&X);
    solve(K, X);
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <iostream>

using namespace std;

struct Node {
	int key;
	Node *right, *left, *parent;
};

Node *root, *NIL;

Node * find(Node *u, int k) {
	while(u != NIL && k != u->key) {
		if(k < u->key) u = u->left;
		else u = u->right;
	}
	return u;
}

void insert(int k) {
	Node *y = NIL;
	Node *x = root;
	Node *z;
	
	z = (Node *)malloc(sizeof(Node));
	z->key   = k;
	z->left  = NIL;
	z->right = NIL;
	
	while(x != NIL) {
		y = x;
		if(z->key < x->key) {
			x = x->left;
		} else {
			x = x->right;
		}
	}
	
	z->parent = y;
	if(y == NIL) {
		root = z;
	} else {
		if( z->key < y->key) {
			y->left = z;
		} else {
			y->right = z;
		}
	}
}

void inorder(Node *u) {
	if(u == NIL) return;
	inorder(u->left);
	printf(" %d",u->key);
	inorder(u->right);
}
void preorder(Node *u) {
	if(u == NIL) return;
	printf(" %d",u->key);
	preorder(u->left);
	preorder(u->right);
}
	
int main(void) {
	int n, i, x;
	string com;
	scanf("%d",&n);
	
	for(i=0;i<n;i++) {
		cin >> com;
		if(com[0] == 'f') {
			scanf("%d",&x);
			Node *t = find(root,x);
			if(t != NIL) printf("yes\n");
			else printf("no\n");
		} else if(com == "insert") {
			scanf("%d",&x);
			insert(x);
		} else if(com == "print") {
			inorder(root);
			printf("\n");
			preorder(root);
			printf("\n");
		}
	}

	return 0;
}

/*
8
insert 30
insert 88
insert 12
insert 1
insert 20
find 12
insert 17
insert 25
find 16
print
*/


Measured memory_bytes: 22080
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

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

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

#[allow(unused_macros)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

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

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

    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };

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

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

fn main() {
    input!{
        n: usize,
        st: [(chars, i64);n],
        x: chars,
    }
    let mut flag =false;
    let mut res = 0i64;
    for i in 0..n {
        if flag {
            res += st[i].1;
        }
        if st[i].0 == x {
            flag = true;
        }
    }
    println!("{}", res);
}

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

int n,k;

int main()
{
	cin >> n;
	string res = "No";

	if (n > 3) {
		for(int i = 0;;i++){
			int tmp = n - 4*i;
			if(tmp % 7 == 0) {
				res = "Yes";
				break;
			}
			if(tmp < 0) {
				break;
			}
		}
	}
	cout << res << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		// 数値
		String n = sc.next();
		if (n.charAt(2) == n.charAt(3) && n.charAt(4) == n.charAt(5)) {
			out("Yes");
		} else {
			out("No");
		}

	}

	/*
	 * 以下メソッド集
	 */
	static int kaijo(int n) {
		if (n == 0 || n == 1) {
			return 1;
		} else {
			return n * kaijo(n - 1);
		}
	}

	static int fib(int n) {
		return (n == 1 || n == 0) ? n : fib(n - 2) + fib(n - 1);
	}

	static long lcm(long m, long n) {

		return m * n / gcd(m, n);
	}

	static int lcm(int m, int n) {

		return m * n / gcd(m, n);
	}

	static long gcd(long a, long b) {
		return (b == 0) ? a : gcd(b, a % b);
	}

	static int gcd(int a, int b) {
		return (b == 0) ? a : gcd(b, a % b);
	}

	static void out(String info) {
		System.out.println(info);
	}

	static void out(int info) {
		System.out.println(info);
	}

	static void out(double info) {
		System.out.println(info);
	}

	static void out(long info) {
		System.out.println(info);
	}
}


Measured memory_bytes: 21844
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pi acos(-1)
int main()
{
    ll n,i,j,k,l,a,b,c,d;
    cin>>n;
    cout<<fixed<<setprecision(20)<<2*pi*n<<endl;
    return 0;

}


Measured memory_bytes: 3816
import sys
import copy
sys.setrecursionlimit(10**7)
def dfs(graph,v,dist_mod):
    color[v] = dist_mod
    for next_v,dist in graph[v]:
        if color[next_v] != -1:
            continue
        dfs(graph,next_v,(dist_mod+dist)%2)
n = int(input())
uvw = [list(map(int,input().split())) for _ in range(n-1)]
g = [[] for _ in range(n)]
color = [-1]*n
for i in range(n-1):
    g[uvw[i][0]-1].append([uvw[i][1]-1,uvw[i][2]])
    g[uvw[i][1]-1].append([uvw[i][0]-1,uvw[i][2]])
dfs(g,0,0)
for i in range(n):
    print(color[i])

Measured memory_bytes: 208876
#include <bits/stdc++.h>
typedef long long ll;
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,a) FOR(i,0,a)
	
using namespace std;
const int MAX_X=2500,MAX_K=2500;
int K,X,S[MAX_K],N;
const ll MOD=1e9+7;
int dp[MAX_X*2][10000],psm[MAX_X*2][10001];
int main(){
	scanf("%d %d %d",&N,&K,&X);
	REP(i,K){
		scanf("%d",S+i);
	}
	dp[0][0]=1;
	REP(i,10000-1)dp[0][i+1]=0;
	psm[0][0]=0;
	REP(i,10000){
		psm[0][i+1]=1;
	}
	FOR(i,1,2*X){
		REP(j,10000){
			int ub;
			if(i%2){
				ub=max(j-i-1,0);
			}else{
				ub=max(j-i,0);
			}
			dp[i][j]=(int)((((ll)psm[i-1][j]-psm[i-1][ub]+MOD)+(j<=i))%MOD);
			psm[i][j+1]=(int)(((ll)psm[i][j]+dp[i][j])%MOD);
		}
	}
	ll ans=1;
	REP(i,K-1){
		if(X*2-1-i*2>=0){
			ans*=dp[X*2-1-i*2][S[i+1]-S[i]-1];
		}else{
			ans=0;
		}
		ans%=MOD;
	}
	printf("%lld\n",ans);
}

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

#define pb push_back
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,n,s) for(int i=(s);i<(n);i++)
#define rrep(i,n) for(int i=(n-1);i>=0;i--)
#define rreps(i,n,s) for(int i=s;i>=n;i--)
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }

using ll = long long;
using namespace std;
constexpr long long MAX = 5100000;
constexpr long long INF = 1LL << 60;
constexpr int MOD = 1000000007;

int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int n;
string s,t;
cin>>n>>s>>t;
int b=n;
rep(i,n){
    if(s[i]==t[0]){
        bool ok=true;
        int k=0;
        reps(j,n,i){
            if(s[j]!=t[k]){
                ok=false;
                break;
            }
            k++;
        }
        if(ok){
            b=i;
            break;
        }
    }
}
string st=s.substr(0,b)+t;
cout<<st.size()<<endl;
return 0;
}

Measured memory_bytes: 256
import itertools
n=int(input())
a=[]
for i in range(n):
  x,y=map(int,input().split())
  a.append((x,y))
num=0
count=0
for i in itertools.permutations(range(n),n):
  s=list(i)
  num+=1
  for j in range(n-1):
    count+=((a[s[j+1]][0]-a[s[j]][0])**2+(a[s[j+1]][1]-a[s[j]][1])**2)**(0.5)
print(count/num)


Measured memory_bytes: 74376
import math
def c(n, r):
  return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))

n, k = map(int, input().split())
l = n-k

for i in range(1, k+1):
  if l < i-1:
    print(0)
    continue
  else:
  	print(c(k-1, i-1)*c(l+1, i)%(10**9+7))

Measured memory_bytes: 3316
#include <bits/stdc++.h>
#define REP(i, a, b) for (int i = a; i <= b; ++i)
#define PER(i, a, b) for (int i = a; i >= b; --i)
#define RVC(i, S) for (int i = 0; i < S.size(); ++i)
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define debug(...) fprintf(stderr, __VA_ARGS__)
using namespace std;

typedef long long LL;
typedef pair<int, int> pii;
typedef vector<int> VI;

inline int read(){
	int x = 0, ch = getchar(), f = 1;
	while (!isdigit(ch)){if (ch == '-') f = -1; ch = getchar();}
	while (isdigit(ch)) x = x * 10 + ch - '0', ch = getchar();
	return x * f;
}

const int N = 100005;
int fa[N], n, m, vis[N];
VI to[N], p1, p2;

int main(){
	n = read(), m = read();
	REP(i, 1, n) fa[i] = i;
	REP(i, 1, m){
		int u = read(), v = read();
		to[u].pb(v);
		to[v].pb(u);
	}

	int st = 1;
	while (st){
		// debug("st = %d\n", st);
		p1.pb(st); vis[st] = 1;
		int tmp = 0;
		RVC(i, to[st]){
			int y = to[st][i];
			if (!vis[y]){
				tmp = y; break;
			}
		}
		st = tmp;
	}

	st = 1;
	while (st){
		// debug("st = %d\n", st);
		p2.pb(st); vis[st] = 1;
		int tmp = 0;
		RVC(i, to[st]){
			int y = to[st][i];
			if (!vis[y]){
				tmp = y; break;
			}
		}
		st = tmp;
	}

	printf("%d\n", (int)p1.size() + (int)p2.size() - 1);
	for (int i = (int)p1.size() - 1; i > 0; --i)
		printf("%d ", p1[i]);
	for (int i = 0; i < p2.size(); ++i)
		printf("%d ", p2[i]);
	printf("\n");
	return 0;
}

Measured memory_bytes: 7544
#define _USE_MATH_DEFINES
#include <math.h>
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <algorithm>
#include <numeric>
#include <stdio.h>
#include <vector>
#include <map>

using namespace std;
typedef long long ll;

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

int main() {
    // 入力
    ll N,M,K;
    cin >> N >> M >> K;
    string out = "No";
    ll S = 0;
    rep(i,N+1){
        rep(j,M+1){
            S = i*M + j*N - i*j*2;
            if(S==K||N*M-S==K) {
                out = "Yes";
                break;
            }
        }
    }
    cout << out << endl;
    return 0;
}


Measured memory_bytes: 256
import java.util.*;
import java.io.*;
import static java.util.Arrays.*;
import static java.util.Collections.*;
import static java.lang.Math.*;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
        int n,i,j,v;
        Scanner scan=new Scanner(System.in);
        n=scan.nextInt();
        int m[]=new int[n];
        int k[]=new int[n];
        for(i=0;i<m.length;i++)
        {
        	m[i]=scan.nextInt();
        }
        
        for(i=0;i<m.length-1;i++)
        {
        	System.out.print(m[i]+" ");
        }
        System.out.println(m[n-1]);
        for(i=1;i<=m.length-1;i++)
        {
        	v=m[i];
        	j=i-1;
        	while(j>=0&&m[j]>v)
        	{
        		m[j+1]=m[j];
        		j--;
        	}
        	m[j+1]=v;
        	for(j=0;j<m.length-1;j++)
        	{
        		System.out.print(m[j]+" ");
        	}
        	System.out.println(m[n-1]);
        }
	}
}

Measured memory_bytes: 22496
#include <math.h>
#include <iostream>
using namespace std;

bool is_prime(int num){
    if (num==2)
        return true;
    if(num < 2 || num%2==0)
        return false;
    for(int i =3;i<=sqrt(num);i+=2){
        if (num%i ==0)
            return false;
    }
    return true;
}



int main(){
    int N;
    int count = 0;
    cin>>N;
    int num;
    for(int i=0;i<N;i++){
        cin>>num;
        if(is_prime(num))
            count++;
    }
    cout<<count<<endl;
    return 0;
}

Measured memory_bytes: 1160
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <stdlib.h>
#include <math.h>
#define min(x,y)(x<y?x:y)
#define max(x,y)(x>y?x:y)
#define rep(i,l,r)for(int i=(int)l;i<(int)r;i++)
#define MAX 100001
#define INF 1000000007
typedef long long lli;
typedef struct{
  int front,rear,data[MAX][3];
}queue;

queue que;

void initQueue(queue *p){p->front=p->rear=0;}
bool emptyQueue(queue *p){return p->front == p->rear;}
bool fullQueue(queue *p){return (p->front-1==p->rear)||(p->front==0&&p->rear==MAX-1);}

void queuePop(queue *p){if(emptyQueue(p)){printf("UnderFlow\n");exit(1);}else
{
    p->front++;
    if (p->front == MAX)
      p->front = 0;
  }
}

void queuePush(queue *p, int x, int y, int d)
{
  if (fullQueue(p))
  {
    printf("OverFlow\n");
    exit(1);
  }
  else
  {
    p->data[p->rear][0] = x;
    p->data[p->rear][1] = y;
    p->data[p->rear][2] = d;
    p->rear++;
    if (p->rear == MAX)
      p->rear = 0;
  }
}


int main(void) {
  char s[22][22];
  int h, w;
  scanf("%d %d", &h, &w);
  rep(hi, 0, h) {
    scanf("%s", s[hi]);
  }

  int mx[4] = { 0, 1, 0, -1 };
  int my[4] = { 1, 0, -1, 0 };
  int ans = 0;
  rep(hi, 0, h) {
    rep(wi, 0, w) {
      if ( s[hi][wi] == '#' ) continue;
      int visited[21][21] = {0};
      initQueue(&que);
      visited[hi][wi] = 1;
      queuePush(&que, hi, wi, 0);
      while ( !emptyQueue(&que) ) {
        int x = que.data[que.front][0];
        int y = que.data[que.front][1];
        int d = que.data[que.front][2];
        queuePop(&que);
        ans = max(ans, d);
        rep(mi, 0, 4) {
          int nextX = x + mx[mi];
          int nextY = y + my[mi];
          if ( nextX < 0 || h <= nextX ) continue;
          if ( nextY < 0 || w <= nextY ) continue;
          if ( visited[nextX][nextY] )   continue;
          if(s[nextX][nextY] == '#' )  continue;
					visited[nextX][nextY] = 1;
					queuePush(&que, nextX, nextY, d + 1);
				}
			}
		}
	}
printf("%d",ans);
}

Measured memory_bytes: 128
#ifdef _MSC_VER
#include <__msvc_all_public_headers.hpp>
#undef min
#undef max
#else
#define NDEBUG
#include <bits/stdc++.h>
#endif

using namespace std;
using large = long long;
int main() {
    int n;
    cin >> n;

    auto a = vector<int>(n);
    for (auto& a_i : a)
        cin >> a_i;

    auto neg_count = count_if(a.begin(), a.end(), [](auto a_i) { return a_i < 0; });
    auto zero_count = count(a.begin(), a.end(), 0);

    auto ans = accumulate(a.begin(), a.end(), 0LL, [](auto sum, auto a_i) { return sum + abs(a_i); });
    if (neg_count % 2 == 1) {
        auto max_neg = INT_MIN;
        auto min_pos = INT_MAX;
        for (auto i = 0; i < n; ++i) {
            if (a[i] < 0)
                max_neg = max(max_neg, a[i]);
            else
                min_pos = min(min_pos, a[i]);
        }
        assert(max_neg < 0);

        if (-max_neg < min_pos)
            ans += 2 * max_neg;
        else
            ans -= 2 * min_pos;
    }

    cout << ans << "\n";
    return 0;
}


Measured memory_bytes: 3776
#include <algorithm>
#include <iostream>
#include <cstdio>
#include <map>
#include <numeric>
#include <cmath>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <complex>
#include <string.h>
#include <unordered_set>
#include <unordered_map>
#include <bitset>
#include <iomanip>
#include <sys/time.h>
#include <tuple>
#include <random>
using namespace std;

#define endl '\n'
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define UNIQ(v) (v).erase(unique((v).begin(), (v).end()), (v).end())

typedef long long ll;
typedef long double ld;
typedef pair<int, int> P;
typedef complex<double> comp;
typedef vector< vector<ld> > matrix;
struct pairhash {
public:
    template<typename T, typename U>
    size_t operator()(const pair<T, U> &x) const {
	size_t seed = hash<T>()(x.first);
	return hash<U>()(x.second) + 0x9e3779b9 + (seed<<6) + (seed>>2);
    }
};
const int inf = 1e9 + 9;
const ll mod = 1e9 + 7;
const double eps = 1e-8;
const double pi = acos(-1);

int n;

map<int, ll> pf;

void prime_factor(int n) {
    for (int i = 2; i * i <= n; i++) {
        while (n % i == 0) {
            pf[i]++;
            n /= i;
        }
    }
    if (n != 1) pf[n]++;
}

ll solve() {
    for (int i = 1; i <= n; i++) {
        prime_factor(i);
    }

    ll res = 1;
    for (auto v : pf) {
        res = res * (v.second+1) % mod;
    }
    return res;
}

void input() {
    cin >> n;
}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(15);

    input();
    cout << solve() << endl;
}


Measured memory_bytes: 256
#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 h=0;h<=C;h++){
        if(500*i+100*j+50*h==X){
          ans++;
        }
      }
    }
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <utility>
#include <queue>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <climits>
using namespace std;

#define MOD1097 1000000007

#define ll long long
#define pint pair<int, int>
#define pll pair<ll, ll>
#define pb push_back
#define mpair make_pair
#define pm(first, second) pb(mpair(first, second))
#define SPACE " "
#define fpf first.first
#define fps first.second
#define spf second.first
#define sps second.second

#define all(X) (X).begin(), (X).end()
#define rall(X) (X).rbegin(), (X).rend()
#define divcel(a, b) (((a) + ((b) - 1)) / (b))

int main(){

	int K;
	string S;
	cin >> K >> S;
	for(int i = 0; i < min((int)S.size(), K); i++){
		cout << S[i];
	}
	if(S.size() > K)cout << "...";
	cout << endl;

	return 0;
}


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

int main() {
    int n, m;
    cin >> n >> m;
    vector<vector<int>> a(n);
    rep(i,n) {
        int k;
        cin >> k;
        rep(j,k) {
            int A;
            cin >> A;
            a[i].push_back(A);
        }
    }

    int ans = 0;
    for (int i = 0; i < a[0].size(); i++) {
        int ct = 0;
        for (int j = 1; j < n; j++) {
            bool ok = false;
            for (int k = 0; k < a[j].size(); k++) {
                if (a[0][i] == a[j][k]) ok = true;
            }
            if (ok) ct++;
        }
        if (ct == n-1) ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int a,b,q,w,e,ans;
int main()
{
	scanf("%d%d",&a,&b);
	q=a+b;
	w=a-b;
	e=a*b;
	ans=max(max(q,w),e);
	printf("%d",ans);
} 

Measured memory_bytes: 256
import java.util.Scanner;
import java.util.ArrayList;
import java.util.List;
import java.util.Collections;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int k, n;
        n = sc.nextInt();
        k = sc.nextInt();
        int i = 0;
        List<Integer> list = new ArrayList<>();
        while(i < n){
            list.add(sc.nextInt());
            i++;
        }
        sc.close();
        Collections.sort(list);
        i = 0;
        int sum = 0;
        while(i < k){
            sum += list.get(i);
            i++;
        }
        System.out.println(sum);
    }
}


Measured memory_bytes: 38984
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		int a = 0;
		int b = 0;
		int c = 0;
		int i = 0;
		int ans = 0;

		Scanner in = new Scanner(System.in);

		a = in.nextInt();
		b = in.nextInt();
		c = in.nextInt();

		while(a<=b){
			if (c % a == 0){
				ans++;
			}else{

			}
		a++;
		}

		System.out.println(ans);

	}

}

Measured memory_bytes: 26316
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,l,r) for(long long i=(l);i<(r);++i)
#define REP(i,n) FOR(i,0,n)
#define int long long
#define _GLIBCXX_DEBUG
const int INF=1e15;

signed main(){
    int W,A,B;cin>>W>>A>>B;
    int x;
    if(A<B)x=B-A-W;
    else x=A-B-W;
    cout<<max(x,0ll)<<endl;
}


Measured memory_bytes: 256
#define _GLIBCXX_DEBUG//TLEの原因になるので注意！！！！！！！！！！！
#include<cmath>
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;
vector<int> arr;
stack<int> st;
queue<int> qu;
queue<pair<int,int> > qu2;
priority_queue<int> pq;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define rep2(i,n) for(int i=1; i<=(int)(n); i++)
#define mins(x,y) x=min(x,y)
#define maxs(x,y) x=max(x,y)
typedef set<int> set_t;
typedef set<string> set_g;
typedef complex<double> xy_t;
static const int NIL = -1;
static const int INF = 1000000007;
#define mp make_pair
#define sz(x) int(x.xise())
#define mod 1000000007
#define reps(i,s,n) for(int i = s; i < n; i++)
//#define int long long

//cerrはコメントアウトしなくても通る//ただしTLEを引き起こすことがある

int a[55];
vector<int> ans1,ans2;

int main(){
    int n;
    cin >> n;
    int mx=-INF,mi=INF;
    int mxnum=0,minum=0;
    rep(i,n){
        cin >> a[i];
        if(mx<a[i]){
            mx=a[i];
            mxnum=i+1;
        }
        if(mi>a[i]){
            mi=a[i];
            minum=i+1;
        }
    }
    int num=0;
    cerr<<mx+mi<<endl;
    if(mx==mi){
        cout<<0<<endl;
    }else if(mx+mi>0){
        rep(i,n){
            
            num++;
            ans1.push_back(mxnum);
            ans2.push_back(i+1);
            
        }
        rep(i,n-1){
            num++;
            ans1.push_back(i+1);
            ans2.push_back(i+2);
        }
        cout<<num<<endl;
        rep(i,ans1.size()){
            cout<<ans1[i]<<' '<<ans2[i]<<endl;
        }
    }else if(mx+mi<=0){
        rep(i,n){
            
            num++;
            ans1.push_back(minum);
            ans2.push_back(i+1);
            
        }
        rep(i,n-1){
            num++;
            ans1.push_back(n-i);
            ans2.push_back(n-i-1);
        }
        cout<<num<<endl;
        rep(i,ans1.size()){
            cout<<ans1[i]<<' '<<ans2[i]<<endl;
        }
    }
    return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * Built using CHelper plug-in Actual solution is at the top
 */

public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		InputReader in = new InputReader(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		Task solver = new Task();
		solver.solve(1, in, out);
		out.close();
	}

	static class Task {
		public void solve(int testNumber, InputReader in, PrintWriter out) {
			int N = in.nextInt();
			int[] V = new int[N];
			int[] C = new int[N];
			int total = 0;
			for(int i = 0; i <  N; i++) {
				V[i] = in.nextInt();
			}
			for(int i = 0; i <  N; i++) {
				C[i] = in.nextInt();
				if(V[i] > C[i]) {
					total += V[i] - C[i];
				}
			}
			out.println(total);
		}
	}

	static class InputReader {
		public BufferedReader reader;
		public StringTokenizer tokenizer;	

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

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

		public char nextChar() {
			return next().charAt(0);
		}

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

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

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

	}
}


Measured memory_bytes: 21460
def p_f(n):
    res = []
    a = 2
    while a**2 <= n:
        if n % a == 0:
            ex = 0
            while n % a == 0:
                n //= a
                ex += 1
            
            res.append([a, ex]) #割り終わったら素因数と指数を格納
        
        a += 1
    if n > 1: res.append([n, 1]) #最後が素数ならそれも格納
    
    return res

n = int(input())
p_f_l = p_f(n) #素因数分解した結果リスト
ans = 0
for i in p_f_l:
    p = i[0] #素数
    ex = i[1] #指数上限
    for j in range(1,ex+1):
        if n % p**j == 0:
            n //= p**j
            ans += 1
print(ans)

Measured memory_bytes: 9220