akhauriyash/Code-Regression huggingface dataset:
//  cout << char(i+48) << endl;//なぜかaは47と得る時がある。+48で出力もaにできる。
//  cout << char(97) << endl;//アスキーコードでaを出力
// sort(b.begin(), b.end());//bという配列を小さい方からソート
// reverse(b.begin(), b.end());//bという配列をリターン
// 10桁でdouble出力するパターン１ 
// printf("%.10f\n", ma);
// 10桁でdouble出力するパターン２
//cout << fixed << setprecision(10);
//  cout << ma << endl;

/*01 02 03 12 13 23　と６回見ていくパターン 
for(int i=0;i<n-1;i++){
  for(int j=i+1;j<n;j++){
    }
  }
*///vector<vector<int>> data(3, vector<int>(4));//int型の2次元配列(3×4要素の)の宣言
//int64_t a;
//10のi乗pow(10, i);
/*string s; stringでの文字列を数字型に変える方法
  cin >> s;
  rep(i,s.size()-2) {
  int a= (s.at(i)-'0')*100 + (s.at(i+1)-'0')*10+ s.at(i+2) -'0';
    */
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
  int n ;
  cin >> n ;
  vector<ll>a(n);
  rep(i,n) cin >> a.at(i);
  vector<ll>b(n);
  rep(i,n) b.at(i) = a.at(i);
  ll cntA = 0;
  ll cntB = 0;
  ll wa =0;
  ll wa2 = 0;
  //Apattern
  for(int i=0;i<n;i++){
    wa += a.at(i);
    if(i%2 == 0){
      if(wa <= 0){
        cntA += abs(1 - wa);
        wa = 1;
      }
    }
    else if(i%2!=0){
      if(wa >=0){
        cntA +=abs(-1 -wa);
        wa = -1;
      }
    }
  }
  wa = 0;
  //Bpattern
    for(int i=0;i<n;i++){
    wa += a.at(i);
//      cout << wa << endl;
    if(i%2 != 0){
      if(wa <= 0){
        cntB += abs(1 - wa);
        wa = 1;
      }
    }
    else if(i%2==0){
      if(wa >=0){
        cntB +=abs(-1 -wa);
        wa = -1;
      }
    }
    }
  if(cntA < cntB) cout << cntA << endl;
  else cout << cntB << endl;
//  cout << cntA << endl;
//  cout << cntB << endl;
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define ins insert
#define vi vector<int>
const int mxN=2e5;

int main()
{
    int k,x;
    cin >> k >> x;
    if(k*500>=x)
        cout << "Yes";
    else
        cout << "No";
}

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

#define rep(i, n) for(int i = 0; i < (int)n; i++)
#define rep2(i, m, n) for(int i = (int)m; i < (int)n; i++)
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<vi> vii; //2次元配列
typedef vector<ll> vll;
typedef vector<string> vs;

/*FUNCs=================================================*/



/*MAIN==================================================*/
int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);   //cin cout 高速化

    string s;
    cin >> s;
    rep(i, 5) cout << s[i];
    cout << " ";
    rep2(i, 6, 13) cout << s[i];
    cout << " ";
    rep2(i, 14, 19) cout << s[i];
    
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define MAX 100001
#define MOD 1000000007
#define ll long long
#define ld long double
#define fast ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
int main() {
	fast;
	int t = 1;
	// cin >> t;
	while (t--) {
		int n;
        cin >> n;
        cout << 1 - n << endl;
	}
}


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

using namespace std;

using int64 = long long;
const int mod = 1e9 + 7;
// const int mod = 998244353;

const int64 infll = (1LL << 62) - 1;
const int inf = (1 << 30) - 1;

struct IoSetup {
  IoSetup() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    cerr << fixed << setprecision(10);
  }
} iosetup;

template< typename T1, typename T2 >
ostream &operator<<(ostream &os, const pair< T1, T2 > &p) {
  os << p.first << " " << p.second;
  return os;
}

template< typename T1, typename T2 >
istream &operator>>(istream &is, pair< T1, T2 > &p) {
  is >> p.first >> p.second;
  return is;
}

template< typename T >
ostream &operator<<(ostream &os, const vector< T > &v) {
  for(int i = 0; i < (int) v.size(); i++) {
    os << v[i] << (i + 1 != v.size() ? " " : "");
  }
  return os;
}

template< typename T >
istream &operator>>(istream &is, vector< T > &v) {
  for(T &in : v) is >> in;
  return is;
}

template< typename T1, typename T2 >
inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }

template< typename T1, typename T2 >
inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }

template< typename T = int64 >
vector< T > make_v(size_t a) {
  return vector< T >(a);
}

template< typename T, typename... Ts >
auto make_v(size_t a, Ts... ts) {
  return vector< decltype(make_v< T >(ts...)) >(a, make_v< T >(ts...));
}

template< typename T, typename V >
typename enable_if< is_class< T >::value == 0 >::type fill_v(T &t, const V &v) {
  t = v;
}

template< typename T, typename V >
typename enable_if< is_class< T >::value != 0 >::type fill_v(T &t, const V &v) {
  for(auto &e : t) fill_v(e, v);
}

template< typename F >
struct FixPoint : F {
  FixPoint(F &&f) : F(forward< F >(f)) {}

  template< typename... Args >
  decltype(auto) operator()(Args &&... args) const {
    return F::operator()(*this, forward< Args >(args)...);
  }
};

template< typename F >
inline decltype(auto) MFP(F &&f) {
  return FixPoint< F >{forward< F >(f)};
}

int main() {
  int R;
  cin >> R;
  cout << R * 2 * acos(-1) << endl;
}


Measured memory_bytes: 3800
// Package main provides
//
// File:  c.go
// Author: ymiyamoto
//
// Created on Tue Dec 25 00:43:02 2018
//
package main

import (
	"fmt"
)

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func main() {
	var N int
	fmt.Scan(&N)
	dp := make([]int, 1e5+1)

	for i := range dp {
		dp[i] = i
	}

	for i := range dp {
		for j := 6; j <= 1e5+0; j *= 6 {
			if i+j <= 1e5 {
				dp[i+j] = min(dp[i+j], dp[i]+1)
			}
		}

		for j := 9; j <= 1e5+0; j *= 9 {
			if i+j <= 1e5 {
				dp[i+j] = min(dp[i+j], dp[i]+1)
			}
		}
	}

	fmt.Println(dp[N])
}


Measured memory_bytes: 1280
import java.io.*;
import java.util.StringTokenizer;

public class Main {

