akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
using namespace std;

int main(){
  string boin = "aeiou";
  string result = "consonant";
  char c;
  cin >> c;

  for(int i = 0; i < boin.size(); i++){
    if(c == boin.at(i)){
      result = "vowel";
      break;
    }
  }

  cout << result << endl;
}

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

using ll = long long;
using ull = unsigned long long;

#define MOD 1000000007

int main(void) {
    ll N;
    ll l = 0, r = 0;
    string L, R;
    string S;
    cin >> N >> S;
    for(ll i = 0;i < S.size();i++) {
        ll j = S.size() - i - 1;
        if(S[i] == '(') l++;
        else l = max(l - 1, 0LL);
        if(S[j] == ')') r++;
        else r = max(r - 1, 0LL);
    }
    L.resize(r, '(');
    R.resize(l, ')');
    S.insert(0, L);
    S.insert(S.size(), R);
    cout << S << endl;
    return 0;
}


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

int main() {
  int N;
  cin >> N;
  int ans;
  for(int i=0;i<N;i++){
    int l,r;
    cin >> l >> r;
    ans += (r + 1) - l;
  }
  cout << ans << endl;
}

Measured memory_bytes: 384
#include <queue>
#include <cstdio>
#include <iostream>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <sstream>
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int a[10];
int k;

int main()
{
	for (int i = 0; i < 5; i++)
	{
		cin >> a[i];
	}
	cin >> k;

	for (int i = 0; i < 5; i++)
	{
		for (int j = i + 1; j < 5; j++)
		{
			if (a[j] - a[i] > k)
			{
				cout << ":(" << endl;
				return 0;
			}
		}
	}

	cout << "Yay!" << endl;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<functional>
#include<algorithm>
#include<iostream>
#define rep(i,a) for(i=0;i<a;i++) 
using namespace std;
int main(void)
{
	int m,r,f,cnt;
	char judge[6]={"ABCDF"};
	while(1) {
		cin>>m>>f>>r;
		if(m==-1&&f==-1&&r==-1) break;
		if(m==-1 || f==-1) cout<<judge[4]<<endl;
		else if(m+f>=80) cout<<judge[0]<<endl;
		else if(m+f>=65) cout<<judge[1]<<endl;
		else if(m+f>=50) cout<<judge[2]<<endl;
		else if(m+f>=30 && r>=50) cout<<judge[2]<<endl;
		else if(m+f>=30) cout<<judge[3]<<endl;
		else cout<<judge[4]<<endl;
	}
	return 0;
}

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

int main(){
	int N;
    cin >> N;
    map<string,int> S;
    rep(i,N){
        string s;
        cin >> s;
        if(S.count(s))S[s] += 1;
        else S[s] = 1;
    }

    int max_value(0);

    for(auto itr = S.begin(); itr != S.end(); ++itr) {
        max_value = max(max_value,itr->second);
    }
    vector<string> ans;
    for(auto itr = S.begin(); itr != S.end(); ++itr) {
        if(itr->second == max_value)ans.push_back(itr->first);
    }

    /*
    for (const auto& [key, value] : S){
        max_value = max(max_value,value);
    }
    for (const auto& [key, value] : S){
        if(value == max_value)ans.push_back(key);
    }*/

    rep(i,ans.size()) cout << ans[i] << endl;

    return 0;
}


Measured memory_bytes: 26868
n = int(input())

f = [0] * n
for x in range(1, 101):
    for y in range(1, 101):
        for z in range(1, 101):
            if (x * x + y * y + z * z + x * y + y * z + z * x <= n):
                f[x * x + y * y + z * z + x * y + y * z + z * x - 1] += 1
for i in range(n):
    print(f[i])


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

using namespace std;
typedef long long ll;
const int N = 2e5 + 10;
int same[N];
int ans[N];

bool check(int n) {
    for (int i = 1; i < 2 * n - 1; i++) {
        ans[i + 1] = ans[i - 1] ^ same[i] ^ ans[i];
    }
    return ans[0] == ans[n] && ans[1] == ans[n + 1];
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(nullptr);
    int n;
    cin >> n;
    string s;
    cin >> s;
    for (int i = 0; i < n; i++) {
        if (s[i] == 'o')
            same[i] = 0;
        else
            same[i] = 1;
        same[i + n] = same[i];
    }
    for (int i = 0; i < 2; i++) {
        for (int j = 0; j < 2; j++) {
            ans[0] = i;
            ans[1] = j;
            if (check(n)) {
                for (int i = 0; i < n; i++) {
                    if (ans[i] == 0)
                        cout << "S";
                    else
                        cout << "W";
                }
                cout << endl;
                return 0;
            }
        }
    }
    cout << "-1" << endl;
    return 0;
}


Measured memory_bytes: 2128
#include <iostream>

using namespace std;

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

    uint64_t ans = 0;
    if(N == 1)
        ans = 1;
    else if(N == 2)
        ans = 3;
    else
    {
        uint64_t Li_1 = 3;
        uint64_t Li_2 = 1;
        uint64_t Li = 0;//Li_1 + Li_2;
        for(int i = 3; i <= N; ++i)
        {
            Li = Li_1 + Li_2;
            Li_2 = Li_1;
            Li_1 = Li;
        }
        ans = Li;
    }

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

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
using namespace std;
int main() {
	int n; int m;
	cin >> n >> m;
	vector<int> it(n);
	it[0] = 0;
	for (int i = 1; i < n; i++) {
		cin >> it[i];
		it[i] += it[i - 1];
	}

	int ans = 0;
	int ba = 0;
	for (int i = 0; i < m;i++) {
		int x;
		cin >> x;
		ans += abs(it[ba] - it[ba + x]);
		ans = ans % 100000;
		ba += x;
	}
	cout << ans << endl;
}



Measured memory_bytes: 3120
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <string>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;

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

    //問題の読込
    vector<int> A(N), sum(N);
    rep(i, N-1) cin >> A.at(i);

    for (int i = N - 1; i > 0; i--) {
        sum.at(A.at(i-1)-1) = sum.at(A.at(i-1)-1) + 1;
    }
    rep(i, N) {
        cout << sum.at(i) << endl;
    }
}


Measured memory_bytes: 4400
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define Bit_check(val,pos)     (bool)(val & (1ll<<pos))
ll ar[500009],br[500009],cr[500009];
map<string,ll>mp;
vector<string>v;
string s[500009];
int main()
{
    ll a,b,c,i,j=-1,k=0,x=0,y,z,f;
    cin>>a;
    for(i=1;i<=a;i++)
    {
        cin>>s[i];
        mp[s[i]]++;
        k=max(k,mp[s[i]]);
    }
    for(i=1;i<=a;i++)
    {
        if(mp[s[i]]==k)
        {
            v.push_back(s[i]);
            mp[s[i]]=0;
        }
    }
    sort(v.begin(),v.end());
    for(i=0;i<v.size();i++)
    {
        cout<<v[i]<<endl;
    }
}


