akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define repr(i, a, b) for (int i = a; i < b; i++)
#define rep(i, n) for (int i = 0; i < n; i++)
typedef long long ll;
#define mod 1000000007

ll gcd(ll x,ll y) {return y ? gcd(y,x%y) : x;} 
ll lcm(ll x,ll y) {return x/gcd(x,y)*y;}

int main(){
    ll n;
    cin >> n;
    unordered_set<string> s;
    rep(i,n){
        string ss;
        cin >> ss;
        s.insert(ss);
    }
    cout << s.size() << endl;

    return 0;
}

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

int main(){
    int a,b,k; cin>>a>>b>>k;
    for(int i=1; i<=k; i++){
        if(i%2==1){
            if(a%2==0){
                a=a/2;
                b+=a;
            }
            else{
                a=a-1; a=a/2;
                b+=a;
            }
        }
        else{
            if(b%2==0){
                b=b/2;
                a+=b;
            }
            else{
                b=b-1; b=b/2;
                a+=b;
            }
        }
    }
    cout << a << " " << b << endl;
}

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

int main () {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n;
  cin >> n;
  int mx = 0;
  map<string, int> cnt;
  for (int i = 0; i < n; i++) {
    string foo;
    cin >> foo;
    ++cnt[foo];
    mx = max (mx, cnt[foo]);
  }
  for (auto to : cnt) {
    if (to.second == mx) cout << to.first << '\n';
  }
  
  return 0;
}


Measured memory_bytes: 23808
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please


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


	int N;
	cin >> N;

	if (N % 2) {
		int M = N * (N - 1) / 2 - N / 2;
		co(M);
		rep1(i, N) {
			for (int j = i + 1; j <= N; j++) {
				if (i + j != N) {
					cosp(i);
					co(j);
				}
			}
		}
	}
	else {
		int M = N * (N - 1) / 2 - N / 2;
		co(M);
		rep1(i, N) {
			for (int j = i + 1; j <= N; j++) {
				if (i + j != N + 1) {
					cosp(i);
					co(j);
				}
			}
		}
	}

	Would you please return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
    char c1, c2;
    cin>>c1;
    if(c1 == '9')
    {
        cout<<"Yes"<<endl;
    }
    else
    {
        cin>>c2;
        if(c2 == '9')
        {
            cout<<"Yes"<<endl;
        }
        else
        {
            cout<<"No"<<endl;
        }
    }
    return 0;
}

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

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())

template<typename T>
T mod(T a, T b){
    return (a + b) % b;
}

template<typename T>
T gcd(T a, T b){
    if (b == 0) return a;
    return gcd(b, a % b);
}

ll lcm(ll a, ll b){
    return a * b / gcd(a,b);
}

// n を素因数分解
map<ll, ll> factor(ll n){
    map<ll, ll> mp;
    for (ll i = 2; i*i <= n; i++) {
        while (n % i == 0) {
            mp[i]++;
            n /= i;
        }
    }

    if (n > 1) {
        mp[n]++;
    }

    return mp;
}

// 文字列に "hoge" が含まれているか
// string str = "hogepiyo";
// if (str.find("hoge") != string::npos) {
//     cout << "文字列が含まれています" << endl;
// }

// char to string
// char c = 'a';
// string str = {c};

void solve(){
    string s;
    cin >> s;

    int n = s.size();
    int red = 0, blue = 0;
    for (int i = 0; i < n; i++) {
        if (s[i] == '0') {
            red++;
        } else {
            blue++;
        }
    }

    cout << min(red,blue) * 2 << endl;

    return;
}

int main(int argc, char const* argv[])
{
    solve();
    return 0;
}


Measured memory_bytes: 512
#include <iostream>
#include <algorithm>
#include <bitset>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <complex>
#include <string.h>
#include <numeric>
using namespace std;

#define int long long
#define reps(i,s,n) for(int (i)=(s);(i)<(n);++(i))
#define rep(i,n) reps(i,0,n)
#define rept(i,n) rep(i,(n)+1)
#define repst(i,s,n) reps(i,s,(n)+1)
#define reprt(i,n,t) for(int (i)=(n);(i)>=(t);--(i))
#define repr(i,n) reprt(i,n,0)
#define each(i,v) for(auto &(i):(v))
#define eachr(i,v) for(auto &(i)=(v).rbegin();(i)!=(v).rend();(i)++)
#define all(c) (c).begin(),(c).end()
#define rall(c) (c).rbegin(),(c).rend()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define tmax(x,y,z) max(x,max(y,z))
#define tmin(x,y,z) min(x,min(y,z))
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define ln '\n'
#define bln(i,n) (((i)==(n)-1)?'\n':' ')
#define dbg(x) cout<<#x" = "<<(x)<<ln<<flush
#define dbga(x,n) {cout<<#x" : ";for(int (i)=0;i<(n);++i){cout<<((x)[i])<<(i==((n)-1)?'\n':' ')<<flush;}}
#define zero(a) memset(a,0,sizeof(a))
#define unq(a) sort(all(a)),a.erase(unique(all(a)),a.end())

//typedef complex<double> P;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<string> vst;
typedef vector<pii> vpii;
typedef vector<pll> vpll;
typedef vector<vector<int> > mat;

const ll inf = (ll)1e9+10;
const ll linf = (ll)1e18+10;
const ll mod = (ll)(1e9+7);
const int dx[] = {0, 1, 0, -1};
const int dy[] = {1, 0, -1, 0};
const int ddx[] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[] = {1, 1, 0, -1, -1, -1, 0, 1};
const double eps = 1e-10;

ll mop(ll a,ll b,ll m=mod) {ll r=1;a%=m;for(;b;b>>=1){if(b&1)r=r*a%m;a=a*a%m;}return r;}
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;}
bool ool(int x,int y,int h,int w) {return((x<0)||(h<=x)||(y<0)||(w<=y));}
bool deq(double a,double b) {return abs(a-b)<eps;}

struct oreno_initializer {
	oreno_initializer() {
		cin.tie(0);
		ios::sync_with_stdio(0);
	}
} oreno_initializer;



int n, k, a[1010];
vector<int> p;