    private static FastReader in = new FastReader(System.in);
    private static PrintWriter out = new PrintWriter(System.out);

    private static final long MOD = (long) 1e9 + 7;

    public static void main(String[] args) {
        solve();
        out.flush();
    }

    private static void solve() {
        String s = in.next();
        char[] ch = s.toCharArray();
        char first = ch[0];
        for (char c : ch) {
            if (first != c) {
                out.println("Yes");
                return;
            }
        }
        out.println("No");
    }

    // https://www.geeksforgeeks.org/fast-io-in-java-in-competitive-programming/
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        FastReader(InputStream inputStream) {
            br = new BufferedReader(new
                    InputStreamReader(inputStream));
        }

        String next() {
            while (st == null || !st.hasMoreElements()) {
                try {
                    st = new StringTokenizer(br.readLine());
                } catch (IOException  e) {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

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

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

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

        // https://qiita.com/masakinpo/items/5f77f2a879578a85a0bb
        public int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        public long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    }
}


Measured memory_bytes: 22996
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int n, num = 1000;

    cin >> n;

    if(n%1000 == 0)
    {
        cout << "0";
    }

    else
    {
        while(1)
        {
            if(num>n)
            {
                int rem = num - n;
                cout << rem;
                break;
            }

            else
            {
                num = num + 1000;
            }
        }
    }
}





















Measured memory_bytes: 3616
#include<iostream>
using namespace std;
int n,s=0;
char str[200005];
int main(){
	cin>>n>>(str+1);
	//for(int i=1;i<=n;i++)s[i]=s[i-1]+(str[i]=='W');
	for(int i=1,j=n;i<j;i++,j--){
		while(str[i]=='R'&&i<j)i++;
		while(str[j]=='W'&&i<j)j--;
		if(i<j)s++;
	}
	cout<<s;
    return 0;
}


Measured memory_bytes: 3820
/*
    It’s Always Darkest Before the Dawn
                This Time is that Darkness in you Life
                                                            */
 
#include<bits/stdc++.h>
using namespace std;
 
#define ll long long 
#define pb push_back  
#define F first
#define S second
#define pii pair<int,int>
#define all(a) a.begin(),a.end()
 
const ll mod=1e9+7,di=998244353,N=3e5+1;
 
bool IsQuery=false; 
ll q=1,a[N];
 
map<int,vector<int>> edge;
map<int,bool> occ;
 
int dx[] = {1, -1, 0, 0};
int dy[] = {0, 0, 1, -1};
 
void solve(){
 	
  	ll n,k;
  	cin>>n>>k;
  
  	for(int i=0;i<n;i++)
      cin>>a[i];
  	
    ll dp[n];
  	
  	memset(dp,-1,sizeof(dp));
  	
  	dp[0]=0;
  
  	for(int i=0;i<n;i++){
      
    	for(int j=1;j<=k && i+j<n;j++){
          
          if(dp[i+j]==-1)
            dp[i+j]=dp[i]+abs(a[i+j]-a[i]);
          
          dp[i+j]=min(dp[i+j],dp[i]+abs(a[i+j]-a[i]));
        }
    }
                    
     	cout<<dp[n-1];
    return;   
} 
int main(){
    
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    
    if(IsQuery)
    cin>>q;
 
    for(int i=0;i<q;i++){
        solve();
        cout<<"\n";
    }
    return 0;
}


Measured memory_bytes: 5212
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
bool sort_by_diff(int a, int b) {
  if (a % 10 == 0) {
    return true;
  }
  if (b % 10 == 0) {
    return true;
  }
  return 10 - a % 10 < 10 - b % 10;
}
int main()
{
  vector<int> vec(5);
  REP(i, 5) {
    cin >> vec[i];
  }
  sort(vec.begin(), vec.end(), sort_by_diff);
  int ans = 0;
  REP(i, 4) {
    if (vec[i] % 10 == 0)  {
      ans += vec[i];
    } else {
      ans += vec[i] + (10 - (vec[i] % 10));
    }
  }
  ans += vec[4];
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
using System;

namespace ConsoleApplication36
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            string[] ss = s.Split(' ');
            int a = int.Parse(ss[0]);
            int b = int.Parse(ss[1]);
            int d = a / b;
            int r = a % b;
            double f = (double)a / b;
            Console.WriteLine("{0} {1} {2:f5}", d, r, f);
        }
    }
}

Measured memory_bytes: 9096
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

k, n, *a = map(int, read().split())
a = sorted(a)
d = [a[0]+k-a[-1]]
for i in range(n-1):
    d.append(a[i+1]-a[i])
print(sum(d)-max(d))

Measured memory_bytes: 20348
#include <bits/stdc++.h>
#define REP(i, n) for (int (i) = 0; (i) < (int)(n); i++) 
#define FOR(i, a, b) for(int (i) = a; (i) < (int)b; i++)
#define RREP(i, n) for(int (i)=((int)(n)-1); (i)>=0; i--)
#define RFOR(i, a, b) for(int (i) =((int)(b)-1); (i)>=(int)a; i--)
#define ALL(v) (v).begin(),(v).end()
#define MOD 1000000007
#define NIL -1
#define FI first
#define SE second
#define MP make_pair
#define PB push_back
#define SZ(x)  (int)x.size()
#define SP(x)  setprecision((int)x)


using namespace std ;
typedef long long ll;
typedef vector<int> vint;
typedef vector<vint> vvint;
typedef vector<string> vstr;
typedef pair<int, int> pii;
const int INF = 1e9;
const ll LINF = 1e18;
const double EPS = 1e-9;
ll gcd(ll a, ll b) {return b ? gcd(b, a % b) : a;} //最大公約数
ll lcm(ll a, ll b) {return a / gcd(a, b) * b;} //最小公倍数

//-------------------------------------------------
//
void yes(){
  cout <<"Yes"<<endl ;
}
void no(){
  cout <<"No"<<endl ;
}


//-------------------------------------------------
//




//-------------------------------------------------


int main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll a, b ;
  cin >> a >> b ;
  ll ans = lcm(a,b) ;
  cout << ans <<endl;
  
  
  
  return 0 ;
}

Measured memory_bytes: 256
// #define _CRT_SECURE_NO_WARNINGS
// #define _USE_MATH_DEFINES	// M_PI=3.1415...
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <cmath>
#include <cstdlib>
#include <functional>
#include <locale>
#include <cctype>
#include <sstream>
#include <iomanip>	// 20桁出力 cout << setprecision(20) << double;
#include <queue>
#include <bitset>	// bitset<8> bs1(131uL); // 10000011 bs1[0]は1 01stringからビット集合生成可
#include <numeric>
#include <random>
#include <climits>  // A/Bを計算するときA==LLONG_MIN && B==-1のみ(1ull<<63)で代用
using namespace std;