Measured memory_bytes: 30964
import java.util.Scanner;
public class Main {
@SuppressWarnings("resource")
public static void main(String[] args) {
	Scanner sc =new Scanner(System.in);

	long A=sc.nextLong();
	long B=sc.nextLong();
	long K=sc.nextLong();
	if(K>A) {
		K-=A;
		A=0;
		if(K>B) {
			B=0;
		}else {
			B-=K;
		}
	}else {
		A-=K;
	}
	System.out.println(A+" "+B);

	}
}

Measured memory_bytes: 23764
#include<bits/stdc++.h>
using namespace std;
int main(){
int n,m;
	cin >> n >> m;
	vector<vector<pair<long long,long long>>> graph(n);
	for(int i=0;i<m;i++){
		long long a,b,c;
		cin >> a >> b >> c;
		a--;
		b--;
		c *= (-1);
		graph[a].push_back({b,c});
	}
	vector<long long> dist(n,1LL<<60);
	dist[0] = 0;
	auto bf = [&](int x){
		for(int i=0;i<x;i++){
			for(int j=0;j<n;j++){
				for(auto p:graph[j]){
					if(dist[p.first] > dist[j] + p.second){
						dist[p.first] = dist[j] + p.second;
					}
				}
			}
		}
	};
	bf(n-1);
	long long ans = dist[n-1];
	bf(n);
	if(ans != dist[n-1]) cout << "inf" << endl;
	else cout << -ans << endl;
}


Measured memory_bytes: 3652
A,B,C,X,Y=map(int,input().split())
onedan=0
if A+B<=2*C:
    print(X*A+Y*B)
    exit()
onedan=min(X,Y)*2*C
if max(X,Y)==X:
    onedan+=(X-Y)*A
else:
    onedan+=(Y-X)*B
onedan=min(onedan,max(X,Y)*2*C)
print(onedan)

Measured memory_bytes: 3064
import sys

l = []
for i in sys.stdin:
    l.append(i.split())

for i in range(0,len(l)):
    if len(l[i]) == 3:
        if l[i][1] == '+':
            result = int(l[i][0]) + int(l[i][2])
        elif l[i][1] == '-':
            result = int(l[i][0]) - int(l[i][2])
        elif l[i][1] == '*':
            result = int(l[i][0]) * int(l[i][2])
        elif l[i][1] == '/':
            result = int(l[i][0]) / int(l[i][2])
        else:
            break
        print(int(result))


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

int main(){
    int N, K;
    cin >> N >> K;
    string S[110];
    for (int i=1; i<N+1; i++) cin >> S[i];
    sort(S+1, S+N+1);
    for (int i=1; i<N+1; i++){
        cout << S[i];
    }
    cout << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <string>
#include <stack>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <iterator>
#include <map>
#include <set>
#include <queue>
#include <list>
#include <regex>
using namespace std;
using pii  = pair<int,int>;
using ll=long long;
using ld=long double;
#define pb push_back
#define mp make_pair
#define sc second
#define fr first
#define stpr setprecision
#define cYES cout<<"YES"<<endl
#define cNO cout<<"NO"<<endl
#define cYes cout<<"Yes"<<endl
#define cNo cout<<"No"<<endl
#define rep(i,n) for(ll i=0;i<(n);++i)
#define Rep(i,a,b) for(ll i=(a);i<(b);++i)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define rRep(i,a,b) for(int i=a;i>=b;i--)
#define crep(i) for(char i='a';i<='z';++i)
#define psortsecond(A,N) sort(A,A+N,[](const pii &a, const pii &b){return a.second<b.second;});
#define ALL(x) (x).begin(),(x).end()
#define debug(v) cout<<#v<<":";for(auto x:v){cout<<x<<' ';}cout<<endl;
#define endl '\n'
int ctoi(const char c){
  if('0' <= c && c <= '9') return (c-'0');
  return -1;
}
ll gcd(ll a,ll b){return (b == 0 ? a : gcd(b, a%b));}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}
constexpr ll MOD=1000000007;
constexpr ll INF=1000000011;
constexpr ll MOD2=998244353;
constexpr ll LINF = 1001002003004005006ll;
constexpr ld EPS=10e-8;
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 (b<a) { a=b; return 1; } return 0; }
template<typename T> istream& operator>>(istream& is,vector<T>& v){for(auto&& x:v)is >> x;return is;}
template<typename T,typename U> istream& operator>>(istream& is, pair<T,U>& p){ is >> p.first; is >> p.second; return is;}
template<typename T,typename U> ostream& operator>>(ostream& os, const pair<T,U>& p){ os << p.first << ' ' << p.second; return os;}
template<class T> ostream& operator<<(ostream& os, vector<T>& v){
  for(auto i=begin(v); i != end(v); ++i){
    if(i !=begin(v)) os << ' ';
    os << *i;
  }
  return os;
}

map<ll,ll> M;

int main(){
  ll N,ans=-INF;
  string S;
  cin >> N;
  cin >> S;
  Rep(i,1,N){
    rep(j,N){
      M[S[j]]=0;
    }
    rep(j,i){
      M[S[j]]=1;
    }
    Rep(j,i,N){
      if(M[S[j]]==1){
        M[S[j]]=2;
      }
    }
    ll K=0;
    for(auto P : M){
      if(P.sc==2){
        K++;
      }
    }
    ans=max(ans,K);
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
def main():
    n,m = tuple([int(t)for t in input().split()])
    a = [int(t)for t in input().split()]

    e = [tuple([int(t)for t in input().split()])for _ in [0]*m]

    e.sort(key=lambda x:x[1])
    t = 0
    for _ in [0]*m:
        b,c = e.pop()
        t+=b
        for _ in [0]*b:
            a.append(c)
        if t>n:break
    
    a.sort(reverse = True)
    print(sum(a[:n]))
if __name__ == "__main__":
    main()

Measured memory_bytes: 24920
import java.util.Scanner;
class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        while(true){
            int H = sc.nextInt();
            int W = sc.nextInt();
            
            if(H == 0 && W == 0){
                break;
            }
            
            for(int i = 0; i < H; i++){
                for(int j = 0; j < W; j++){
                    if(0 < i&& i < (H-1) && 0 < j && j < (W-1)){
                        System.out.print(".");
                    }else{
                        System.out.print("#");
                    }
                }
                System.out.println();
            }
            System.out.println();
        }
    }
}



