akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<tuple>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<deque>
#include<cmath>
#include<stack>
#include<string.h>
#include <iomanip>
#define rep(i,n) for(int i = 0;i<n;i++)
#define _GLIBCXX_DEBUG
using ll = long long; 
using namespace std;
template<class T>inline bool chmax(T& a,T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}
template<class T>inline bool chmin(T& a,T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

int main() {
    double r;
    cin >> r;
    cout << std::fixed << std::setprecision(15) << (double)(2*3.141592653589793*r) << endl;
}


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

int main() {
  int n;
  cin>>n;
  vector<string> s(n);
  rep(i,n){
    cin>>s[i];
  }
  int m;
  cin>>m;
  vector<string> t(m);
  rep(i,m){
    cin>>t[i];
  }
  int max_ans=0;
  for(auto x : s){
    int ans=0;
    rep(i,n){
      if(s[i]==x)ans++;
    }
    rep(i,m){
      if(t[i]==x)ans--;
    }
    max_ans=max(max_ans,ans);
  }
  cout<<max_ans<<endl;
}

Measured memory_bytes: 256
# frozen_string_literal: true

N = gets.to_i
if(N < 10)
    a = N
end
if(N < 100 && N >= 10) 
 a = (N % 10) + (N / 10)
elsif(N >= 100 && N < 1000)
 a = (N / 100) + ((N % 100) / 10) + (N % 10)
elsif(N >= 1000 && N < 10_000)
 a = (N / 1000) + (N % 1000) / 100 + (N % 100) / 10 + (N % 10)
elsif(N >= 10_000 && N < 100_000)
 a = (N / 100_000) + (N % 10_000) / 1000 + (N % 1000) / 100 + (N % 100) / 10 + (N % 10)
elsif(N >= 100_000 && N < 1_000_000)
 a = (N / 100_000) + (N % 100_000) / 10_000 + (N % 10_000) / 1_000 + (N % 1_000) / 100 + (N % 100) / 10 + (N % 10)
 elsif(N / 1_000_000 && N < 10_000_000)
 a = (N / 1_000_000) + (N % 1_000_000) / 100_000 + (N % 100_000) / 10_000 + (N % 10_000) / 1000 + (N % 1_000) / 100 + (N % 100) / 10 + (N % 10)
 elsif(N >= 10_000_000 && N < 100_000_000)
 a = (N / 10_000_000) + (N % 10_000_000) / 1_000_000 + (N % 1_000_000) / 100_000 + (N % 100_000) / 10_000 + (N % 10_000) / 1_000 + (N % 1_000) / 100 + (N % 100) / 10 + (N % 10)
 elsif(N == 100_000_000)
    a = 1
end
if N % a == 0 
    puts "Yes"
elsif N % a != 0
    puts "No"
end

Measured memory_bytes: 3836
#include <bits/stdc++.h>
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define REP(i,n) for(int (i)=0;(i)<=(int)(n);(i)++)
#define rep1(i,x,n) for(int (i)=(x);(i)<(int)(n);(i)++)
#define REP1(i,x,n) for(int (i)=(x);(i)<=(int)(n);(i)++)
#define rrep(i,x) for(int i=((int)(x)-1);i>=0;i--)
using namespace std;
using ll = long long;
using ull = unsigned long long;
using Int = long long;

//INT_MAX = 2147483647;
//LLONG_MAX = 9223372036854775807;
//ULLONG_MAX = 18446744073709551615;
const int MOD = 1000000007;
const ll INF = numeric_limits<ll>::max();
const int inf = 1e8;
typedef pair<int,int> P;
typedef std::priority_queue<int> IntPrioQueue;
typedef std::priority_queue<int, std::vector<int>, std::greater<int> > IntReversePrioQueue;

//少数点表示
//cout << std::fixed << std::setprecision(14) << 値

int main(){
    cin.tie( 0 ); ios::sync_with_stdio( false );
    int n;
    cin >> n;
    
    cout << 1110-n << endl;
    
    return 0;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <stack>
#include <stdio.h>
#include <string>
#include <utility>
#include <vector>

using namespace std;

// conversion
//------------------------------------------
inline int toInt(string s) {
  int v;
  istringstream sin(s);
  sin >> v;
  return v;
}
template <class T> inline string toString(T x) {
  ostringstream sout;
  sout << x;
  return sout.str();
}

// math
//-------------------------------------------
template <class T> inline T sqr(T x) { return x * x; }

// typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;

// container util
//------------------------------------------
#define ALL(a) (a).begin(), (a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i, c)                                                             \
  for (typeof((c).begin()) i = (c).begin(); i != (c).end(); ++i)
#define EXIST(s, e) ((s).find(e) != (s).end())
#define SORT(c) sort((c).begin(), (c).end())

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

// constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI = acos(-1.0);

// clear memory
#define CLR(a) memset((a), 0, sizeof(a))

// debug
#define dump(x) cerr << #x << " = " << (x) << endl;
#define debug(x)                                                               \
  cerr << #x << " = " << (x) << " (L" << __LINE__ << ")"                       \
       << " " << __FILE__ << endl;

void solve(long long N, std::vector<long long> A) {
  vector<long long>S = A;
  SORT(S);
  long long m = S[S.size()-1];
  long long sub = m;
  for(int i=N-1; i>=0; i--){
    if(S[i]<m && i == N-2){
      sub=S[i];break;
    }
  }
  for(int i=1; i<=N; i++){
    if(A[i-1] == m)cout<<sub<<endl;
    else cout<<m<<endl;
  }
  return;
}

int main() {
  long long N;
  scanf("%lld", &N);
  std::vector<long long> A(N);
  for (int i = 0; i < N; i++) {
    scanf("%lld", &A[i]);
  }
  solve(N, std::move(A));
  return 0;
}


Measured memory_bytes: 4736
#include <iostream>
#include<cstring>
#include<cstdio>
#include<algorithm>
#define N 100010
using namespace std;
int a[N], dp[N][2];
int main()
{
    int i, n;
    scanf("%d", &n);
    for(i = 1; i <= n; ++i) scanf("%d", &a[i]);
    dp[1][1] = dp[1][0] = 1;
    for(i = 2; i <= n; ++i)
    {
        if(a[i] > a[i - 1])
        {
            dp[i][0] = dp[i - 1][0];
            dp[i][1] = min(dp[i - 1][0], dp[i - 1][1]) + 1;
        }else
        if(a[i] < a[i - 1])
        {
            dp[i][1] = dp[i - 1][1];
            dp[i][0] = min(dp[i - 1][0], dp[i - 1][1]) + 1;
        }else
        {
            dp[i][1] = dp[i - 1][1];
            dp[i][0] = dp[i - 1][0];
        }
    }
    printf("%d\n", min(dp[n][1], dp[n][0]));
    return 0;
}


Measured memory_bytes: 1408
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int N,A,min;
    int count[200] = {0};
    cin >> N;
    for(int i=0; i<N; i++){
        cin >> A;
        while(A%2 == 0){
            A=A/2;
            count[i]++;
        }
    }
    
    min = count[0];
    
    for(int i=1; i<N; i++)
        if (min > count[i]) min = count[i];
        
    cout << min << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std ;
int n ;
struct Node {
    int x , y ;
} a[ 100000 + 10 ] ;
inline int read () {
    int tot = 0 , f = 1 ;
    char c = getchar () ;
    while ( c < '0' || c > '9') {
        if ( c == '-' ) f = -1 ;
        c = getchar () ;
    }
    while ( c >= '0' && c <= '9' ) {
        tot = ( tot << 1 ) + ( tot << 3 ) + ( c ^ 48 ) ;
        c = getchar () ;
    }
    return tot * f ;
}
inline bool cmp ( Node u , Node v ) {
    if ( u.y != v.y  )return u.y < v.y ;
    return u.x < v.x ;
}
signed main () {
    n = read () ;
    for ( int i = 1 ; i <= n ; i ++ ) {
        int x = read () , l = read () ;
        a[ i ].x = x - l ; a[ i ].y = x + l ;
    }
    sort ( a + 1 , a + 1 + n , cmp ) ;
    int now = -0x3f3f3f3f , ans = 0 ;
    for ( int i = 1 ; i <= n ; i ++ ) {
        if ( a[ i ].x >= now ) now = a[ i ].y , ans ++ ;
    }
    printf ( "%d\n" , ans ) ;
    return 0 ;
}

Measured memory_bytes: 1024
#include <iostream>
#include <complex>
#include <set>
#include <vector>
#include <algorithm>
#include <cmath>

#define EPS (1e-10)
#define EQ(a,b) (abs((a)-(b)) < EPS)
#define EQV(a,b) ( EQ((a).real(), (b).real()) && EQ((a).imag(), (b).imag()) )

using namespace std;

typedef complex<double> P;

P center1(P a ,P b ,double r){
  return (a+b)/(P)2+(b-a)*P(0,1)*(P)(sqrt(r*r-norm((b-a)/(P)2))/abs(b-a));
}

P center2(P a ,P b ,double r){
  return (a+b)/(P)2+(b-a)*P(0,-1)*(P)(sqrt(r*r-norm((b-a)/(P)2))/abs(b-a));
}

int main(){
  int n;
  double x,y;
  while(true){
    cin >>n;
    if (!n)
      break;
    P dot[n];
    for(int i=0;i<n;i++){
      cin >>x >>y;
      dot[i] = P(x,y);
    }
    set<int> near_dot[n];
    for(int i=0;i<n;i++){
      for(int j=i+1;j<n;j++){
	if (norm(dot[i]-dot[j])<4)
	  near_dot[i].insert(j);
      }
    }
    
    set<int>::iterator it;
    int cnt,max=1;
    P c;
    for(int i=0;i<n;i++){
      it = near_dot[i].begin();
      while(it != near_dot[i].end()){
	c = center1(dot[i],dot[*it],1);
	cnt=0;
	for(int j=0;j<n;j++)
	  if (norm(dot[j]-c)<=1.0001)
	    cnt++;
	if (max<cnt){
	  max=cnt;
	}

	c = center2(dot[i],dot[*it],1);
	cnt=0;
	for(int j=0;j<n;j++)
	  if (norm(dot[j]-c)<=1.0001)
	    cnt++;
	if (max<cnt){
	  max=cnt;
	}
	it++;
      }
    }
    cout << max << endl;
  }
  return 0;
}

Measured memory_bytes: 1292
#include<bits/stdc++.h>
using namespace std;
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long int
using namespace __gnu_pbds;
typedef tree<pair<ll,pair<ll,ll> >, null_type, less<pair<ll,pair<ll,ll> > >, rb_tree_tag, tree_order_statistics_node_update>ordered_set;
#define me BOSS
#define bug() cout<<"AIkahne aise"<<endl
#define PI acos(-1)
/* Precode Start Here *\
     Sieve
void sieve()
{
    for(ll i=3; i<=2000; i+=2)
    {
        for(ll j=i*i; j<=4000000; j+=i)
            A[j]=1;
    }
    v.push_back(2);
    for(ll i=3; i<=4000000; i+=2)
        if(A[i]==0)
            v.push_back(i);
}

     Power Function Modulo P

ll modPow(ll a, ll x, ll p) {
    //calculates a^x mod p in logarithmic time.
    long res = 1;
    while(x > 0) {
        if( x % 2 != 0) {
            res = (res * a) % p;
        }
        a = (a * a) % p;
        x /= 2;
    }
    return res;
}


   factorial

ll fact(ll n)
{
    ll ans=1;
    for(ll i=1;i<=n;i++)
    {
        ans=(ans*i)%mod;
    }
    return ans;
}
     Calculating nCr using Fermats law Theorem

ll modInverse(ll a, ll p) {
    //calculates the modular multiplicative of a mod m.
    //(assuming p is prime).
    return modPow(a, p-2, p);
}


ll modBinomial(ll n, ll k, ll p) {
// calculates C(n,k) mod p (assuming p is prime).

    ll numerator = 1; // n * (n-1) * ... * (n-k+1)
    for (ll i=0; i<k; i++) {
        numerator = (numerator * (n-i) ) % p;
    }

    ll denominator = 1; // k!
    for (ll i=1; i<=k; i++) {
        denominator = (denominator * i) % p;
    }

    // numerator / denominator mod p.
    return ( numerator* modInverse(denominator,p) ) % p;
}
     num of divisor and euler totient

ll phi[1000001],mark[1000001],divi[1000001];;
void divisorPhi(ll n)
{
    for(int i=1;i<=n;i++)
        phi[i]=i;
    for(int i=2;i<=n;i++)
    {
        if(!mark[i])
        {
            for(int j=i;j<=n;j+=i)
            {
                mark[j]=1;
                phi[j]*=(1-1/(double)i);
            }
        }
    }
    for(ll i=1;i<=n;i++)
    {
        for(ll j=i;j<=n;j+=i)
            divi[j]++;
    }
}
/* Precode Ends */
#define mod 1000000007
ll A[5000001],dp[5000001];
vector<ll>v;
map<ll,ll>myMap;
set<ll>mySet;
vector<pair<ll,ll> >vp;
priority_queue<ll> pq;
priority_queue<ll, vector<ll>, std::greater<ll> > first;
ll po(ll a,ll n)
{
  ll ans=1;
  for(int i=1;i<=n;i++)
       ans*=a;
    return ans;
}

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

 ll n,ans=0;
 cin>>n;
 for(int i=1;i<=n;i++)
 {
     cin>>A[i];
 }
 sort(A+1,A+n+1);
 for(int i=1;i<=n;i++)
 {
     if(dp[A[i]]==1||(A[i]==A[i-1]))
     {
         if(A[i]==A[i-1])
            dp[A[i]]=1,dp[A[i-1]]=1;
         continue;
     }
     for(int j=A[i]+A[i];j<=1000000;j+=A[i])
     {
        dp[j]=1;
     }
 }
 for(int i=1;i<=n;i++)
 {
     if(dp[A[i]]==0)
        ans++;
 }
 cout<<ans<<endl;
return 0;
}



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


int main(){
	int n,k;
	cin>>n>>k;
	vector<int> h(n);
	for(int i=0;i<n;i++)cin>>h[i];
	sort(h.begin(),h.end());
	vector<int> t(n-k+1);
	for(int i=0;i<n-k+1;i++){
		t[i] = h[i+k-1]-h[i];
	}
	sort(t.begin(),t.end());
	cout<<t[0]<<endl;
	return 0;
}


Measured memory_bytes: 1024
a,b,c,x,y = map(int, input().split())

ans = a*x+b*y

if x<y:
    ans = min(ans, c*2*x+(y-x)*b, c*2*y)
else:
    ans = min(ans, c*2*y+(x-y)*a, c*2*x)

print(ans)

Measured memory_bytes: 3060
N = int(input())
temp = [0 for x in range(N+1)]

#既に昇順に並んでいる最も長い部分列を考えて、残りの部分を動かす
#ex.[5,6,1,2,3,4]→4 [1,3,2,4]→2(12 or 34) [6,3,1,2,7,4,8,5]→3(678)

#tempに各数値を基準にした昇順の部分列をリストにし、MAX（最も長い部分列）を取る

for i in range(N):
  X=int(input())
  temp[X]=temp[X-1]+1
  
print(N-max(temp))

Measured memory_bytes: 11048
#include <stdlib.h>
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
using ll=long long;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
inline constexpr ll gcd(ll a,ll b){if(!a||!b)return 0;while(b){ll c=b;b=a%b;a=c;}return a;}
inline constexpr ll lcm(ll a,ll b){if(!a||!b)return 0;return a*b/gcd(a,b);}
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;
}
const long long INF=1LL << 60;
long long a,b;
long long dp[100200][110];
long long w[110],v[110];