typedef long long LL;
typedef pair<LL, LL> P;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<LL> VL;
typedef vector<VL> VVL;				// VVL v(100,VL(100,0));
typedef vector<pair<LL, LL> > VP;
typedef vector<string> VS;
typedef map<int, int> MAPII;
typedef multimap<int, char, greater<int> > MuMAPIC;
typedef multimap<int, string, greater<int> > MuMIS;
typedef pair<LL, pair<P, P> > PP;

#define INF 999999999999999997		// 少し加算したらオーバーフローする
#define MP make_pair
#define FAST_IO  cin.tie(0); ios::sync_with_stdio(false);
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define FORL(i,a,b) for(LL i=(a);i<(b);i++)
#define FOR_REV(i,a,b) for(int i=(a);i>=(b);i--)
#define foreach_it(type,it,c) for(type::iterator it=c.begin(),c_end=c.end();it!=c_end;++it)
#define FOR_ITR(d) for(auto itr=d.begin(),d_end=d.end();itr!=d_end;++itr)	// C++11
#define O(s) cout<<s<<endl;

#define DUMP_VVI(b) if(dbgF){FOR(i,0,b.size()){FOR(j,0,b[i].size())printf("%d ",b[i][j]);puts("");}}
#define D_OUT(str,value) if(dbgF){cout<<str<<" : "<<value<<endl;}

template<class T>T IN() { T d; cin >> d; return d; }

LL gcd(LL a, LL b) { return (b > 0) ? gcd(b, a%b) : a; } // 最大公約数（Greatest Common Divisor）
LL lcm(LL a, LL b) { return a / gcd(a, b) * b; } // 最小公倍数（Least Common Multiple）
bool uruu(LL Y) { return (((Y % 4 == 0 && Y % 100 != 0) || Y % 400 == 0) ? true : false); } // うるう年判定
string Replace(string S, string from, string to) { auto p = S.find(from); while (p != string::npos) { S.replace(p, from.size(), to); p = S.find(from, p + to.size()); }return S; }

int dx[4] = { 0,1,0,-1 };
int dy[4] = { 1,0,-1,0 };
int dxx[8] = { 0,1,1,1,0,-1,-1,-1 };
int dyy[8] = { 1,1,0,-1,-1,-1,0,1 };

// -------------------------------------------------------------------------------

int main() {
	FAST_IO;
	bool dbgF = true; // for D_OUT(str, value)  ... cout<< str <<" : "<< value <<endl;

	LL A, B, C;
	cin >> A >> B >> C;

	VL ans = { A,B,C };
	sort(ans.begin(), ans.end());

	LL count = 0;
	count += ans[2] - ans[1];
	ans[1] = ans[2];
	ans[0] += count;

	if (ans[0] % 2 == ans[2] % 2) {
		count += (ans[2] - ans[0]) / 2;
	}
	else {
		count += ceil((ans[2] - ans[0]) / 2.0);
		count++;
	}
	O(count);

	return 0;
}

Measured memory_bytes: 256
import java.util.Random;
import java.util.Scanner;

public class Main{
    public static void main(final String[] args){
        Scanner scanner = new Scanner(System.in);
        int w = scanner.nextInt();
        int n = scanner.nextInt();
        int[] values = new int[w];
        for(int i = 0; i < w; i++){
            values[i] = i+1;
        }
        for(int i = 0; i < n; i++){
            String string = scanner.next();
            String[] ab = string.split(",");
            int a = Integer.parseInt(ab[0])-1;
            int b = Integer.parseInt(ab[1])-1;
            int temp = values[a];
            values[a] = values[b];
            values[b] = temp;
        }
        for(int i = 0; i < w; i++){
            System.out.println(values[i]);
        }
        scanner.close();
    }
     
    

}


Measured memory_bytes: 25784
#include<iostream>
#include<string>
using namespace std;
string s;
int M,len;
int dp[2][3][10][500][500];
int getans(string str);
string change(string str);
int bfs(bool flg,int pm,int num,int mod,int idx);
int main(){
	string a,b;
	cin >> a; cin >> b; cin >> M;
	//cout << getans(b) << endl;
	//cout << getans(change(a)) << endl;
	cout << (getans(b) - getans(change(a))+10000) % 10000 << endl;
}

string change(string str){
	int len = str.size();
	for(int i=len-1;i>=0;i--){
		if(str[i] == '0') str[i] = '9';
		else {
			str[i]--;
			break;
		}
	}
	return (str);
}

int getans(string str){
	s = str;
	len = s.size();
	for(int i=0;i<2;i++){
		for(int j=0;j<3;j++){
			for(int k=0;k<10;k++){
				for(int l=0;l<500;l++){
					for(int p=0;p<500;p++){
						dp[i][j][k][l][p] = -1;
					}
				}
			}
		}
	}
	return bfs(false,0,0,0,0);
}

int bfs(bool flg,int pm,int num,int mod,int idx){
	if(idx == len) return mod == 0;
	if(dp[flg][pm][num][mod][idx] != -1) return dp[flg][pm][num][mod][idx];
	int ret = 0,end;
	if(flg) end = 9;
	else end = s[idx] - '0';
	for(int i=0;i<=end;i++){
		if(pm == 1 && num <= i) continue;
		if(pm == 2 && num >= i) continue;

		if(pm == 0){
			if(num && num == i) continue;
			if(num == 0) ret += bfs(flg|(i!=end),0,i,(mod*10+i)%M,idx+1);
			else if(num < i) ret += bfs(flg|(i!=end),1,i,(mod*10+i)%M,idx+1);
			else if(num > i) ret += bfs(flg|(i!=end),2,i,(mod*10+i)%M,idx+1);
		}
		else if(pm == 1){
			ret += bfs(flg|(i!=end),2,i,(mod*10+i)%M,idx+1);
		}
		else if(pm == 2){
			ret += bfs(flg|(i!=end),1,i,(mod*10+i)%M,idx+1);
		}
	}
	return dp[flg][pm][num][mod][idx] = ret % 10000;
}

Measured memory_bytes: 59868
#include "bits/stdc++.h"
#include "math.h"
 
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<int> vin;
typedef pair<ll,ll> P;
typedef vector<P> vp;
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define drep(i,a,b) for(ll i=(a);i>=(b);--i)
#define SIZE(a) ll((a).size())
#define out(a) cout<<(a)<<endl;
const int inf=INT_MAX;
const int MAX = 510000;
const ll MOD = 998244353;

