akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n, m, penalties = 0, correct = 0; 
  cin >> n >> m;
  vector < int > penalty(n, 0);
  vector < bool > accepted(n, false);
  for(int i = 1; i <= m; i++){
	int task;
    string verdict;
    cin >> task >> verdict;
    if(verdict == "AC"){
      if(accepted[task] == false)penalties += penalty[task], correct++;
      accepted[task] = true;
    }else{
      penalty[task]++;
    }
  }
  cout << correct << ' ' << penalties;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
#include<string.h>
 
typedef long long int ll;
#define all(x) (x).begin(), (x).end()
 
using namespace std;

int nxt() {
    int x;
    cin >> x;
    return x;
}

ll nxtl(){
    ll x;
    cin>>x;
    return x;
}
 
void SieveOfEratosthenes(int n,vector <int> &primes) 
{ 
    // Create a boolean array "prime[0..n]" and initialize 
    // all entries it as true. A value in prime[i] will 
    // finally be false if i is Not a prime, else true. 
    bool prime[n+1]; 
    memset(prime, true, sizeof(prime)); 
  
    for (int p=2; p*p<=n; p++) 
    { 
        // If prime[p] is not changed, then it is a prime 
        if (prime[p] == true) 
        { 
            // Update all multiples of p greater than or  
            // equal to the square of it 
            // numbers which are multiple of p and are 
            // less than p^2 are already been marked.  
            for (int i=p*p; i<=n; i += p) 
                prime[i] = false; 
        } 
    } 
  
    // Print all prime numbers 
    for (int p=2; p<=n; p++) 
       if (prime[p]) 
          primes.push_back(p);
} 
 
ll max(ll a,ll b)
{
    if(a>b)
        return a;
    return b;
}
 
ll power(ll x, ll y,ll mod) 
{ 
    ll temp; 
    if( y == 0) 
        return 1; 
    temp = power(x, y/2,mod); 
    if (y%2 == 0) 
        return (temp*temp)%mod; 
    else
        return (((x*temp)%mod)*temp)%mod; 
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n=nxt();
    map <int,int> m;
    for(int i=0;i<n;i++)
    {
        int x=nxt();
        m[x]+=1;
    }
    int c=0;
    for(auto it=m.begin();it!=m.end();it++)
        if(it->second%2==0)
            c++;
    if(c%2)
        cout<<m.size()-1<<endl;
    else
        cout<<m.size()<<endl;
    
    
    
    return 0;   
}




 
 


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

#ifdef LOCAL
  #include <contest/local.hpp>
#else
  #define LOG(...) do {} while (false)
#endif

#define REP(i,n) for (decltype (n) i = 0, i ## __len = (n); i < i ## __len; ++ i)
#define ALL(x) (x).begin (), (x).end ()

using namespace std;

auto main () -> int
{
  cin.tie (nullptr);
  ios::sync_with_stdio (false);
  cout << fixed << boolalpha;
  cerr << fixed << boolalpha;

  unsigned int n;
  cin >> n;
  vector <int64_t> a;

  REP (i, n)
  {
    int64_t a_;
    cin >> a_;
    a.emplace_back (a_);
  }

  auto x0 = 0;
  for (int i = 0; i < n; i += 2)
  {
    x0 += a [i];
  }
  for (int i = 1; i < n; i += 2)
  {
    x0 -= a [i];
  }

  x0 /= 2;
  LOG (x0);

  vector <int64_t> ans (n);
  ans [0] = x0;
  for (auto i = 1u; i < n; ++ i)
  {
    ans [i] = a [i - 1] - ans [i - 1];
    if (ans [i] < 0)
    {
      cerr << "ha?" << endl;
    }
  }

  REP (i, n)
  {
    cout << (i == 0 ? "" : " ") << ans [i] * 2;
  }
  cout << endl;
}



Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;

int main() {
  string S;
  cin >> S;
  rep(i, S.size())
    if((i % 2 == 0 && S[i] == 'L') ||
       (i % 2 == 1 && S[i] == 'R')) {
      cout << "No" << endl;
      return 0;
    }
  cout << "Yes" << endl;
  return 0;
}


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

using namespace std;

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

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n, t;
    cin >> n;
    int occ[n] = {};
    ll rez = 0;
    for (int ctr1 = 0; ctr1 < n; ++ctr1) {
        cin >> t;
        if (ctr1 - t >= 0)
            rez += occ[ctr1 - t];
        if (ctr1 + t < n)
            ++occ[ctr1 + t];
    }
    cout << rez << '\n';

    return 0;
}


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

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

using namespace std;

int h,w;
string c[110];
bool f[110][110];

int main() {
  cin >> h >> w;
  rep(i,h) {
    cin >> c[i];
  }
  rep(i,w) f[0][i] = true;
  rep(i,h) {
    rep(j,w) {
      if( c[i][j] == 'o' ) {
	f[i][j] = true;
	if( j - 1 >= 0  ) f[i][j-1] = true;
	if( j + 1 <  w  ) f[i][j+1] = true;
      } else if( c[i][j] == 'x' ) {
	f[i][j] = true;
	REP(dy,-1,2) {
	  REP(dx,-1,2) {
	    int nx = j + dx, ny = i + dy;
	    if( ( 0 <= nx && nx < w && 0 <= ny && ny < h ) ) {
	      f[ny][nx] = true;
	    }
	  }
	}
      } 
    }
  }
  int cnt = 0;
  rep(i,h) rep(j,w) if( f[i][j] == false ) ++cnt;
  cout<< cnt << endl;
  
  return 0;
}

Measured memory_bytes: 1236
#include <bits/stdc++.h>
#include <stdlib.h>
#include <fstream>
#include <iostream>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll,ll> llP;

ll mod(ll a, ll b){
  ll ret=a%b;
  if(ret<0) ret+=b;
  return ret;
}

ll modpow(ll a,ll b,ll c){
  ll res=1;
  while(b>0){
    if(b&1) res=mod(res*a,c);
    a=mod(a*a,c);
    b>>=1;
  }
  return res;
}

int GCD(int x,int y){
  if(x<y){
    swap(x,y);
  }
  while(x%y!=0){
    int temp=x;
    x=y;
    y=temp%y;
  }
  return y;
}

int digitsum(int x){
  int sum=0;
  while(x>0){
    sum+=(x%10);
    x/=10;
  }
  return sum;
}