signed main() {
	cin >> n >> k;
	rep(i,n) cin >> a[i];
	rep(i,n) {
		int t = a[i];
		p.push_back(t);
		reps(j,i+1,n) {
			t += a[j];
			p.push_back(t);
		}
	}
	int res = 0, m = p.size();
	for (int b=60; b>=0; b--) {
		res |= 1ll<<b;
		int cnt = 0;
		rep(i,m) if ((p[i]&res) == res) cnt++;
		if (cnt<k) res ^= 1ll<<b;
	}
	cout << res << endl;
}

Measured memory_bytes: 6512
N, M = map(int, input().split(' '))
P_n = [input().split(' ') for _ in range(M)]
ac = set([])
for p in P_n:
    if p[1] == 'AC':
        ac.add(p[0])
correct = 0
incorrect = 0
already = set([])
for p in P_n:
    if p[0] not in already and p[0] in ac:
        if p[1] == 'AC':
            correct += 1
            already.add(p[0])
        elif p[1] == 'WA':
            incorrect += 1
print(str(correct) + ' ' + str(incorrect))

Measured memory_bytes: 49072
#include "bits/stdc++.h"
#include <boost/range/irange.hpp>
using namespace std;
using boost::irange;

// 定義
typedef long long           ll;
typedef pair<ll, ll>        P;
#define ALL(x)              (x).begin(),(x).end()
#define REP(i, n)           for (ll i = 0 ; i < (ll)n ; ++i)
#define REPN(i, m, n)       for (ll i = m ; i < (ll)n ; ++i)
const ll                    INF = 2e9;
const ll                    INF_LL = 1LL<<60;
const ll                    MOD = 1e9 + 7;
namespace {
	ll Ceil(ll val, ll div)   { return (val + div - 1) / div; }
	ll CeilN(ll val, ll div)  { return Ceil(val, div) * div; }
	ll FloorN(ll x, ll n)     { return (x - x % n); }
	bool IsOdd(ll x)          { return ((x & 1) == 1); }
	bool IsEven(ll x)         { return ((x & 1) == 0); }
	template<class T> bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
	template<class T> bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
};

// 処理
void Solve()
{
	string S;
	cin >> S;
	map<char, ll> mp;
	for_each(ALL(S), [&](char one){mp[one]++; });

	ll ans = INF;
	for (auto it = mp.begin(); it != mp.end(); it++) {
		ll ansOne = 0;
		auto one = *it;
		string s = S;
		while (1) {
			bool isSame = true;
			REP(i, s.size()) {
				if (s[i] != one.first) {
					isSame = false;
				}
			}
			if (isSame) {
				break;
			}

			string t;
			REP(i, s.size() - 1) {
				if (s[i] == one.first || s[i + 1] == one.first) {
					t += one.first;
				} else {
					t += s[i];
				}
			}
			s = t;
			ansOne++;
		}
		chmin(ans, ansOne);
	}

	cout << ans << endl;
}

// メイン
int main()
{
	cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	cout << fixed << setprecision(15);
	Solve();
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  //データの数と割った数を宣言
  int N;
  int n = 0;
  cin >> N;
  
  //データ用のセルを宣言
  vector <int> data (N);
  for (int i = 0; i < N; i++){
    cin >> data.at(i) ;
  }
  
  while(true){
    bool exit_odd =false;
    for (int i =0; i < N; i++){
      if(data.at(i) % 2 != 0){
        exit_odd =true;
      }
    }
    if(exit_odd){
      break;
    }
    
    for (int i =0; i < N; i++){
      data.at(i) /= 2;
    }
    n++;
  }
  cout << n << endl;
  
  

}


Measured memory_bytes: 3588
from itertools import product
n, k = input().split()
a = list(input().split())
l = set([str(i) for i in range(10)]).difference(a)
ni = int(n)
ans = int('99'+n)
for j in range(len(n), len(n)+2):
    for i in product(l, repeat=j):
        t = int(''.join(i))
        if t >= ni:
            ans = min(t, ans)
print(ans)

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

#define REP(i, n, N) for(ll i=(n); i<(N); i++)
#define RREP(i, n, N) for(ll i=(N-1); i>=n; i--)
#define CK(n, a, b) ((a)<=(n)&&(n)<(b))
#define ALL(v) (v).begin(),(v).end()
#define MCP(a, b) memcpy(b,a,sizeof(b))
#define p(s) cout<<(s)<<endl
#define p2(a, b) cout<<(a)<<" "<<(b)<<endl
#define v2(T) vector<vector<T>>
typedef long long ll;
using namespace std;
const ll mod = 1e9 + 7;
const ll inf = 1e18;

ll N;
ll A[100010];
priority_queue<ll, vector<ll>, greater<ll> > pls;
priority_queue<ll>	mns;
vector<pair<ll, ll>> ans;
int main() {
	cin >> N;
	REP(i,0,N){
		cin >> A[i];
		if(A[i] >= 0){
			pls.push(A[i]);
		}else{
			mns.push(A[i]);
		}
	}
	while(mns.size()+pls.size()>2){
		ll left, right;
		if(mns.size()==0){
			left = pls.top();
			pls.pop();
			right = pls.top();
			pls.pop();
			mns.push(left-right);
		}else if(pls.size()==0){
			left = mns.top();
			mns.pop();
			right = mns.top();
			mns.pop();
			pls.push(left-right);
		}else if(mns.size() >= pls.size()){
			left = pls.top();
			right = mns.top();
			pls.pop();
			mns.pop();
			pls.push(left-right);

		}else{
			left = mns.top();
			right = pls.top();
			pls.pop();
			mns.pop();
			mns.push(left-right);
		}
		ans.emplace_back(left, right);
	}
	ll left, right;
	if(mns.size()==0){
		right = pls.top();
		pls.pop();
		left = pls.top();
		pls.pop();
	}else if(pls.size()==0){
		left = mns.top();
		mns.pop();
		right = mns.top();
		mns.pop();
	}else if(mns.size() == pls.size()){
		left = pls.top();
		right = mns.top();
		pls.pop();
		mns.pop();
	}else{
		assert(false);
	}
	ans.emplace_back(left, right);

	p(ans.back().first - ans.back().second);
	for(auto as: ans){
		p2(as.first, as.second);
	}
	return 0;
}


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