int main(){
  ll n,m,x,ans=0;cin>>n>>x>>m;
  vll o(m,-1),v(0),syu(0);
  rep(i,0,n){
    if(o[x]!=-1){
      rep(j,o[x],i){syu.push_back(v[j]);}
      break;
    }
    o[x]=i;
    v.push_back(x);
    ans+=x;
    x=(x*x)%m;
  }
  n-=v.size();
  if(n==0){out(ans);return 0;}
  ll a=n%syu.size(),b=n/syu.size(),cnt=0;
  rep(i,0,syu.size()){
    cnt+=syu[i];
  }
  ans+=cnt*b;
  rep(i,0,a){ans+=syu[i];}
  out(ans);
}







Measured memory_bytes: 5032
import java.util.*;
public class Main {
	static Scanner sc = new Scanner(System.in);
	static int W, H;
	static char[][] field;
	static int[] dx = {-1, 0, 1, 0}, dy = {0, 1, 0, -1};
	public static void main(String[] args) {
		while(read()){
			solve();
		}
	}
	
	static boolean read(){
		W = sc.nextInt();
		H = sc.nextInt();
		if(W == 0 && H == 0)return false;
		
		field = new char[H][W];
		
		for(int i = 0; i < field.length; i++){
			field[i] = sc.next().toCharArray();
		}
		
		return true;
	}
	
	static void solve(){
		int res = 0;
		for(int i = 0; i < field.length; i++){
			for(int j = 0; j < field[0].length; j++){
				if(field[i][j] == '@')dfs(j, i);
			}
		}
		for(int i = 0; i < field.length; i++){
			for(int j = 0; j < field[0].length; j++){
				if(field[i][j] == '*')res++;
			}
		}
		System.out.println(res);
	}
	
	static void dfs(int x, int y){
		field[y][x] = '*';
		for(int i = 0; i < 4; i++){
			int nx = x + dx[i], ny = y + dy[i];
			if(0 <= nx && nx < W && 0 <= ny && ny < H && field[ny][nx] == '.'){
				dfs(nx, ny);
			}
		}
	}

}

Measured memory_bytes: 12000
#include<cstdio>
#include<vector>
#include<algorithm>
#include<utility>
#include<numeric>
#define _USE_MATH_DEFINES

#include<math.h>

#define min(a,b) (a)>(b)?(b):(a)
#define max(a,b) (a)>(b)?(a):(b)

using namespace std;

int main()
{
	int n;
	vector<int> a, b;
	
	while (true)
	{
		int ta, tb;
		scanf("%d %d", &ta, &tb);

		if (ta == 0 && tb == 0)
		{
			break;
		}
		else
		{
			a.push_back(ta);
			b.push_back(tb);
		}
	}

	for (int i = 0; i != a.size(); i++)
	{
		for (int j = 0; j < a[i]; j++)
		{
			for (int k = 0; k < b[i]; k++)
			{
				printf("#");
			}
			printf("\n");
		}
		printf("\n");
	}

	return 0;
}

Measured memory_bytes: 2648
n = int(input())
b = []
b_i = [0 for i in range(110)]
for i in range(n):
    s = input()
    if not s in b:
        b.append(s)
        b_i[b.index(s)] += 1
    else:
        b_i[b.index(s)] += 1 
m = int(input())
for i in range(m):
    t = input()
    if not t in b:
        b.append(t)
        b_i[b.index(t)] += 1
    else:
        b_i[b.index(t)] -= 1 
print(max(b_i))


Measured memory_bytes: 3064
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys

X = int(input())
if X < 600:
    print(8)
elif X < 800:
    print(7)
elif X < 1000:
    print(6)
elif X < 1200:
    print(5)
elif X < 1400:
    print(4)
elif X < 1600:
    print(3)
elif X < 1800:
    print(2)
else:
    print(1)



Measured memory_bytes: 10840
import math


def distance(X, Y):
    d = 0
    for x, y in zip(X, Y):
        d += (x - y)**2
    return math.sqrt(d)


str = input()

N, D = map(int, str.split(" "))

X = []
for i in range(N):
    x = input()
    x = x.split(" ")
    x = map(int, x)
    X.append(x)

X = list(map(list, X))

count = 0
for i in range(N):
    for j in range(i + 1, N):
        d = distance(X[i], X[j])
        if d.is_integer():
            count += 1

print(count)


Measured memory_bytes: 3064
n=int(input())
l=[0]*(n+1)
for i in range(2,n+1):
    cur = i
    for j in range(2,i+1):
        while cur%j==0:
            l[j]+=1
            cur//=j


def num(m):
    #lのvalueがm-1以上のものを返す
    return len(list(filter(lambda x:x>=m-1, l)))


print(num(75) + num(25)*(num(3)-1) + num(15)*(num(5)-1)
 + num(5)*(num(5)-1)*(num(3)-2)//2#num(5)の入れ替えに関して2!で割る
 )

Measured memory_bytes: 3064
def calc(a, op, b):
    if op == "+":
        return a + b
    elif op == "-":
        return a - b
    elif op == "*":
        return a * b
    else:
        return a // b

while True:
    str_list = input().split()
    a = int(str_list[0])
    op = str_list[1] 
    b = int(str_list[2])

    if op == "?":
        break

    print(calc(a, op, b))

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

#define db(x) cerr << #x << " == " << x << endl
#define all(container) container.begin(), container.end()
#define mp(i,j) make_pair(i,j)
#define pb push_back

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

template<typename T>
void print_vector_debug(const T& t) {
	cout << "[DEBUG] VECTOR:";
	for (auto i = t.cbegin(); i != t.cend(); ++i) {
		if ((i + 1) != t.cend()) {
			cout << *i << " ";
		} else {
			cout << *i << endl;
		}
	}
}

#define MAXN 3005

string s, t;
int vis[MAXN][MAXN], dp[MAXN][MAXN];
int dpr[MAXN][MAXN];

int solve(int is, int it)
{
	if (is >= (int)s.size() || it >= (int)t.size())
	{
		return 0;
	}
	
	if (vis[is][it])
	{
		return dp[is][it];
	}
	vis[is][it] = 1;
	
	int res = 0;
	if (s[is] == t[it])
	{
		res = solve(is + 1, it + 1) + 1;
		dpr[is][it] = 3;
	}
	else
	{
		int left = solve(is + 1, it) ;
		int right = solve(is, it + 1);
		
		if (left > right)
		{
			res = left;
			dpr[is][it] = 1;
		}
		else
		{
			res = right;
			dpr[is][it] = 2;
		}
	}
	
	dp[is][it] = res;
	return res;
	
}