Measured memory_bytes: 34724
import math
while True:
  a, op, b = input().split()
  a = int(a)
  b = int(b)
  if op == "+":
    print(math.floor(a+b))
  elif op == "-":
    print(math.floor(a-b))
  elif op == "*":
    print(math.floor(a*b))
  elif op == "/":
    print(math.floor(a/b))
  else:
    break


Measured memory_bytes: 5664
#include <iostream>

#include <vector>
#include <map>
#include <algorithm>
#include <fstream>
#include<cstdio>
#include<iomanip>
#include<stack>
#include<queue>

#define REP(i, n) for(int i=0;i<n;i++)
#define REP2(i, s, n) for(int i=s;i<n;i++)
#define REP_1(i, n) for(int i=1;i<n+1;i++)
#define bitSearch(bit, n) for(int bit = 0; bit < (1 << N); bit++)
using namespace std;

void printAns(long long a) { cout << a << endl; }

void yesno(bool a) { if (a)cout << "Yes" << endl; else cout << "No" << endl; }

void YESNO(bool a) { if (a)cout << "YES" << endl; else cout << "NO" << endl; }

typedef long long ll;
typedef unsigned long ul;
typedef long double ld;

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

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

//ll INF = 10000000;
//ll mod = 1000000007;//10^9+7

//using Graph = vector<vector<pair<int, int>>>;
//Graph G(100100);


//番号ズレ注意！！
int main() {
    int N, T;
    cin >> N >> T;
    int c[N], t[N];
    REP(i, N) {
        cin >> c[i] >> t[i];
    }
    bool home = false;
    int ans = 2000;
    REP(i, N) {
        if (t[i] <= T) {
            chmin(ans, c[i]);
            home = true;
        }
    }
    if (home) { cout << ans << endl; }
    else { cout << "TLE" << endl; }

}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int n,mp[1010][1010],head[1000010],tot,deg[1000010],num[1010][1010],Num,dp[1000010],ans;
struct node {
	int ed,last;
} G[3000010*2];
void Add(int st,int ed) {
	tot++;
	G[tot]=node {ed,head[st]};
	head[st]=tot;
}
queue<int> Q;
bool vis[1010*1010];
int Hash(int x,int y) {
	if(num[x][y]==0&&num[y][x]==0)return num[x][y]=num[y][x]=++Num;
	return num[x][y];
}
int main() {
	tot=0;
	memset(head,-1,sizeof(head));
	scanf("%d",&n);
//	for(int i=1;i<=n;i++){
//		for(int j=1;j<=n;j++)cout<<num[i][j]<<" ";
//		cout<<endl;
//	}
	for(int i=1; i<=n; i++) {
		for(int j=1; j<=n-1; j++)scanf("%d",&mp[i][j]);
		for(int j=1; j<=n-2; j++) {

			Add(Hash(i,mp[i][j]),Hash(i,mp[i][j+1])),deg[Hash(i,mp[i][j+1])]++;
		}
	}
//	for(int i=1;i<=Num;i++){
//		for(int j=head[i];~j;j=G[j].last){
//			int t=G[j].ed;
//			cout<<i<<" "<<t<<endl;
//		}
//	}
	int Cnt=0;
	for(int i=1; i<=Num; i++) {
		if(!deg[i]) {
			Q.push(i);
		}
	}
	while(!Q.empty()) {
		int now=Q.front();
		Q.pop();
		Cnt++;
		for(int i=head[now]; ~i; i=G[i].last) {
			int t=G[i].ed;
			deg[t]--;
			dp[t]=max(dp[t],dp[now]+1);
			if(deg[t]==0) {
				Q.push(t);
			}
		}
	}
//	for(int i=1;i<=Num;i++)cout<<deg[i]<<" ";
//	cout<<endl;
	if(Cnt!=Num) {
		puts("-1");
		return 0;
	}
	for(int i=1; i<=Num; i++)ans=max(ans,dp[i]);
	cout<<ans+1;
	return 0;
}

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

using namespace std;

int main () {
	long int a, b, c, d;
	long int a1= 0, a2 = 0, a3 = 0, a4 = 0, pro = 0, pro2 = 0;
	cin >> a >> b >> c >> d;

	for (int i = 0; i < 4; i++) {
		a1 = a * c;
		a2 = a * d;
		a3 = b * c;
		a4 = b * d;
	}

	pro = max(a1, a2);
	pro2 = max(a3, a4);
	cout << max(pro, pro2) << endl;	
	return 0;
}


Measured memory_bytes: 3624
#include<bits/stdc++.h>
#define _ ios_base::sync_with_stdio(0);cin.tie(0);
#define REP(i,n) for(int i=0;i<(int)(n);i++)

using namespace std;

int main(){ _;
  int x,y,s;
  while(cin>>x>>y>>s,(x|y|s)!=0){
    int maxPrice=0;
    for(int i=1;i<=s/2;i++){
      int i_=i*(100+x)/100;
      for(int j=s;j>0;j--){
	int j_=j*(100+x)/100;
	if(i_+j_==s){
	  maxPrice=max(maxPrice,i*(100+y)/100+j*(100+y)/100);
	  break;
	}
      }
    }
    cout<<maxPrice<<endl;
  }
}

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

using namespace std;

typedef long long int ll;

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

  char ch;
  cin >> ch;
  if (ch >= 'A' && ch <= 'Z') cout << "A\n";
  else cout << "a\n";
}


Measured memory_bytes: 3580
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#define rep(i, a, b) for(int i = (a); i < (b); i++)
#define ill long long
#define fcout cout << fixed << setprecision(10)
using namespace std;

int main() {
  int a, b, c;
  cin >> a >> b >> c;
  for(int i = b; i <= c; i++) {
    if(i % a == 0) {
      cout << "OK";
      return 0;
    }
  }
  cout << "NG";
}


Measured memory_bytes: 3624
#include<bits/stdc++.h>
#include<unordered_set>
#include<unordered_map>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
using vc = vector<char>;
using vvc = vector<vc>;
ll dx[4]={0,1,0,-1};
ll dy[4]={1,0,-1,0};
int main(){
  ll k,t;
  cin>>k>>t;
  vll a(t);
  rep(i,t) cin>>a[i];
  ll ans=0;
  sort(rall(a));
  while(a[1]){
    a[0]-=a[1];
    a[1]=0;
    sort(rall(a));
  }
  if(a[0]>0) a[0]--;
  COUT(a[0]);
}

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

using namespace std;

int main() {
    #ifdef LOCAL
    freopen("in", "r", stdin);
    #endif // LOCAL
    ios::sync_with_stdio(0); cin.tie(0);
    string s;
    cin >> s;
    if (s == "RRR") cout << 3 << endl;
    else if (s == "RRS" || s == "SRR") cout << 2 << endl;
    else if (s == "SSS") cout << 0 << endl;
    else cout <<1 << endl;
    return 0;
}