int main(){
  int a,b,c;
  cin>>a>>b>>c;
  bool flag=true;
  if(a==b&&b!=c&&a!=c){
      flag=false;
  }
  if(a==c&&b!=c&&b!=a){
      flag=false;
  }
  if(b==c&&a!=b&&a!=c){
      flag=false;
  }
  if(flag){
      cout<<"No"<<endl;
  }
  else{
      cout<<"Yes"<<endl;
  }
}



Measured memory_bytes: 256
import java.util.Scanner;

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

		int Thp = sc.nextInt();
		int Tatk = sc.nextInt();

		int Ahp = sc.nextInt();
		int Aatk = sc.nextInt();

		int counter = 1;
		while (0 < Thp && 0 < Ahp) {
			if (counter % 2 == 1) {
				Ahp -= Tatk;
			} else {
				Thp -= Aatk;
			}
			counter++;
		}
		if (Thp < Ahp) {
			System.out.println("No");
		} else {
			System.out.println("Yes");
		}

	}

}

Measured memory_bytes: 35764
#include<bits/stdc++.h>
using namespace std;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()
typedef long long int ll;
typedef vector<ll> vi;
typedef vector<pair<ll, ll> > vp;
typedef vector<string> vs;
typedef vector<char> vc;
typedef list<ll> lst;
typedef pair<ll, ll> P;
const long long INF = numeric_limits<ll>::max();
const long long MOD = 1000000007;
const long double PI = 3.1415926;
template <class T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <class T> T &chmax(T &a, const T &b) { return a = max(a, b); }
 