int main() 
{
	cin >> s >> t;
	
	solve(0, 0);
	
	int is = 0, it = 0;
	
	while (is < (int)s.size() && it < (int)t.size())
	{
		if (s[is] == t[it])
		{
			cout << s[is];
			++it;
			++is;
		}
		else if (dpr[is][it] == 1)
		{
			++is;
		}
		else
		{
			++it;
		}
	}
	cout << endl;
	return 0;
}


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

int main() {
  int a, b, c;
  cin >> a >> b >> c;

  int ans = abs(a - b) + abs(a - c) + abs(b - c) -
            max(abs(a - b), max(abs(a - c), abs(b - c)));
  cout << ans;
}

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

  int i = 0;
  //入力を受け取る
  string M;
  cin >> M;
  
  if(M[0] =='1') {
    i++;
  }
  if(M[1] =='1') {
    i++;
  }
  if(M[2] =='1') {
    i++;
  }
  
  cout << i;
}

Measured memory_bytes: 3624
#include<algorithm>
#include<cstdio>
#include<queue>
#include<vector>

using namespace std;
typedef pair<int, int> P;

int n, m;
vector<P> sal;
priority_queue<int> unchi;

bool cmp(const P&, const P&);

int main() {
    scanf("%d %d", &n, &m);
    for (int i = 0; i < n; i++) {
        int a, b;
        scanf("%d %d", &a, &b);
        sal.push_back(P(a, b));
    }

    sort(sal.begin(), sal.end(), cmp);
    int ans = 0;
    for (int i = 1; i <= m; i++) {
        while (!sal.empty() && sal.back().first == i) {
            unchi.push(sal.back().second);
            sal.pop_back();
        }
        
        if (!unchi.empty()) {
            ans += unchi.top();
            unchi.pop();
        }
    }
    printf("%d\n", ans);
    return 0;
}


bool cmp(const P &a, const P &b) {
    if (a.first > b.first) return true;
    else return false;
}


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

using namespace std;

int n;
char info[111][222];
map<string, int> idx;
vector<string> ans;

void update(char data[222])
{
  char member[222], delim[11] = ".", newdata[222] = "";
  do{
    sscanf(data, "%[^,.]%[,.]%s", member, delim, data);
    string str = member;
    if(idx.count(str) != 0) update(info[idx[str]]);
    else ans.push_back(str);
  }while(delim[0] != '.');
  return;
}

int main()
{
  while(cin >> n, n){
    idx.clear();
    ans.clear();
    for(int i = 0; i < n; i++){     
      scanf("%s", info[i]);
      char group[111];
      sscanf(info[i], "%[^:]:%s", group, info[i]);
      string str = group;
      idx[str] = i;
      strcat(info[i], ".");
    }
    update(info[0]);
    sort(ans.begin(), ans.end());
    ans.erase(unique(ans.begin(), ans.end()), ans.end());
     cout << ans.size() << endl;
  }
  return 0;
}

Measured memory_bytes: 1384
/*	
*  Sachin Mittal
*/
#include<bits/stdc++.h>
#define int long long
#define M 998244353
#define mod 1000000007
#define all(v) v.begin(),v.end()
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define F first
#define S second
#define mem0(dp) memset(dp,0,sizeof(dp))
#define mem1(dp) memset(dp,-1,sizeof(dp))
#define pb push_back
#define fr(i,j,n) for(int i=j;i<n;i++)
#define sz(s) (int)(s.size())
using namespace std;
int32_t main(){
ios
int t=1;
//cin>>t;
while(t--)
{
	int n;cin>>n;
	if(n<10){cout<<n;return 0;}
	queue<int> q;
	for(int i=0;i<9;i++)q.push(i+1);
	int cnt=9;
	while(!q.empty())
	{
		int s=q.front();
		q.pop();
		if(s%10!=0 and cnt<n)
			q.push(s*10+s%10-1),cnt++;
		if(cnt<n)
			q.push(s*10+s%10),cnt++;
		if(s%10!=9 and cnt<n)
			q.push(s*10+s%10+1),cnt++;
		if(cnt==n)
		{
			cout<<q.back();
			break;
		}
	}
}
}

Measured memory_bytes: 768
#include <bits/stdc++.h>
using namespace std;
const int MOD = 1e5 + 7;

#include <math.h>
#define PI 3.14159265358979323846264338327950L


int main() {
    int n, k;
    cin >> n >> k;
    vector<vector<int>> snuke(n);
    for (int i = 0; i < k; i++) {
        int d;
        cin >> d;
        for (int j = 0; j < d; j++) {
            int x;
            cin >> x;
            x--;
            snuke[x].push_back(i);
        }
    }
    int cnt = 0;
    for (int i = 0; i < n; i++) {
        if (snuke[i].empty()) cnt++;
    }
    cout << cnt;
    return 0;
}

Measured memory_bytes: 3620
/*
    Author:zeke

    pass System Test!
    GET AC!!
*/
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
using ll = long long;
using ld = long double;
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()
#define rep3(var, min, max) for (ll(var) = (min); (var) < (max); ++(var))
#define repi3(var, min, max) for (ll(var) = (max)-1; (var) + 1 > (min); --(var))
#define Mp(a, b) make_pair((a), (b))
#define F first
#define S second
#define Icin(s) \
    ll(s);      \
    cin >> (s);
#define Scin(s) \
    ll(s);      \
    cin >> (s);
template <class T>
bool chmax(T& a, const T& b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
bool chmin(T& a, const T& b) {
    if (b < a) {
        a = b;
        return 1;
    }
    return 0;
}
typedef pair<ll, ll> P;
typedef vector<ll> V;
typedef vector<V> VV;
typedef vector<P> VP;
ll mod = 1e9 + 7;
ll MOD = 1e9 + 7;
ll INF = 1e18;
// cout << "Case #" << index << " :IMPOSSIBLE";
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);
    ld a,b;
    cin>>a>>b;
    ld k=a*b;
    cout<<(ll)k<<endl;
}


Measured memory_bytes: 3748
def combination x, y
  ans = 1
  x.downto (x-y+1) do |i|
    ans *= i
  end
  y.downto 1 do |i|
    ans /= i
  end
  ans
end

n, a, b = gets.split(" ").map{|v| v.to_i}
b = n if n < b
values = gets.split(" ").map{|v| v.to_i}