Measured memory_bytes: 3648
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define all(v) v.begin(), v.end()

int main() {
    long long int H; cin >> H;    
    long long int ans = 1;
    int i = 1;
    while (H > 1) {
      H/= 2;
      ans += 1LL << i;//1をlong long と明記したいとき 1LLとする
      //cout<<"H:"<<H<<" i:"<<i<<" ans:"<<ans<<endl;
      i++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <stdio.h>
#define INF 1000000
#define W 0
#define G 1
#define B 2
int Prim(void);
int n,A[100][100];

int main()
{
  int i,j;

  scanf("%d",&n);
  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
      scanf("%d",&A[i][j]);
      if(A[i][j]==-1) A[i][j]=INF;      
    }
  }

  printf("%d\n",Prim());
  return 0;
}

int Prim(void)
{
  int i,k,kv,min,sum=0;
  int dp[100],pr[100],col[100];

  for(i=0;i<n;i++){
    dp[i]=INF;
    pr[i]=-1;
    col[i]=W;
  }
  
  dp[0]=0;
  while(1){
    min=INF;
    k=-1;
    for(i=0;i<n;i++){
      if(dp[i]<min && col[i]!=B){
	k=i;
	min=dp[i];
      }
    }
    
    if(k==-1) break;
    col[k]=B;
    for(kv=0;kv<n;kv++){
      if(col[kv]!=B && A[k][kv]!=INF){
	if(A[k][kv]<dp[kv]){
	  dp[kv]=A[k][kv];
	  pr[kv]=k;
	  col[kv]=G;
	}
      }
    }
  }
  
  for(i=0;i<n;i++){
    if(pr[i]!=-1) sum+=A[i][pr[i]];
  }
  return sum;
}

Measured memory_bytes: 632
#include<bits/stdc++.h>                          
using namespace std;    
int x,m,n,y,a[105],b[105]; 
int main(){
	cin>>n>>m>>x>>y;
	for(int i=1;i<=n;i++) cin>>a[i];
	for(int i=1;i<=m;i++) cin>>b[i];
	for(int i=x+1;i<=y;i++)
	{
		int ant=0;
		for(int j=1;j<=n;j++) 
		    if(a[j]>=i) {ant=1;break;}
		for(int j=1;j<=m;j++)
		    if(b[j]<i) {ant=1;break;}
		if(ant==0) {cout<<"No War";return 0;}
	}
	cout<<"War";
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define pa(x,n) for(ll i=0;i<n;i++){cout<<(x[i])<<" \n"[i==n-1];};
#define pb push_back

using ll = long long;
using namespace std;
using pint = pair<int,int>;
using pll = pair<ll,ll>;
const int INFint = 1e9;
const ll INFll = 1e18;
ll MOD=1e9+7;

ll gcd(ll a, ll b) { return __gcd(a,b); } //最大公約数
ll lcm(ll a, ll b) { return a/gcd(a,b)*b; } //最大公倍数

// aのn乗をMODで割りながら計算する
ll modpow(ll a, ll n) {
  long long res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % MOD;
    a = a * a % MOD;
    n >>= 1; // right shift
  }
  return res;
}

// MODを法としたaの逆元を計算する
ll modinv(ll a) {
  return modpow(a, MOD - 2);
}

int main(){
  string s;
  cin>>s;
  for (int i(0);i<int(s.size());i++){
    if (i==3) cout << '8';
    else cout << s[i];
  }
  cout << endl;
  return 0;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  string s;
  cin>>s;
  if(s.at(0)==s.at(1)&&s.at(2)==s.at(3)&&s.at(0)!=s.at(2)){
    cout<<"Yes"<<endl;
  }
  else if(s.at(0)==s.at(2)&&s.at(1)==s.at(3)&&s.at(0)!=s.at(1)){
    cout<<"Yes"<<endl;
  }
  else if(s.at(0)==s.at(3)&&s.at(1)==s.at(2)&&s.at(0)!=s.at(1)){
    cout<<"Yes"<<endl;
  }
  else{
    cout<<"No"<<endl;
  }
  return 0;
}

Measured memory_bytes: 3624
import math

num = int(input())
x = list(map(int,input().split()))
y = list(map(int,input().split()))
xy = [abs(i - j) for i,j in zip(x, y)] 
for i in range(3):
  result = 0
  p = i + 1
  for j in xy:
    result += j ** p
  result = math.pow(result, 1 / p)
  print(result)
result = 0
print(max(xy))


Measured memory_bytes: 5708
#include <iostream>
#include <vector>
#include <algorithm>    // std::min_element, std::max_element
using namespace std;


int main(){
    
    int c = 0; //count how many input sets
    int l; //entire length
    int n; // number of branches
    int m; //number of orders
    vector<int> v;
    int sum;
    
    
    for(;; c++){
        
        sum = 0;
        cin >> l;
        if(l == 0)
            break;
        cin >> n;
        cin >> m;
        
        vector<int> d; //from 4th to n-1 line on txt
        d.push_back(0);
        int k[m]; //coustomer k1' house at k[0] meater     n+3 to m line
        
        for(int i = 1; i < n; i++){
            int in;
            cin >> in;
            d.push_back(in);
        }
        
        for(int i = 0; i < m; i++)
            cin >> k[i];
        
        std::sort(d.begin(), d.end());
      
        for (int j = 0; j < m; j++){
            
            int right = n-1;
            int left = 0;
            int middle = (right + left)/2;
            
            if ( d[right] <= k[j] )
                sum  += min(k[j] - d[right], l - k[j]);
            else{
                while(true){//Binary Search
                    if (left + 1 == right)
                    {
                        sum  += min(abs(d[right] - k[j]), abs(k[j] - d[left]));
                        break;
                    }
                    else if ( k [j] == d[middle] )
                        break;
                    else if(k [j] < d[middle])
                    {
                        right = middle;
                        middle = (right + left)/2;
                    }
                    else if(k [j] > d[middle]){
                        left = middle;
                        middle = (right + left)/2;
                    }
                }
            }
        }
        
        v.push_back(sum);
        
    }
    for (int i = 0; i < c; i++)
        cout << v[i] << endl;
    return 0;
}
     
       

Measured memory_bytes: 3364
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,k,q;
  cin >> n >> k >> q;
  vector<int> a (q);
  vector<int> b (n+1,0);
  for(int i = 0; i < q; i++){
    cin >> a[i];
    b[a[i]]++;
  }
  for(int j = 1; j < n+1; j++){
    int sum = 0;
    sum = k - q + b[j];
    if(sum < 1) cout << "No"<<endl;
    else cout << "Yes" <<endl;
  }
  return 0;
}



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

