akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <cassert>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>

#include <limits.h>

using namespace std;

typedef long long ll;

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

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

vector<int> as;
vector<int> bs;

int f(const int target, const int a, const int N, const vector<int> &ns) {
    int left = -1, right = N, mid;
    while (right - left > 1) {
        mid = left + (right - left) / 2;
        int b = ns[mid];
#ifdef DEBUG
        printf("left: %d, right: %d, mid: %d, a: %d, b: %d\n", left, right, mid, a, b);
#endif
        if (a + b < target) {
            left = mid;
        } else {
            right = mid;
        }
    }
    return right;
}

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

    as.resize(N);
    for (int i = 0; i < N; i++) {
        cin >> as[i];
    }

    bs.resize(N);
    for (int i = 0; i < N; i++) {
        cin >> bs[i];
    }

    vector<int> ans_bits;
    vector<int> bs2(N);

    // why failed if bit < 28 -> a + b might have bit 28 (e.g. a = (1 << 28) - 1, b = (1 << 28) - 1.
    for (int bit = 0; bit < 29; bit++) {
        for (int i = 0; i < N; i++) {
            bs2[i] = bs[i] % (1 << (bit + 1));
        }
        sort(bs2.begin(), bs2.end());

        ll cnt = 0;
        for (auto orig_a : as) {
            int a = orig_a % (1 << (bit + 1));
            int T = 1 << bit;
            {
#ifdef DEBUG
                printf("[%d, %d): \n", (1 << bit), 2 * (1 << bit));
#endif
                int left = f(T, a, N, bs2);
                int right = f(2 * T, a, N, bs2);
#ifdef DEBUG
                printf("bit: %d, a: %d, left: %d, right: %d\n", bit, a, left, right);
#endif
                cnt += right - left;
            }
            {
#ifdef DEBUG
                printf("[%d, %d): \n", 3 * (1 << bit), 4 * (1 << bit));
#endif
                int left = f(3 * T, a, N, bs2);
                int right = N;
                // int right = f(bit, 4 * (1 << bit), a, N, bs2);
#ifdef DEBUG
                printf("bit: %d, a: %d, left: %d, right: %d\n", bit, a, left, right);
#endif
                cnt += right - left;
            }
        }
        if (cnt % 2 == 0) {
            ans_bits.push_back(0);
        } else {
            ans_bits.push_back(1);
        }
    }


    reverse(ans_bits.begin(), ans_bits.end());
    ll ans = 0;
    for (auto bit : ans_bits) {
        ans = ans * 2 + bit;
    }
    cout << ans << endl;

    return 0;
}


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

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

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

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

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

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

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

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