ll n, m, k, ans = 0, sum = 0, cnt = 0;
string s;
//char c;
 
#define Endl endl
 
/*--------------------template--------------------*/
vi a;
vector<char> ops(3);

bool rep(ll i){
    if(i==3){
        ll ans=a[0];
        REP(i,3){
            if(ops[i]=='+')ans+=a[i+1];
            else ans-=a[i+1];
        }
        if(ans==7)return true;//return a[0]+ops[0]+a[1]+ops[1]+a[2]+ops[2]+a[3];
        return false;
    }
    ops[i]='+';
    if(rep(i+1))return true;
    ops[i]='-';
    return (rep(i+1));
}

int main() {
    cin>>n;
    a=vi(4);
    ll d=1000;
    REP(i,4){
        a[i]=n/d;
        n=n%d;
        d/=10;
    }
    if(rep(0))cout<<a[0]<<ops[0]<<a[1]<<ops[1]<<a[2]<<ops[2]<<a[3]<<"=7";
    return 0;
}

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

#define MOD_1_000_000_007 (1000000007LL)
#define rep(i, n)   for (long long i = 0; i <  (long long)(n); i++)
#define rep1(i, n)  for (long long i = 1; i <  (long long)(n); i++)
#define rep2(i, n)  for (long long i = 2; i <  (long long)(n); i++)
#define rep0c(i, n) for (long long i = 0; i <= (long long)(n); i++)
#define rep1c(i, n) for (long long i = 1; i <= (long long)(n); i++)
#define rep2c(i, n) for (long long i = 2; i <= (long long)(n); i++)
#define repc0(n, i) for (long long i = (long long)(n); i >= 0; i--)
#define repc1(n, i) for (long long i = (long long)(n); i >= 1; i--)
#define repc2(n, i) for (long long i = (long long)(n); i >= 2; i--)

namespace solver {
  using namespace std;
  typedef long long ll;

  ll L;

  void init() {
    scanf("%lld", &L);
  }

  void solve() {
    double a = ((double)L)/3.0;
    printf("%.12f\n", a*a*a);
  }
}

int main() {
  solver::init();
  solver::solve();
  return 0;
}

Measured memory_bytes: 256
N,K = map(int,input().split())

from collections import defaultdict
from bisect import insort_left

L = defaultdict(int)
for _ in range(N):
    a,b = map(int,input().split())
    L[a] += b

L_sorted = sorted(L.items(), key=lambda x:x[0])

ans = 0
for a,b in L_sorted:
    ans += b
    if ans >= K:
        print(a)
        exit()

Measured memory_bytes: 15332
#include<bits/stdc++.h>
#include<unordered_map>
using namespace std;
using Graph = vector<vector<int>>;
#define ll long long
#define all(x) (x).begin(),(x).end()
#define rep(i, n) for(ll i = 0; i < n; i++)
const ll INF = 1LL << 60;