using namespace std;

using ll = long long;

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    int n, m;
    cin>>n >> m;
    cout << n * (n-1)/2 + m * (m-1)/2 << "\n";
    return 0;
}

Measured memory_bytes: 256
#[macro_use]
mod input {

use std;
use std::io;

const SPLIT_DELIMITER: char = ' ';

#[macro_export]
#[allow(unused_macros)]
macro_rules! input {
    ( $($x:expr ),*) => {
        {
            let temp_str = input_line_str();
            let mut split_result_iter = temp_str.split_whitespace();
                $(
                let buf_split_result = split_result_iter.next();
                let buf_split_result = buf_split_result.unwrap();
                    ($x) = buf_split_result.parse().unwrap();
                )*
        }
    };
}

#[allow(dead_code)]
pub fn input_line_str() -> String {
    let mut s = String::new();
    io::stdin().read_line(&mut s).unwrap();
    s.trim().to_string()
}

#[allow(dead_code)]
pub fn p<T>(t: T)
where
    T: std::fmt::Display,
{
    println!("{}", t);
}

#[allow(dead_code)]
pub fn input_vector2d<T>(line: usize) -> Vec<Vec<T>>
where
    T: std::str::FromStr,
{
    let mut v: Vec<Vec<T>> = Vec::new();

    for _ in 0..line {
        let vec_line = input_vector();
        v.push(vec_line);
    }
    v
}

#[allow(dead_code)]
pub fn input_vector<T>() -> Vec<T>
where
    T: std::str::FromStr,
{
    let mut v: Vec<T> = Vec::new();

    let s = input_line_str();
    let split_result = s.split(SPLIT_DELIMITER);
    for z in split_result {
        let buf = match z.parse() {
            Ok(r) => r,
            Err(_) => panic!("Parse Error"),
        };
        v.push(buf);
    }
    v
}

#[allow(dead_code)]
pub fn str2vec(s: &str) -> Vec<char> {
    let mut v: Vec<char> = Vec::new();
    for c in s.chars() {
        v.push(c);
    }
    v
}

}
use input::*;

use std::cmp;
use std::collections::HashMap;

fn main() {
    let n: usize;
    input!(n);
    let v = input_vector::<isize>();
    let mut ans = 0;
    let mut map = HashMap::new();

    for z in v {
        let p = map.entry(z).or_insert(0);
        *p += 1;
    }

    for (i, x) in &map {
        let mut ans_buf = 0;
        if map.contains_key(&(i - 1)) {
            ans_buf += map[&(i - 1)];
        }
        if map.contains_key(&(i + 1)) {
            ans_buf += map[&(i + 1)];
        }
        ans_buf += *x;
        ans = cmp::max(ans, ans_buf);
    }
    p(ans);
}


Measured memory_bytes: 12540
def modpow(a, n, mod):
    res = 1
    while n > 0:
        if n & 1:
            res = res * a % mod
        a = a * a % mod
        n >>= 1
    return res

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

MOD = 1000000007

if n-1 > k:
    ans = 1
    com1 = 1
    com2 = 1
    for i in range(k):
        com1 = com1 * (n-1-i) * modpow(i+1, MOD-2, MOD) % MOD
        com2 = com2 * (n-i) * modpow(i+1, MOD-2, MOD) % MOD
        ans += com1 * com2
    print(ans % MOD)
else:
    ans = 1
    for i in range(n-1):
        ans = ans * (n*2-1-i) * modpow(i+1, MOD-2, MOD) % MOD
    print(ans % MOD)

Measured memory_bytes: 41536
//{{{
#include <bits/stdc++.h>
using namespace std;
#define repX(a,b,c,x,...) x
#define repN(a) repX a
#define rep(...) repN((__VA_ARGS__,rep3,rep2,loop))(__VA_ARGS__)
#define rrep(...) repN((__VA_ARGS__,rrep3,rrep2))(__VA_ARGS__)
#define loop(n) rep2(i_,n)
#define rep2(i,n) rep3(i,0,n)
#define rep3(i,begin,end) for(int i=(int)(begin),i##_end=(int)(end);i<i##_end;++i)
#define rrep2(i,n) rrep3(i,n,0)
#define rrep3(i,begin,end) for(int i=(int)(begin-1),i##_end=(int)(end);i>=i##_end;--i)
#define foreach(x,a) for(auto&x:a)
using ll=long long;
const ll mod=(ll)1e9+7;
//}}}

int main(){
  int A, B, C;
  cin >> A >> B >> C;
  int ans = max(C - (A - B), 0);
  cout << ans << endl;
  return 0;
}


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