int main() {
	int x,y;
	cin >> x >> y;
	string k = "error";
	int z = x + y;
	if(z > 9)
	{
		cout << k << endl;
		return 0;
	}
    cout << z << endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <climits>
#include <set>
#include <algorithm>
#include <unordered_map>
#include <queue>
#include <iomanip>
#include <map>
#include <utility>
#include <numeric>
#include <chrono>
#include <ctime>
#include <bitset>
#include <iterator>
#include <cmath>
#include <stack>
#include <random>

#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define debug(x) cerr << #x << ": " << x << ", "
#define debugln(x) cerr << #x << ": " << x << '\n'

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

using namespace std;
using ll = long long;
using P = pair<ll, ll>;

constexpr ll mod = 1e9+7;
const double PI = acos(-1.0);
mt19937_64 engine(chrono::steady_clock::now().time_since_epoch().count());

signed main() {

  vector<int> a(3);
  cin >> a[0];
  cin >> a[1];
  cin >> a[2];
  if (a[0] == a[1] && a[1] == a[2]) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }

}


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

UL N, Q;
UL VW[1 << 18][2] = {};
UL dp[10][100001] = {};
UL dp2[1 << 9][2] = {};
UL ans[100000] = {};

struct Query {
	UL i; UL L;
};
vector<Query> que[1 << 18];

void DFS(UL p = 0, UL i = 0) {
	if (i == 18) return;
	UL v = VW[p][0];
	UL w = VW[p][1];
	if (i < 9) {
		dp[i + 1][0] = 0;
		for (UL j = 1; j <= 100000; j++) {
			dp[i + 1][j] = max(dp[i + 1][j - 1], dp[i][j]);
			if (j >= w) dp[i + 1][j] = max(dp[i + 1][j], dp[i][j - w] + v);
		}
		for (auto& q : que[p]) {
			ans[q.i] = dp[i + 1][q.L];
		}
	}
	else {
		UL ii = i - 9;
		rep(j, 1 << ii) {
			dp2[j + (1 << ii)][0] = dp2[j][0] + v;
			dp2[j + (1 << ii)][1] = dp2[j][1] + w;
		}
		for (auto& q : que[p]) {
			rep(j, 1 << (ii + 1)) {
				if (dp2[j][1] <= q.L)
					ans[q.i] = max(ans[q.i], dp[9][q.L - dp2[j][1]] + dp2[j][0]);
			}
		}
	}
	DFS((p << 1) + 1, i + 1);
	DFS((p << 1) + 2, i + 1);
}


int main() {
	scanf("%u", &N);
	rep(i, N) scanf("%u%u", &VW[i][0], &VW[i][1]);
	scanf("%u", &Q);
	rep(i, Q) {
		UL v, L; scanf("%u%u", &v, &L); v--;
		que[v].push_back({ i, L });
	}
	DFS();
	rep(i, Q) printf("%u\n", ans[i]);
	return 0;
}


Measured memory_bytes: 18992
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
typedef int64_t int64;
typedef uint32_t uint;
typedef uint64_t uint64;
using namespace std;

//---

template <typename T>
inline void print(const T& rhs){ std::cout<<" = "<<rhs<<std::endl; }
template <typename T>
inline void print(const std::vector<T>& rhs){
    std::cout<<" = [ ";
    for(uint i=0; i<rhs.size(); ++i){ std::cout<<rhs[i]<<' '; }
    std::cout<<"]"<<std::endl;
}
template <typename T>
inline void print(const std::vector<std::vector<T>>& rhs){
    std::cout<<" = "<<std::endl;
    std::cout<<"[[ ";
    for(uint p=0; p<rhs.size(); ++p){
        if(p!=0){ std::cout<<" [ "; }
        for(uint q=0; q<rhs[p].size(); ++q){
            std::cout<<rhs[p][q]<<' ';
        }
        if(p!=rhs.size()-1){ std::cout<<"]"<<std::endl; }
    }
    std::cout<<"]]"<<std::endl;
}
template <typename TL, typename TR>
inline void print(const std::vector<std::pair<TR,TL>>& rhs){
    std::cout<<" = [";
    uint i=0;
    for(; i<rhs.size()-1; ++i){ std::cout<<"[f: "<<rhs[i].first<<", s: "<<rhs[i].second<<"], "; }
    std::cout<<"[f: "<<rhs[i].first<<", s: "<<rhs[i].second<<"]]" << endl;
}
#define printn(var) {printf("%s", #var);print(var);}
#define printn_all(var) {printf("%s(%d): ", __func__, __LINE__);printf("%s", #var);print(var);}

//---

bool isNum(char c){ return ('0'<=c && c<='9'); }