int main(){
    int A, B;
    string str1, str2;
    cin >> str1 >> str2;
    rep(i, str1.length()){
        if(str1[i] != str2[i]){
            cout << "No" << endl;
            return 0;
        }
    }
    cout << "Yes" << endl;
}

Measured memory_bytes: 3628
function Main(input) {
	input = input.split("\n");
	var n = parseInt(input[0], 10);	
  	l2=input[1].split(" ");
  	var h=new Array(n);
  	var cost=new Array(n);
  	for (var i=0; i<n; i++){
     h[i]= parseInt(l2[i], 10);
    }
  	cost[0]=0;
  	cost[1]=Math.abs(h[1]-h[0]);
  
  	for (var i=2; i<n; i++){
     cost[i]=Math.min(cost[i-1]+Math.abs(h[i]-h[i-1]),cost[i-2]+Math.abs(h[i]-h[i-2]));
    }
  
  	console.log('%d',cost[n-1]);
  }
Main(require("fs").readFileSync("/dev/stdin", "utf8"));



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

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;

int keta(ll n) { return log10(n) + 1; }

int main() {
  ll n;
  cin >> n;
  n++;
  cout << (keta(n) - 1) * 9 + ll((n / pow(10, keta(n) - 1)) - 1) << endl;
  return 0;
}


Measured memory_bytes: 4020
#include <stdio.h>

int main() {
  int i,j,ans;
  for (i=1 ; i<10 ; i++) {
    for (j=1 ; j<10 ; j++) {
      ans = i*j;
      printf("%dx%d=%d\n",i,j,ans);
    }
  }
  return 0;
}

Measured memory_bytes: 524
import java.io.*;
import java.math.*;
import java.util.*;
import java.util.stream.*;

public class Main {

	void submit() {
		nextInt();
		String s = nextToken();
		int[] a = new int[26];
		for (char c : s.toCharArray()) {
			a[c - 'a']++;
		}
		
		int ret = 1;
		for (int x : a) {
			ret = (int)((long)ret * (x + 1) % P);
		}
		ret--;
		if (ret < 0) {
			ret += P;
		}
		
		out.println(ret);
	}
	
	static final int P = 1_000_000_007;

	void test() {

	}

	void stress() {
		for (int tst = 0;; tst++) {
			if (false) {
				throw new AssertionError();
			}
			System.err.println(tst);
		}
	}

	Main() throws IOException {
		is = System.in;
		out = new PrintWriter(System.out);
		submit();
		// stress();
		// test();
		out.close();
	}

	static final Random rng = new Random();
	static final int C = 5;

	static int rand(int l, int r) {
		return l + rng.nextInt(r - l + 1);
	}

	public static void main(String[] args) throws IOException {
		new Main();
	}

	private InputStream is;
	PrintWriter out;

	private byte[] buf = new byte[1 << 14];
	private int bufSz = 0, bufPtr = 0;

	private int readByte() {
		if (bufSz == -1)
			throw new RuntimeException("Reading past EOF");
		if (bufPtr >= bufSz) {
			bufPtr = 0;
			try {
				bufSz = is.read(buf);
			} catch (IOException e) {
				throw new RuntimeException(e);
			}
			if (bufSz <= 0)
				return -1;
		}
		return buf[bufPtr++];
	}

	private boolean isTrash(int c) {
		return c < 33 || c > 126;
	}

	private int skip() {
		int b;
		while ((b = readByte()) != -1 && isTrash(b))
			;
		return b;
	}