values = values.sort do |x1, x2|
  x2 <=> x1
end

sum = values[0...a].inject 0 do |tmp_sum, value|
  tmp_sum + value
end
puts sprintf("%.6f", sum.to_f / a)

num_of_min = 0
head_of_min = nil
values.each_with_index do |value, i|
  if value == values[a-1] then
    num_of_min += 1
    head_of_min = i if not head_of_min
  elsif value < values[a-1] then
    break
  end
end

if head_of_min != 0 then
  puts combination(num_of_min, a - head_of_min)
else
  ans = 0
  (a..((b < num_of_min) ? b : num_of_min)).each do |i|
    ans += combination(num_of_min, i)
  end
  puts ans
end


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

int top, S[1000];

void push(int x){
  /*top
   */
  S[++top]=x;
}

int pop(){
  top--;
  return S[top+1];
}

int main(){
  int a,b;
  top=0;
  char s[100];
  while(scanf("%s", s)!=EOF){
    if(s[0]=='+'){
      a=pop();
      b=pop();
      push(a+b);
    }
    else if(s[0]=='-'){
      b=pop();
      a=pop();
      push(a-b);
    }
    else if(s[0]=='*'){
      a=pop();
      b=pop();
      push(a*b);
    }
    else {
      push(atoi(s));
    }
  }
  printf("%d\n",pop());
  return 0;
}



Measured memory_bytes: 2144
n = int(input())
list_n = list((map(int, input().split())))

def selectionSort(list_a, n):
    count = 0
    for i in range(0, n):
        minj = i
        for j in range(i, n):
            if list_a[j] < list_a[minj]:
                minj = j
        (list_a[i], list_a[minj]) = (list_a[minj], list_a[i])
        if minj != i:
            count += 1
    return list_a,count

list_n, count = selectionSort(list_n, n)
print(" ".join(str(number) for number in list_n))
print(count)



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

using VS = vector<string>;    using LL = long long;
using VI = vector<int>;       using VVI = vector<VI>;
using PII = pair<int, int>;   using PLL = pair<LL, LL>;
using VL = vector<LL>;        using VVL = vector<VL>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
//#pragma GCC optimize ("-O3") 
#ifdef YANG33
#include "mydebug.hpp"
#else
#define DD(x) 
#endif
const int INF = 1e9;                          const LL LINF = 1e16;
const LL MOD = 1000000007;                    const double PI = acos(-1.0);
int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };

/* -----  2019/03/16  Problem: ABC 076 B / Link: http://abc076.contest.atcoder.jp/tasks/abc076_b  ----- */


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

	LL N, K; cin >> N >> K;

	LL ans = LINF;

	FOR(st, 0, 1 << N) {
		LL a = 1;

		FOR(i, 0, N) {
			if (st & 1 << i) {
				a *= 2;
			}
			else {
				a += K;
			}
		}

		ans = min(ans, a);
	}
	
	
	cout << (ans) << "\n";

	return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int tate = scan.nextInt();
		int yoko = scan.nextInt();
		int menseki = tate * yoko;
		int syu = 2*tate + 2*yoko;
		System.out.println(menseki + " " +syu);
	}
}

Measured memory_bytes: 25816
use std::io;
use std::process::exit;
use std::cmp::min;


fn read() -> (i64, i64, i64) {
    let mut buffer: String = String::new();
    if let Err(_) = io::stdin().read_line(&mut buffer) {
        exit(1)
    }

    let mut iter = buffer.split_whitespace();
    let p: i64 = iter.next().unwrap().parse().unwrap();
    let q: i64 = iter.next().unwrap().parse().unwrap();
    let r: i64 = iter.next().unwrap().parse().unwrap();

    (p, q, r)
}


fn main() {
    let (p, q, r) = read();

    println!("{}", min(p + q, min(q + r, r + p)))
}

Measured memory_bytes: 4352
#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++)
typedef long long ll;
 
int main() {
    int n;
  cin >> n;
    vector<ll> a(n);
    ll l1=0,l2=0;
    int c1=0,c2=0;
    rep(i,n)
    {
        cin >> a[i];
    }
    sort(a.begin(),a.end());
    reverse(a.begin(),a.end());
    rep(i,n)
    {
        if(a[i]==a[i+1] && l1==0){
            l1=a[i];
            i++;
        }
        else if(a[i]==a[i+1] && l1!=0){
            l2=a[i];
            break;
        }
    }
    cout << l1*l2 << endl;
}

Measured memory_bytes: 1024
#include<iostream>
#include<map>

using namespace std;

map<string, int> mp;

int main(void)

{
    int n, i;
    cin>>n;
    for(i = 0; i < n; i++){
        string s;
        cin>>s;
        mp[s]++;
    }
    cout<<mp.size()<<endl;
    return 0;
}

Measured memory_bytes: 18712
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <math.h>
int minimum(int a, int b) { return a < b ? a : b; }
int maximum(int a, int b) { return a > b ? a : b; }
const long long mod = 1000000007;
//const long long mod = 998244353;
int main() {
	long long H;
	scanf("%lld", &H);
	long long res = 0;
	for (int i = 0; i < 64; i++) {
		H /= 2;
		res |= (1LL << i);
		if (H == 0)break;
	}
	printf("%lld", res);
	return 0;
}

Measured memory_bytes: 128
S = raw_input()
length = 0
max_length = 0
for s in S:                                                                                                         
    if s == "A" or s == "C" or s == "G" or s == "T":
        length += 1
        if max_length < length:
            max_length = length
    else:
        length = 0
print max_length


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

using namespace std;

using ll = long long int;
using vi = vector<int>;
#define f(n) for(int i = 0; i < n; i++)
#define fj(n) for(int j = 0; j < n; j++)
#define fk(n) for(int k = 0; k < n; k++)
#define ci(n) cin >> n;
#define ic(n) int n; cin >> n;
#define lc(n) int n; cin >> n;
#define all(a) a.begin(), a.end()
#define pri(a, n) for(int i = 0; i < n; i++) cout << a[i] << " "; cout << "\n";
#define sc(a, n) int a[n] = {0}; for(int i = 0; i < n; i++) cin >> a[i];
#define scl(a, n) ll a[n] = {0}; for(int i = 0; i < n; i++) cin >> a[i];
#define pb push_back
#define eb emplace_back
#define int long long
const int inf = 1e9, maxn = 2e5, mod = 998244353;