bool solve(const string& s, const int A, const int B){
    for(int i=0; i<A; ++i){
        if(! isNum(s[i]) ){ return false; }
    }
    
    if(s[A]!='-'){ return false; }
    
    for(int i=0; i<B; ++i){
        if(! isNum(s[A+1+i]) ){ return false; }
    }
    
    return true;
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    int A, B; cin >> A >> B;
    string s; cin >> s;
    
    cout << (solve(s, A, B) ? "Yes":"No") << endl;
    
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int maxn=2e5;
char str[maxn];
int ps[maxn];
int main()
{
	int N;
	scanf("%s",str);
	N=strlen(str);
	int flag=1;
	for(int i=1;i<=N;i++)
		if(i==1&&str[i-1]!='1')
				flag=0;
		else if(i==N&&str[i-1]!='0')
				flag=0;
		else if(i!=1&&i!=N&&str[i-1]!=str[N-i-1])flag=0;
	if(flag==0)printf("-1\n");
	else{
		int cnt=0;
		for(int i=1;i<N;i++)
			if(str[i]=='1')ps[++cnt]=i+1;
		for(int i=1;i<cnt;i++)
			printf("%d %d\n",i,i+1);
		//构造一个头 cnt+1
		printf("%d %d\n",cnt,cnt+1);
		int sz=cnt+2;
		for(int i=1;i<=cnt;i++){
			for(int j=0;j<ps[i]-ps[i-1]-1;j++)
				printf("%d %d\n",i,sz++);
		}
	}
}

Measured memory_bytes: 1920
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <numeric>
#include <string>
#include <string.h>
#include <map>
#include <set>
#include <functional>
#include <complex>
#include <stack>
#include <tuple>
using namespace std;
#define rep(i,n) for (int i=0; i < (n); i++)


typedef long long int ll;
typedef double D;      // ??§?¨?????????????double???long double?????????
typedef complex<D> P;  // Point
typedef pair<P, P> L;  // Line
typedef vector<P> VP;


const int INF = (1<<30) - 1;
const D EPS = 1e-9;

#define X real()
#define Y imag()
#define LE(n,m) ((n) < (m) + EPS)
#define GE(n,m) ((n) + EPS > (m))
#define EQ(n,m) (abs((n)-(m)) < EPS)

#define NOT_YET -1
#define CAT 1
#define RABBIT 0

int8_t memo[500][500+1];

bool is_cat(string &s, int b, int e){
    if(memo[b][e] != NOT_YET)
        return memo[b][e];
    
    if(e - b == 0) return true;
    
    if(s[b] == 'm' && s[e-1] == 'w'){
        bool ret = false;
        for(int i=b; i<e; i++){
            if(s[i] == 'e')
                ret |= is_cat(s, b+1, i) && is_cat(s, i+1, e-1);
        }
        return memo[b][e] = ret;
    }else{
        return memo[b][e] = false;
    }
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    memset(memo, -1, sizeof(memo));
    
    string s;
    cin >> s;
    cout << (is_cat(s, 0, s.size()) ? "Cat" : "Rabbit") << endl;
    
    return 0;
}

Measured memory_bytes: 1440
#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
int main(void){
    for(;;){
        int p[10010];
        int d1[10010],d2[10010];
        int d[10010];
        int n,ans=0,po;
        cin>>n;
        if(n==0)break;
        for(int i=0;i<n;i++){
            cin>>p[i]>>d1[i]>>d2[i];
            d[i]=d1[i]+d2[i];
            if(ans<d[i]){
                ans=d[i];
                po=p[i];
            }

        }
        cout<<po<<" "<<ans<<endl;

    }
        return 0;

}

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

bool cmp(long long a, long long b)
{
    return (b<a);
}
long long int num = 1e9 + 7;
long long mod(long long a)
{
    return (a%num+num)%num;
}
long long modi(long long a, long long b)
{
    return mod(mod(a)* mod(b));
}

int main()
{
    int n,k;
    cin>>n>>k;
    long long in;
    vector<long long> pos;
    vector<long long> neg;

    //store the elments
    for(int i=0; i<n; i++){
        cin>>in;
        if(in>0) pos.push_back(in);
        else neg.push_back(in);
    }
    long long answer=1;

    if(pos.size()==0){//if all newg
        //desc order
        sort(neg.begin(),neg.end());

        if(k%2==1)
            reverse(neg.begin(),neg.end());//here if odd must take from increment

        for(int i=0; i<k; i++)
            answer=modi(answer,neg[i]);

        cout<<answer<<endl;
        return 0;
    }
    else
    {
        if(k%2==1){//take grater from kast positive
            sort(pos.begin(), pos.end());
            answer=modi(answer,pos.back());
            k--;
            pos.pop_back();
        }
        vector<long long> poo;
        sort(pos.begin(),pos.end(),cmp);//gratest
        sort(neg.begin(), neg.end());
        for(int i=0; i<(int)pos.size()-1; i+=2)//tow pares
        {
            poo.push_back(pos[i]*pos[i+1]);
        }
        for(int i=0; i<(int)neg.size()-1; i+=2)
        {
            poo.push_back(neg[i]*neg[i+1]);
        }
        if((int)pos.size()%2==1 and (int)neg.size()%2==1)
        {
            poo.push_back(pos.back()*neg.back());
        }
        sort(poo.begin(),poo.end(),cmp);
        for(int i=0; i<k/2;i++)
        {
            answer=modi(answer,(long long)poo[i]);
        }
        cout<<answer<<endl;
    }
    return 0;
}


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

int main(){

    int a,b;
    cin >> a >> b;

    if(a%3 == 0 || b%3 == 0 || (a+b)%3 == 0){
        cout << "Possible" << endl;
    }else{
        cout << "Impossible" << endl;
    }


    return 0;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	string s;
	cin >> s;
	int k;
	cin >> k;
	int len = (int) s.length();
	for (int i = 0; i < len; i++) {
		if (i == len - 1) {
			s[i] = (s[i] - 'a' + k) % 26 + 'a';
			break;
		}
		if (s[i] != 'a') {
			int x = 'z' - s[i] + 1;
			if (x <= k) {
				s[i] = 'a';
				k -= x;
			}
		}
	}
	cout << s << '\n';
	return 0;
}


Measured memory_bytes: 592
n,k=map(int,input().split())
l=[]
for m in range(1,n+1):
  l.append(m)
for i in range(k):
  d=int(input())
  s=input().split()
  for j in s:
    if int(j) in l:
      l.remove(int(j))
print(len(l))

Measured memory_bytes: 9172
#include <bits/stdc++.h>
using namespace std;
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define all(x) (x).begin(),(x).end()
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
typedef long long ll;
const long long INF = 1LL << 60;
typedef pair<int, int> P;
const int MOD = 1e9 + 7;

ll mod_pow(ll x, ll n, ll mod) {
    ll res = 1;
    while(n > 0) {
        if (n & 1) res = res * x % mod;
        x = x * x % mod;
        n >>= 1;
    }
    return res;
}

int main()
{
    int m, n;
    cin >> m >> n;

    cout << mod_pow(m, n, MOD) << endl;
    return 0;
}


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

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

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

int compare_char(char *a,char *b){
	return strcmp(a,b);
}

int intsort(const void *a, const void *b){
	return *(int*)b - *(int*)a;
	/*qsort(a,aの配列数,sizeof(int),intsort);*/
}

int longsort(const void *a, const void *b){
	long *A=(long *)a;
	long *B=(long *)b;
	if(*A>*B) return -1;
	if(*A<*B) return 1;
	return 0;
}

int main(){
  int i,N,K,a[200];
  for(i=0;i<3;i++){
    scanf("%d",&a[i]);
  }
  if((a[0]>a[2] &&a[1]<a[2]) || (a[0]<a[2] &&a[1]>a[2])){
    printf("Yes\n");
  }else{
    printf("No\n");
  }
  return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <queue>
#include <stack>
#include <cstdlib>
#include <map>
#include <iomanip>
#include <set>
using namespace std;
#define rep(i,n) for(int i=0;i<n;i++)
#define int long long
#define pie 3.141592653589793238462643383279
#define mod 1000000007
#define INF 1145141919364364
#define all(vec) vec.begin(),vec.end()
#define P pair<int,int>
#define S second
#define F first
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
int lcm(int x, int y) {
	return x / gcd(x, y)*y;
}
bool prime(int x) {
	for (int i = 2; i <= sqrt(x); i++) {
		if (x%i == 0)return false;
	}
	return true;
}

int kai(int x) {
	if (x == 1)return 1;
	return kai(x - 1)*x%mod;
}

int mod_pow(int x, int y, int moder) {
	int res = 1;
	while (y > 0) {
		if (y & 1)res = res * x%moder;
		x = x * x%moder;
		y >>= 1;
	}
	return res;
}

int comb(int x, int y) {
	if (y > x)return 0;
	if (x == y)return 1;
	return kai(x)* mod_pow(kai(x - y), mod - 2, mod) % mod * mod_pow(kai(y), mod - 2, mod) % mod;
}

int n, a[100010];
vector<int> ta;
bool bl;

int ni(int n, int s) {
	int l = 0;
	int r = n - 1;
	int c = n - 1;
	bl = true;
	while (1) {
		int d = c;
		c = (l + r) / 2;
		if (ta[c] >= s) {
			if (d - c == 1 && bl)return d;
			l = c;
			bl = false;
		}
		else {
			r = c;
			bl = true;
		}
		if (c == d && !bl)return c + 1;
		else if (c == d)return c;
	}
}

signed main() {
	cin >> n;
	rep(i, n)cin >> a[i];
	ta.push_back(a[0]);
	for (int i = 1; i < n; i++) {
		if (ta[ta.size() - 1] >= a[i])ta.push_back(a[i]);
		else ta[ni(ta.size(), a[i])] = a[i];
	}
	cout << ta.size() << endl;
}

Measured memory_bytes: 2168
#include <atcoder/dsu>
#include <cstdio>

using namespace std;
using namespace atcoder;

int main() {
    int n, q;
    scanf("%d %d", &n, &q);
    dsu d(n);
    for (int i = 0; i < q; i++) {
        int t, u, v;
        scanf("%d %d %d", &t, &u, &v);
        if (t == 0) {
            d.merge(u, v);
        } else {
            if (d.same(u, v)) {
                printf("1\n");
            } else {
                printf("0\n");
            }
        }
    }
    return 0;
}


Measured memory_bytes: 3496
#include<iostream>
#include<cstdio>
#include<string>
#include<math.h>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<map>
#include<numeric>
#include<stack>
#include<queue>
#include<functional>
#include<cassert>
#include<set>
#include<numeric>
#define rep(a,b) for(ll a=0;a<b;++a)
#define REP(a,b,c,d) for(ll a=b;a<c;a+=d)
#define yes cout<<"Yes"<<endl
#define no cout<<"No"<<endl
#define mod 1000000007
using namespace std;
using ll = long long;
using p_i = pair<int, int>;
int main() {
	vector<p_i> A(5);
	int ans = 0;
	rep(i, 5) {
		cin >> A[i].second;
		if(A[i].second%10==0)A[i].first = 10;
		else A[i].first = A[i].second % 10;
	}
	sort(A.begin(), A.end());
	rep(i, 5) {
		if (i == 0)ans += A[i].second;
		else if (A[i].second %10== 0)ans += A[i].second;
		else ans += ((A[i].second / 10) + 1) * 10;
	}
	cout << ans << endl;
	cin >> ans;
}

Measured memory_bytes: 256
"""
n = (m*k+1)*(k^l) となるm,lがあるか？

kは「nの約数 or n%k==1<=>kがn-1の約数」が必要
"""
def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)
    # divisors.sort()
    return divisors
 
def is_f(k,n):
    while n%k==0:
        n /= k
    return n%k==1


n = int(input())

cnt = 0
num = tuple(make_divisors(n)[1:] + make_divisors(n-1)[1:])

for k in num:
    if is_f(k,n):
        cnt += 1

print(cnt)



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

using namespace std;

typedef unsigned long long ull;
typedef long long ll;
typedef double ld;
//#define ll __int128
//#define int ll
//#define int ll
//#define char ll
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<vvc> vvvc;
typedef pair<int, int> pii;
typedef pair<pii, pii> piii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector< vi > vvi;
typedef vector< vvi > vvvi;
typedef vector<short> vs;
typedef vector<vs> vvs;
typedef vector<vvs> vvvs;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
typedef vector<ld> vld;
typedef vector<vld> vvld;
typedef vector<vvld> vvvld;
typedef vector<string> vst;
typedef vector<vst> vvst;
typedef pair<ld, ld> pld;

#define inmin(a, b) a = min(a, (b))
#define inmax(a, b) a = max(a, (b))
#define ALL(a) a.begin(),a.end()
#define RALL(a) a.rbegin(),a.rend()
#define sqr(x) ((x) * (x))
#define fori(i, n) for(int i = 0; i < int(n); ++i)
#define SZ(a) ((int)((a).size()))
#define triple(T) tuple<T, T, T>
#define quad(T) tuple<T, T, T, T>
#define watch(x) cerr << (#x) << " = " << (x) << endl;

#ifdef MAX_HOME
#define cerr cout
#else
#define cerr if (false) cerr
#endif

const double PI = 2 * acos(0.0);
#define rand shittttty_shit
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
mt19937_64 rng_64(chrono::steady_clock::now().time_since_epoch().count());

const string DIGITS = "0123456789";
const string ALPH = "abcdefghijklmnopqrstuvwxyz";


template <class T0, class T1>
inline ostream & operator << (ostream &out, pair<T0, T1> &a) {
    return out << "{" << a.first << ", " << a.second << "}";
}

template <class T0, class T1>
inline istream & operator >> (istream &in, pair<T0, T1> &a) {
    return in >> a.first >> a.second;
}

template <class T0, class T1, class T2>
inline ostream & operator << (ostream &out, tuple<T0, T1, T2> &a) {
    return out << "{" << get<0>(a) << ", " << get<1>(a) << ", " << get<2>(a) << "}";
}

template <class T0, class T1, class T2, class T3>
inline ostream & operator << (ostream &out, tuple<T0, T1, T2, T3> &a) {
    return out << "{" << get<0>(a) << ", " << get<1>(a) << ", " << get<2>(a) << ", " <<  get<3>(a) << "}";
}

template<class T>
inline ostream & operator << (ostream &out, vector<T> &a) {
    out << "[";
    fori (i, a.size())
        out << a[i] << vector<string>{", ", "]  "}[i + 1 == a.size()];
    return out;
}


void smain();



signed main() {
    ios::sync_with_stdio(0);
    cin.tie(0); cout.tie(0);
#ifdef MAX_HOME
    freopen("input.txt", "r", stdin);
    clock_t start = clock();
#endif
    cout << setprecision(4) << fixed;
    smain();
#ifdef MAX_HOME
    cout << "\n\n\n\nTOTAL EXECUTION TIME: " << float( clock () - start ) /  CLOCKS_PER_SEC << endl;
#endif
    return 0;
}

void smain() {

    int n = 7;

    vl a(n);

    fori (i, n) {
        cin >> a[i];
    }


    ll ans = a[1];

    ll dif = a[0] % 2 + a[3] % 2 + a[4] % 2;
    if (a[4] && a[0] && a[3]) {
        inmin(dif, 3 - dif);
    }

    ans += a[0] + a[3] + a[4] - dif;

    cout << ans;

}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#define boost_io ios::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define num(a) a-'0'
#define rep(i,a,b) for(int i=a;i<b;i++)
#define maxs(a,b) if(b>a)a=b
#define mins(a,b) if(b<a)a=b
#define debug(x) cerr<<#x<<":"<<x<<" "
#define all(a) (a).begin(), (a).end()
#define vi vector<int>
#define vl vector<long long int>
#define v vector
#define p pair
#define pb push_back
#define mk make_pair
#define f first
#define s second
#define ln "\n"
typedef long long int ll;
typedef long double ld;
typedef double d;
using namespace std;
ll modF=1e9+7;
ll INF=1e11;

void solve(){
	int k,n;
	cin>>k>>n;
	vi a(n);
	rep(i,0,n){
		cin>>a[i];
		a[i]=a[i]%k;
	}
	sort(all(a));
	int ans=INT_MAX;
	for(int i=0;i<n;i++){
		int hb,hf;
		if(i==0){
			hb=n-1;
			mins(ans,abs(a[i]%k-a[hb]%k));
		}
		else{
			hb=i-1;
			mins(ans,k-abs(a[i]%k-a[hb]%k));
		}
		if(i==n-1){
			hf=0;
			mins(ans,abs(a[i]%k-a[hf]%k));
		}
		else{
			hf=i+1;
			mins(ans,k-abs(a[i]%k-a[hf]%k));
		}
	}
	cout<<ans<<ln;
}	

int main(){
	boost_io;
	cout<<setprecision(10);
	solve();
	return 0;
}


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

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

Measured memory_bytes: 256
#include <stdio.h>
#include <math.h>

int main(void) {
	int n, p, max = 0, sum = 0;

	scanf("%d", &n);
	for (int i = 0; i < n; ++i) {
		scanf("%d", &p);
		max = fmax(max, p);
		sum += p;
	}
	printf("%d", sum - max / 2);

	return 0;
}

Measured memory_bytes: 128
#include <stdio.h>
#include <stdlib.h>

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

void dfs(int x, int y, char **data, char tmp)
{
	int i, j;
	data[y][x] = 0;
	for (i=0; i<4; i++)	
//		for (j=0; j<4; j++)
//			if (x+dx[j]>=0 && x+dx[j]<w && y+dy[i]>=0 && y+dy[i]<h && data[y+dy[i]][x+dx[j]] == tmp)
			if (x+dx[i]>=0 && x+dx[i]<w && y+dy[i]>=0 && y+dy[i]<h && data[y+dy[i]][x+dx[i]] == tmp)
//				dfs(x + dx[j], y + dy[i], data, tmp);
				dfs(x + dx[i], y + dy[i], data, tmp);
}

int main()
{
	int i = 0;
	int j = 0;

	while(1) {
		int res = 0;
		char **data;
		scanf("%d %d ", &h, &w);
		if (h == 0 && w == 0)
			break;
	
		data = (char **)calloc(h, sizeof(char *));
		for (i=0; i<h; i++)
			data[i] = (char *)calloc(w, sizeof(char));
	
		char rLine[100];
		for (i=0; i<h; i++) {
			gets(rLine);
		  for (j=0; j<w; j++) 
				data[i][j] = rLine[j];
		}
	
		for	(i=0; i<h; i++)
			for	(j=0; j<w; j++)
				if (data[i][j] != 0) {
					dfs(j, i, data, data[i][j]);
					res++;
				}
	
		for (i=0; i<h; i++)
			free(data[i]);
		free(data);
	
		printf("%d\n", res);	
	}

	return 0;
}

Measured memory_bytes: 1248
#include <bits/stdc++.h>
#define _overload3(_1,_2,_3,name,...)name
#define _rep(i,n)repi(i,0,n)
#define repi(i,a,b)for(int i=int(a),i##_len=(b);i<i##_len;++i)
#define MSVC_UNKO(x)x
#define rep(...)MSVC_UNKO(_overload3(__VA_ARGS__,repi,_rep,_rep)(__VA_ARGS__))
#define all(c)c.begin(),c.end()
#define write(x)cout<<(x)<<'\n'
using namespace std; typedef long long ll; template<class T>using vv = vector<vector<T>>;
template<class T>auto vvec(int n, int m, T v) { return vv<T>(n, vector<T>(m, v)); }
constexpr int INF = 1 << 29, MOD = int(1e9) + 7; constexpr ll LINF = 1LL << 60;
struct aaa { aaa() { cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(10); }; }aaaa;

int main() {
    int N, M;
    cin >> N >> M;
    vector<int> A(M);
    rep(i, M) cin >> A[i];
    write(max(-1, N - accumulate(all(A), 0)));
}

Measured memory_bytes: 3668
#include<stdio.h>

void hantei(int numbers[],int array_size){

int i,j,temp;
int c=0;
  for(i=0;i<array_size-1;i++){
    for(j=array_size-1;j>i;j--){
      if(numbers[j-1]>numbers[j]){
        temp=numbers[j-1];
        numbers[j-1]=numbers[j];
        numbers[j]=temp;
        c++;
      }
    }
  }
  for(int k=0;k<array_size;k++){
    if(k!=array_size-1){printf("%d ",numbers[k]);}
    else{printf("%d\n",numbers[k]);}

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

int main(void){
  int n=0;
  scanf("%d",&n);
  int a[n];
  for(int i=0;i<n;i++){
    scanf("%d",&a[i]);
  }
  hantei(a,n);
return 0;
}



Measured memory_bytes: 2044
n = int(input())
li = list(input())

R = li.count("R")
G = li.count("G")
B = li.count("B")

cnt = 0

for i in range(n-1):
    for j in range(i+1, n):
        if 2*j - i > n-1:
            continue
        if li[i] != li[j]:
            if li[2*j-i] != li[i] and li[2*j-i] != li[j]:
                cnt += 1
print(R*G*B - cnt)

Measured memory_bytes: 9200
#include <iostream>
#include <cstdio>
#include <map>
#include <cstring>

using namespace std;

const int maxn = 505;
int c[maxn],s[maxn],f[maxn];
int main()
{
    int n;
    scanf("%d",&n);

    for(int i=1; i<n; i++)
    {
        scanf("%d%d%d",&c[i],&s[i],&f[i]);
    }
    for(int i=1; i<=n-1; i++)
    {   int ans = 0;
        for(int j=i; j<=n-1; j++)
        {
            if(ans<s[j])
                ans = s[j];
            if(ans%f[j]!=0)
                ans+=f[j]-ans%f[j];
            ans +=+ c[j];
        }
        //ans +=
        printf("%d\n",ans);

    }
    printf("0\n");
    return 0;
}


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

int main(){
	
	int x,y;
	while(true){
		cin >> x >> y;
		if(x == 0 && y == 0)break;
		if(x > y){
			swap(x,y);
		}
		cout << x << " " << y << endl;
	}

	return 0;
}

Measured memory_bytes: 1160
import math
a,b,h,m=map(int,input().split())
ra=6*m
rb=(60*h+m)/2
deg = rb-ra
if deg>180:
    deg = 360-deg
cos = math.cos(math.radians(deg))
res2 = a**2+b**2-2*a*b*cos
print(math.sqrt(res2))

Measured memory_bytes: 9508
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <cmath>
using namespace std;
long long gcd(long long a, long long b) { return b?gcd(b,a%b):a;}
long long lcm(long long a, long long b) { return a/gcd(a,b)*b;}

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

const int INF = 1001001001;

int main() {
  int n;
  cin >> n;
  vector<int> v;
  int tmp;
  int dp[n + 5];

  rep (i, n) {
    cin >> tmp;
    v.push_back(tmp);
    dp[i] = INF;
  }

  dp[0] = 0;
  rep (i, n) {
    int ni = i + 1;
    dp[ni] = min(dp[ni], dp[i] + abs(v[i] - v[ni]));

    ni = i + 2;
    dp[ni] = min(dp[ni], dp[i] + abs(v[i] - v[ni]));
  }

  // rep (i, n) {
  //   cout << dp[i] << endl;
  // }
  cout << dp[n - 1] << endl;
  return 0;
}

Measured memory_bytes: 1148
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(ll i=0;i<(n);i++)
#define rrep(i,n) for(ll i = 1; i <= (n); ++i)
#define drep(i,n) for(ll i = (n)-1; i >= 0; --i)
#define all(v) v.begin(),v.end()
#define len(x) (ll)(x).length()
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define pb push_back
#define sz(x) (ll)(x).size()
#define v(T) vector<T>
#define vv(T) vector<vector<T>>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
ll gcd(ll a,ll b){if(a%b==0){return b;}else{return(gcd(b,a%b));}}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}
const int INF=1e9;
const ll MX = 1e18;
const int MOD=INF+7;
const int di[] = {-1,0,1,0};
const int dj[] = {0,-1,0,1};
const double PI=acos(-1);
 
int main() {
  int n;
  string s,t;
  cin>>n>>s>>t;
  rep(i,n){
    cout<<s[i]<<t[i];
  }
  cout<<endl;
}

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

int main(void){
  string s,t;
  cin>>s>>t;
  int l1=s.size(),l2=t.size();
  for(int i=0;i<l1-l2+1;i++){
    bool f=true;
    for(int j=0;j<l2;j++){
      if(s[i+j]!=t[j]){
        f=false;
        break;
      }
    }
    if(f)cout<<i<<endl;
  }
  return 0;
}



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

    res=0

    MOD=10**9+7

    for i in range(K,N+2):
        MAX=(N+(N-i+1))*i//2
        MIN=(i-1)*i//2

        res+=MAX-MIN+1
        res%=MOD

    print(res%MOD)

if __name__=="__main__":
    main()

Measured memory_bytes: 9124
#include<iostream>
#include<string>
#include<vector>
#include<list>
#include<cmath>
#include<algorithm>
#include<cstdio>
#include<set>
#include<map>
#include<queue>
using namespace std;

typedef long long ll;

int main() {
  ll N,M; cin >> N >> M;
  ll ans = 0;
  if ( N >= M ) {
    ans = M/2;
  } else if (N < M ) {
    
    if ( M <= 2*N ) {
    ans = M/2;
    }else if ( M > 2*N ) {
    ans = N;
    M -= 2*N;
    ans += M/4;
    }
  }

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


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

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
using P = pair<ll, ll>;
using V = vector<ll>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep1(i, n) for(ll i=1;i<=(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
#define ALL(obj) (obj).begin(), (obj).end()
#define RALL(obj) (obj).rbegin(), (obj).rend()
#define MOD 1000000007
#define INF 1000000000

void solve_abc_c() {
	ll n;
	ll ans = 0;
	cin >> n;

	V h(n);
	rep(i, n) {
		cin >> h[i];
	}

	ll val = 0;
	rep(i, n - 1) {
		if (h[i] >= h[i + 1]) {
			val++;
		}
		else {
			ans = max(ans, val);
			val = 0;
		}
	}
	ans = max(ans, val);

	cout << ans << "\n";
}

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

	solve_abc_c();

	return 0;
}


Measured memory_bytes: 1024
import java.util.*;
 
public class Main {
 
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
         int x = sc.nextInt();
         int y = sc.nextInt();
 
        for (int i = 0; i <= x; ++i) {
            if (2*i + 4*(x - i) == y) {
                System.out.println("Yes");
                return;
            }
        }
        System.out.println("No");
    }
}

Measured memory_bytes: 35560
# -*- coding: utf-8 -*-

import sys

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

W,H=MAP()
P=[(INT(), 'p') for i in range(W)]
Q=[(INT(), 'q') for i in range(H)]

# 行列をまとめて、コストが低い方から進める
PQ=P+Q
PQ.sort()

a=H+1
b=W+1
ans=0
for i in range(W+H):
    val,_type=PQ[i]
    if _type=='p':
        # 横線を行数に応じて足して、列数を1つ減らす
        ans+=a*val
        b-=1
    else:
        # 縦線を列数に応じて足して、行数を1つ減らす
        ans+=b*val
        a-=1
print(ans)


Measured memory_bytes: 26212
class Integer
    def to_mcxi
        r = self
        arr = []
        arr[0], r = r.divmod(1000)
        arr[1], r = r.divmod(100)
        arr[2], arr[3] = r.divmod(10)
        mcxi = arr[0] > 1 ? arr[0].to_s + "m" : arr[0] == 1 ? "m" : ""
        mcxi += arr[1] > 1 ? arr[1].to_s + "c" : arr[1] == 1 ? "c" : ""
        mcxi += arr[2] > 1 ? arr[2].to_s + "x" : arr[2] == 1 ? "x" : ""
        mcxi += arr[3] > 1 ? arr[3].to_s + "i" : arr[3] == 1 ? "i" : ""
        mcxi
    end
end

class MCXI
    @str = nil

    def initialize(str)
        @str = str
    end

    def to_i
        x, k = 0, 1
        @str.each_char{|c|
            d = c.to_i
            case d
            when 0
                case c
                when 'm' then x += k * 1000
                when 'c' then x += k * 100
                when 'x' then x += k * 10
                when 'i' then x += k
                end
                k = 1
            else
                k = d
            end
        }
        x
    end
end

gets.to_i.times{
    a, b = gets.chomp.split
    puts (MCXI.new(a).to_i + MCXI.new(b).to_i).to_mcxi
}



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

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

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

  int count = 0;
  for (int ai : a) {
    while (ai % 2 == 0) {
      ai /= 2;
      count++;
    }
  }

  cout << count << endl;

  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
struct UnionFind
{
    vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2
    UnionFind(int N) : par(N)
    { //最初は全てが根であるとして初期化
        for (int i = 0; i < N; i++)
            par[i] = i;
    }
    int root(int x)
    { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] == x)
            return x;
        return par[x] = root(par[x]);
    }
    void unite(int x, int y)
    {                     // xとyの木を併合
        int rx = root(x); //xの根をrx
        int ry = root(y); //yの根をry
        if (rx == ry)
            return;   //xとyの根が同じ(=同じ木にある)時はそのまま
        par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
    }
    bool same(int x, int y)
    { // 2つのデータx, yが属する木が同じならtrueを返す
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};
int main(){
    int N,M,i,p,q;
    cin >> N >> M;
    int P[N];
    for(i = 0;i < N;i++){
        cin >> P[i];
    }
    UnionFind tree(N + 10);
    for (i = 0; i < M; i++){
        cin >> p >> q;
        tree.unite(p,q);
    }
    p = 0;
    for(i = 0;i < N;i++){
        if(tree.same(i + 1,P[i])){
            p++;
        }
    }
    cout << p << endl;
}

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

int main() {
    ll N, K;
    cin >> N >> K;
    ll mod = 1e9+7;
    ll ans = 0;
    for (ll i = K; i <= N+1; i++) {
        ans += (N*(N+1)/2 - (N-i)*(N-i+1)/2) - i*(i-1)/2 + 1;
        ans %= mod;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3592
using System;
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder
{
    public class Prog
    {
        const int MOD = 1000000007;
        public static void Main(string[] args)
        {
            var sw = new StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);
            new Prog().Solve(new ConsoleInput(Console.In, ' '));
            Console.Out.Flush();
        }

        public void Solve(ConsoleInput cin)
        {
            var x = cin.ReadInt;
            var a = cin.ReadInt;

            var ans = (x < a) ? 0 : 10;

            Console.WriteLine(ans);
        }
    }

    public class ConsoleInput
    {
        private readonly System.IO.TextReader _stream;
        private char _separator = ' ';
        private Queue<string> inputStream;
        public ConsoleInput(System.IO.TextReader stream, char separator = ' ')
        {
            this._separator = separator;
            this._stream = stream;
            inputStream = new Queue<string>();
        }
        public string Read
        {
            get
            {
                if (inputStream.Count != 0) return inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for (int i = 0; i < tmp.Length; ++i)
                    inputStream.Enqueue(tmp[i]);
                return inputStream.Dequeue();
            }
        }
        public string ReadLine { get { return _stream.ReadLine(); } }
        public int ReadInt { get { return int.Parse(Read); } }
        public long ReadLong { get { return long.Parse(Read); } }
        public double ReadDouble { get { return double.Parse(Read); } }
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret; }
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret; }
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret; }
        public void ReadIntArrays(long N, out int[] A, out int[] B) { A = new int[N]; B = new int[N]; for (long i = 0; i < N; ++i) { A[i] = ReadInt; B[i] = ReadInt; } }
    }
}