int main()
{
    int n;
    int max = 0;
    cin >> n;

    int v[n],c[n],p[n];
    for(int i=0;i<n;i++){
        cin >> v[i];
    }
    for(int j=0;j<n;j++){
        cin >> c[j];
    }
    for(int k=0;k<n;k++){
        p[k] = v[k] - c[k];
        if(p[k] > 0){
            max = max + p[k];
        }
    }

    cout << max << endl;
    
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <iomanip>
#include <queue>
#include <deque>
#include <map>
#include <unordered_map>
#define rep(i,n) for(int i=0;i<n;i++)
#define repn(i,n) for(int i=1;i<=n;i++)
#define repr(e,x) for(auto& e:x)
using namespace std;
typedef long long ll;
typedef long double ld;
ll const MOD=1'000'000'007;

ll N;
string S[100000];
ll cnt[5];

int main(){
    cin>>N;
    rep(i,N) cin>>S[i];

    rep(i,N){
        if(S[i][0]=='M') cnt[0]++;
        if(S[i][0]=='A') cnt[1]++;
        if(S[i][0]=='R') cnt[2]++;
        if(S[i][0]=='C') cnt[3]++;
        if(S[i][0]=='H') cnt[4]++;
    }

    ll ans=0;
    rep(i,5-2){
        for(int j=i+1;j<5-1;j++){
            for(int k=j+1;k<5;k++){
                ans+=cnt[i]*cnt[j]*cnt[k];
            }
        }
    }

    cout<<ans<<endl;
}

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

typedef long long ll;
typedef pair<ll,ll> P;
typedef pair<P,ll> PLL;
typedef pair<P,P> PP;
typedef vector<ll> VECLL;
typedef vector<P> VECP;
typedef priority_queue<P,VECP,greater<P> > PQP;
typedef priority_queue<ll, VECLL, greater<ll> > PQll;

#define rep(i,a,n) for(ll i = a;i < n;i++)   
#define rrep(i,a,n) for(ll i = n; i >= a;i--)
#define index_check(i,n) if(i > n-1 || i < 0) continue; 
#define LINF (ll)1e18
#define INF (int)1e9
#define fs first
#define sc second

const ll MOD = 1e9+7;

int main(){
    ll n,minn = LINF,ans = -LINF;
    cin >> n;
    ll a[n] = {};

    rep(i,0,n) cin >> a[i];

    rep(i,0,n){
        if(i > 0) ans = max(ans,a[i]-a[i-1]);
        
        if(a[i] > minn) ans = max(ans,a[i] - minn);
        else minn = a[i];
    }

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



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

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

typedef long long ll;
// typedef pair<int, int> P;
typedef tuple<int, int, int> TUPLE;
typedef vector<int> V;
typedef vector<V> VV;
typedef vector<VV> VVV;

typedef complex<double> P;
const double EPS = 1e-10;
const double INF = 1e12;

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

    int N;
    cin >> N;
    vector<double> r(N);
    rep(i, N) cin >> r[i];

    vector<double> p;
    p.emplace_back(0);
    rep2(i, 1, N) {
        double l = -INF;
        rep(j, i) {
            double d = 2 * sqrt(r[i] * r[j]);
            double x = p[j] + d;
            l = max(l, x);
        }
        p.emplace_back(l);
    }

    double L = INF, R = -INF;
    rep(i, N) {
        L = min(L, p[i] - r[i]);
        R = max(R, p[i] + r[i]);
    }

    printf("%.10f\n", R - L);

}

Measured memory_bytes: 3376
#include <bits/stdc++.h>
#define r(i,n) for(int i = 0; i<n; i++)
using namespace std;
 
int main() {
  int q;
  multimap<string,int>m;
  cin >> q;
  while(q--){
    int x, y;
    string key;
    cin >> x;
    if(!x){
      cin>>key>>y;
      m.insert(make_pair(key,y));
    }
    else if(x==1){
     cin >> key;
     map<string,int>::iterator end,it;
     it=m.lower_bound(key);
     end=m.upper_bound(key);
     for(;it!=end;it++)cout<<(*it).second<<endl;
    }
    else if(x==2){
      cin >> key;
      m.erase(key);
    }
    else{
      string l,r; cin >> l >> r;
      map<string,int>::iterator end,it;
      it=m.lower_bound(l);
      end=m.upper_bound(r);
      for(;it!=end;it++){
        cout << (*it).first<<' ' << (*it).second<< endl;
      }
    }
  }
}


Measured memory_bytes: 24868
#include <stdio.h>
#include <string.h>

int n, m, a[11234], b[11234];
int my_friends[11234], their_friends[11234];
int ans = 0;
bool cancel = false;

int main(void) {
	while (true) {
		ans = 0;
		scanf("%d%d", &n, &m);
		if (n == 0 && m == 0) { break; }
		for (int i = 0; i < m; ++i) { scanf("%d%d", &a[i], &b[i]); }

		memset(my_friends, -1, sizeof(my_friends));
		memset(their_friends, -1, sizeof(their_friends));
		my_friends[0] = 1, their_friends[0] = 1;
		for (int i = 0; i < m; ++i) {
			if (a[i] == 1) { my_friends[b[i] - 1] = b[i]; ans++; }
		}
		for (int i = 0; i < m; ++i) {
			for (int j = 0; j < m; ++j) {
				if (a[i] == my_friends[j]) {
					for (int k = 0; k < n; ++k) {
						if (b[i] == my_friends[k] || b[i] == their_friends[k]) {
							cancel = true;
							break;
						}
					}
					if (cancel == false) { their_friends[b[i] - 1] = b[i]; ans++; }
					cancel = false;
				}
				else if (b[i] == my_friends[j]) {
					for (int k = 0; k < n; ++k) {
						if (a[i] == my_friends[k] || a[i] == their_friends[k]) {
							cancel = true;
							break;
						}
					}
					if (cancel == false) { their_friends[a[i] - 1] = a[i]; ans++; }
					cancel = false;
				}
			}
		}

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

Measured memory_bytes: 2724
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <utility>
#include <numeric>

using namespace std;
typedef long long llong;
typedef unsigned long long ullong;

const ullong MOD = 1000000000 + 7;

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

	cout << s.front() << s.length() - 2 << s.back() << endl;
}

Measured memory_bytes: 256
use input::Input;

fn main() {
    let mut input = Input::default();

    let x = input.parse::<u32>();
    let ans = if 400 <= x && x <= 599 {
        8
    } else if 600 <= x && x <= 799 {
        7
    } else if 800 <= x && x <= 999 {
        6
    } else if 1000 <= x && x <= 1199 {
        5
    } else if 1200 <= x && x <= 1399 {
        4
    } else if 1400 <= x && x <= 1599 {
        3
    } else if 1600 <= x && x <= 1799 {
        2
    } else {
        1
    };
    println!("{}", ans);
}

#[allow(dead_code)]
pub mod input {
    #[derive(Default)]
    pub struct Input(Vec<String>);

    impl Input {
        pub fn read_line(&mut self) -> String {
            let mut s = String::new();
            std::io::stdin().read_line(&mut s).ok().expect("read error");
            s
        }
        pub fn parse<T: std::str::FromStr>(&mut self) -> T {
            let x = if let Some(x) = self.0.pop() {
                x
            } else {
                let s = self.read_line();
                self.0 = s.split_whitespace().map(String::from).rev().collect();
                self.0.pop().expect("reached EOF")
            };
            x.parse().ok().expect("parse error")
        }
    }
}


Measured memory_bytes: 2120
#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <climits>
#include <cfloat>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <utility>
#include <numeric>
#include <iterator>

using namespace std;

typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int,int> PII;
typedef vector<PII> VPII;
typedef istringstream ISS;
typedef ostringstream OSS;

#define REP( i, m, n ) for ( int i = (int)( m ); i < (int)( n ); ++i )
#define FOR( v, c ) for ( auto &v : c )
#define EACH( it, c ) for ( auto it = c.begin(); it != c.end(); ++it )
#define ALL( c ) (c).begin(), (c).end()
#define DRANGE( c, p ) (c).begin(), (c).begin() + p, (c).end()

#define PB( n ) push_back( n )
#define MP( a, b ) make_pair( ( a ), ( b ) )
#define EXIST( c, e ) ( (c).find( e ) != (c).end() )

#define fst first
#define snd second

#define DUMP( x ) cerr << #x << " = " << ( x ) << endl
#define DEBUG( x ) cerr << __FILE__ << ":" << __LINE__ << ": " << #x << " = " << ( x ) << endl

#include <complex>
typedef complex<double> Point;
const double EPS = 1e-8;

// テ・ツ?・テ・ツ環崚」ツつケテ」ツδ暗」ツδェテ」ツδシテ」ツδ?」ツ?凝」ツつ嘉・ツョツ淌ヲツ閉ーテ、ツコツ古」ツ?、テ」ツつ津」ツ?ィテ」ツ?」テ」ツ?ヲ Point テ」ツ?ク
istream& operator >> ( istream &s, Point &a )
{
	double r, i;
	s >> r >> i;
	a = Point( r, i );
	return s;
}

// テ、ツクツ嘉ィツァツ津・ツスツ「 ( a, b, c ) テ」ツ?ョテゥツ敖「テァツゥツ催ッツシツ暗」ツδ佚」ツδュテ」ツδウテ」ツ?ョテ・ツ?ャテ・ツシツ湘ッツシツ?
double heron( const double a, const double b, const double c )
{
	const double s = ( a + b + c ) / 2;
	return sqrt( s * ( s - a ) * ( s - b ) * ( s - c ) );
}
double heron( const Point &a, const Point &b, const Point &c )
{
	return heron( abs( a - b ), abs( b - c ), abs( c - a ) );
}

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

	vector<Point> ps;
	{
		char d;
		for ( double a, b; cin >> a >> d >> b; ps.PB( Point( a, b ) ) );
	}

	double s = 0;
	REP( i, 1, ps.size() - 1 )
	{
		s += heron( ps[0], ps[i], ps[ i + 1 ] );
	}
	cout << setprecision( 8 ) << fixed << s << endl;

	return 0;
}

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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second

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

void Main()
{
	int n, a, b;
  	cin >> n >> a >> b;
 	cout << min(n*a, b) << endl;
	return;
}

int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Main();
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;
#define  rep(i,a,b)for(long long i=a;i<b;++i)
#define  rrep(i,a,b)for(int i=a;i>=b;--i)
#define  yesno(flag)if(flag)cout<<"Yes"<<endl; else cout<<"No"<<endl;
using namespace std;
const int INF=1000000000LL;
const ll r197=1000000007;
typedef pair<int,int>P;
typedef pair<int,P>Pa;
ll b[100005]={},d1[100005],d2[100005];

int main() {
	ll n,a[100002];
	cin>>n;
	rep(i,0,n){
		cin>>a[i];
	}
//	ll c=1;
	d1[0]=1;
	d2[n+1]=1;
	rep(i,1,n+1){
		d1[i]=(i*d1[i-1])%r197;
	}
	rrep(i,n,1){
		d2[i]=(i*d2[i+1])%r197;
	}
	rep(i,1,n+1){
		b[i]=(d1[i-1]*d2[i+1])%r197;
		b[i]=(b[i]+b[i-1])%r197;
	}
	ll ans=0;
	rep(i,0,n){
		ll s=b[i+1]+b[n-i]-b[1];
		if(s<0)s+=r197;
		ll v=(s*a[i])%r197;
		ans=(ans+v)%r197;
	}
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 3328
#include <bits/stdc++.h>
#define mod 1000000007

using namespace std;

int sosu[1001];
int yakusu(int k){
	int re;
	for(int i = 1; i * i <= k; i++){
		re++;
	}
	return re;
}
void soinsu(int num){
	for(int i = 2; num != 1; i++){
		while(num % i == 0){
			num = num / i;
			sosu[i]++;
		}
	}
}
int main(void)
{
	int n; cin>>n;
	for(int i = 0; i <= n; i++) sosu[i] = 0;
	
	for(int i = 1; i <= n; i++){
		soinsu(i);
	}
	long long ans = 1;
	for(int i = 1; i <=n; i++){
		ans = ans * (sosu[i]+1) % mod;
	}
	
	/*
	for(int i = 1; i <= n; i++){
		cout<<"i = "<<i<<", sosu[i] = "<<sosu[i]<<endl;
	}
	*/
	
	cout<<ans<<endl;
	return 0;
}



Measured memory_bytes: 384
#include <stdio.h>
#include <vector>
#include <algorithm>
#include <string.h>

using namespace std;

typedef unsigned long long ull;

int main(void){
	while(true){
		int d;
		scanf("%d", &d);
		if(d == 0) return 0;

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

		vector<int> shops;
		shops.push_back(0);
		for(int i = 0;i < n-1;++i){
			int t;
			scanf("%d", &t);
			shops.push_back(t);
		}
		shops.push_back(d);

		sort(shops.begin(), shops.end());

		int s = 0;

		for(int j = 0;j < m;++j){
			int t, l, r;
			scanf("%d", &t);

			vector<int>::iterator itr = upper_bound(shops.begin(), shops.end(), t);

			s += min(*itr - t, t - (*(itr - 1)));
		}

		printf("%d\n", s);
	}
}


Measured memory_bytes: 2980
#include"bits/stdc++.h"
using namespace std;
using ll=long long;
using ull=unsigned long long;
constexpr auto inf=static_cast<ll>(1e18);
template<typename T=ll>inline T in(){T ret;cin>>ret;return ret;}
template<typename T=ll>inline auto vec2(size_t h,size_t w,T v=T()){return vector<vector<T>>(h,vector<T>(w,v));}
inline void setp(int n){cout<<fixed<<setprecision(n);}
inline void delnl(){cin.ignore(numeric_limits<streamsize>::max(),'\n');}

int main()
{
    cout<<(in()+in()+in()>=22?"bust":"win")<<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define IO ios_base::sync_with_stdio(false)
#define ll  long long
ll a[300300], b[302000], fc[300000];
vector<ll>v;

ll f(ll n, ll b, ll mod)
{
    ll aa, ans=1;
    if(!b) return 1;
    if(b%2) ans=n;
    aa = f(n,b/2,mod);
    return ((aa*aa)%mod*ans)%mod;
}
int main()
{
    IO;
    ll i, j=1, k = 0, mod = 1e9+7, m, mx, n, l = 1, p, t, h, kk=0, cnt=0;
    cin>>n>>m>>k;  p = n*m; fc[0]=1;

    for(i=1; i<=p; i++) fc[i]=(fc[i-1]*i)%mod;
    for(i=1; i<=n; i++){
        for(j=1; j<=m; j++){
            l = (n-i)*((j*(j-1))/2+((m-j)*(m-j+1))/2)+m*((n-i)*(n-i+1))/2+((m-j)*(m-j+1))/2;
            cnt=(cnt+l)%mod;
        }
    }
    l = (fc[p-2]*f((fc[p-k]*fc[k-2])%mod,mod-2,mod))%mod;
    cout<<(l*cnt)%mod<<endl;
    return 0;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define rep(i, n) for(i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
#define MOD 1000000007
#define PI 3.14159265359
 
int main(){
  ll X, A, B, i, j;
  
  cin >> X;
  
  for (ll A = -300; A <= 300; A++){
    for(ll B = -300; B <= 300; B++){
      if(pow(A, 5) - pow(B, 5) == X){
        cout << A << " " << B << endl;
        return 0;
      }
    }
  }
  
  return 0;
}

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

ll N;

ll dfs(string s){
  ll num = 0; 
  ll dig = 1;
  for(ll i = s.size()-1; i >= 0 ;i--){
    num += dig * (s[i] - '0');
    dig *= 10;
  }
  if(N < num) return 0;
  
  ll ret = 0;
  bool san = false;
  bool go = false;
  bool nana = false;
  for(auto ss : s){
    if(ss == '3') san = true;
    if(ss == '5') go = true;
    if(ss == '7') nana = true;
  }
  if(san && go && nana) ret++;
  ret += dfs(s+"3");
  ret += dfs(s+"5");
  ret += dfs(s+"7");
  return ret;
}

int main(){
  cin >> N;
  cout << dfs("3") + dfs("5") + dfs("7") << endl;
  return 0;
}

Measured memory_bytes: 3556
#include<stdio.h>
#include<algorithm>
#include<set>
#include<vector>
using namespace std;
char str[210];
int cur;
set<int> expr();
set<int> dig(){
	if(str[cur]=='('){
		cur++;
		set<int>R=expr();
		cur++;
		return R;
	}
	int ret=0;
	while('0'<=str[cur]&&str[cur]<='9'){
		ret*=10;
		ret+=str[cur]-'0';
		cur++;
	}
	set<int>r;r.insert(ret);
	return r;
}
set<int> expr(){
	vector<set<int> > num;
	vector<char> op;
	num.push_back(dig());
	while(str[cur]=='+'||str[cur]=='-'||str[cur]=='/'||str[cur]=='*'){
		op.push_back(str[cur]);
		cur++;
		num.push_back(dig());
	}
	set<int>ret;
	int n=op.size();
	vector<int>perm(n);for(int i=0;i<n;i++)perm[i]=i;
	do{
		vector<set<int> > tmp=num;
		bool dame=false;
		for(int i=0;i<n;i++){
			int L=perm[i];
			int R=perm[i]+1;
			char opr=op[perm[i]];
			while(L>=0&&!tmp[L].size()){
				L--;
			}
			if(L<0){
				dame=true;break;
			}
			set<int>to;
			for(set<int>::iterator i1=tmp[L].begin();i1!=tmp[L].end();i1++){
				for(set<int>::iterator i2=tmp[R].begin();i2!=tmp[R].end();i2++){
					if(opr=='+')to.insert((*i1)+(*i2));
					if(opr=='-')to.insert((*i1)-(*i2));
					if(opr=='*')to.insert((*i1)*(*i2));
					if(opr=='/'&&(*i2))to.insert((*i1)/(*i2));
				}	
			}
			tmp[L]=to;
			tmp[R].clear();
		}
		if(!dame){
			for(set<int>::iterator it=tmp[0].begin();it!=tmp[0].end();it++)
				ret.insert(*it);
		}
	}while(next_permutation(perm.begin(),perm.end()));
	//printf("%d ",ret.size());
	return ret;
}
int main(){
	while(1){
		scanf("%s",str);
		if(str[0]=='#')break;
		cur=0;
		set<int>ret=expr();
	//	for(set<int>::iterator it=ret.begin();it!=ret.end();it++)
		//	printf("%d ",*it);
		printf("%d\n",ret.size());
	}
}

Measured memory_bytes: 1060
#include <algorithm>
#include <cassert>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
//#include <regex>

/* g++ -g -std=c++0x */
/* g++ -g -std=c++11 */

using namespace std;

// std::ios::sync_with_stdio(false);

// freopen("input.txt", "rt", stdin);
// freopen("output.txt", "wt", stdout);

#define ALL(c)          (c).begin(), (c).end()
#define ALLR(c)         (c).rbegin(), (c).rend()
#define FOR(i,a,b)      for (int i=(a); i < (b); ++i)
#define FORR(i,a,b)     for (int i=(a); i > (b); --i)
#define FOR_ALL(i,c)    for (__typeof((c).begin()) i=(c).begin();   \
                             i != (c).end(); ++i)
#define FOR_ALLR(i,c)   for (__typeof((c).rbegin()) i=(c).rbegin(); \
                             i != (c).rend(); ++i)
#define SZ(array)       (sizeof(array)/sizeof(array[0]))
#define lc(x)           (x<<1)     /* 2*x */
#define rc(x)           (x<<1 | 1) /* 2*x+1 */
#define lowbit(x)       (x & (-x)) /* 0b10100 -> 0b100 */

typedef long long       LL;
typedef map<int,int>    MII;
typedef pair<int,int>   PII;
typedef set<int>        SI;
typedef vector<bool>    VB;
typedef vector<double>  VD;
typedef vector<int>     VI;
typedef vector<string>  VS;

/* check if a key is in container C */
template <class C>
inline bool in_(const typename C::key_type& k, const C& A)
{ return A.find(k) != A.end(); }
inline bool in_(const string& s, const string& S)
{ return S.find(s) != string::npos; }

const int inf = 1e9;
const int maxn = 210;
const int maxm = 1<<10;
int G[maxn][maxn],dist[maxm][maxn];
int N,M,R,r[maxn];
int ans;

void dfs(const int mask, const int u)
{
    if (mask+1 == (1<<(R+1))) {
        ans = min(ans,dist[mask][u]);
        return;
    }
    FOR(v,1,N+1) if (r[v]) {
        int m = mask | (1<<r[v]);
        if (dist[m][v] > dist[mask][u]+G[u][v]) {
            dist[m][v] = dist[mask][u]+G[u][v];
            dfs(m,v);
        }
    }
}

int main()
{
/* #ifndef ONLINE_JUDGE */
/*     freopen("foo", "rt", stdin); */
/* #endif */
    while (cin >> N >> M >> R) {
        memset(r,0,sizeof(r));
        int cnt = 1;
        FOR(i,0,R) {
            int t; cin >> t; r[t] = cnt++;
        }
        FOR(i,0,N+1) FOR(j,0,N+1)
            G[i][j] = inf;
        FOR(_,0,M) {
            int a,b,c; cin >> a >> b >> c;
            G[a][b] = G[b][a] = c;
        }
        FOR(k,1,N+1) FOR(i,1,N+1) FOR(j,1,N+1)
            G[i][j] = min(G[i][j], G[i][k]+G[k][j]);
        ans = inf;
        FOR(u,1,N+1) if (r[u]) {
            FOR(i,0,maxm) FOR(j,0,maxn)
                dist[i][j] = inf;
            const int mask = (1<<0) | (1<<r[u]);
            dist[mask][u] = 0;
            dfs(mask,u);
        }
        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 1408