struct Vector
{
    int x, y;
    Vector(int _x = 0, int _y = 0) : x(_x), y(_y) {}
};
int operator * (Vector a, Vector b)
{
    return a.x * b.x + a.y * b.y;
}
int operator % (Vector a, Vector b)
{
    return a.x * b.y - a.y * b.x;
}
Vector operator - (Vector a)
{
    return Vector(-a.x, -a.y);
}
bool operator == (Vector a, Vector b)
{
    return ((a * b) > 0) && ((a % b) == 0);
}
void solve(int ci)
{
     ic(h) ic(w) ic(k)
     char a[h][w];
     f(h) fj(w) cin >> a[i][j];
     int ans = 0;
     f(1ll << h)
     {
         fj(1ll << w)
         {
             int am = 0;
             for(int pi = 0; pi < h; pi++)
             {
                 for(int pj = 0; pj < w; pj++)
                 {
                     if((((i >> pi) & 1ll) | ((j >> pj) & 1ll)) == 0) am += (a[pi][pj] == '#');
                 }
             }
             ans += (am == k);
         }
     }
    cout << ans;

}
main()
{
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int t = 1;
    //cin >> t;
    f(t) solve(i + 1);
}


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

int main(void){
  int N;
  cin >> N;
  int h[N];
  for(int i=0; i<N; i++) cin >> h[i];
  int hh[N];
  hh[0]=h[0];
  for(int i=0; i<N-1; i++) hh[i+1] = max(hh[i], h[i+1]);
  int ans = 1;
  for(int i=1; i<N; i++) if(h[i]>=hh[i-1]) ans++;
  cout << ans << endl;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC087A
{
    class Program
    {
        static void Main(string[] args)
        {

            int x, a, b, c;
            x = int.Parse(Console.ReadLine());
            a = int.Parse(Console.ReadLine());
            b = int.Parse(Console.ReadLine());

            c = (x - a) % b;

            Console.WriteLine(c);

            Console.ReadKey();

        }
    }
}


Measured memory_bytes: 11092
function Main(input) {
    // 1行目がinput[0], 2行目がinput[1], …に入る
    tmp = input.split("\n");
    tmp = tmp.map(Number);
    sum = 0;
    c = 99;
    for(i = 0; i<tmp.length;i++){
        kurai = String(tmp[i]).substr(-1,1)
        if(Number(kurai) !== 0){
            c = Math.min(kurai, c);
        }
        sum += Math.ceil(tmp[i]/10)*10;
    }
    if(c!==99){
        sum = sum -10 + Number(c);    
    }
    
    console.log(sum);
    
    
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));




Measured memory_bytes: 7372
#include <bits/stdc++.h>
#define SZ(x) ((int)(x).size())
typedef long long ll;
using namespace std;

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); cout.setf(ios::fixed); cout.precision(20);
    int h, w; cin >> h >> w;
    vector<vector<char>> a(h, vector<char>(w));
    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            cin >> a[i][j];
        }
    }
    vector<vector<int>> left(h, vector<int>(w, -1));
    vector<vector<int>> right(h, vector<int>(w, -1));
    vector<vector<int>> up(h, vector<int>(w, -1));
    vector<vector<int>> down(h, vector<int>(w, -1));
    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            if (a[i][j] == '#') {
                int k = j + 1;
                while (k < w && a[i][k] == '.' && left[i][k] == -1) {
                    left[i][k] = j;
                    k++;
                }
                k = i + 1;
                while (k < h && a[k][j] == '.' && up[k][j] == -1) {
                    up[k][j] = i;
                    k++;
                }
                k = i - 1;
                while (k >= 0 && a[k][j] == '.' && down[k][j] == -1) {
                    down[k][j] = i;
                    k--;
                }
                k = j - 1;
                while (k >= 0 && a[i][k] == '.' && right[i][k] == -1) {
                    right[i][k] = j;
                    k--;
                }
            }
        }
    }
    int res = 0;
    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            if (a[i][j] == '#') {
                continue;
            }
            int tot = 0;
            if (right[i][j] == -1) {
                tot += w - j - 1;
            } else {
                tot += right[i][j] - j - 1;
            }
            if (left[i][j] == -1) {
                tot += j;
            } else {
                tot += j - left[i][j] - 1;
            }
            if (down[i][j] == -1) {
                tot += h - i - 1;
            } else {
                tot += down[i][j] - i - 1;
            }
            if (up[i][j] == -1) {
                tot += i;
            } else {
                tot += i - up[i][j] - 1;
            }
            res = max(res, tot + 1);
        }
    }
    cout << res << "\n";
}


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

#define FOR(i,a,b) for(int i=a;i<b;i++)
#define REP(i,b) FOR(i,0,b)
#define MP make_pair
#define PB push_back
#define REACH cerr<<"reached line "<<__LINE__<<endl
#define DBG(x) cerr<<"line "<<__LINE__<<" "<<#x<<":"<<x<<endl

using uint=unsigned int;
using ll=long long;
using pii=pair<int,int>;
using vi=vector<int>;
using ld=long double;

template<class T,class U>
ostream& operator<<(ostream& os,const pair<T,U>& p){
	os<<"("<<p.first<<","<<p.second<<")";
	return os;
}

template<class T>
ostream& operator <<(ostream& os,const vector<T>& v){
	os<<"[";
	REP(i,(int)v.size()){
		if(i)os<<",";
		os<<v[i];
	}
	os<<"]";
	return os;
}

int read(){
	int i;
	scanf("%d",&i);
	return i;
}

void Yes(){
	cout<<"Yes"<<endl;
	exit(0);
}

void No(){
	cout<<"No"<<endl;
	exit(0);
}

template<class T>
void chmax(T& a,T b){
	a=max(a,b);
}

template<class T>
void chmin(T& a,T b){
	a=min(a,b);
}

template<class T>
void ResetVector(vector<T>& v,int n,const T& t){
	v.clear();
	v.resize(n,t);
}

int main(){
	int n=read(),a=read(),b=read(),ans=0;
	REP(_,n){
		int t=read();
		if(t<a||b<=t)
			ans++;
	}
	cout<<ans<<endl;
}


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

int main() {
  uint32_t n_jobs, time_limit;
  std::cin >> n_jobs >> time_limit;
  std::vector<std::pair<uint32_t, uint32_t>> vec;
  vec.reserve(n_jobs);
  for (uint32_t i = 0; i < n_jobs; ++i) {
    uint32_t x, y;
    std::cin >> x >> y;
    if (time_limit >= x) {
      vec.emplace_back(x, y);
    }
  }
  std::sort(vec.begin(), vec.end());
  std::priority_queue<uint32_t> pq;
  uint32_t index = 0;
  uint32_t ans = 0;
  for (uint32_t t = 0; t <= time_limit; ++t) {
    while (index < vec.size() && vec[index].first <= t) {
      pq.push(vec[index].second);
      index++;
    }
    if (pq.size() != 0) {
      auto res = pq.top();
      pq.pop();
      ans += res;
    }
  }
  std::cout << ans << std::endl;
  return 0;
}