int main() {
  int n,x;
  cin>>n>>x;
  int a[n];
  for(int i=0;i<n;i++) cin>>a[i];
  sort(a,a+n);
  int ans=0;
  for(int i=0;i<n;i++){
    x-=a[i];
    if(i==n-1){
      if(x==0) ans++;
      continue;
    }
    if(x>=0){
      ans++;
      continue;
    }
    else break;
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 3620
#include<bits/stdc++.h>
#define int long long
#define rep(i,n) for(int i=0;i<n;i++)
#define elif else if
#define INF 1000000007
using namespace std;
int a,b[110000];
char c;
string s;
signed main()
{
	cin>>a>>s;
	rep(i,s.size()){
		if(s[i]+a>90){
			c=s[i]+a-26;
		}else{
			c=s[i]+a;
		}
		cout<<c;
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h> 
using namespace std; 
int main() { 
  int r,g,b; 
  cin >> r >> g >> b; 
  if ((10*g+b)%4==0) {
    cout <<"YES"<<endl;
  }
  else {
    cout<<"NO"<<endl;
  }

}


Measured memory_bytes: 3600
import java.util.Arrays;
import java.util.Scanner;

public class Main {

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

        while (true) {
            int n = sc.nextInt();

            if (n == 0)
                break;

            SortMap[] list = new SortMap[26];
            for (int i = 'A'; i <= 'Z'; i++) {
                list[i - 65] = new SortMap((char)i);
            }

            int i = 0;
            for (i = 0; i < n; i++) {
                int a = (int) sc.next().charAt(0);
                for (SortMap m: list) {
                    if (m.i == a) {
                        m.n ++;
                        break;
                    }
                }
                Arrays.sort(list);
                SortMap sa = list[0];
                SortMap sb = list[1];
                // System.out.println(sa);
                // System.out.println(sb);
                if (sa.n > sb.n + (n - i - 1)) {
                    for (int j = 0; j < n - i - 1; j++) {
                        sc.next();
                    }
                    break;
                }
            }

            Arrays.sort(list);
            SortMap s1 = list[0];
            SortMap s2 = list[1];
            if (s1.n == s2.n) {
                System.out.println("TIE");
            } else {
                System.out.println(((char) s1.i) + " " + ((int)i + 1));
            }

//            for (int i = 0; i < n; i++) {
//                int tmp = (int)sc.next().charAt(0) -65;
//
//                nums[tmp]++;
//
//                if (first != tmp) {
//                    if (nums[second] < nums[tmp]) {
//                        if (nums[first] < nums[tmp]) {
//                            second = first;
//                            first = tmp;
//                        }
//                        else {
//                            if (second != tmp) {
//                                second = tmp;
//                            }
//                        }
//                    }
//                }
//
//                if (nums[first] > nums[second] + (n - i - 1)) {
//                    for (int j = 0; j < n - i - 1; j++) {
//                        sc.next();
//                    }
//                    break;
//                }
//            }
//
//            if (nums[first] == nums[second])
//                System.out.println("TIE");
//            else
//                System.out.println((char)(first+65) + " " + nums[first]);
        }
    }

    static class SortMap implements Comparable<SortMap> {
        public char i;
        public int n;

        public SortMap(char i) {
            this.i = i;
            this.n = 0;
        }

        @Override
        public String toString() {
            return "SortMap{" +
                    "i=" + i +
                    ", n=" + n +
                    '}';
        }
        @Override
        public int compareTo(SortMap o) {
            return o.n - this.n;
        }
    }
}

Measured memory_bytes: 50508
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); i++)
#define rep2(i,n) for (int i = 1; i <= (n); i++)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
using ll = long long;
template <class T>
using Grid = vector<vector<T>>;

int main(){
    int n;
    cin >> n;
    vector<int> v(n - 1);
    rep(i, n - 1) cin >> v[i];
    int sum = v[0];
    rep(i, n - 1) {
        sum += min(v[i], v[i - 1]);
    }
    sum += v.back();
    cout << sum << endl;
}

Measured memory_bytes: 3628
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define ll long long
#define rep(i,l,r)for(ll i=(l);i<(r);i++)
#define max(p,q)((p)>(q)?(p):(q))
#define min(p,q)((p)<(q)?(p):(q))

int main(){
	ll n,d,ans;
	scanf("%lld%lld%lld",&n,&d,&ans);
	rep(i,0,n){
		ll t;
		scanf("%lld",&t);
		ans+=(d+t-1)/t;
	}
	printf("%lld",ans);
}

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

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

const int INF=1e9;
const int MOD=1e9+7;

vector<int> g[100100];
int dist[100100]={};
int ans[100100]={};

int tak,ao;

void dfs(int u, int pa, int d){
    for(auto v:g[u]){
        if(v==pa) continue;
        dfs(v,u,d+1);
    }
    dist[u]=d;
}

void dfs2(int u, int pa, int d){
    for(auto v:g[u]){
        if(v==pa) continue;
        if(d+1>=dist[v]){
            continue;
        }else{
            dfs2(v,u,d+1);
        }
    }
    ans[u]=dist[u];
}

int main(){
    int N;
    cin >> N >> tak >> ao;
    tak--; ao--;
    for(int i=0;i<N-1;i++){
        int a,b; cin >> a >> b;
        a--; b--;
        g[a].push_back(b);
        g[b].push_back(a);
    }
    dfs(ao,-1,0);
    dfs2(tak,-1,0);
    int f_a=0;
    for(int i=0;i<N;i++){
        f_a=max(ans[i],f_a);
    }
    cout << f_a-1 << endl;
}

Measured memory_bytes: 16196
Tri=[]
x1,y1=map(int,input().split())
x2,y2=map(int,input().split())
x3,y3=map(int,input().split())
a1,a2=x2-x1,y2-y1
b1,b2=x3-x1,y3-y1
c1,c2=x3-x2,y3-y2
S=abs(a1*b2-a2*b1)/2
a=(a1**2+a2**2)**(1/2)
b=(b1**2+b2**2)**(1/2)
c=(c1**2+c2**2)**(1/2)
h=2*S/max(a,b,c)
r=S/(h+(a+b+c)/2)
print(r)

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

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

    int n;
    cin>>n;
    long long ans = 0;
    for (int i=1; i<=n; i++){
        long long num = n/i;
        ans += i*(num*(num+1))/2;
    }
    cout<<ans<<endl;
    return 0 ;
}


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

int K;
double R, L, P, E, T;

double dfs(int d, double p, double r, double l) {
    double h = (r + l) / 2.;
    if (d == K) {
        if (abs(T - h) <= E) {
            return 0.;
        } else {
            return p;
        }
    }

    if (l < T - E || T + E < r) return p;
    if (T - E < r && l < T + E) return 0.;

    double good_r, good_l, but_r, but_l;

    if (h >= T) {
        good_r = r;
        good_l = h;
        but_r = h;
        but_l = l;
    } else {
        good_r = h;
        good_l = l;
        but_r = r;
        but_l = h;
    }

    return dfs(d + 1, p * (1.0 - P), good_r, good_l) + dfs(d + 1, p * P, but_r, but_l);
}

int main() {
    cin >> K >> R >> L >> P >> E >> T;
    printf("%.12f\n", 1. - dfs(0, 1., R, L));

    return 0;
}

Measured memory_bytes: 3288
#include <stdio.h>
int main(){
  int ai,am,as,ae,bi,bm,bs,be,suma,sumb;
  scanf("%d%d%d%d",&ai,&am,&as,&ae);
  scanf("%d%d%d%d",&bi,&bm,&bs,&be);
  suma=ai+am+as+ae;
  sumb=bi+bm+bs+be;
  if(suma<sumb){
    printf("%d\n",sumb);
  }else{
    printf("%d\n",suma);
  }
  return 0;
}