Measured memory_bytes: 11220
#include<iostream>
#include<algorithm>
#define INF 5e7
using namespace std;

int graf[15][15];

void warshall() {
	for (int k = 0;k < 13;k++)
		for (int i = 0;i < 13;i++)
			for (int j = 0;j < 13;j++)graf[i][j] = min(graf[i][j], graf[i][k] + graf[k][j]);
}

int main() {
	int n;
	while (cin >> n, n) {
		for (int i = 0;i < 15;i++)
			for (int j = 0;j < 15;j++) {
				graf[i][j] = INF;
				if (i == j)graf[i][j] = 0;
			}
		
		for (int i = 0;i < n;i++) {
			int a, b,c;
			cin >> a >> b>>c;
			graf[a][b] = c;
			graf[b][a] = c;
		}

		warshall();
		int t, time=1e9;

		for (int i = 0;i < 10;i++) {
			int a=0;
			for (int j = 0;j < 10;j++) {
				if(graf[i][j]!=INF)a += graf[i][j];
			}
			if (time > a&&a!=0) {
				time = a;
				t = i;
			}
		}

		cout << t << ' ' << time << endl;
	}
	return 0;
}

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

using namespace std;

int cnt[200005];

int main(){

    ios_base::sync_with_stdio(false);
    cin.tie(0);

    memset(cnt,0,sizeof(cnt));
    int n,i,x;
    cin>>n;
    for(i=2;i<=n;i++){
        cin>>x;
        cnt[x]++;
    }
    for(i=1;i<=n;i++)cout<<cnt[i]<<endl;
 	return 0;
}


Measured memory_bytes: 4372