fn main() {
    input!{
        s: String,
    };

    let s = s.as_bytes();

    let ans = s[0] == s[1] && s[1] == s[2];

    println!("{}", if ans {"No"} else {"Yes"});
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
#define IN_OUT(n) ios::sync_with_stdio(0) , cin.tie(0) , cout.tie(0) , cout << fixed << setprecision(n)
#define F first
#define S second
typedef pair<int,int> pii;
typedef pair<pii,int> tpi;
typedef pair<pii,pii> qpi;
typedef long long ll;
const int MOD = 1e9 + 7;
const int MAX = 1e5;
const int INF = 2e9;
int MA = -INF , MI = INF;

int n;
ll f[100];

int32_t main()
{
	IN_OUT(10);
	cin>>n;
	f[0] = 2 , f[1] = 1;

	for(int i=2 ; i<=n ; i++)
		f[i] = f[i-1] + f[i-2];

	cout<<f[n];
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define mod 1000000007
#define pb push_back
#define ll long long
using namespace std;
int main(){
	ll n;
	cin>>n;
	vector<ll>  a(n),b(n),p(n);
	for(ll i=0;i<n;i++){
		ll x;
		cin>>x;
		p[x-1]=i+1;
	}
	for(ll i=0;i<n;i++){
		a[i] = 40000*i + p[i];
		b[i] = 40000*(n-1-i) + p[i];
	}
	for(ll i=0;i<n;i++){
		cout<<a[i]<<" ";
	}
	cout<<endl;
	for(ll i=0;i<n;i++){
		cout<<b[i]<<" ";
	}
	cout<<endl;
	return 0;
}

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

int main() {
  long n,ans=0;
  cin >> n;
  vector<long> a(n);
  for(long i=0;i<n;i++) cin >> a[i];
  sort(a.begin(),a.end());
  reverse(a.begin(),a.end());
  priority_queue<vector<long>> q;
  q.push({a[0],0,0});
  for(long i=1;i<n;i++) {
    vector<long> x=q.top();
    ans+=x[0];
    q.push({a[i],x[1],i});
    q.push({a[i],i,x[2]});
    q.pop();
  }
  cout << ans << endl;
}

Measured memory_bytes: 15840
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
typedef long long ll;
const int MAX_N = 1e5+10;

int main() {
	int n,m; cin>>n>>m;
	vector<int> p(MAX_N), y(MAX_N);
	vector<vector<int>> yd(MAX_N);
	rep(i,m){
		cin>>p[i]>>y[i];
		p[i]--;
		yd[p[i]].push_back(y[i]);
	}
	rep(i,n) sort(yd[i].begin(),yd[i].end());
	rep(i,m){
		vector<int> pp=yd[p[i]];
		int num=lower_bound(pp.begin(), pp.end(), y[i])-pp.begin();
		printf("%06d%06d\n", p[i]+1, num+1);
	}
}

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

ll solve() {
    ll N;
    cin >> N;
    vector<ll> A(N);
    for ( int i = 0; i < N; i++ ) {
        cin >> A[i];
        if ( A[i] == 0 ) return 0;
    }
    ll p = 1, m = 1e18;
    for ( int i = 0; i < N; i++ ) {
        if ( p > m/A[i] ) return -1;
        p *= A[i];
    }
    ll ans = p;
    return ans;
}

int main() {
    auto ans = solve();
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 4048
#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 FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF (long long)1 << 61
#define MOD 1000000007
using namespace std;

typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;
typedef vector<llong> LV;

int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

int main() {
	llong n;cin >> n;
    LV y(n+1);
    REP(i,n) cin >> y[i];
    y[n]=y[0];


    vector<vector<llong>> V(n+1,vector<llong>(2,0));
    V[0][0]=2;V[0][1]=0;
    FOR(i,1,n+1){
        V[i][0]=   0   - V[i-1][0];
        V[i][1]=2*y[i] - V[i-1][1];
    }
    llong a=V[0][0],b=V[0][1],c=V[n][0],d=V[n][1];
    llong k = (d-b)/(a-c);

    // cout << a  << " " << b <<" " << c<<" " << d <<" "<< "e";

    cout << V[n-1][0]*k + V[n-1][1] << endl;
    REP(i,n-1){
        cout << V[i][0]*k + V[i][1] << endl;
    }

    return 0;
}




// bool compare_by_b(pair<int, int> &a, pair<int, int> &b) {
//     if(a.second != b.second){
//         return a.second < b.second;
//     }else{
//         return a.first < b.first;
//     }
// }

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

//     vector<pair<int,int>> pairs(N);
//     llong a,b;
//     REP(i,N){
//         cin >> a >> b;
//         pairs[i]=make_pair(a,b);
//     }

//     sort(pairs.begin(),pairs.end(),compare_by_b);
    
//     llong now=0;
//     REP(i,N){
//         now+=pairs[i].first;
//         if(now>pairs[i].second){
//             cout << "No" << endl;
//             return 0;
//         }
//     }

//     cout << "Yes" << endl;
//     return 0;
// }


Measured memory_bytes: 7552
#include<cstdio>
#include<cstring>
#include<string>
#include<iostream>
#include<algorithm>

typedef long long ll;
inline void read(ll &T) {
	ll x=0;bool f=0;char c=getchar();
	while(c<'0'||c>'9'){if(c=='-')f=!f;c=getchar();}
	while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}
	T=f?-x:x;
}

ll n,x,ans=1;
ll a[100001];

int main() {
	read(n);
	for(int i=1;i<=n;++i) read(a[i]);
	std::sort(a+1,a+n+1);
	for(int i=1;i<=n;++i) {
		if(a[i]==0) {
			puts("0");
			return 0;
		}
		if(1000000000000000000/ans<a[i]) {
			puts("-1");
			return 0;
		}
		ans*=a[i];
	}
	std::cout<<ans<<'\n';
	return 0;
}

Measured memory_bytes: 4412
def main():
    N,M,X = map(int, input().split(" "))

    A = [0]*(N+1)
    for i in map(int, input().split(" ")):
        A[i] = 1

    print(min(sum(A[0:X]), sum(A[X:N])))



if __name__ == '__main__':
    main()


Measured memory_bytes: 2940
#include<stdio.h>
#include<algorithm>
using namespace std;
pair<pair<int,int> ,int >wolf[50];
int tt[50][10];
int wa[50][10];
int main(){
	int a,b,c,d;
	while(scanf("%d%d%d%d",&a,&b,&c,&d),a){
		for(int i=0;i<50;i++)
			for(int j=0;j<10;j++)
				{tt[i][j]=-1;wa[i][j]=0;}
		
		for(int i=0;i<d;i++){
			int p,q,r,s;
			scanf("%d%d%d%d",&p,&q,&r,&s);
			q--;
			r--;
			if(s)wa[q][r]++;
			else tt[q][r]=p;
		}
		for(int i=0;i<b;i++){
			int n=0;
			int t=0;
			for(int j=0;j<c;j++){
				if(~tt[i][j]){
					n++;
					t+=tt[i][j]+wa[i][j]*20;
				}
			}
			wolf[i]=make_pair(make_pair(-n,t),-i);
		}
		std::sort(wolf,wolf+b);
		printf("%d",-wolf[0].second+1);
		for(int i=1;i<b;i++){
			if(wolf[i].first.first==wolf[i-1].first.first&&wolf[i].first.second==wolf[i-1].first.second)printf("=");
			else printf(",");
			printf("%d",-wolf[i].second+1);
		}printf("\n");
	}
}

Measured memory_bytes: 1040
#include<bits/stdc++.h>
using namespace std;
int main() 
{
	int x;
	bool flag=true;
	cin>>x;
	while(1)
	{
		flag=true;
		if(x==1) {cout<<2;return 0;}
		for(int i=2;i*i<=x;i++) if(x%i==0){x++;flag=false;break;} 
		if(flag==true)
		{
			cout<<x;
			return 0;
		}
	}
}

Measured memory_bytes: 256
/**
 *      ABC 51 A
 *      author  : kyomukyomupurin
 *      created : 2018-09-05 02:43:32
**/

#include <bits/stdc++.h>
using namespace std;

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    string s; cin >> s;
    string sub1 = s.substr(0, 5);
    string sub2 = s.substr(6, 7);
    string sub3 = s.substr(14, 5);
    cout << sub1 << " " << sub2 << " " << sub3 << endl;

    return 0;

}


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

int main(){
int n;
cin >> n;
map<int, int> mp;
for(int i = 1; i<=100;i++){
  for(int j= 1; j<=100; j++){
    for(int k = 1; k<=100; k++){
          ll m = i*i+j*j+k*k+i*j+j*k+k*i;
         mp[m]++;
       }
    }
}
for(int i=1; i<=n; i++)cout << mp[i] << endl;
return 0;
}

Measured memory_bytes: 5348
using System;
using System.Collections.Generic;
using System.Linq;

namespace ConsoleApp3
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            var hwm = Console.ReadLine().Split(" ").Select(int.Parse).ToArray();
            var h = hwm[0];
            var w = hwm[1];
            var m = hwm[2];

            var s = new HashSet<(int H, int W)>(Enumerable.Range(0, m).Select(_ =>
            {
                var hw = Console.ReadLine().Split(" ").Select(int.Parse).ToArray();
                return (hw[0], hw[1]);
            }));

            var hs = s.GroupBy(x => x.H)
                .Select(x => (H: x.Key, Count: x.Count()))
                .GroupBy(x => x.Count, x => x.H)
                .OrderByDescending(x => x.Key)
                .ToArray();
            var ws = s.GroupBy(x => x.W)
                .Select(x => (W: x.Key, Count: x.Count()))
                .GroupBy(x => x.Count, x => x.W)
                .OrderByDescending(x => x.Key)
                .ToArray();

            var maxHCount = hs.First().Key;
            var maxWCount = ws.First().Key;

            var hasValue = hs.First().Any(maxH =>
            {
                return ws.First().Any(maxW =>
                {
                    return !s.Contains((maxH, maxW));
                });
            });

            if (hasValue)
            {
                Console.WriteLine(maxHCount + maxWCount);
            }
            else
            {
                Console.WriteLine(maxHCount + maxWCount - 1);
            }
        }
    }
}

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

int main()
{
  int n, k;
  cin >> n >> k;
  vector<int> a(n);
  for (auto&& e : a) {
    cin >> e;
  }
  for (int i = k; i < n; i++) {
    cout << (a[i] > a[i - k] ? "Yes" : "No") << endl;
  }
}