Measured memory_bytes: 592
use std::io;
use std::cmp;
use std::cmp::Ordering;

// read a line(without line feed)
fn read_line() -> String {
    let mut in_str = String::new();
    io::stdin().read_line(&mut in_str).unwrap();
    return in_str.trim().to_string();
}

// read wods on a line
pub fn read_words_in_line() -> Vec<String> {
    let s = read_line();
    return s.split_whitespace().map(|x| x.to_string()).collect::<Vec<String>>()
}

// read type t on a line
pub fn read_t_in_line<T : std::str::FromStr>() -> Vec<T> {
    let mut v : Vec<T> = Vec::new();
    for e in read_words_in_line().iter().map(|x| x.parse::<T>()) {
        if let Ok(r) = e {
            v.push(r);
        }
        else{
            return Vec::new();
        }
    }
    return v;
}

// sort slice
pub fn sort<T : std::cmp::Ord>(slice : &mut [T]) {
    slice.sort();
}
// sort slice by reverse order
pub fn sort_rev<T : std::cmp::Ord>(slice : &mut [T]) {
    slice.sort_by(|x, y| y.cmp(x));
}

pub fn min<T : std::cmp::Ord>(a : T, b : T) -> T{
    return cmp::min(a, b);
}

pub fn max<T : std::cmp::Ord>(a : T, b : T) -> T{
    return cmp::max(a, b);
}

#[derive(Copy, Clone, Eq, PartialEq, Debug)]
struct State {
    cost     : i32,
    node     : i32,
    vismask  : i32
}

impl Ord for State {
    fn cmp(&self, other: &State) -> Ordering {
        other.cost.cmp(&self.cost)
    }
}

impl PartialOrd for State {
    fn partial_cmp(&self, other : &State) -> Option<Ordering> {
        Some(self.cmp(other))
    }
}


fn main() {

    let mut n = read_t_in_line::<i32>()[0];
    
    while n > 0 {
        if n % 10 == 9 {
            println!("Yes");
            return;
        }
        n /= 10;
    }

    println!("No");

}


Measured memory_bytes: 4352
import scala.annotation.tailrec
import scala.collection.mutable
import scala.collection.mutable.ArrayBuffer
object Main extends App {
  import scala.io.StdIn._


  val Array(n, m) = readLine.trim.split(' ').map(_.toInt)
  val fan = readLine.trim.split(' ').map(_.toInt) :+ n + 1
  val q = readInt
  val defaultLoss = fan.head - 1
  val loss = fan.indices.tail.map(i ⇒ fan(i).toLong - fan(i - 1)).sorted.toArray
  val sumLoss = (0L +: loss).also(a ⇒ a.indices.tail.foreach(i ⇒ a(i) += a(i - 1)))
  for (l ← readLine.trim.split(' ').map(_.toInt)){
    if (defaultLoss <= l) {
      var min = 1
      var max = n
      while (min < max) {
        val mid = (min + max) / 2
        val count = upperBound(loss, mid)//lossが起きない送風機の数
        if (l < sumLoss.last - sumLoss(count) - (m - count) * mid + defaultLoss) {
          min = mid + 1
        } else {
          max = mid
        }
      }
      println(max)
    }else println(-1)
  }


  def upperBound(array: Array[Long], target: Int): Int = {
    var left = 0
    var right = array.length
    while(left < right){
      val mid = (left + right) / 2
      if (array(mid) <= target){
        left = mid + 1
      }else {
        right = mid
      }
    }
    right
  }
  implicit class Scope[T](val value: T) extends AnyVal {
    @inline
    def let[A](func: T ⇒ A): A = func(value)
    @inline
    def also(func: T ⇒ Unit): T = {
      func(value)
      value
    }
  }
}



Measured memory_bytes: 154904
#include <cstdio>
#include <cctype>
#include <set>
#include <iostream>

using namespace std;

typedef long long LL;

inline char gc()
{
	static const int L = 23333;
	static char sxd[L], *sss = sxd, *ttt = sxd;
	if (sss == ttt)
	{
		ttt = (sss = sxd) + fread(sxd, 1, L, stdin);
		if (sss == ttt) return EOF;
	}
	return *sss++;
}

#ifdef ___my_computer
#define gc getchar
#endif

#define dd c = gc()
template <class T>
inline bool read(T& x)
{
	x = 0;
	register char dd;
	bool flag = false;
	for (; !isdigit(c); dd)
	{
		if(c == '-') flag = true;
		else if(c == EOF) return false;
	}
	for (; isdigit(c); dd)
		x = (x << 1) + (x << 3) + (c ^ 48);
	if (flag) x = -x;
	return true;
}
#undef dd

const int maxn = 105;
const int inf = 0x3f3f3f3f;

int tong[maxn];