	String nextToken() {
		int b = skip();
		StringBuilder sb = new StringBuilder();
		while (!isTrash(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	String nextString() {
		int b = readByte();
		StringBuilder sb = new StringBuilder();
		while (!isTrash(b) || b == ' ') {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	double nextDouble() {
		return Double.parseDouble(nextToken());
	}

	char nextChar() {
		return (char) skip();
	}

	int nextInt() {
		int ret = 0;
		int b = skip();
		if (b != '-' && (b < '0' || b > '9')) {
			throw new InputMismatchException();
		}
		boolean neg = false;
		if (b == '-') {
			neg = true;
			b = readByte();
		}
		while (true) {
			if (b >= '0' && b <= '9') {
				ret = ret * 10 + (b - '0');
			} else {
				if (b != -1 && !isTrash(b)) {
					throw new InputMismatchException();
				}
				return neg ? -ret : ret;
			}
			b = readByte();
		}
	}

	long nextLong() {
		long ret = 0;
		int b = skip();
		if (b != '-' && (b < '0' || b > '9')) {
			throw new InputMismatchException();
		}
		boolean neg = false;
		if (b == '-') {
			neg = true;
			b = readByte();
		}
		while (true) {
			if (b >= '0' && b <= '9') {
				ret = ret * 10 + (b - '0');
			} else {
				if (b != -1 && !isTrash(b)) {
					throw new InputMismatchException();
				}
				return neg ? -ret : ret;
			}
			b = readByte();
		}
	}
}


Measured memory_bytes: 21588
use proconio::input;

fn main() {
    input!(h: usize, w: usize, n: usize, mut a: [usize; n]);
    let mut ans = vec![vec![0; w]; h];
    let mut k = 0;
    for i in 0..h {
        for j0 in 0..w {
            let j = if i % 2 == 0 { j0 } else { w - 1 - j0 };
            ans[i][j] = k;
            a[k] -= 1;
            if a[k] == 0 {
                k += 1;
            }
        }
    }
    for v in ans {
        println!(
            "{}",
            v.iter().map(|&x| (x + 1).to_string()).fold(
                String::new(),
                |acc, x| if acc.is_empty() {
                    x
                } else {
                    acc + " " + x.as_ref()
                }
            )
        );
    }
}


Measured memory_bytes: 2336
#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 REP(i,n) for(int i=0;i<(n);i++)
#define fi frist
#define se second
#define pb push_back
#define mp make_pair
using namespace std;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef long long ll;

template<class T> void read(T &x){
	int f=0; x=0; char ch=getchar();
	for(;!isdigit(ch);ch=getchar()) f|=(ch=='-');
	for(;isdigit(ch);ch=getchar()) x=x*10+ch-'0';
	if(f) x=-x;
}



int main(){
	ll a,v,b,w,t;
	
	cin>>a>>v;
	cin>>b>>w;
	cin>>t;

	if(fabs(a-b)<=(v-w)*t){
		puts("YES");
	}
	else{
		puts("NO");
	}

	return 0;
}


Measured memory_bytes: 3640
import java.util.Scanner;

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

		int a = sc.nextInt();
		int b = sc.nextInt();

		int c = a - b * 2;

		if (c < 0 || a <= b) {
			System.out.println("0");
		} else {
			System.out.println(c);
		}

		sc.close();
	}
}

Measured memory_bytes: 27056
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

#define mp make_pair
#define pb push_back
#define ll long long

#define maxN 100011

int n, i, x, y;
vector<int> list[maxN];
bool down[maxN];

void First() {
    cout << "First";
    exit(0);
}

void Second() {
    cout << "Second";
    exit(0);
}

void dfs(int node, int root) {
    int cnt = 0;

    for (auto to : list[node]) {
        if (to == root) continue;
        dfs(to, node);
        cnt += down[to];
    }

    if (cnt >= 2) First();
    down[node] = 1 ^ cnt;
}

int main()
{
    //freopen("test.in","r",stdin);

    cin >> n;
    for (i = 1; i < n; i++) cin >> x >> y, list[x].pb(y), list[y].pb(x);

    if (n % 2 == 1)
        First();

    dfs(1, 0);
    Second();

    return 0;
}


Measured memory_bytes: 5888
#include<map>
#include<iostream>
#include<deque>
#include<algorithm>
#include<string>
#include<cctype>
#include<iomanip>
#include<vector>
#include<queue>
 
using namespace std;
#define REP(i,b,e) for(ll i=(ll)b;i<(ll)e;i++)
#define rep0(i,n) REP(i,0ll,n)
#define rep1(i,n) REP(i,1ll,n+1)
 
#define shosu setprecision(10)
 
typedef long long ll;
typedef pair<int,int> P;
ll longinf=1ll<<60;
int inf=1<<29;
int dx[4]={1,-1,0,0};
int dy[4]={0,0,1,-1};

int N;
int64_t x[102],y[102],h[102];


int main (){
      cin>>N;
      rep0(i,N){
            cin>>x[i]>>y[i]>>h[i];
      }
      rep0(Cx,101){
            rep0(Cy,101){
                  bool ok=true;
                  int64_t H=-1;
                  int cnt=0;
                  int remh,remx,remy;
                  rep0(i,N){
                        if(h[i]>0){
                            cnt++; 
                            remh=h[i];
                            remx=x[i];
                            remy=y[i];
                        }
                  }
                  if(cnt==1){
                              cout<<remx<<" "<<remy<<" "<<remh<<endl;
                              return 0;
                        }
                  rep0(i,N){
                        if(h[i]>0&&H<0){
                              H = h[i]+abs(Cx-x[i])+abs(Cy-y[i]);
                        }
                        if(H>0&&h[i]>0){
                              if(h[i]!=(H-abs(Cx-x[i])-abs(Cy-y[i]))){
                                    ok=false;
                              }
                        }
                  }
                  if(ok){
                        cout<<Cx<<" "<<Cy<<" "<<H<<endl;
                        return 0;
                  }
            }
      }
      
      return 0;
}


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

char F[101][101];

void DFS(int y,int x,char tmp){
	if(F[y][x]!=tmp)
		return;

	F[y][x] = '.';

    DFS(y-1,x  ,tmp);
    DFS(y  ,x+1,tmp);
    DFS(y+1,x  ,tmp);
    DFS(y  ,x-1,tmp);
}
int main(){
	while(true){
		int h,w;
		cin>>h>>w;
		if(h==0&&w==0){break;}
		for(int y=1;y<=h;y++){
			for(int x=1;x<=w;x++){
				cin>>F[y][x];
			}
		}
	
		int C = 0;
	    char map[3]={'#','@','*'};
	    for(int i=0;i<=3;i++){
    	    for(int y=1;y<=h;y++){
			    for(int x=1;x<=w;x++){
            	    if(F[y][x]==map[i]){
    				    C++;
                    	DFS(y,x,map[i]);
                	}
		    	}
	    	}
    	}
    	cout<<C<<endl;
	}
	
    return 0;
}


Measured memory_bytes: 3380
# https://atcoder.jp/contests/abc126/tasks/abc126_c
import itertools
from collections import Counter
from collections import defaultdict
import bisect
import math

def main():
    N, K = map(int, input().split())

    ans = 0.0
    if N < K:
        for i in range(1, N + 1):
            x = math.ceil(math.log2(K / i))
            # print(x)
            ans += (1 / min(N, K)) * 0.5 ** x
    else:
        ans += (N - K + 1) / N
        for i in range(1, K):
            x = math.ceil(math.log2(K / i))
            # print(x)
            ans += (1 / N) * 0.5 ** x

    print(ans)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3444
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;

int main()
{
	int x, t;
	cin >> x >> t;
	if (x > t)
		cout << x - t << endl;
	else
		cout << 0 << endl;
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
int main(void){
  int n;
  char s[100];
  scanf("%d",&n);
  scanf("%s",&s);
  if (n%2!=0){
    printf("No");
    return 0;
  }
  int i,j;
  for(i=0,j=n/2;i<n/2,j<n;i++,j++){
    if(s[i]!=s[j]){
      printf("No");
      return 0;
    }
  }
  printf("Yes");
  return 0;
}


Measured memory_bytes: 128
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cassert>
#include<cstring>
#include<climits>
#include<sstream>
#include<deque>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<bitset>

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

using namespace std;

typedef long long ll;
typedef pair<int,int> ii;

#define MAX 100010
int H,W,N,a[MAX],b[MAX];

bool isValid(int x,int y) { return 0 <= x && x < W && 0 <= y && y < H; }

set<ii> B;

int count(int x,int y) {
  int cnt = 0;
  REP(dy,-1,2) {
    REP(dx,-1,2) {
      int nx = x + dx;
      int ny = y + dy;
      if( !isValid(nx,ny) ) return -1;
      if( B.count(ii(nx,ny)) ) ++cnt;
    }
  }
  return cnt;
}

void compute() {
  set<ii> S;
  vector<ll> ans(10,0);
  rep(i,N) {
    REP(dy,-1,2) {
      REP(dx,-1,2) {
	int x = b[i] + dx;
	int y = a[i] + dy;
	if( !isValid(x,y) ) continue;
	if( S.count(ii(x,y)) ) continue;
	S.insert(ii(x,y));
	int cnt = count(x,y);
	if( cnt <= 0 ) continue;
	++ans[cnt];
      }
    }
  }
  long long sum = (ll)( H - 2 ) * (ll)( W - 2 );
  REP(i,1,10) sum -= ans[i];
  ans[0] = sum;
  rep(i,10) cout << ans[i] << endl;
}

int main() {
  cin >> H >> W >> N;
  rep(i,N) {
    cin >> a[i] >> b[i];
    --a[i], --b[i];
    B.insert(ii(b[i],a[i]));
  }
  compute();
  return 0;
}


Measured memory_bytes: 49920
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <stack>
#include <queue>
#include <functional>
#include <math.h>
#include <stdlib.h>
#include <map>
#include <deque>
#include <list>
#include <sys/timeb.h>
#include <fstream>
#include <set>

using namespace std;

#define repr(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repr(i,0,n)
#define reprrev(i,a,b) for(int i=(int)(b)-1;i>=(int)(a);i--)
#define reprev(i,n) reprrev(i,0,n)
#define repi(itr,ds) for(auto itr=ds.begin();itr!=ds.end();itr++)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define mp make_pair
#define mt make_tuple
#define INF 1050000000
#define INFL 1100000000000000000LL
#define EPS (1e-10)
#define MOD 1000000007
#define PI 3.1415926536
#define RMAX 4294967295

typedef long long ll;
typedef pair<int, int> Pi;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<bool> vb;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<Pi> vPi;
typedef vector<vector<int> > vvi;
typedef vector<vector<bool> > vvb;
typedef vector<vector<ll> > vvll;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<double> > vvd;
typedef vector<vector<Pi> > vvPi;
typedef priority_queue<int, vector<int>, greater<int> > pqli;
typedef priority_queue<ll, vector<ll>, greater<ll> > pqlll;
typedef priority_queue<Pi, vector<Pi>, greater<Pi> > pqlP;
struct Edge {
	int from, to, cost;
	bool operator<(Edge e) {
		return cost < e.cost;
	}
};
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;
template <class T>
using vec = vector<T>;
template<class T>
using pql = priority_queue<T, vector<T>, greater<T>>;
string debug_show(Pi a) {
	return "(" + to_string(a.first) + "," + to_string(a.second) + ")";
}

template<class T>
struct augEdge {
	T from, to;
	int cost;
	bool operator<(augEdge e) { return cost < e.cost; }
	bool operator>(augEdge e) { return cost > e.cost; }
};
template<class T>
using augGraph = vector<augEdge<T>>;


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

	int n;
	cin >> n;
	ll t1 = 2;
	ll t2 = 1;
	ll ans = t1+t2;
	if (n == 0) {
		cout << t1 << endl;
		return 0;
	} else if (n == 1) {
		cout << t2 <<endl;
		return 0;
	}

	rep(i,n-2) {
		t1 = t2;
		t2 = ans;
		ans = t1+t2;
	}
	cout << ans <<endl;

	return 0;
}



Measured memory_bytes: 256
s = input()
t = input()

s1 = len(s)
t1 = len(t)

ans = []

for i in range(s1 - t1 + 1):
    s_tmp = s[i:i+t1]
    flag = True
    for j in range(t1):
        if s_tmp[j] != '?' and s_tmp[j] != t[j]:
            flag = False
    if flag:
        s_tmp2 = s[:i] + t + s[i+t1:]
        s_tmp3 = ''
        for j in range(s1):
            if s_tmp2[j] == '?':
                s_tmp3 += 'a'
            else:
                s_tmp3 += s_tmp2[j]
        ans.append(s_tmp3)

if ans:
    ans.sort()
    print(ans[0])
else:
    print('UNRESTORABLE')


Measured memory_bytes: 3064
N = int(input())
A = [0] + list(map(int, input().split())) + [0]
Sums = []
for i in range(N+1):
    Sums.append(abs(A[i+1] - A[i]))

ans = sum(Sums)
for i in range(N):
    diff = Sums[i] + Sums[i+1] - abs(A[i+2] - A[i]) 
    print(ans - diff)


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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

#define INF 1<<30
#define LINF 1ll<<60ll
#define MOD 1000000007
#define pb(a) push_back(a)

#define _overload3(_1,_2,_3,_4,name,...) name
#define _rep(i,n) _repi(i,0,n)
#define _repi(i,a,b) for(int i=a, i##_len=(b); i<i##_len; ++i)
#define _repis(i,a,b,s) for(int i=a, i##_len(b); i<i##_len; i+=s)
#define REP(...) _overload3(__VA_ARGS__,_repis,_repi,_rep,)(__VA_ARGS__)

#define REPR(i, n) for(int i = n;i >= 0;--i)
#define REPARR(i, v) for(int i = 0;i < sz(v);++i)

#define all(vec) (vec.begin()),(vec.end())
#define sz(x) ((int)(x).size())
#define bit(n) (1ll<<(n))

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

#define YES(n) cout<<((n)?"YES":"NO")<<endl
#define Yes(n) cout<<((n)?"Yes":"No")<<endl
#define yes(n) cout<<((n)?"yes":"no")<<endl
#define poss(n) cout<<((n)?"possible":"impossible")<<endl
#define Poss(n) cout<<((n)?"Possible":"Impossible")<<endl
#define POSS(n) cout<<((n)?"POSSIBLE":"IMPOSSIBLE")<<endl



int main(){
    int n,k;

    cin>>n>>k;
    vi x(n);
    REP(i,n){
        cin>>x[i];

    }
    int minus,plus;
    minus=lower_bound(all(x),0)-x.begin();
    if(minus==0 && x[0]!=0)minus=-1;

    plus=upper_bound(all(x),0)-x.begin();

    //cout<<minus<<endl<<plus<<endl;
    ll mi=LINF;
    REP(i,n){
        ll score=abs(x[i]);
        if(x[i]<0){
            if(plus-i<k){
                if(plus+(k-plus+i)-1<n){
                    score+=abs(x[plus+(k-plus+i)-1]-x[i]);
                }else{
                    continue;
                }
            }
        }else{
            if(i-minus<k){
                if(i-k+1>=0){
                    score+=abs(x[i]-x[i-k+1]);
                }else{
                    continue;
                }
            }
        }
        //cout<<i<<" "<<score<<endl;
        chmin(mi,score);
    }
    cout<<mi<<endl;
    return 0;
}


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

bool check(vector<ll> &vec,ll n,ll caution){
    /*i番目の項まで見たとき、足したり引いたりしてjを作れるならexist[i][j]=true*/
    vector<vector<bool>> exist(4010,vector<bool>(16010,false));
    exist[0][8005]=true;
    ll num=vec.size();

    if(vec.size()!=0){
        if(caution==0){//startはx軸正方向しか向けない
            exist[1][8005+vec[0]]=true;
        }else{//y軸方向には、正でも負でもよい
            exist[1][8005+vec[0]]=true;
            exist[1][8005-vec[0]]=true;
        }
    }

    rep(i,num){
        if(i==0) continue;
        rep(j,16010){
            if(exist[i][j]==false) continue;
            exist[i+1][j+vec[i]]=true;
            exist[i+1][j-vec[i]]=true;
        }
    }

    return (exist[num][8005+n]==true);
}

int main(){
    string s;cin>>s;
    ll x,y;cin>>x>>y;

    vector<ll> proc;
    ll sum=0;
    //連続するFの数を数える(x,y軸方向の移動に帰着)
    rep(i,s.size()){
        if(s[i]=='F'){
            sum++;
            if(i==s.size()-1) proc.push_back(sum);
        }else{
            proc.push_back(sum);
            sum=0;
        }
    }

    vector<ll> odd,even;
    rep(i,proc.size()){
        if(i%2==1) odd.push_back(proc[i]);//x軸方向の移動
        else even.push_back(proc[i]);//y軸方向の移動
    }

    bool yes=false;
    if(check(even,x,0)==true && check(odd,y,1)==true){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }

    return 0;
}

Measured memory_bytes: 11444
#include<bits/stdc++.h>
#define de(x) cout<<#x<<"="<<x<<endl
#define dd(x) cout<<#x<<"="<<x<<" "
#define rep(i,a,b) for(int i=a;i<(b);++i)
#define repd(i,a,b) for(int i=a;i>=(b);--i)
#define repp(i,a,b,t) for(int i=a;i<(b);i+=t)
#define mt(a,b) memset(a,b,sizeof(a))
#define fi first
#define se second
#define mp(u,v) make_pair(u,v)
#define sz(a) (int)a.size()
#define pb push_back
#define PI acos(-1.0)
#define qc std::ios::sync_with_stdio(false)
#define all(a) a.begin(),a.end()
using namespace std;
typedef vector<int> vi;
typedef long long ll;
typedef double db;
typedef pair<ll,ll> pll;
typedef pair<ll,int> pli;
typedef pair<int,int> pii;
typedef pair<int,pii> piii;

const ll mod = 1000000007;
const int N = 5e5+6;
const int M = 2e6+6;
const double eps = 1e-6;
const int inf = 0x3f3f3f3f;

bool eq(const db &a, const db &b) { return fabs(a - b) < eps; }
bool ls(const db &a, const db &b) { return a + eps < b; }
bool le(const db &a, const db &b) { return eq(a, b) || ls(a, b); }
ll gcd(ll a,ll b) { return a==0?b:gcd(b%a,a); };
ll lcm(ll a,ll b) { return a/gcd(a,b)*b; }
ll kpow(ll a,ll b) {ll res=1;a%=mod; if(b<0) return 1; for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll read(){
    ll x=0,f=1;char ch=getchar();
    while (ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
    while (ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
//inv[1]=1;
//for(int i=2;i<=n;i++) inv[i]=(mod-mod/i)*inv[mod%i]%mod;
ll n, a, b;
int main() {
	while(~scanf("%lld%lld%lld", &n, &a, &b)) {
		ll d = b - a;
		if(d & 1) {
			ll ret = min(n - a, b - 1);
			ret = min(ret, a + (d - 1) / 2);
			ret = min(ret, n - b + 1 + (d - 1) / 2);
			printf("%lld\n", ret);
		} else {
			printf("%lld\n", d / 2);
		}
	}
    return 0;
}


Measured memory_bytes: 256
n = int(input())
A = list(map(int, input().split()))

money = 1000
stock = 0

for i in range(n-1):
    if A[i] < A[i+1]:
        tmp = money // A[i]
        stock += tmp
        money -= tmp * A[i]
    if A[i] > A[i+1]:
        money += stock * A[i]
        stock = 0
money += stock * A[-1]
print(money)

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

int main(){
  int N, K, Q;
  cin>>N>>K>>Q;
  map<int, int> score;
  vector<int> failed(N+1);
  for(int i=1; i<=N; i++){
    score[i]=K-Q;
  }
  for(int i=0; i<Q; i++){ //Q問
    int a;
    cin>>a;
    score[a]++;
  }
  for(int i=1; i<=N; i++){
    if(score[i]<=0) cout<<"No"<<endl;
    else cout<<"Yes"<<endl;
  }
}


Measured memory_bytes: 7424
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Math;
 
public class Hello{
    public static void Main(){
        int[] num = inta();
        WriteLine((double)num[0] / num[1]);
    
    
    
    }
    //各種読取
    static string rstr(){
        return ReadLine();
    }
    static int rint(){
        return int.Parse(ReadLine());
    }
    static long rlong(){
        return long.Parse(ReadLine());
    }
    static string[] stra(){
        return ReadLine().Split(' ');
    }
    static int[] inta(){
        string[] read_str_array = ReadLine().Split(' ');
        int[] return_int_array = new int[read_str_array.Length];
        for(int countup_i=0;countup_i<read_str_array.Length;countup_i++){
            return_int_array[countup_i] = int.Parse(read_str_array[countup_i]);
        }
        return return_int_array;
    }
    static int[,] inta2(int num_array,int in_array){
        int[,] int_array2 = new int[num_array,in_array];
        for(int i=0;i<num_array;i++){
            int[] temp_array = inta();
            for(int j=0;j<in_array;j++){
                int_array2[i,j] = temp_array[j];
            }
        }
        return int_array2;
    }
    static long[] longa(){
        string[] read_str_array = ReadLine().Split(' ');
        long[] return_long_array = new long[read_str_array.Length];
        for(long countup_i=0;countup_i<read_str_array.Length;countup_i++){
            return_long_array[countup_i] = long.Parse(read_str_array[countup_i]);
        }
        return return_long_array;
    }
    static double[] doublea(){
        string[] read_str_array = ReadLine().Split(' ');
        double[] return_double_array = new double[read_str_array.Length];
        for(long countup_i=0;countup_i<read_str_array.Length;countup_i++){
            return_double_array[countup_i] = long.Parse(read_str_array[countup_i]);
        }
        return return_double_array;
    }
    // A/B小数点以下切上
    static long divideup(long divided,long divid){
        long temp_divide = divided/divid;
        if(divided % divid > 0){
            temp_divide++;
        }
        return temp_divide;
    }
    static long GCD(long a,long b){
        if(a < b){
            long temp = a;
            a = b;
            b = temp;
        }
        if(a % b == 0){ return b; }
        else{
            long temp = b;
            b = a%b;
            a = temp;
            return GCD(a,b);
        }
    }
    static long LCM(long a,long b){
        return a * b / GCD(a,b);
    }
}
//知見
// (string) hogestr -> (char[]) hoge
    // char hoge = hogestr.ToCharArray();
// (char[]) hoge -> (string) hogestr
    // string hoge = new string(hoge);
// Hashtable ×  Dictionary ○
// Dictionary hoge<string,int>
    // hoge.ContainsKey(string) -> return boolean
    // hoge[string] -> return int
    // hoge[int] -> CE
// Dictionary hoge<int1,int2>
    // hoge<int1,int2>: hoge[int1] -> return int2
    // KeyValuePair<int,int> k <-> k.Key == int1 / k.Value == int2
// SortedDictionary() > SortedList() ???
// キュー　-> 幅優先 ???
// スタック -> 深さ優先 ???

Measured memory_bytes: 11092
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <math.h>

#define P 1000000007

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

int main(void){
	long a, b, n;
	scanf("%ld%ld%ld", &n, &a, &b);
	long ans=n/(a+b)*a;
	n%=(a+b);
	printf("%ld\n", n<a?ans+n:ans+a);
}


Measured memory_bytes: 128
N, C = map(int, input().split())
stc = [list(map(lambda x:int(x), input().split())) for _ in range(N)]

stc = sorted(stc, key=lambda x:(x[2], x[0], x[1]))
l = []
i = N-1
s, t, c = 0, 0, 0
while i >= 0:
    if stc[i][2] == stc[i-1][2] and stc[i][0] == stc[i-1][1]:
        s = stc[i-1][0]
        if t == 0:
            t = stc[i][1]
        c = stc[i][2]
    else:
        if s != 0:
            l += [[s, t, c]]
            s, t, c = 0, 0, 0
        else:
            l += [stc[i]]

    i -= 1
        
imos = [0]*(2*10**5+1)
for s, t, c in l:
    imos[s-1] += 1
    imos[t] -= 1

for i in range(len(imos)-1):
    imos[i] = imos[i] + imos[i-1]

print(max(imos))





Measured memory_bytes: 110716
# -*- coding: utf-8 -*-
# abc139/abc139_a
import sys

s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in list(ss)]
ss2nnn = lambda ss: [s2nn(s) for s in list(ss)]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [i2s() for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

def main():
    S = i2s()
    T = i2s()
    n = 0
    for i in range(3):
        if S[i] == T[i]:
            n += 1
    print(n)
    return

main()


Measured memory_bytes: 3064
#pragma GCC optimize("O3")

#include<bits/stdc++.h>
#define sp " "
#define endl "\n"
#define MAX 10e9
#define MAXN 100001 
#define inf_int 2e9
#define inf_ll 2e18
#define e 1e-9
#define vi vector<int>
#define vl vector<ll>
#define vc vector<char>
#define vs vector<string>
#define vpl vector<pair<ll,ll>>
#define vpc vector<pair<char,char>>
#define adj_list vector<vl> 
#define umap unordered_map<ll, ll>
#define pll pair<ll,pair<ll, ll>>
#define clr(x) memset(x,0,sizeof(x))
#define set(x,k) memset(x,k,sizeof(x))
#define cy cout << "YES" << endl
#define  cn cout << "NO" << endl
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;
typedef long long int ll;

ll spf[MAXN]; 
void sieve() 
{ 
    spf[1] = 1; 
    for (auto i=2; i<MAXN; i++) 
  		spf[i] = i; 
  	for (auto i=4; i<MAXN; i+=2) 
        spf[i] = 2; 
    for (auto i=3; i*i<MAXN; i++) 
    {
        if (spf[i] == i) 
        { 
            for (auto j=i*i; j<MAXN; j+=i) 
                if (spf[j]==j) 
                    spf[j] = i; 
        } 
    } 
	return;
} 

vl getFactorization(ll x) 
{ 
    vl ret; 
    while (x != 1) 
    { 
        ret.push_back(spf[x]); 
        x = x / spf[x]; 
    } 
    return ret; 
} 

struct item {
	ll a,b,c;
};


void check()
{
	ll n,ans = 0;
	cin >> n;
	vl l(n);
	map<ll,item> mp;
	for(int i=0;i<n;i++) cin >> l[i];
	for(int i=0;i<n;i++) {
		for(int j=i+1;j<n;j++) {
			for(int k=j+1;k<n;k++) {
				item x = {l[i],l[j],l[k]};
				if(l[i]+l[j]>l[k] and l[j]+l[k]>l[i] and l[i]+l[k]>l[j] and l[i]!=l[j] and l[j]!=l[k] and l[i]!=l[k]) ans++,mp[i] = x;
			}
		}
	}
	cout << ans << endl;
    return ;
}

int32_t main()
{
    fastio;
    ll t = 1;
    //cin >> t;
    while(t--)
        check();
    return 0;
}

Measured memory_bytes: 3672
#include<bits/stdc++.h>
#include<vector>
using namespace std;
int main(void){

while(true){
  int n;   cin >> n;
  if(n == 0)    break;

  vector<int>  a(n);  long sum = 0;
  for(int i = 0 ; i < n ; i++){
    cin >> a[i];
    sum += a[i];
  }

  double ave = sum / n;     int ans = 0;
  for(int i = 0 ; i < n ; i++)
    if((double)a[i] <= ave)   ans++;

  cout << ans << endl;
}

  return 0;
}



Measured memory_bytes: 3144
#include <iostream>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <string>
#include <map>
#include <queue>
#include <memory.h>
using namespace std;
int dx[] = {1,0,-1,0};
int dy[] = {0,1,0,-1};

int W, H, N;
int X1[1000], X2[1000], Y1[1000], Y2[1000];

bool fld[1000 * 6][1000 * 6];

int compress(int *x1, int *x2, int w) {
  vector<int> xs;

  for(int i = 0; i < N; i++) {
    for(int d = -1; d <= 1; d++) {
      int tx1 = x1[i] + d, tx2 = x2[i] + d;
      if(0 <= tx1 && tx1 < w) xs.push_back(tx1);
      if(0 <= tx2 && tx2 < w) xs.push_back(tx2);
    }
  }
  sort(xs.begin(),xs.end());
  xs.erase(unique(xs.begin(),xs.end()),xs.end());

  for(int i = 0; i < N; i++) {
    x1[i] = find(xs.begin(),xs.end(),x1[i]) - xs.begin();
    x2[i] = find(xs.begin(),xs.end(),x2[i]) - xs.begin();
  }
  return xs.size();
}

void solve() {
  W = compress(X1,X2,W);
  H = compress(Y1,Y2,H);

  memset(fld,0,sizeof(fld));

  for(int i = 0; i < N; i++) {
    for(int y = Y1[i]; y < Y2[i]; y++) {
      for(int x = X1[i]; x < X2[i]; x++) {
        fld[y][x] = true;
      }
    }
  }


  int ans = 0;
  for(int y = 0; y < H; y++) {
    for(int x = 0; x < W; x++) {
      if(fld[y][x]) continue;
      ans++;

      queue<pair<int,int> > que;
      que.push(make_pair(x,y));
      while(!que.empty()) {
        int sx = que.front().first, sy = que.front().second;
        que.pop();

        for(int i = 0; i < 4; i++) {
          int tx = sx + dx[i], ty = sy + dy[i];
          if(tx < 0 || ty < 0 || tx >= W || ty >= H) continue;
          if(fld[ty][tx]) continue;
          que.push(make_pair(tx,ty));
          fld[ty][tx] = true;
        }
      }
    }
  }
  printf("%d\n",ans);
}


int main() {
  while(1) {
    scanf("%d %d",&W,&H);
    if(W == 0 && H == 0) break;
    scanf("%d",&N);
    for(int i = 0; i < N; i++) {
      scanf("%d %d %d %d",&X1[i],&Y1[i],&X2[i],&Y2[i]);
    }
    solve();
  }
}

Measured memory_bytes: 36404