Measured memory_bytes: 4052
#include <algorithm>
#include <cmath>
#include <climits>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <cassert>
#include <functional>

using namespace std;

#define LOG(...) printf(__VA_ARGS__)
//#define LOG(...)
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(),(a).rend()
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())
#define RSORT(c) sort((c).rbegin(),(c).rend())
#define CLR(a) memset((a), 0 ,sizeof(a))

typedef long long ll;
typedef unsigned long long ull;
typedef vector<bool> vb;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vb> vvb;
typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

const int dx[] = { -1, 0, 1, 0 }; const int dy[] = { 0, 1, 0, -1 };
struct salary{
	int no;
	long long int sell;
};

int main() {
	
	int n;
	while(cin>>n,n){
		vector<salary> vs;
		set<int> si;
		REP(i, n){
			int no;
			long long int v,sum;
			cin >> no >> v >> sum;
			if (si.find(no) == si.end()){
				vs.push_back({ no, (long long int)(v*sum) });
				si.insert(no);
			}
			else
				REP(j, vs.size()){
				if (vs[j].no == no)
					vs[j].sell += (long long int)(v*sum);
			}
		}
		bool b = false;
		REP(j, vs.size()){
			if (vs[j].sell >= 1000000){
				cout << vs[j].no << endl;
				b = true;
			}
		}
		if (!b)
			cout <<"NA" << endl;
	}
}

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

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

		char[] c = s.toCharArray();
		int n = c.length + 1;
		int[] a = new int[n];
		Arrays.fill(a, Integer.MIN_VALUE);
		if (c[0] == '<') {
			a[0] = 0;
		}
		if (c[c.length - 1] == '>') {
			a[c.length] = 0;
		}
		for (int i = 0; i < c.length - 1; i++) {
			if (c[i] == '>' && c[i + 1] == '<') {
				a[i + 1] = 0;
			}
		}
		for (int i = 0; i < a.length; i++) {
			if (a[i] == 0) {
				for (int j = i - 1; j >= 0; j--) {
					if (c[j] == '>') {
						a[j] = Math.max(a[j], a[j + 1] + 1);
					} else {
						break;
					}
				}
				for (int j = i; j < c.length; j++) {
					if (c[j] == '<') {
						a[j + 1] = a[j] + 1;
					} else {
						break;
					}
				}
			}
		}
		long ans = 0;
		for (int i = 0; i < a.length; i++) {
			ans += a[i];
		}
		System.out.println(ans);
	}
}


Measured memory_bytes: 30648
#include <algorithm>
#include <cassert>
#include <cctype>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>

using namespace std;

#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i = 0; i < (n); i++)
#define repr(i,b,e) for(int i = (b); i <= (e); i++)

#define pr(x) do{cerr << (#x) << " = " << (x) << endl;}while(0)
#define pri(x,i) do{cerr << (#x) << "[" << i << "] = " << (x[i]) << endl;}while(0)

namespace std {
	template<class S, class T> pair<S, T> operator + (const pair<S, T> &a, const pair<S, T> &b) {return mp<S, T>(a.first + b.first, a.second + b.second);}
	template<class S, class T> pair<S, T> operator - (const pair<S, T> &a, const pair<S, T> &b) {return mp<S, T>(a.first - b.first, a.second - b.second);}
	template<class S, class T> pair<S, T>& operator += (pair<S, T> &a, const pair<S, T> &other) {return a = a + other;}
	template<class S, class T> pair<S, T>& operator -= (pair<S, T> &a, const pair<S, T> &other) {return a = a - other;}
	template<class S, class T> ostream& operator << (ostream& ost, pair<S, T> p) {ost << "(" << p.first << ", " << p.second << ")";return ost;}
	template<class T> ostream& print_iterable_container(ostream& ost, T& container) {
		for (auto&& iter = begin(container); iter != end(container); ++iter) ost << (iter == begin(container) ? " [ " : ", ") << (*iter);
		return ost << " ]";
	}
#	define APPLY_PRINT_ITERABLE_CONTAINER(container_type)\
	template<class T> ostream& operator << (ostream& ost, container_type<T>& container) {\
		return print_iterable_container(ost, container);\
	}
	APPLY_PRINT_ITERABLE_CONTAINER(vector);
	APPLY_PRINT_ITERABLE_CONTAINER(list);
	APPLY_PRINT_ITERABLE_CONTAINER(deque);
}

template<class T> inline bool CHMAX(T &l,const T &r){return l<r?l=r,1:0;}
template<class T> inline bool CHMIN(T &l,const T &r){return l>r?l=r,1:0;}

using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vi>;
using vvll = vector<vll>;
using vpii = vector<pii>;
using vpll = vector<pll>;

using ld = long double;

template<class T> using VV = vector<vector<T> >;
template<class T> using maxPQ = priority_queue<T>;
template<class T> using minPQ = priority_queue<T, vector<T>, greater<T> >;
template<class T, class U> using uomap = unordered_map<T, U>;
template<class T> using uoset = unordered_set<T>;

const ll INF = 1001001001;
const ll INFll = (ll)INF * INF;
const ll MOD = 1000000007;
const ll MOD_FFT = 998244353;
const ld EPS = 1e-15;

function<void(int,int)> tensi_no_3p=[&](int v,int d){
};

int main() {
	int N, K;
	cin >> N >> K;
	if (K % 2) {
		ll t = N / K;
		cout << t * t * t << endl;
	}
	else {
		ll s = N / (K / 2);
		ll t = N / K;
		s -= t;
		cout << t * t * t + s * s * s << endl;
	}
	return 0;
}


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

using namespace std;

#ifdef DEBUG_MODE
	#define DBG(n) n;
#else
	#define DBG(n) ;
#endif
#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {for(int W = 0;W < (n);W++)cerr << v[W] << ' ';cerr << endl << endl;}
#define SHOW2d(v,i,j) {for(int aaa = 0;aaa < i;aaa++){for(int bbb = 0;bbb < j;bbb++)cerr << v[aaa][bbb] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 1000000007

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

vector<ll> pri;
bool isp[111];
int seica[111];
int ans;

void makepri() {
	for(int i = 2;i < 111;i++){
		if(!isp[i]){
			pri.PB(i);
			for(int j = i;j < 111;j += i)isp[j] = true;
		}
	}
}

void dfs(int depth,int now){
	if(now > 75)return;
	if(depth == 16){
		if(now == 75)ans++;
		return;
	}
	dfs(depth + 1,now);
	if(seica[depth] >= 2)dfs(depth + 1,now * 3);
	if(seica[depth] >= 4)dfs(depth + 1,now * 5);
	if(seica[depth] >= 14)dfs(depth + 1,now * 15);
	if(seica[depth] >= 24)dfs(depth + 1,now * 25);
	if(seica[depth] >= 74)dfs(depth + 1,now * 75);
}