Measured memory_bytes: 1660
#include<stdio.h>
 
int main(void)
{
  int num;
  int i;
 
  scanf("%d", &num);
 
  for(i=1;i<=num;i++)
    {
      if (i%3==0)
    printf(" %d", i);
      else if (i%10==3)
    printf(" %d", i);
      else if (i/10==3)
    printf(" %d", i);
      else if (i/10%10==3)
    printf(" %d", i);
      else if (i/10/10%10==3)
    printf(" %d", i);
      else if (i/100==3)
    printf(" %d", i);
      else if (i/1000==3)
    printf(" %d", i);
    }
 
  printf("\n");
 
  return 0;
}

Measured memory_bytes: 600
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <cstring>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <bitset>
#include <stack>
#include <cmath>
#include <time.h>
#include <unordered_set>
#include <unordered_map>
#define ll long long
#define LINF 0x3f3f3f3f3f3f3f3f
#define INF 0x3f3f3f3f
#define PI 3.14159265
#define RAND (rand()*rand())
#define MAX(x, y) ((x) > (y) ? (x):(y)) 
#define MIN(x, y) ((x) > (y) ? (y):(x))
#define ABS(x) ((x) > 0 ? (x) : -(x))
#define CEIL(x, y) (((x) + (y) - 1)/(y))
using namespace std;
const int MAXN = 2e5 + 5;
const ll MOD = 1e9 + 7;
int N, M, K, Q, T;
int A[MAXN];

int main()
{
	int i, j;
	scanf("%d", &N);
	for (i = 1; i <= N; ++i) {
		scanf("%d", &A[i]);
	}
	int cur = 1;
	int cnt = 0;
	for (i = 1; i <= N; ++i) {
		if (A[i] == cur) {
			++cur;
			++cnt;
		}
	}
	if (cur == 1 && cnt == 0) printf("-1");
	else printf("%d", N - cnt);
	return 0;
}

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

int main(){
    long long a,b,c;

    scanf("%lld %lld %lld",&a,&b,&c);
    printf("%s\n",(c>a+b)&&((c-a-b)*(c-a-b) > 4*a*b)?"Yes":"No");
    return 0;
}

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

using namespace std;
#define REPP(i,a,b,c) for(int i=a; i<=b; i+=c)
#define REP(i,a,b) REPP(i,a,b,1)
#define REVV(i,a,b,c) for(int i=a; i>=b; i-=c)
#define REV(i,a,b) REVV(i,a,b,1)
#define FOR(i,a) REP(i,0,(int)a-1)
#define FORD(i,a) REV(i,(int)a-1,0)
#define PB push_back
#define POB pop_back
#define FI first
#define SE second
#define MP make_pair
typedef long long ll;
typedef unsigned long long ull;
typedef pair < int , int > pii;
typedef vector < int > vi;
typedef vector < pii > vii;
typedef vector < ll > vl;
typedef pair < ll , ll > pll;

const double PI = acos(-1);
const double EPS = 1e-9;
const ll MOD = 1e9 + 7;
const int INF = 1e9;
	

ll addMod(ll a, ll b){
	if(a + b >= MOD) return a + b - MOD;
	return a + b;
}

ll mulMod(ll a, ll b){
	return (a*b)%MOD;
}

ll fast(ll a, ll b){
	if(b == 0) return 1;
	ll tmp = fast(a,b/2);
	tmp = mulMod(tmp,tmp);
	if(b%2 == 1) tmp = mulMod(tmp,a);
	return tmp;
}

ll GCD(ll a, ll b){
	if(a > b) return GCD(b,a);
	if(a == 0) return b;
	return GCD(b%a,a);
}

#define getc getchar
template<typename T>
T getnum(){
	int sign = 1;
	T ret = 0;
	char c;

	do{
		c = getc();
	}while(c == ' ' || c == '\n');
	if(c == '-')sign = -1;
	else ret = c-'0';
	while(1){
		c = getc();
		if(c < '0' || c > '9')break;
		ret = 10*ret + c-'0';
	}
	return sign * ret;
}

inline void ini(int& x){
	x = getnum<int>();
}

//////////////////////////////////////////////


int main(){
	ios_base :: sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int m[3],d[3];
	FOR(i,2){
		cin >> m[i] >> d[i];
	}
	if(m[0] != m[1]) cout << 1 << endl;
	else cout << 0 << endl;
	return 0;
}

Measured memory_bytes: 256
n = gets.to_i
s = gets.chomp
cnt = 0
min = n
(n-1).times do |i|
  cnt += 1 if s[i+1] == 'W'
end
min = [min,n-1-cnt].min
(n-1).times do |i|
  cnt += 1 if s[i] == 'E'
  cnt -= 1 if s[i+1] == 'W'
  min = [min,n-1-cnt].min
end
puts min


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

int main()
{
	char S[102];
	while(cin>>S){
	int i,m;
	for(i=0;S[i]!='\0';i++)
	{
			if((i+1)%2==0&&S[i]=='R'){
				cout<<"No"<<endl;
				m=1;
				break;
			}
			else if((i+1)%2==1&&S[i]=='L'){
				cout<<"No"<<endl;
				m=1;
				break;
			}
			else{
				m= 0;
			}
	}
	if(m==0){
	cout<<"Yes"<<endl;
	}
	}
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cmath>
#include <iomanip>
#include <stack>
#include <set>
#include <queue>
#include <algorithm>
#include <deque>
#include <map>
using namespace std;

#define INF 1e18
#define int long long
#define MAX 1000000010

signed main() {
    int n; cin >> n;
    map<int, int> mp;
    for(int i = 0; i < n; i++) {
        int a; cin >> a;
        if(mp.find(a) == mp.end()) {
            mp.emplace(a, 1);
        } else {
            mp[a]++;
        }
    }

    int ans = 0;
    for(auto itr = mp.begin(); itr != mp.end(); itr++) {
        int val = itr -> first;
        int cnt = itr -> second;
        if(val > cnt) ans += cnt;
        else if(val < cnt) ans += cnt - val;
    }

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


Measured memory_bytes: 6272