int main()
{
	int n, zj = 0;
	read(n);
	for (int i = 1, a; i <= n; ++i)
	{
		read(a);
		tong[a]++;
		zj = max(a, zj);
	}
//	cout << tong[2] << ' ' << tong[3] << endl;
//	cout << "zj = " << zj << endl;
	for (int i = 0; i <= zj; ++i)
	{
		int noww = max(i, zj - i);
//		cout << i << ' ' << noww << endl;
		if (!tong[noww])
		{
			puts("Impossible");
			return 0;
		}
		tong[noww]--;
	}
	for (int i = 1; i <= ((zj + 1) >> 1); ++i)
	{
		if (tong[i])
		{
			puts("Impossible");
			return 0;
		}
	}
//	if (zj == 2 && tong[2])
//	{
//		puts("Impossible");
//		return 0;
//	}
	puts(tong[1] ? "Impossible" : "Possible");
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(void) {
  int H, W;
  char str[110][110];
  int i;
  
  scanf("%d %d", &H, &W);
  for(i = 0; i < H; i++) {
   	scanf("%s", str[i]);
  }
  
  for(i = 0; i < H; i++) {
    printf("%s\n%s\n", str[i], str[i]);
  }
  
  return 0;
}
  

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

int main(){
    string s, t;
    int a, b;
    string u;
    cin >> s >> t;
    cin >> a >> b;
    cin >> u;
    if(s==u){
        cout << a-1 << " " << b;
    }
    else{
        cout << a << " " << b-1;
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
  cin.tie(NULL);
  ios::sync_with_stdio(false);
  int n,a,b,sum=0,keta=0;
  cin>>n>>a>>b;
  int na;
  for(int i=1;i<=n;i++){
    na=i;
    while(na>=9){
      keta+=na%10;
      na/=10;
    }
    keta+=na;
    if(a<=keta && keta<=b) sum+=i;
    keta=0;
  }
  cout<<sum<<'\n';
  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<iostream>
#include<algorithm>
using namespace std;

int k,x;
int kq;

int main(){
  scanf("%d%d",&k,&x);
  int l=max(-1000000,x-k+1);
  int r=min(1000000,x+k-1);
  for(int i=l;i<=r;i++) cout<<i<<" ";
}


Measured memory_bytes: 256
#include <iostream>
#include <cctype>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <utility>
#include <string>
#include <functional>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <iomanip>
#define pb push_back 
#define YES cout<<"YES"<<endl
#define Yes cout<<"Yes"<<endl
#define NO cout<<"NO"<<endl
#define No cout<<"No"<<endl
#define INF (1<<30)
#define MOD 1000000007
using ll = long long;
using namespace std;

int main() {
    ll n, ans = 0;
    vector<ll> a;
    cin >> n;
    for (int i = 1; i <= n; i++) {
        ll t;
        cin >> t;
        t -= i;
        a.pb(t);
    }
    sort(a.begin(), a.end());
    int b = a[(n + 1) / 2 - 1];
    for (int i = 0; i < n; i++) {
        ans += abs(a[i] - b);
    }
    cout << ans << endl;
    return 0;
}


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

int main() {
  int D;
  cin >> D;
  if(D == 22) cout << "Christmas Eve Eve Eve" << endl;
  if(D == 23) cout << "Christmas Eve Eve" << endl;
  if(D == 24) cout << "Christmas Eve " << endl;
  if(D == 25) cout << "Christmas" << endl;
}


Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<cstring>
using namespace std;
typedef long long ll;
const int N=2e5+10;
int n,num;char s[N];ll ans;
int main(){
	scanf("%s",s+1);n=strlen(s+1);
	for(register int i=1;i<=n;i++)if(s[i]=='B')num++;
	num=n-num+1;
	for(register int i=1;i<=n;i++)if(s[i]=='B')ans+=num-i,num++;
	printf("%lld\n",ans);return 0;
}

Measured memory_bytes: 1016
#include <iostream>
#include <string>

using namespace std;

int main()
{

	string s;
	cin >> s;
	string hitachi = "";
	for (int i = 1; i <= 5; i++) {
		hitachi += "hi";
		if (hitachi == s) {
			cout << "Yes" << endl;
			return 0;
		}
	}
	cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 256
/*

結果:
*/
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>  
#include <stdbool.h>   
#define inf (INT_MAX-1)
#define INF 9223372036854775807
#define EPS 1e-10
#define sq(n) ((n)*(n))
#define rep(i,n) for(i=0;i<n;i++)
#define rev(i,n) for(i=n-1;i>=0;i--)
#define sort(a,n) qsort(a,n,sizeof(TYPE),cmp)
#define sort_r(a,n) qsort(a,n,sizeof(TYPE),cmp_r);
#define chsort(s,n) qsort(s,n,sizeof(char),cmp)
#define chsort_r(s,n) qsort(s,n,sizeof(char),char_cmp_r);
#define TYPE long long
#define ll long long
#define MEMSET(a) memset(a,0,sizeof(a))
#define MEMSET_U(a) memset(a,-1,sizeof(a))
const int mod = (int)1e09 + 7;

//#define DEBUG1
//#define DEBUG2
//#define DEBUGF

int in(void) { int i; scanf("%d", &i); return i; }
long long llin(void) { long long i; scanf("%lld", &i); return i; }
double din(void) { double i; scanf("%lf", &i); return i; }
void chin(char s[]) { scanf("%s", s); }
void print(int a) { printf("%d\n", a); }
void llprint(long long a) { printf("%lld\n", a); }
void dprint(double a) { printf("%.10f\n", a); }
void print2(int a, int b) { printf("%d %d\n", a, b); }
long long llmax(long long a, long long b) { return a > b ? a : b; }
long long llmin(long long a, long long b) { return a < b ? a : b; }
double dmax(double a, double b) { return a > b ? a : b; }
int cmp(const void *a, const void *b) { return *(TYPE *)a - *(TYPE *)b; }
int cmp_r(const void *a, const void *b) { return *(TYPE *)b - *(TYPE *)a; }
int char_cmp(const void *a, const void *b) { return strcmp((char *)a, (char *)b); }
int char_cmp_r(const void *a, const void *b) { return strcmp((char *)b, (char *)a); }
void swap(int *a, int *b) { int t = *a; *a = *b; *b = t; }

int divisor_count(//約数の数を返す
	int n
) {
	int j, c = 1;
	for (int i = 2; i * i <= n; i++, c *= j)
		for (j = 1; !(n % i); j++) n /= i;
	return (1 < n) ? c * 2 : c;
}

int main() {
	//int A = in(); int B = in();
	//print(A*B - (A + B - 1));
	int n = in();
	int A[201] = { 0 };
	int ans = 0;
	for (int i = 1; i <=n; i+=2) {
		A[i] = divisor_count(i);
	}
	for (int i = 1; i < n + 1; i++) {
		if (A[i] == 8) {
			++ans;
		}
	}
	print(ans);


#ifdef DEBUGF
	getch();
#endif
	return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <queue>
#include <stack>
#include <set>

using namespace std;

int a[2001][2001]={};
int x[2001][2001]={};
int y[2001][2001]={};

int main(){
	int n,m,q;
	cin >> n >> m >> q;
	vector<string> s(n);
	for(int i=0;i<n;i++){
		cin >> s[i];
	}
	for(int i=1;i<=n;i++){
		for(int j=1;j<=m;j++){
			if(s[i-1][j-1]=='1'){
				a[i][j]+=1;
			}
			a[i][j] += a[i][j-1]+a[i-1][j]-a[i-1][j-1];
		}
	}
	for(int i=1;i<=n;i++){
		for(int j=2;j<=m;j++){
			if(s[i-1][j-2]=='1'&&s[i-1][j-1]=='1'){
				x[i][j]+=1;
			}
			x[i][j] += x[i][j-1]+x[i-1][j]-x[i-1][j-1];
		}
	}
	for(int i=2;i<=n;i++){
		for(int j=1;j<=m;j++){
			if(s[i-2][j-1]=='1'&&s[i-1][j-1]=='1'){
				y[i][j]+=1;
			}
			y[i][j] += y[i][j-1]+y[i-1][j]-y[i-1][j-1];			
		}
	}
	int x1,x2,y1,y2;
	int ans;
	for(int i=0;i<q;i++){
		cin >> x1 >> y1 >> x2 >> y2;
		ans =0;
		ans += a[x2][y2]-a[x1-1][y2]-a[x2][y1-1]+a[x1-1][y1-1];
		ans -= x[x2][y2]-x[x1-1][y2]-x[x2][y1]+x[x1-1][y1]; 
		ans -= y[x2][y2]-y[x1][y2]-y[x2][y1-1]+y[x1][y1-1];
		cout << ans << endl;
	}
	return 0;
}

Measured memory_bytes: 52864
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, ll> pil;
#define ls i << 1
#define rs i << 1 | 1
class RangeUpdateSegmentTree {
   private:
    struct node {
        int l, r;
        ll x = 0, adt = 0;
    };
    vector<node> a;
    void push(int i) {
        if (a[i].adt) {
            a[ls].adt += a[i].adt, a[rs].adt += a[i].adt;
            a[ls].x += a[i].adt, a[rs].x += a[i].adt;
            a[i].adt = 0;
        }
    }
    void pull(int i) {
        a[i].x = max(a[ls].x, a[rs].x);
    }
    void build(int l, int r, int i) {
        a[i].l = l, a[i].r = r;
        if (l == r) return;
        int mid = (l + r) >> 1;
        build(l, mid, ls), build(mid + 1, r, rs);
    }
   public:
    RangeUpdateSegmentTree(int n) : a(n << 2) {
        build(0, n, 1);
    }
    void add(int l, int r, ll val, int i = 1) {
        if (a[i].l >= l && a[i].r <= r) {
            a[i].x += val;
            a[i].adt += val;
            return;
        }
        push(i);
        int mid = (a[i].l + a[i].r) >> 1;
        if (l <= mid) add(l, r, val, ls);
        if (r > mid) add(l, r, val, rs);
        pull(i);
    }
    ll maxx(int l, int r, int i = 1) {
        if (l <= a[i].l && a[i].r <= r) return a[i].x;
        push(i);
        ll ret = -9e18;
        int mid = (a[i].l + a[i].r) >> 1;
        if (l <= mid) ret = max(ret, maxx(l, r, ls));
        if (r > mid) ret = max(ret, maxx(l, r, rs));
        pull(i);
        return ret;
    }
};

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n, m;
	cin >> n >> m;
	vector<ll> add(n + 1);
	vector<vector<pil>> del(n + 1);
	for (int i = 0; i < m; i++) {
		int l, r; ll a;
		cin >> l >> r >> a;
		add[l] += a;
		del[r].push_back(pil(l, a));
	}
	RangeUpdateSegmentTree ST(n + 1);
	ll ans = 0;
	for (int i = 1; i <= n; i++) {
		ST.add(0, i - 1, add[i]);
		ll tmp = ST.maxx(0, i - 1);
		ans = max(ans, tmp);
		ST.add(i, i, tmp);
		for (pil p : del[i])
			ST.add(0, p.first - 1, -p.second);
	}
	cout << ans << "\n";
	return 0;
}


Measured memory_bytes: 33664
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; ++i)
#define FOR(i, a, b) for (int i = a; i < b; ++i)
#define ALL(vec) vec.begin(), vec.end()
#define rALL(vec) vec.rbegin(), vec.rend()
using namespace std;
using ll = long long;
// ------------------------------

int main() {
    string S;
    cin >> S;
    int cnt = 0;
    rep(i, S.size()) if (S[i] == 'B') cnt += 1;
    ll ans = 0;
    int last = S.size() - 1;
    for (int i = S.size() - 1; cnt != 0; --i) {
        if (S[i] == 'B') {
            ans += last - i;
            cnt -= 1;
            last -= 1;
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3732
#include <stdio.h>
#include <string.h>
int main(){
  char s[100010];
  long long int dp[100010][4];
  scanf("%s",s);
  int i,j;
  int N = strlen(s),mod = 1000000007;
  for(i = N; i >= 0; --i){
    for(j = 3; j >= 0; --j){
      if(i == N){
        dp[i][j] = (j == 3 ? 1 : 0);
      }else{
        dp[i][j] = dp[i+1][j] * (s[i] == '?' ? 3ll : 1ll);
        if(j < 3 && (s[i] == '?' || s[i] == 'A'+j)){
          dp[i][j] += dp[i+1][j+1];
        }
        dp[i][j] %= mod;
      }
    }
  }
  printf("%lld\n",dp[0][0]);
  return 0;
}

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

char g[10][10];

int memo[10][10][3][59049];
int pow3[20];

int H,W;


int dfs(int x,int y,int yoko,int tate){
	if( x == W ){
		if( yoko ) return 0;
		x = 0;
		y++;
	}
	if( y == H ) {
		return tate == 0;
	}
	if( memo[y][x][yoko][tate] != -1 ){
		return memo[y][x][yoko][tate];
	}
	
	if( g[y][x] == '.' ){
		if( yoko && tate / pow3[W-1] % 3 ) return 0;
		return dfs(x+1,y,yoko,(tate * 3 + tate / pow3[W-1] % 3 ) % pow3[W]);
	}else{
		int need = g[y][x] - '0' - yoko - tate / pow3[W-1] % 3;
		int ans = 0;
		for(int i = 0 ; i <= 2 ; i++){
			for(int j = 0 ; j <= 2 ; j++){
				if( i + j == need ){
					ans += dfs(x+1,y,i,(tate * 3 + j) % pow3[W]);
					if( ans > 100000007 ) ans -= 100000007;
				}
			}
		}
		return memo[y][x][yoko][tate] = ans;
	}
}
int main(){
	pow3[0] = 1;
	for(int i = 1 ; i < 20 ; i++)
		pow3[i] = pow3[i-1] * 3;
	cin >> H >> W;
	for(int i = 0 ; i < H ; i++)
		for(int j = 0 ; j < W ; j++)
			cin >> g[i][j];
	memset(memo,-1,sizeof(memo));
	cout << dfs(0,0,0,0) << endl;
}

Measured memory_bytes: 70372
#include<bits/stdc++.h>
#define ll long long int
#define pb push_back
#define PB push
#define N 100005
#define nd second
#define st first
#define ii pair<ll,ll>
#define mp make_pair
#define p_q priority_queue
using namespace std;

ll a, b, c;

int main(){
	cin >> a >> b >> c;
	if(a == b && a != c){
		cout <<"Yes" << endl;
		return 0;
	}
	else if(a == c && a != b){
		cout <<"Yes" << endl;
		return 0;	
	}
	else if(b == c && a != b){
		cout << "Yes" << endl;
		return 0;	
	}
	else{
		cout << "No" << endl;
		return 0;
	}
}

Measured memory_bytes: 256
#include <stdio.h>

int main() {
	int n;
	scanf("%d", &n);
	int v[n], c[n];
	for (int i = 0; i < n; i++) {
		scanf("%d", &v[i]);
	}
	for (int i = 0; i < n; i++) {
		scanf("%d", &c[i]);
	}
	int ans = 0;
	for (int i = 0; i < n; i++) {
		ans += (v[i] > c[i] ? v[i] - c[i] : 0);
	}
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
//C++14 (GCC 5.4.1)
int main() {
    int N;
    cin >>N;
    vector<int> h(N);

    rep(i,N) cin >> h.at(i);
    //-----------------------------------
    vector<int> c_1(N-1);
    rep(i,N-1)c_1.at(i)=std::abs(h.at(i+1)-h.at(i));

    vector<int> c_2(N-2);
    rep(i,N-2)c_2.at(i)=std::abs(h.at(i+2)-h.at(i));

    vector<int> c_min(N,0);

    c_min.at(1)=c_1.at(0);
    for(int i=2;i<N;i++){
        c_min.at(i)=min(c_min.at(i-2)+c_2.at(i-2),c_min.at(i-1)+c_1.at(i-1));
    }

    cout << c_min.at(N-1) <<endl;
}

Measured memory_bytes: 1792
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int bill = sc.nextInt();
    int numCnt = sc.nextInt();
    String[] array = new String[numCnt];
    for(int i = 0; i < numCnt;i++){
      array[i] = String.valueOf(sc.nextInt());
    }
	
    
    String result = "";
    while(true){
      boolean check = false;
      String strBill = String.valueOf(bill);
      for(int x = 0;x < strBill.length();x++){
        if(Arrays.asList(array).contains(String.valueOf(strBill.charAt(x)))){
          check = true;
          break;
        }
      }
      if(!check){
        result = strBill;
        break;
      }
      bill++;
    }
    
    System.out.println(bill);
  }
}

Measured memory_bytes: 30548
#include <bits/stdc++.h>
using namespace std;
int main () {
  int N, M;
  cin >> N >> M;
  vector<int> data(N + 1);
  int l, r;
  for(int i = 0; i < M; i++){
    cin >> l >> r;
    l--;
    r--;
    data.at(l)++;
    data.at(r + 1)--;
  }
  int sum = 0, count = 0;
  for(int i = 0; i < N; i++){
    sum += data.at(i);
    if(sum == M)count++;
  }
  cout << count << endl;
  return 0;
}

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

long long Combination(int n, int r) {
  long long i = 1;
  int k = r > n - r ? n - r : r, count;

  if (k < 0) return 0;

  for (count = 1; count <= k; ++count) {
    i *= n - count + 1;
    i /= count;
  }
  return i;
}

long long comb(int n, int r) {
  vector<vector<long long>> v(n + 1, vector<long long>(n + 1, 0));
  for (int i = 0; i < v.size(); i++) {
    v[i][0] = 1;
    v[i][i] = 1;
  }
  for (int j = 1; j < v.size(); j++) {
    for (int k = 1; k < j; k++) {
      v[j][k] = (v[j - 1][k - 1] + v[j - 1][k]);
    }
  }
  return v[n][r];
}

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

  string s = "";
  map<string, int> mp;
  for (int i = 0; i < N; i++) {
    cin >> s;
    sort(s.begin(), s.end());

    auto itr = mp.find(s);
    if (itr != mp.end()) {
      itr->second++;
    } else {
      mp[s] = 1;
    }
  }

  long long ans = 0;
  for (auto itr = mp.begin(); itr != mp.end(); ++itr) {
    if (itr->second > 1) {
      ans += Combination(itr->second, 2);
    }
  }

  printf("%lld", ans);
  return 0;
}


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

const ll LINF = 1e18;
const int INF = 1e9;
const ll MOD = 1000000007;

int main(){

    int r, d;
    cin >> r >> d;
    int x;
    cin >> x;
    for(int i = 0; i < 10; i++){
        int x_next;
        x_next = r * x - d; 
        cout << x_next << endl;
        x = x_next;
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <vector>
#include <deque>
#include <queue>
#include <array>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <cassert>
#include <utility>
#include <functional>
#include <bitset>

using namespace std;
using lli = long long int;
template<class T, class U> void init_n(vector<T>& v, size_t n, U x) 
{ v = vector<T>(n, x); }
template<class T> void init_n(vector<T>& v, size_t n) { init_n(v, n, T()); }
template<class T> void read_n(vector<T>& v, size_t n, size_t o = 0) 
{ v = vector<T>(n+o); for (lli i=o; i<n+o; ++i) cin >> v[i]; }
template<class T> void read_n(T a[], size_t n, size_t o = 0)
{ for (lli i=o; i<n+o; ++i) cin >> a[i]; }
template<class T> T gabs(const T& x) { return max(x, -x); }
#define abs gabs

string s;
int main() {
  cin >> s;
  lli n = s.size();
  if (n == 2 && s[0] == s[1]) {
    cout << "1 2\n";
    return 0;
  }

  for (lli i=0; i<n-2; ++i) {
    char c = s[i], d = s[i+1], e = s[i+2];
    if (c == d || d == e || e == c) {
      cout << i+1 << ' ' << i+3 << '\n';
      return 0;
    }
  }
  cout << "-1 -1\n";
  return 0;
}



Measured memory_bytes: 512
#include <stdio.h>
#include <string.h>
#define MAX_C 15
#define MAX_D 30
#define MAX_W 50
#define MAX_X 5


int mem[MAX_D + 1][MAX_W + 1][MAX_X + 1];
int C, D, W, X, E[MAX_C][MAX_D], F[MAX_C][MAX_D];


int max(int a,int b){
	if(a > b){
		return a;
	}else{
		return b;
	}
}



int dfs(int d,int w,int x){
	//printf("%d %d %d\n",d,w,x);
	int i, j, m, e, f;

	if(d == D){
		return 0;
	}
	if(mem[d][w][x] != -1){
		return mem[d][w][x];
	}
	m = dfs(d + 1,w,x);
	for(i = 0;i < C;i++){
		e = f = 0;
		for(j = 0;i + j < C;j++){
			e = e + E[i + j][d];
			f = f + F[i + j][d];
			if(E[i + j][d]==0) break;
			if(w+f>W) continue;
			
			if(j == 0){
				m = max(dfs(d + 1,w + f,x) + e,m);
			}else{
				if(x+1>X) continue;
				m = max(dfs(d + 1,w + f,x + 1) + e,m);
			}
		}
	}
	return mem[d][w][x] = m;
}





int main(void){
	int i, j;
	while(1){

		scanf("%d%d%d%d",&C,&D,&W,&X);

		if(C == 0 && D == 0 && W == 0 && X == 0){
			break;
		}

		for(i = 0;i < C;i++){
			for(j = 0;j < D;j++){
				scanf("%d",&E[i][j]);
			}
		}

		for(i = 0;i < C;i++){
			for(j = 0;j < D;j++){
				scanf("%d",&F[i][j]);
			}
		}
		memset(mem,-1,sizeof(mem));

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

Measured memory_bytes: 1076
#include <bits/stdc++.h>
#define fst first
#define snd second
#define rep(n) for(lint I = 0; (I) < (lint)(n); ++(I))
#define repeat(i, n) for(lint i = 0; (i) < (lint)(n); ++(i))
#define repeat_to(i, n) for(lint i = 0; (i) <= (lint)(n); ++(i))
#define repeat_from(i, m, n) for(lint i = (m); (i) < (lint)(n); ++(i))
#define repeat_from_to(i, m, n) for(lint i = (m); (i) <= (lint)(n); ++(i))
#define repeat_reverse_from_to(i, m, n) for(lint i = (m); (i) >= (lint)(n); --(i))
#define el cout<<endl
#define es cout<<" "
#define dump(x) cout<<" "<<#x<<"="<<x
#define pdump(p) cout<<" "<<#p<<"=("<<p.fst<<","<<p.snd<<")"
#define vdump(v) for(size_t I=0; I<v.size(); ++I){cout<<" "<<#v<<"["<<I<<"]="<<v[I];} cout<<endl
using namespace std; using lint = long long; using ld = long double;
using pii = pair<int, int>; using pll = pair<lint, lint>;
template<class T> vector<T> make_vec(size_t a){return vector<T>(a);}
template<class T, class... Ts> 
auto make_vec(size_t a, Ts... ts){return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));}

int main(void) {
    vector<int> v(5);
    repeat (i, 5) cin >> v[i];
    
    auto upper = [](int n) -> int {
        int m = n % 10;
        int k = n / 10;
        if (m > 0) return (k+1) * 10;
        else return k * 10;
    };
    
    int ans = 0;
    int d = 0;
    repeat (i, 5) {
        ans += upper(v[i]);
        int m = v[i] % 10;
        if (m != 0) {
            d = max(d, (10-m));
        }
    }
    cout << ans - d << endl;
}

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

int main()
{
  string s;
  int n,i=0,a;
  cin>>n;
  cin>>s;
  while(s[i]!='\0')
        {
          a=s[i];
          if(a+n<91)
            s[i]=a+n;
          else
            s[i]=(a+n-90)+64;
    	  i++;
        }
  cout<<s;
  return 0;
        }

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

using namespace std;

#define fst(t) std::get<0>(t)
#define snd(t) std::get<1>(t)
#define thd(t) std::get<2>(t)

using ll = long long;
using P = std::tuple<int,int>;

const int dx[8] = {-1, 1, 0, 0, -1, -1, 1, 1}, dy[8] = {0, 0, -1, 1, -1, 1, -1, 1};
const int INF = numeric_limits<int>::max() / 2;

vector<int> graph[100000];
int values[100000];
int N, K, root;
bool visited[100000];
P ranges[100000];

bool isIn(const int x, const P range){
    return fst(range) <= x && x <= snd(range);
}

template <int n>
bool dfs(int u, vector<int> (&graph)[n], bool (&visited)[n]){
    visited[u] = true;
    ranges[u] = std::make_tuple(-INF, INF);
    
    for(int v : graph[u]){
        if(!visited[v]){
            if(!dfs(v, graph, visited)){return false;}
            P r = ranges[v];
            --fst(r); ++snd(r);
            if(snd(r) < fst(ranges[u]) || snd(ranges[u]) < fst(r)){return false;}
            fst(ranges[u]) = max(fst(ranges[u]), fst(r));
            snd(ranges[u]) = min(snd(ranges[u]), snd(r));
        }
    }

    if(values[u] != -1){
        if(!isIn(values[u], ranges[u])){return false;}
        ranges[u] = std::make_tuple(values[u], values[u]);
    }
    
    return true;
}

template <int n>
bool dfs2(int u, int value, vector<int> (&graph)[n], bool (&visited)[n]){
    visited[u] = true;
    
    for(int v : graph[u]){
        if(!visited[v]){
            int v_value = INF;
            if(isIn(value - 1, ranges[v])){
                v_value = value - 1;
            }
            if(isIn(value + 1, ranges[v])){
                v_value = value + 1;
            }

            if(v_value == INF){return false;}
            values[v] = v_value;
            if(!dfs2(v, v_value, graph, visited)){return false;}
        }
    }

    return true;
}

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

    memset(values, -1, sizeof(values));

    std::cin >> N;
    
    for(int i=0;i<N-1;++i){
        int u, v;
        std::cin >> u >> v;
        --u; --v;

        graph[u].emplace_back(v);
        graph[v].emplace_back(u);
    }

    std::cin >> K;

    for(int i=0;i<K;++i){
        int u, v;
        std::cin >> u >> v;
        --u;

        values[u] = v;
        // std::cout << u << " = " << v << std::endl;
        root = u;
    }

    memset(visited, 0, sizeof(visited));
    if(!dfs(root, graph, visited)){
        std::cout << "No" << std::endl;
        return 0;
    }

    // if(values[root] < fst(ranges[root]) || snd(ranges[root]) < values[root]){
    //     std::cout << "No" << std::endl;
    //     return 0;
    // }

    memset(visited, 0, sizeof(visited));
    if(!dfs2(root, values[root], graph, visited)){
        std::cout << "No" << std::endl;
        return 0;
    }

    std::cout << "Yes" << std::endl;
    for(int i=0;i<N;++i){
        std::cout << values[i] << std::endl;
    }
}


Measured memory_bytes: 15488
#include <iostream>
#include <cmath>
#include <vector>

using namespace std;
const long long MOD = 1e9+7;


bool isPrime(long long n){
    for(long long i = 2; i <= sqrt(n); i++){
        if(n % i == 0){
            return false;
        }
    }

    return true;
}


int main(){
    long long N;
    cin >> N;
    vector<long long> cnt_p;
    long long v;
    long long n;
    for(long long i = 2; i <= N; i++){
        if(isPrime(i)){
            v = 0;
            for(long long j = 2; j <= N; j++){
                n = j;
                while(n % i == 0){
                    n /= i;
                    v++;
                }
            }
            cnt_p.push_back(v);
        }
    }

    
    long long ans = 1;
    for(auto p : cnt_p){
        ans *= (p+1)%MOD;
        ans %= MOD;
    }

    cout << ans << endl;


    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

int main()
{
  int h,w,i,j,hw,ij,mini,minj;

  while(1){
    scanf("%d%d",&h,&w);
    if(h==0 &&w==0)break;

    hw=h*h+w*w;
    mini=150;
    minj=150;
    for(i=1;i<150;i++){
      for(j=i+1;j<150;j++){
	ij=i*i+j*j;
        if((hw<ij||((ij==hw) &&h<i)) && mini*mini+minj*minj>ij){
          mini=i;
          minj=j;
	  // printf("%d %d\n",mini,minj);
	}
      }
    }
    printf("%d %d\n",mini,minj);
  }
  return 0;
}



Measured memory_bytes: 2044
#include <iostream>

using namespace std;

int main()
{
    int n,m,a=0,b=100001;
    cin >> n >> m;
    int l[m],r[m];
    for(int i=0;i<m;i++){
        cin >> l[i] >> r[i];
        a=max(a,l[i]);
        b=min(b,r[i]);
    }
    if(b-a+1<=0) cout << 0 << endl;
    else cout << b-a+1 << endl;
    return 0;
}


Measured memory_bytes: 1024
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<string>
#include<cstring>
#include<cmath>
#include<vector>
#include<map>
#include<stack>
#include<set>
#include<cstdlib>
#include<deque>
#include<queue>
#include<bitset>
#include<functional>
#include<utility>
#include<list>
#include<iomanip>
#include<ctime>
#include<cassert>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
using namespace std;
const int INF=1e9+1;
vector<int > v[200005];
bool q,vis[200005];
int n,m;
void dfs(int x,int d)
{
	vis[x]=1;
	if(d==2)
	{
		if(x==n) q=1;
		return;
	}
	for(int i=0;i<v[x].size();i++)
	{
		if(!vis[v[x][i]]) dfs(v[x][i],d+1);
	}
}
int main()
{
	cin>>n>>m;
	for(int i=0;i<m;i++)
	{
		int x,y;
		cin>>x>>y;
		v[x].push_back(y);
		v[y].push_back(x);
	}
	dfs(1,0);
	if(q==1) cout<<"POSSIBLE";
	else cout<<"IMPOSSIBLE";
	return 0;
}


Measured memory_bytes: 12144
#include <vector>
#include <iostream>
#include <cmath>
#include <map>
#include <algorithm>
#include <fstream>
#include <unistd.h>
#include <string>
#include <numeric>
#include <queue>
#include <deque>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
typedef vector<string> vs;
typedef vector<vector<string>> vvs;
typedef vector<char> vc;
typedef vector<vector<char>> vvc;
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
typedef vector<P> vp;
typedef vector<PL> vpl;
typedef vector<vector<P>> vvp;
const int INF = 1001001001;
const ll LINF = 1e18;
const string endstr = "\n";
#define FOR(i, a, b) for(ll i = (a); i < b; i++)
#define REP(i, n) for(ll i = 0; i < n; i++)

template <typename T>
T gcd(T a, T b) {
    return (a == 0) ? b : gcd(b%a, a);
}
template <typename T>
T lcm(T a, T b) {
    return a / gcd(a, b) * b;
}

bool p_comp_fs(const P p1, const P p2){ return p1.first < p2.first;};
bool p_comp_fg(const P p1, const P p2){ return p1.first > p2.first;};
bool p_comp_ss(const P p1, const P p2){ return p1.second < p2.second;};
bool p_comp_sg(const P p1, const P p2){ return p1.second > p2.second;};
template <typename T>
vector<T> uniquen(vector<T> vec){
    vec.erase(unique(vec.begin(), vec.end()), vec.end());
    return vec;
}


int main(){
    ll N, K; cin >> N >> K;
    map<ll, ll> m;
    REP(i, N){
        ll a, b; cin >> a >> b; m[a] += b;
    }
    
    ll c = 0; ll ret = 0;
    for (auto it = m.begin(); it != m.end(); it++) {
        c += it->second;
        if(c >= K){
            ret = it->first; break;
        }
    }
    cout << ret << endstr;
    return 0;
}


Measured memory_bytes: 4224
// IDE used VSCode with gcc plug-in
/*
Event: Codeforces Global Round 7
Author: miitbh1
*/
#include <map>
#include <set>
#include <cmath>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <cstdio>
#include <cstring>
#include <cassert>
#include <cstdlib>
#include <climits>
#include <iomanip>
#include <iostream>
#include <algorithm>


#define rep(i, n) for(int i=0; i<n; i++)
#define repA(i, a, n) for(int i=a; i<n; i++)
#define repD(i, a, n) for(int i=a; i>=n; i--)
#define trav(it, ctr) for(auto it=ctr.begin(); it!=ctr.end(); it++)
#define p(x) cout<<x<<"\n"
#define FIO ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pp(x, y) cout<<x<<" "<<y<<"\n"
#define btc __builtin_popcount
#define all(x) x.begin(), x.end()
#define pb push_back
#define mp make_pair
#define X first
#define Y second
 
using namespace std;
 
typedef priority_queue<int> pq;
typedef pair<int, int> ii;
typedef map<int, int> mii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef long double ld;
using ll=long long int;
int N=100001, M=1e9+7;

int32_t main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll n, y, x, ans=0;
    cin>>n;
    ll a[n];
    map<ll, ll>freq;
    rep(i, n){
    	cin>>a[i];
        freq[a[i]]++;
    }
    for(auto e:freq){
        x=e.second;
    	x*=x-1;
    	x/=2;
    	ans+=x;
    }
    rep(i, n){
    	x=freq[a[i]]-1;
    	x*=x-1;
    	x/=2;
    	y=freq[a[i]];
    	y*=y-1;
    	y/=2;
    	y=ans-y+0ll;
        x+=y;
    	p(x);
    }
    return 0;
}

Measured memory_bytes: 11264
#include<iostream>
using namespace std;
main(){
  int n,k;
  cin>>n>>k;
  k-=n-1+(n-2)*(n-1)/2;
  if(1<n+k){cout<<-1;return 0;}
  cout<<-k<<"\n";
  for(int i=1;i<n&&k;++i)for(int j=i+1;j<=n&&k;++j)cout<<i<<" "<<j<<"\n",k++;
}

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

int main() {
  int n;
  cin >> n;
  int a[n];
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int k = 1;
  for (int i = 0; i < n; i++) {
    if (a[i] == k) k++;
  }
  if (k == 1) cout << -1 << endl;
  else cout << n - k + 1 << endl;
}

Measured memory_bytes: 1024
#!/usr/bin/ruby
# -*- coding: utf-8 -*-
=begin
ITP1_9-C

String - Card Game
Time Limit : 1 sec, Memory Limit : 65536 KB
??????????????????

????????¨??±?????????????????????????????????????????????????????????n???????????????????????£????????????n????????????????????????????????????????????§?????????????????????????????????????????????????????????????????¢????????????????????????????????????????????????????????????????????????????????§??§?????????????????????????????????????????¨????????????????????????????????????????????????????????´?????????????????????????????????????????????????????????

????????¨??±???????????????????????????????????±???????????????????????????????????????????????????????????????????????????????????°????????????????????????
Constraints

    ??\?????§?????????????????????1000????¶????????????¨????????????
    ????????????????????????????????????100??\?????§???????????¢??????????????????????°?????????????????????????

Input

??????????????????????????°?????????????????????????¶????n??????????????????????????????????????±??????????????????????????????????????????????????????????????????????????????????????????????????????????????????????????±???????????????????????????????????????????????§?????????
Output

??????????????°??????????????????????????????????????°????????±??????????????¨?????????????????????????????????????????°?????????????????????????????????????????????
Sample Input

3
cat dog
fish fish
lion tiger

Sample Output

1 7

=end

def shuffle(str, hl)
  if hl == [] then
    str
  else
    h = hl.shift
    len=str.length
    t = str.slice(h..(len-1)) + str.slice(0..(h-1))
    shuffle(t, hl)
  end
end

class Main
  def initialize()
    #fh = open("IPT1_9_C.txt")
    fh = STDIN
    p_taro=0
    p_hanako=0
    n = fh.gets.chomp.to_i
    (1..n).each {|x|
      fl = fh.gets.chomp.split
      s_taro   = fl[0]
      s_hanako = fl[1]
       if s_taro > s_hanako then
         p_taro += 3
       elsif s_taro == s_hanako then
          p_taro += 1
          p_hanako += 1
       else
          p_hanako += 3
       end
    }
    puts p_taro.to_s + " " + p_hanako.to_s
  end
end

if $0 == __FILE__ then
  Main.new
end

Measured memory_bytes: 8640