int main(){
	
	makepri();
	int n;cin >> n;
	
	for(int i = 2;i <= n;i++){
		int tmp = i;
		REP(j,pri.size()){
			while(tmp % pri[j] == 0){
				tmp /= pri[j];
				seica[j]++;
			}
		}
	}
	
	dfs(0,1);
	cout << ans << endl;
	
	return 0;
}


Measured memory_bytes: 256
from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(input())
def inpl(): return list(map(int, input().split()))
def inpl_str(): return list(input().split())



while True:
    N,W,H = inpl()
    imosW = [0]*(W+1)
    imosH = [0]*(H+1)
    for _ in range(N):
        x,y,w = inpl()
        lx,rx = max(0,x-w),min(W-1,x+w-1)
        ly,ry = max(0,y-w),min(H-1,y+w-1)
        imosW[lx] += 1
        imosW[rx+1] -= 1
        imosH[ly] += 1
        imosH[ry+1] -= 1

    for i in range(1,W+1):
        imosW[i] += imosW[i-1]

    for i in range(1,H+1):
        imosH[i] += imosH[i-1]

    flagH = True
    flagW = True

    for i in range(W):
        if imosW[i] == 0:
            flagH = False
            break

    for i in range(H):
        if imosH[i] == 0:
            flagW = False
            break

    if flagH or flagW:
        print('Yes')
    else:
        print('No')

    #print(imosH)
    #print(imosW)
    break



Measured memory_bytes: 15028
import sys
sys.setrecursionlimit(100000)
inf = float('inf')

def dfs(h, s):
    # 停止条件
    if h == D:
        tmp = 0
        p = 0
        ans = 0
        for i, c in enumerate(s):
            if c == '0':
                tmp = i
            else:
                ans += pc[i][0]
                p += (i+1) * 100 * pc[i][0] + pc[i][1]
        for i in range(pc[tmp][0]-1):
            if p < G:
                p += (tmp + 1) * 100
                ans += 1
        if p < G:
            return inf
        else:
            return ans
    tmp1 = dfs(h+1, s + '0')
    tmp2 = dfs(h+1, s + '1')
    return min(tmp1, tmp2)


D, G = map(int, input().split())
pc = [list(map(int, input().split())) for _ in range(D)]
print(dfs(0, ''))

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

using namespace std;
#define ll long long 

int main() {
  ll n;
  ll ans = 0;
  string s;
  map<string, int> mp;
  cin >> n;

  for(int i = 0; i < n; i++){
    cin >> s;
    sort(s.begin(), s.end());
    mp[s]++;
  }

  for(auto& p :mp){
    int a = p.second;
    ans += (ll) a * (a - 1) / 2; 
  }
  
  cout << ans << endl;
}

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


def main():
	a, b, c = map(int, input().split())
	if a < c < b or b < c < a:
		print('Yes')
	else:
		print('No')

if __name__ == '__main__':
	import sys
	sys.exit(main())



Measured memory_bytes: 2940
import math
L = int(input())
s = int(math.log2(L))
N = s+1

count = 0
graph = []
for i in range(N-1,0,-1):
    if L - 2 ** (i-1) >= 2 ** s:
        graph.append([i, N ,L-2 ** (i-1)])
        L = L - 2 ** (i-1)
        count += 1

print(N, end = ' ')
print(2*(N-1)+count)



for i in range(N,1,-1):
    print(i-1, end = ' ')
    print(i, end = ' ')
    print(0)
    print(i - 1, end=' ')
    print(i, end=' ')
    print(2 ** (i-2))

for i in range(len(graph)):
    print(graph[i][0], end = ' ')
    print(graph[i][1], end = ' ')
    print(graph[i][2])


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

int n, p;
ll dp[51][2];

int main(){
	scanf("%d%d", &n, &p);
	dp[0][0] = 1;
	for(int i = 1, x; i <= n; i++){
		scanf("%d", &x);
		x %= 2;
		dp[i][0] += dp[i - 1][0];
		dp[i][1] += dp[i - 1][1];
		dp[i][0] += dp[i - 1][0 ^ x];
		dp[i][1] += dp[i - 1][1 ^ x];
	}
	printf("%lld\n", dp[n][p]);
}

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

int x, y;
cin >> x >> y;

for (int i = 0; i <= x; i++){
    if(i * 2 + (x - i) * 4 == y){
        cout << "Yes" << endl;
        return 0;
    }
}

cout << "No" << endl;

return 0;
}

Measured memory_bytes: 3592
#include<iostream>
#include<algorithm>
using namespace std;
long long n, w, W[105], V[105], dp[100005];
int main(){
	cin >> n >> w;
	for (int i = 0; i < n; ++i)cin >> W[i] >> V[i];
	for (int i = 0; i < n; ++i)for (int j = w; j >= W[i]; --j)dp[j] = max(dp[j - W[i]] + V[i], dp[j]);
	cout << dp[w];
}

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



int main(){
	//freopen("output.txt","r",stdin);

	int n;
	cin>>n;
	
	string s;
	cin>>s;
	int r[n] = {};
	int g[n] = {};
	int b[n] = {};
	for(int i=0;i<n;i++){
		if(s[i] == 'R')
			r[i] = 1;
		if(s[i] == 'G')
			g[i] = 1;
		if(s[i] == 'B')
			b[i] = 1;
	}

	int pr[n],pg[n],pb[n];
	for(int i=0;i<n;i++){
		pr[i] = r[i];
		pb[i] = b[i];
		pg[i] = g[i];
	}
	for(int i=n-2;i>=0;i--){
		r[i] += r[i+1];
		g[i] += g[i+1];
		b[i] += b[i+1];
	}
	long long int ans = 0;
	int arr[26] = {};
	for(int i=0;i<n-2;i++){
		for(int j=i+1;j<n-1;j++){
			if(s[i] != s[j]){
				arr[s[i]-'A'] = 1;
				arr[s[j] -'A'] = 1;
				int diff = j - i;

				
				if(arr[17] == 0){
					if(j+diff > n-1){
						ans += r[j+1];
					}else{
						ans += r[j+1];
						ans -= pr[j+diff];
					}
				}else if(arr[6] == 0){
					if(j+diff > n-1){
						ans += g[j+1];
					}else{
						ans += g[j+1];
						ans -= pg[j+diff];
					}

				}else{
					if(j+diff > n-1){
						ans += b[j+1];
					}else{
						ans += b[j+1];
						ans -= pb[j+diff];	
					}
				}
				arr[s[i]-'A'] = 0;
				arr[s[j]-'A'] = 0;

			}
		}
	}


	cout<<ans<<endl;
}

Measured memory_bytes: 3704
#include <stdio.h>

int main(void){
    int flag=1;
    while(flag){
        int a=0,b=0;
        scanf("%d %d",&a,&b);
        if(a==0 && b==0){
            flag=0;
            break;
        }
        int i,j;
        for(i=0;i<a;i++){
            for(j=0;j<b;j++){
                printf("#");
                if(j==b-1){
                    printf("\n");
                }
            }
        }
        printf("\n");
    }
}


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

using namespace std;

int main(void){
	string s;
	while(getline(cin, s)){
		for(int i=0;i<s.size();i++){
			if(0x60<s[i]&&s[i]<0x7b) s[i]-=0x20;
		}
		cout << s << "\n";
	}
	return 0;
}

Measured memory_bytes: 0
import numpy as np
import sys
i4 = np.int32
i8 = np.int64

if sys.argv[-1] == 'ONLINE_JUDGE':
    from numba.pycc import CC
    from numba import njit
    from numba.types import int64, Array
    cc = CC('my_module')

    @njit
    def factorization(N):
        p = np.zeros(N + 1, i8)
        n_max = int(np.sqrt(N)) + 1
        p[0] = 1
        p[1] = 1
        for i in range(2, n_max):
            if p[i] == 0:
                j = i
                while j <= N:
                    p[j] = i
                    j += i
        for i in range(n_max, N + 1):
            if p[i] == 0:
                p[i] = i
        return p

    @cc.export('solve', (Array(int64, 1, 'C'),))
    def solve(A):
        a = np.sort(A)
        p_max = a[-1]
        p = factorization(p_max)
        primes_num = 0
        for i in range(p.shape[0]):
            if i == p[i]:
                primes_num += 1
        a_start = 0
        while a[a_start] == 1:
            a_start += 1
            if a_start == a.shape[0]:
                return 0
        a = a[a_start:]
        if len(a) > primes_num:
            return 1
        check = np.zeros(p_max + 1, i8)
        stack = np.empty(20, i8)
        p_stack = 0
        for d in a:
            while d > 1:
                x = p[d]
                for i in range(p_stack):
                    if stack[i] == x:
                        break
                else:
                    stack[p_stack] = x
                    p_stack += 1
                d //= x

            while p_stack > 0:
                p_stack -= 1
                check[stack[p_stack]] += 1

        if check.max() > 1:
            return 1
        else:
            return 0
    cc.compile()
    exit()


def main(in_file):
    stdin = open(in_file)
    stdin.readline()
    A = np.fromstring(stdin.readline(), i8, sep=' ')
    ans = solve(A)
    if ans:
        g = np.gcd.reduce(A)
        if g > 1:
            ans = 2
        else:
            ans = 1
    p = ['pairwise coprime', 'setwise coprime', 'not coprime']
    print(p[ans])


if __name__ == '__main__':
    from my_module import solve
    main('/dev/stdin')

Measured memory_bytes: 58156
#include<bits/stdc++.h>
#include<bitset>
#include<random>
#include<time.h>

using namespace std;

#define M 1000000007
#define pb push_back
#define f first
#define s second
#define rep(i, st, ed) for(int i=st; i<ed; i++)
#define repn(i, st, ed) for(int i=st; i<=ed; i++)
#define repb(i, ed, st) for(int i=ed; i>=st; i--)

typedef long long ll;
typedef unsigned long long int llt;
typedef long double ld;

const long double PI  =3.141592653589793238463;
const int N = 5e5 + 10;
const ll INF = 1LL << 60;

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



// Main Code

llt dp[100];

llt findlucs(int n)
{
  if(dp[n] != 0) return dp[n];
  return dp[n] = (findlucs(n-1) + findlucs(n-2));
}

int main()
{
  int n;
  cin>>n;
  dp[0] = 2;
  dp[1] = 1;
  cout<<findlucs(n)<<endl;
}


Measured memory_bytes: 256
import collections
import itertools

yakusuu = {}
for j in range(2, 101):
    I = j
    s = 0
    R = int(I)
    L = []
    while s == 0:
        for i in range(2, R + 1):
            if I % i == 0:
                I = I / i
                if I == 1:
                    s = 1
                L.append(i)
                break
    if len(L) == 1:
        yakusuu[R] = [R]
    else:
        yakusuu[R] = L

n = int(input())

cnt = 0

for num in range(1, n + 1):
    tmp = []
    if n == 1:
        print(0)
        exit()
    for i in range(2, num + 1):
        tmp += yakusuu[i]

tmp = dict(collections.Counter(tmp))
tmp_array = sorted(list(tmp.keys()))

cnt = 0

for i in tmp_array:
    if tmp[i] >= 74:
        cnt += 1

for i in tmp_array:
    for j in tmp_array:
        if i == j:
            continue
        elif tmp[i] >= 14 and tmp[j] >= 4:
            cnt += 1

for i in tmp_array:
    for j in tmp_array:
        if i == j:
            continue
        elif tmp[i] >= 24 and tmp[j] >= 2:
            cnt += 1

res_array = list(itertools.combinations(tmp_array, 3))
for i in range(len(tmp_array)):
    for j in range(len(tmp_array)):
        for k in range(j+1, len(tmp_array)):
            if (j == i) or (i == k): continue
            if tmp[tmp_array[i]] >= 2 and tmp[tmp_array[j]] >= 4 and tmp[tmp_array[k]] >= 4:
                cnt += 1

print(cnt)


Measured memory_bytes: 3444
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
using namespace std;
typedef long long int lli;

int main() {
	int H, W, D, Q;
	cin >> H >> W >> D;
	int A[300][300];
		for (int i = 0;i<H;i++) {
			for (int j = 0;j<W;j++) cin >> A[i][j];
		}
	cin >> Q;
	int L[100000];
	int R[100000];
	for (int i = 0;i<Q;i++) cin >> L[i] >> R[i];

	//1以上HW以下の数字にその座標を対応させる
	int x[90001];
	int y[90001];
	for (int i = 0;i<H;i++) {
		for (int j = 0;j<W;j++) {
			x[A[i][j]] = i;
			y[A[i][j]] = j;
		}
	}
	//数字nからn+Dへ移動させるコストを計算
	int co[90001];
	for (int n = 1;n <= H * W;n++) co[n] = 0;
	for (int n = 1;n <= H * W - D;n++) {
		int xabs = abs(x[n] - x[n + D]);
		int yabs = abs(y[n] - y[n + D]);
		co[n] = xabs + yabs;
	}
	//数字nについて,n%Dからnへのコストを累積して計算
	int cosum[90001];
	for (int n = 1;n <= D;n++) cosum[n] = 0;
	for (int n = D + 1;n <= H * W;n++) cosum[n] = cosum[n - D] + co[n - D];

	//各クエリについて, cosum[R_i]-cosum[L_i]が求めるもの
	for (int i = 0;i<Q;i++) cout << cosum[R[i]] - cosum[L[i]] << endl;
}

Measured memory_bytes: 3712
#include <bits/stdc++.h>
using namespace std;
int RGB[4005][3];
string s;
int main()
{
    long long n,ans=0;
    cin>>n>>s;
	RGB[n][0]=0;
	RGB[n][1]=0;
	RGB[n][2]=0;
	for(int i=n-1;i>=0;i--)
	{
		RGB[i][0]=RGB[i+1][0];
		RGB[i][1]=RGB[i+1][1];
		RGB[i][2]=RGB[i+1][2];
		if (s[i]=='R')RGB[i][0]++;
		else if (s[i]=='G')RGB[i][1]++;
		else if (s[i]=='B')RGB[i][2]++;
	}
	/*for(int i=0;i<n;i++)
	{
		cout<<RGB[i][0]<<' '<<RGB[i][1]<<' '<<RGB[i][2]<<endl;
	}*/
    for(int i=0;i<n;i++)
    {
    	for(int j=0;j<i;j++)
    	{
    		if (s[j]=='R' && s[i]=='G')
    		{
    			ans+=RGB[i+1][2];
    			if (s[2*i-j]=='B')ans--;
			}
			else if (s[j]=='R' && s[i]=='B')
    		{
    			ans+=RGB[i+1][1];
    			if (s[2*i-j]=='G')ans--;
			}
			else if (s[j]=='G' && s[i]=='R')
    		{
    			ans+=RGB[i+1][2];
    			if (s[2*i-j]=='B')ans--;
			}
			else if (s[j]=='G' && s[i]=='B')
    		{
    			ans+=RGB[i+1][0];
    			if (s[2*i-j]=='R')ans--;
			}
			else if (s[j]=='B' && s[i]=='R')
    		{
    			ans+=RGB[i+1][1];
    			if (s[2*i-j]=='G')ans--;
			}
			else if (s[j]=='B' && s[i]=='G')
    		{
    			ans+=RGB[i+1][0];
    			if (s[2*i-j]=='R')ans--;
			}
		}
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 3652
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int N,M,L,R,a,b;
  cin>>N>>M>>L>>R;
  a=L;
  b=R;
  for(int i=0;i<M;i++){
    cin>>L>>R;
    if(a<L){
      a=L;
    }
    if(b>R){
      b=R;
    }
  }
  if(b<a)
    cout<<0<<endl;
  else
    cout<<b-a+1<<endl;
}

Measured memory_bytes: 256
#include <stdio.h>

int main(){
	int S, h, m;
	scanf("%d", &S);
	
	h = S / 3600;
	S %= 3600;
	m = S / 60;
	S %= 60;
	printf("%d:%d:%d\n", h, m, S);

	return 0;
}

Measured memory_bytes: 1020
#include<cstdio>
#include<iostream>
using namespace std;
int main(){
	int A, B;
	cin >> A >> B;
	if((A == 1 && B != 1)|| A > B && B != 1){
		cout << "Alice" << endl;;
	}
	else if(A == B){
		cout << "Draw" << endl;
	}
	else if((B == 1 && A != 1)|| B > A && A != 1){
		cout << "Bob" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstring>
#include<cmath>
#include<map>
#include<queue>
#include<stack>
#include<cstdio>
#include<algorithm>
using namespace std;
#define REP(i,x,y) for(int i=x;i<=y;i++)
#define rep(i,n) REP(i,1,n)
#define rep0(i,n) REP(i,0,n-1)
#define repG(i,x) for(int i=pos[x];~i;i=e[i].next)
#define ll long long
#define db double
const int N=107;
const int INF=1e9+7;
char s[N][15];
int v[N];
int n;

int main(){
	scanf("%d",&n);
	rep(i,n)scanf("%s",s[i]+1);
	rep(i,n)v[i]=strlen(s[i]+1);
	rep(i,n){
		if(i!=1&&s[i][1]!=s[i-1][v[i-1]]){
			printf("No\n");
			return 0;
		}
		rep(j,i-1){
			if(v[j]!=v[i])continue;
			bool flag=1;
			rep(k,v[j])if(s[i][k]!=s[j][k]){flag=0; break;}
			if(flag){
				printf("No\n");
				return 0;
			}
		}
	}
	printf("Yes\n");
	
	return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextInt()) {
            int N = sc.nextInt();
            int[] t = new int[N];
            int max = Integer.MIN_VALUE;
            int maxIdx = -1;

            for (int i = 0; i < N; i++) {
                t[i] = sc.nextInt();
                int abs = Math.abs(t[i]);
                if (max < abs) {
                    max = abs;
                    maxIdx = i;
                }
            }

            System.out.println(N * 2 - 1);

            for (int i = 0; i < N; i++) {
                System.out.println((maxIdx + 1) + " " + (i + 1));
            }

            for (int i = 0; i < N - 1; i++) {
                if (t[maxIdx] > 0) {
                    System.out.println((i + 1) + " " + (i + 2));
                } else {
                    System.out.println((N - i) + " " + (N - i - 1));
                }
            }
        }
    }
}


Measured memory_bytes: 23892
N = int(input())
A = list(map(int, input().split()))

def solve():
    s = sum(A)
    ans = s
    a = 0
    for i in range(N-1):
        a += A[i]
        b = s - a
        ans = min(ans, abs(a - b))
    
    return ans

print(solve())

Measured memory_bytes: 26220
import java.util.*;
import static java.lang.System.*;

public class Main {

	Scanner sc = new Scanner(in);
	
	void run() {
		int q = sc.nextInt();
		long num = 0L;
		int lr = 0;
		for (int i = 0; i < q; i++) {
			sc.next();
			char p = sc.next().charAt(0);
			int n = sc.nextInt();
			if (p == '(') {
				if (num == 0) {
					num = n;
					lr = 1;
				} else {
					if (lr > 0) {
						num += n;
					} else {
						if (num >= n) {
							num -= n;
						} else {
							num = n - num;
							lr = 1;
						}
					}
				}
			} else {
				if (num == 0) {
					num = n;
					lr = -1;
				} else {
					if (lr < 0) {
						num += n;
					} else {
						if (num >= n) {
							num -= n;
						} else {
							num = n - num;
							lr = -1;
						}
					}
				}
			}
			if (num == 0)
				out.println("Yes");
			else 
				out.println("No");
		}
	}
	
	public static void main(String[] args) {
		new Main().run();
	}

}

Measured memory_bytes: 42840
#include<bits/stdc++.h>
using namespace std;
bool is_pal(string s) {
    bool ans = true;
    for (int i = 0; i < (int)s.size() / 2; i++) {
        if (s[i] != s[(int)s.size() - 1 - i]) {
            ans = false;
        }
    }
    return ans;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    string s;
    cin >> s;
    int len = (int)s.size();
    bool ans1 = is_pal(s);
    string s2;
    s2.assign(s, 0, (len -1) / 2);
    bool ans2 = is_pal(s2);
    string s3;
    s3.assign(s, (len + 1) / 2, len);
    bool ans3 = is_pal(s3);
    if (ans1 && ans2 && ans3) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
N, K = map(int, input().split())
MOD = 10 ** 9 + 7
L = [i for i in range(K + 1)]
res = 0
for i in range(1, K + 1):
    res += pow(K // i, N, MOD) * L[i]
    res %= MOD
    j = i * 2
    while j <= K:
        L[j] -= L[i]
        j += i
print(res)


Measured memory_bytes: 73600
#include<iostream>
#include<cstdio>
using namespace std;
int main(){
	int n;
	cin>>n;
	if(n==1){
		cout<<"Hello World";
	}else{
		if(n==2){
			int a,b;
			cin>>a>>b;
			cout<<a+b<<endl;
		}
	}
} 

Measured memory_bytes: 256
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <cmath>
#include <ctime>
#include <vector>
#include <cstdio>
#include <string>
#include <cstring>
#include <iostream>
#include <algorithm>

using namespace std;

#define LL long long
#define pii pair<int,int>
#define sd(x) scanf("%d",&x)
#define slld(x) scanf("%lld",&x)
#define pd(x) printf("%d\n",x)
#define plld(x) printf("%lld\n",x)
#define rep(i,a,b) for(int i = (a) ; i <= (b) ; i++)
#define per(i,a,b) for(int i = (a) ; i >= (b) ; i--)
#define mem(a) memset(a,0,sizeof(a))
#define lson l , m , rt << 1
#define rson m + 1 , r , rt << 1 | 1
#define fast_io ios::sync_with_stdio(false)

const int INF = 1e9;
const LL mod = 1e9 + 7;
const int maxn = 2e5 + 7;

char s[maxn];
LL cnt[maxn];

LL qpow(LL a,LL b,LL p) {
    LL res = 1;
    while(b) {
        if(b & 1) res = (res * a) % p;
        a = (a * a) % p;
        b >>= 1;
    }
    return res%p;
}

int main() {
    int n,p;
    while(~scanf("%d%d",&n,&p)) {
        scanf("%s",s);
        int len = strlen(s);
        LL ans = 0;
        if(p == 2 || p == 5) {
            rep(i,0,len-1) {
                if((s[i] - '0') % p == 0) ans += 1LL * (i + 1);
            }
        } else {
            mem(cnt);
            LL sum = 0;
            cnt[0] = 1;
            rep(i,0,len-1) {
                sum = (sum * 10 + (s[i] - '0')) % p;
                LL val = (qpow(10LL,n-i-1,p) * (sum % p)) % p;
                cnt[val]++;
            }
            rep(i,0,p-1) {
                ans += cnt[i] * (cnt[i] - 1) / 2;
            }
        }
        plld(ans);
    }
    return 0;
}


Measured memory_bytes: 2048
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<utility>//swapでaとbの値を入れ替える
#define rep(i,n) for(int i=0;i<(n);i++)
#define ll long long
#define sort(s) sort(s.begin(),s.end())
#define r(s) reverse(s.begin(),s.end())
using namespace std;
int main() {
	ll a;
	ll ans = 0;
	ll abc = 0;
	cin >> a;
	vector<int> s(a);

	rep(i, a) {
		cin >> s[i];
	}
	for(int i=0;i<a-1;i++){
		if (s[i] >= s[i + 1]) {
			abc++;
			ans = max(ans, abc);
		}

		else {
			ans = max(ans, abc);
			abc = 0;
		}
	}


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

Measured memory_bytes: 640
import java.util.*;

public class Main {
	Scanner in = new Scanner(System.in);
	public static void main(String[] args) {
		new Main();
	}
	public Main() {
		new AOJ0226();
	}
	
	class AOJ0226{
		public AOJ0226() {
			while(true){
				String r = in.next();
				String a = in.next();
				if(r.equals("0")&&a.equals("0"))break;
				int hit,blow;hit=blow=0;
				HashMap<String,Boolean> map = new HashMap<String, Boolean>();
				for(int i=0;i<a.length();i++){
					if(a.charAt(i)==r.charAt(i))hit++;
					map.put(r.charAt(i)+"",true);
				}
				for(int i=0;i<a.length();i++)if(map.containsKey(a.charAt(i)+""))blow++;
				blow-=hit;
				System.out.println(hit+" "+blow);
			}
		}
	}

	class Problem_C{
		int X,Y,right,mirror,left;
		int x,y;
		
		void doIt(){
			x = in.nextInt();
			y = in.nextInt();
			int result_x=x,result_y=y;
			int mx = X, my = Y, work; 
			switch (right) {
			case 0:
				break;
			case 1:
				work = x;
				result_x = mx-result_x;
				result_y = work;
				work=mx;mx=my;my=work;//swap
				break;
			case 2:
				result_x = mx-result_x;
				result_y = my-result_y;
				break;
			case 3:
				work = result_x;
				result_x = result_y;
				result_y = my - work;
				work=mx;mx=my;my=work;//swap
				break;
			}
			System.out.println("右回転 "+result_x+" "+result_y);
			
			switch (mirror) {
			case 0:
				break;
			case 1:
				result_x = mx-result_x+1;
				break;
			}
			System.out.println("反転　 "+result_x+" "+result_y);
			
			switch (left) {
			case 0:
				break;
			case 1:
				work = result_x;
				result_x = result_y;
				result_y = my - work;
				work=mx;mx=my;my=work;//swap
				break;
			case 2:
				result_x = mx-result_x;
				result_y = my-result_y;
				break;
			case 3:
				work = x;
				result_x = mx-result_x;
				result_y = work;
				work=mx;mx=my;my=work;//swap
				break;
			}
			
			System.out.println("左回転 "+result_x+" "+result_y);
		}

		public Problem_C() {
			X = in.nextInt();
			Y = in.nextInt();
			right = in.nextInt()%4;
			mirror = in.nextInt()%2;
			left = in.nextInt()%4;
			int p = in.nextInt();
			for(int i=0;i<p;i++)doIt();
		}
	}
}

Measured memory_bytes: 60624
#include<iostream>
#include<string>
using namespace std;
int main(){
    string s;
    cin>>s;
    char a=s[0],b=1;
    int fa=0,fb=0;
    for(int i=1;i<s.size();i++){
        if(s[i]==a) fa=1;
        if(s[i]==b) fb=1;
        if(b==1&&s[i]!=a) b=s[i];
    }
    if(fa&&fb) cout<<"Yes\n";
    else cout<<"No\n";
    return 0;
}

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

using namespace std;
#define pb push_back

typedef long long ll;
 //__builtin_popcount(unsigned int)
int n;
int a[15+5][15+5];
//int mark[15+5];

int main()
{
  ios::sync_with_stdio(false);
  cin.tie(0); cout.tie(0);
  cin >> n;
  int ai, ta, tb;
  memset(a, -1, sizeof(a));
  for(int i = 1; i <= n; i++)
  {
    cin >> ai;
    for(int j = 0; j < ai; j++)
    {
      cin >> ta >> tb;
      a[i][ta] = tb?1:0;
    }
  }
  //for(int i = 1; i <= n; i++, cout <<endl)for(int j = 1; j <= n; j++) cout << a[i][j] << ' ';
  int ans = 0; //max
  for(unsigned int  s = 0; s < (1<<n); s++)
  {
    //cout << "now at state " << s << endl;
    bool flag = 0;
    for(int i = 1; i <= n; i++)if((s>>(i-1))&1)
    {
      //cout << "now at rule from " << i << endl;
      for(int j = 1; j <= n; j++)
      {
        if(a[i][j] != -1)
        {
          bool tmp = (s>>(j-1))&1;
          //cout << "now at " << j <<  " tmp is " << tmp << endl;
          if(tmp != a[i][j])
          {
            flag = 1;
            //cout << "contradiction @ " << i << ' ' << j << endl; //rule of i at j
          }
        }
      }
      if(flag) break;
    }
    if(flag) continue;
    else ans = max(ans, __builtin_popcount(s));
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1000000007;
const ll LINF=1LL<<60;
const int INF=1<<30;

int main(){
	int N;
	cin >> N;
	if (N < 1200){
		cout << "ABC" <<endl;
	}
	else if(N < 2800){
		cout << "ARC" <<endl;
	}
	else{
		cout <<"AGC" <<endl;
	}
	return 0;
}

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

using namespace std;

typedef long long int64;

int H, N, P, M, K, S[500];


int main()
{
  memset(S, -1, sizeof(S));

  cin >> H >> N >> P >> M >> K;
  for(int i = 0; i < M; i++) {
    int a, b;
    cin >> a >> b;
    S[--a] = --b;
  }

  vector< vector< double > > curr(K + 1, vector< double >(N, 0.0));
  curr[0][--P] = 1.0;
  for(int i = H - 1; i >= 0; i--) {
    vector< vector< double > > next(K + 1, vector< double >(N, 0.0));
    if(S[i] >= 0) {
      for(int j = 0; j <= K; j++) {
        for(int k = 0; k < N; k++) {
          if(S[i] == k) next[j][k + 1] += curr[j][k];
          else if(S[i] + 1 == k) next[j][k - 1] += curr[j][k];
          else next[j][k] += curr[j][k];
        }
      }
    } else {
      for(int j = 0; j <= K; j++) {
        for(int k = 0; k < N; k++) {
          next[j][k] += curr[j][k];
        }
      }
      for(int j = 1; j <= K; j++) {
        for(int k = 0; k < N; k++) {
          for(int S_i = 0; S_i + 1 < N; S_i++) {
            if(S_i == k) next[j][k + 1] += curr[j - 1][k];
            else if(S_i + 1 == k) next[j][k - 1] += curr[j - 1][k];
            else next[j][k] += curr[j - 1][k];
          }
        }
      }
    }
    curr.swap(next);
  }

  double ret = 0, all = 0;
  for(int i = 0; i < N; i++) {
    all += curr[K][i];
    ret = max(ret, curr[K][i]);
  }
  cout << fixed << setprecision(10) << ret / all << endl;
}

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

#define INF 900000000
#define LINF 9000000000000000000

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

ll n, k;
ll ls[100001];

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

	cin >> n >> k;
	for (int i = 0; i < n; i++) {
		int a, b;
		cin >> a >> b;
		ls[a]+=b;
	}
	ll cnt=0, ans;
	for (int i = 1; i <= 100000; i++) {
		cnt += ls[i];
		if (cnt >= k) {
			ans = i;
			break;
		}
	}
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 1024
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		String t = sc.nextLine();
		StringBuilder sb = new StringBuilder();
		int tLength = t.length();
		int sLength = s.length();
		int i = sLength - tLength;

		for(;i>=0;i--){
			boolean replace = true;
			for(int j = 0;j < tLength;j++){
				if(s.charAt(i+j) == '?' || s.charAt(i+j) == t.charAt(j)) continue;
				replace = false;
				break;
			}
			if(replace){
				s = s.replaceAll("\\?", "a");
				if(i > 0){
					sb.append(s.substring(0, i));
				}
				sb.append(t);
				if(i+tLength < sLength){
					sb.append(s.substring(i+tLength, sLength));
				}
				break;
			}
		}
		System.out.println(i < 0 ? "UNRESTORABLE" : sb.toString());
	}
}


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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;
typedef pair<ll, P> PP;

static const double EPS = 1e-8;
static const double PI = 4.0 * atan(1.0);
static const ll INF = 1023456789;

#define REP(i,n)	for(int i=0;i<n;++i)
#define REPR(i,n)	for(int i=n-1;i>=0;--i)
#define FOR(i,s,n)	for(int i=s;i<n;++i)
#define FORR(i,s,n)	for(int i=n-1;i>=s;--i)
#define ALL(c)		(c).begin(),(c).end()
#define CLEAR(v)	memset(v,0,sizeof(v))
#define MP(a,b)		make_pair((a),(b))
#define ABS(a)		((a)>0?(a):-(a))
#define F			first
#define S			second

ll n, l[10];

int main(int argc, char **argv) {
	cin >> n;
	REP(i, n) cin >> l[i];
	sort(l, l+n);
	ll s = 0;
	REP(i, n-1) s += l[i];
	cout << (l[n-1] < s ? "Yes" : "No") << endl;
	return 0;
}


Measured memory_bytes: 3640