akhauriyash/Code-Regression huggingface dataset:
// #include <boost/multiprecision/cpp_int.hpp> 
// using namespace boost::multiprecision; 
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define f first
#define s second
#define pb push_back
#define REP(i,a,b) for(long long int i=a ; i<b ; i++)
#define mp make_pair
#define INF 1000000000000000000
#define mod 1000000007
#define pi pair<ll,ll>
#define pd pair<ld,ld>
#define vi vector<ll>
#define vd vector<ld>
#define vvi vector<vi>
#define vvd vector<vd>
#define vpi vector<pi>
#define vpd vector<pd>
#define us unordered_set<ll>
#define um unordered_map<ll,ll>
#define sortA(a) sort(a.begin(),a.end())
#define sortD(a) sort(a.begin(),a.end(),greater<ll>())
#define all(a) a.begin(),a.end()
#define N 100005


#include <ext/pb_ds/assoc_container.hpp> 
using namespace __gnu_pbds; 
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> new_data_set; 
#define in insert
#define fbo find_by_order
#define ook order_of_key


void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

ll powmod(ll x,ll y)
{
	if(x==0)
		return 0;
	if(y==0 || x==1)
		return 1;
	if(y%2==0)
		return powmod((x*x)%mod,y/2)%mod;
	return (x*powmod(x,y-1)%mod)%mod;
}
void print1D(vi a)
{
	for(ll i=0;i<a.size();++i)
	{
		cout<<a[i]<<" ";
	}
	cout<<endl;
}
void print2D(vector<vi> a)
{
	for(ll i=0;i<a.size();++i)
	{
		for(ll j=0;j<a[i].size();++j)
		{
			cout<<a[i][j]<<" ";
		}
		cout<<endl;
	}
}
void solve()
{
	ld n;
	cin>>n;
	ld p=3.14159265358;
	cout<<(2*p*n);
}
int main()
{
	ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL);
	ll t=1;
	// cin>>t;
	while(t--)
	{
		solve();
	}
}


Measured memory_bytes: 3804
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int [] a = new int[n];
		int cnt = 0, an = 0;
		boolean sw = true;
		for(int i = 0; i < n; i++) {
			a[i] = sc.nextInt();
		}
		while(sw == true){
			for(int i = 0; i < n; i++){
				if(a[i]%2==0){
					cnt++;
					a[i] = a[i] / 2;
				}
			}
			if(cnt==n){
				an++;
				cnt = 0;
			} else {
				sw = false;
				break;
			}
		}
		System.out.println(an);
	}
}

Measured memory_bytes: 19924
#include <stdio.h>
long min(long n,long m){
    if(n<m) return n;
    else return m;
}
int main(void){
    long n,a[100],i,j,ans=1000000;
    scanf("%ld",&n);
    for(i=0;i<n;i++) scanf("%ld",&a[i]);
    for(i=0;i<100;i++){
        long g=0;
        for(j=0;j<n;j++){
            g+=(a[j]-i)*(a[j]-i);
        }
        ans = min(ans,g);
    }
    printf("%ld",ans);
    return 0;
}

Measured memory_bytes: 128
def InsertionSort(A , N):
	for i in range(1,N):
		v =  A[i]
		j = i -1 
		while j > -1 and A[j] > v:
			A[j+1] = A[j]
			j = j -1
		A[j+1] = v 
		print " ".join(map(str, A))

def main():
	N = int( raw_input() )
	A = map(int, raw_input().split())
	print " ".join(map(str, A))
	InsertionSort(A, N)

if __name__=='__main__':
	main()

Measured memory_bytes: 6460
object Main {
  def main(args: Array[String]): Unit = {
    solve
  }

  def solve(): Unit = {
    val sc = new java.util.Scanner(System.in)
    val n = sc.nextInt
    val a = new Array[Long](n)
    for (i <- 0 until n) {
      a(i) = sc.nextLong()
    }
    val reversed = a.reverse

    val ans = Array.fill[Long](n)(0L)
    var step = 0
    for (i <- 0 until n) {
      if (i % 2 == 0) {
        ans(step) = reversed(i)
      } else {
        ans(n - 1 - step) = reversed(i)

        step += 1
      }
    }

    println(ans.mkString(" "))
  }
}


Measured memory_bytes: 72584
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,string,queue
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))

n,x = inpl()
h = [1] * (n+1)
b = [0] * (n+1)
p = [1] * (n+1)
for i in range(1,n+1):
    h[i] = 3 + h[i-1] * 2
    b[i] = 2 + b[i-1] * 2
    p[i] = h[i] - b[i]
# print(h,p)
def sol(n,x):
    if n == 0 :
        return 1
    elif x == 1:
        return 0
    elif x <= 1 + h[n-1]:
        return sol(n-1, x-1)
    elif x == 2 + h[n-1]:
        return p[n-1] + 1
    elif x < h[n]:
        return p[n-1] + 1 + sol(n-1, x-(h[n-1]+2))
    else:
        return p[n-1] * 2 + 1
print(sol(n,x))



Measured memory_bytes: 39660
#list L内にkey値が存在するか。nは番兵のindex
def linearSearch(L,n,key):
    i = 0
    L.append(key)#番兵としてkeyをLに追加
    while L[i] != key:
        i += 1
    L.pop(n)
    #i==n ならFalse(番兵まで探索した),i!=nなら番兵より手前でkeyと一致
    return i != n

n = int(input())
S = list(map(int,input().split()))
q = int(input())
T = list(map(int,input().split()))

ans = 0
for i in range(len(T)):
    if linearSearch(S,len(S),T[i]):
        ans += 1
print(ans)


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

using namespace std;

int main() {
  string s;
  int n = 0;
  cin >> s;
  if(s[0]=='1') n++;
  if(s[1]=='1') n++;
  if(s[2]=='1') n++;
  cout << n << endl;
  return 0; 
}

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <algorithm>
using namespace std;
 
int main(){
    // 引数の受け取り
    long long  N,K;
    cin >> N >> K;
    long long A[N];
 
    for (long long i =0 ; i < N ;i++){
       cin >> A[i];
    }
 
    long long mod = 1000000007;
    long long ans1 =0;
    long long ans2 =0;
    long long ans =0;
    long long o = K*(K-1)/2% mod;
    for(long long i = 0;i<N;i++){
        ans1 =0;
        for (long long j= 0;j<N;j++){
            if(A[i]>A[j]){
                ans1++;//ブロックにあるかず
                if(i<j){
                    ans2++;// →にあるかず
                }
            }
        }
        ans = (ans + ans1 * o % mod)% mod;
    }
        ans = (ans + ans2 * K % mod) % mod;
    //printf("%d",(((ans2*K%mod)+(ans1*K*(K-1)/2 % mod))%mod));
    cout << ans << endl;
 
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

//Spherical Mirrors
public class Main{

	double dot(double[] a, double[] b){
		double r = 0;
		for (int i = 0; i < a.length; i++) {
			r += a[i]*b[i];
		}
		return r;
	}
	
	void run(){
		Scanner sc = new Scanner(System.in);
		while(true){
			int n = sc.nextInt();
			if(n==0)break;
			double[] s = {0, 0, 0};
			double u = sc.nextDouble();
			double v = sc.nextDouble();
			double w = sc.nextDouble();
			double[] p = {u, v, w};
			double[][] c = new double[n][4];
			for(int i=0;i<n;i++)for(int j=0;j<4;j++)c[i][j]=sc.nextDouble();
			while(true){
				double min = 1<<20;
				int id = -1;
				for(int i=0;i<n;i++){
					double a = dot(p, p);
					double[] cs = {s[0]-c[i][0], s[1]-c[i][1], s[2]-c[i][2]};
					double b = 2*dot(p, cs);
					double C = dot(cs, cs)-c[i][3]*c[i][3];
					double D = b*b-4*a*C;
					if(D<0)continue;
					double t = (-b-Math.sqrt(D))/(2*a);
					if(t<0)continue;
					if(t<min){
						min = t;
						id = i;
					}
				}
				if(min==1<<20)break;
				s[0] += min*p[0];
				s[1] += min*p[1];
				s[2] += min*p[2];
				double pnorm = Math.sqrt(p[0]*p[0]+p[1]*p[1]+p[2]*p[2]);
				double nnorm = Math.sqrt(Math.pow(s[0]-c[id][0], 2)+Math.pow(s[1]-c[id][1], 2)+Math.pow(s[2]-c[id][2], 2));
				double[] a = {-p[0]/pnorm, -p[1]/pnorm, -p[2]/pnorm};
				double[] N = {(s[0]-c[id][0])/nnorm, (s[1]-c[id][1])/nnorm, (s[2]-c[id][2])/nnorm};
				double an = 2*dot(a, N);
				double[] b = {an*N[0]-a[0], an*N[1]-a[1], an*N[2]-a[2]};
				p = b;
			}
			System.out.printf("%.4f %.4f %.4f\n", s[0], s[1], s[2]);
		}
	}
	
	public static void main(String[] args) {
		new Main().run();
	}
}

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

using namespace std;

#define ll long long
#define ss stringstream
#define rep(i,n) for(int i=1;i<=(n);i++)
#define rep0(i,n) for(int i=0;i<(n);i++)

const ll INF=1e9+7;

int main()
{
	/*freopen("input.txt","r",stdin);
	freopen("outcout<<put.txt","w",stdin);*/
	int n;
	ll a[105];
	cin>>n;
	rep(i,n)cin>>a[i];
	rep(i,n-1){
		for(int j=i+1;j<=n;j++){
			if(a[i]>a[j])swap(a[i],a[j]);
		}
	}
	cout<<a[n]-a[1];
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
vector<int> g[100005];
int vis[100005];
int dp[100005];
void dfs(int v)
{
vis[v]=1;
//dp[v]=0;
for(auto j:g[v])
{
	if(!vis[j])
   { dfs(j);
   }
    //if(dp[v]==0)
    dp[v]=max(dp[j]+1,dp[v]);
}
}
 int main()
 {int ans=0;
     int n,m;
     cin>>n>>m;
     for(int i=0;i<m;i++)
     {
         int u,v;
         cin>>u>>v;
         g[u].push_back(v);
     }
     fill(dp,dp+100005,0);
     for(int i=1;i<=n;i++)
     if(!vis[i])
     dfs(i);
     for(int i=1;i<=n;i++)
     {//cout<<dp[i]<<" ";
         ans=max(ans,dp[i]);
     }
     cout<<ans<<endl;
     
 }

Measured memory_bytes: 8576
n,l=map(int,input().split())
a=list(map(int,input().split()))
failflag=1
for i in range(n-1):
  if a[i]+a[i+1]>=l:
    failflag=0
    k=i
    break
if failflag==1:
  print('Impossible')
else:
  print('Possible')
  for i in range(1,k+1):
    print(i)
  for i in range(n-1-k):
    print(n-1-i)

Measured memory_bytes: 63984
#include <iostream>
#include <climits>
#include <cmath>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <deque>
#define INF_INT (INT_MAX / 2)
#define INF_LONG (LONG_MAX / 2)
//#define DEBUG true
#define DEBUG false
using namespace std;

const int MAX = 100001;
const int MOD = 1000000007;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<int, ll> pil;

int ceil(int x, int y)
{
  return (x % y == 0) ? x / y : x / y + 1;
}

int gcd(int x, int y)
{
  return y ? gcd(y, x % y) : x;
}

int lcm(int x, int y)
{
  return x / gcd(x, y) * y;
}

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

  string s;
  cin >> s;

  int n = s.length();

  ll pow[n + 1];
  pow[0] = 1;
  for (int i = 1; i <= n; i++)
  {
    pow[i] = (pow[i - 1] * 10) % 13;
  }

  reverse(s.begin(), s.end());

  ll dp[n + 1][13];

  fill(dp[0], dp[0] + 13, 0);
  dp[0][0] = 1;

  for (int i = 1; i <= n; i++)
  {
    for (int j = 0; j < 13; j++)
    {
      dp[i][j] = 0;
      if (s[i - 1] != '?')
      {
        ll k = s[i - 1] - '0';
        int r = (k * pow[i - 1]) % 13;
        dp[i][j] = dp[i - 1][(j - r + 13) % 13];
      }
      else
      {
        for (ll k = 0; k < 10; k++)
        {
          int r = (k * pow[i - 1]) % 13;
          dp[i][j] = (dp[i][j] + dp[i - 1][(j - r + 13) % 13]) % MOD;
        }
      }
    }
  }

  cout << dp[n][5] << endl;

  return 0;
}


Measured memory_bytes: 11456
#include<iostream>
#include<algorithm>
#include<cmath>
#include<cstdio>
#include<string>
#include<vector>
#include<list>
#include<set>
#include<cctype>
#define ld long double
#define ll long long int
#define ull unsigned long long int
using namespace std;
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;}
const long long INF=1LL<<60;
//set<int>::iterator it;



int main(void){
	ios::sync_with_stdio(false); cin.tie(0);
	
	int j,i,h,w,f,l,lal=-1,lf=-1;
	string s;
	cin>>h>>w;
	for(i=0;i<h;i++){
		f=l=-1;
		cin>>s;
		for(j=0;j<w;j++){
			if(s[j]=='#'){
				f=j;
				break;
			}
		}
		l=f;
		for(j=f;j<w;j++){
			if(s[j]=='#')l=j;
		}
		if(lal==-1){
			lal=l;
			lf=f;
			continue;
		}
		else{
			if(lal!=f){
				cout<<"Impossible"<<endl;
				return 0;
			}
		}
		lal=l;
		lf=f;
	}
	cout<<"Possible"<<endl;
	
	return 0;
}


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

using namespace std;

int main() {
    string s;
    int K;
    cin >> s;
    cin >> K;
    vector<string> subs;
    for (int i = 0; i < s.size(); i++) {
        for (int k = 0; k <= K; k++) {
            string sub = "";
            for (int sub_i = i; sub_i <= i+k; sub_i++) {
                if (sub_i >= s.size()) break;
                sub += s[sub_i];
            }
            subs.push_back(sub);
        }
    }
    sort(subs.begin(),subs.end());
    subs.erase(unique(subs.begin(),subs.end()),subs.end());
    cout << subs[K-1] << endl;
    return 0;
}


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

char M[10][10];

int main() {
    int H, W, K; cin >> H >> W >> K;
    rep(i, H){
        rep(j, W){
            cin >> M[i][j];
        }
    }

    int ans = 0;

    for (int i = 0; i < 1<<H; i++){
        for (int j = 0; j < 1<<W; j++){
            char M2[10][10];
            rep(k, H){
                rep(l, W){
                    M2[k][l] = M[k][l];
                }
            }
            for (int m = 0; m < H; m++){
                if(i>>m&1){
                    for (int m2 = 0; m2 < W; m2++){
                        M2[m][m2] = '.';
                    }
                }
            }
            for (int n = 0; n < W; n++){
                if(j>>n&1){
                    for (int n2 = 0; n2 < H; n2++){
                        M2[n2][n] = '.';
                    }
                }
            }

            int blk = 0;
            rep(k, H){
                rep(l, W){
                    if(M2[k][l] == '#')blk++;
                }
            }

            if(blk == K)ans++;
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3640
#include <iostream>
#include <algorithm>
using namespace std;
struct edge{int from,to,cost;};
edge es[2002];
int d[1002];
int V,E;
const int INF = (1 << 30);

void shortest_path(int s){
    for (int i=0;i < V;i++) d[i]=INF;
    d[s] = 0;
    while(true){
        bool update = false;
        for (int i = 0;i < E;i++){
            edge e = es[i];
            if ( d[e.from] != INF && d[e.to] > d[e.from] + e.cost){
                d[e.to] = d[e.from] + e.cost;
                update = true;
            }
        }
        if (!update) break;
    }
}

bool find_negative_loop(int s){
    for (int i=0;i < V;i++) d[i] = 0;
    for (int i=0;i < V;i++){
        for (int j = 0;j < E;j++){
            edge e =es[j];
            if ( d[e.to] > d[e.from] + e.cost){
                d[e.to] = d[e.from] + e.cost;
                if (i == V-1 ) return true;
            }
        }
    }
    return false;
}

bool f(int s){
    for (int i=0;i < V;i++) d[i]=INF;
    d[s] = 0;
    int cnt=0;
    while(true){
        bool update = false;
        for (int i = 0;i < E;i++){
            edge e = es[i];
            if ( d[e.from] != INF && d[e.to] > d[e.from] + e.cost){
                d[e.to] = d[e.from] + e.cost;
                update = true;
                if (cnt == V-1) return true; 
            }
        }
        cnt++;
        if (!update) break;
    }
    return false;
}

int main(){
    int s;
    cin >> V >> E >> s;
    for (int i=0;i < E;i++){
        cin >> es[i].from >> es[i].to >> es[i].cost;
    }
    if (f(s)) {
        cout << "NEGATIVE CYCLE" << endl;
        //for (int i=0;i < V;i++){
        //    cout << d[i] << endl;
        //}
    }
    else{
        //shortest_path(s);
        for (int i=0;i < V;i++){
            if (d[i] == INF) cout << "INF" << endl;
            else cout << d[i] << endl;
        }
    }

    return 0;
}


Measured memory_bytes: 3128
N,M = (int(i) for i in input().split())

SC = []
max_digits = 0
for i in range(M):
  S,C = (int(i) for i in input().split())
  SC.append([S,C])

ans = -1
if M != 0:
  ans = -1
  range_min = 10**(N-1)
  if N == 1:
    range_min = 0
  for i in range(range_min,10**(N)):
    check_flag = True
    for sc in SC:
      s = sc[0]
      c = sc[1]
      if str(i)[s-1] != str(c):
        check_flag = False
        break
    if check_flag is True:
      ans = i
      break
else:
  if N == 1:
    ans = 0
  elif N ==2:
    ans = 10
  elif N == 3:
    ans = 100

print(ans)


Measured memory_bytes: 3188
var i,n:longint;
    a,b:array[1..100000] of longint;
begin
	readln(n); b[1]:=0;
	for i:=1 to n do read(a[i]);
	for i:=1 to n do 
	  if i mod 2 = 0 then  b[1]:= b[1] - a[i]
	  else b[1]:=b[1] + a[i];
	for i:=2 to n do b[i]:= (a[i-1] - b[i - 1] div 2) * 2;
	for i:=1 to n do write(b[i],' ');
end.

Measured memory_bytes: 1920
from collections import defaultdict, deque
N, M = map(int, input().split())

diff_dic = defaultdict(lambda: [])
for _ in range(M):
    L, R, M = map(int, input().split())
    diff_dic[L-1].append([R-1, M])
    diff_dic[R-1].append([L-1, -M])

INF = 10 ** 10

# print(diff_dic)

ans_array = [INF] * N

for i in range(N):
    if ans_array[i] != INF:
        continue
    people_deque = deque()
    people_deque.append(i)
    if ans_array[i] == INF:
        ans_array[i] = 0
    while(len(people_deque)):
        # print(ans_array)
        person = people_deque.popleft()

        for v in diff_dic[person]:
            p, m = v
            if ans_array[p] == INF:
                ans_array[p] = ans_array[person] + m
                people_deque.append(p)
            elif ans_array[p] != (ans_array[person] + m):
                print("No")
                exit()
print("Yes")


Measured memory_bytes: 85856
#include<stdio.h>
#include<math.h>
#include<algorithm>
#include<cctype>

int main()
{
	char x[1001] = { 0 };
	int sum = 0;
	
	while (1) {
		sum = 0;
		scanf("%s", &x);
		for (int i = 0; x[i]!=0; i++) {
			sum += x[i] - '0';
		}
		
		if (sum == 0) {
			break;
		}
		else {
			printf("%d\n", sum);
		}
	}
	
	return 0;
}

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

int main(void){
    string s,t;

    cin >> s >> t;
    vector<vector<int>> pos(26);
    for(int i=0;i<s.size();i++) pos[s[i]-'a'].push_back(i);
    for(int i=0;i<s.size();i++) pos[s[i]-'a'].push_back(i+s.size());

    ll ans = 0;
    int p = -1;
    for(int i=0;i<t.size();i++){
        int c = t[i]-'a';
        auto itr = upper_bound(pos[c].begin(), pos[c].end(), p);
        if(itr==pos[c].end()){
            cout << -1 << endl;
            return 0;
        }

        int npos = *itr;
        if(npos>=s.size()){
            ans += s.size();
            p = npos - s.size();
        }else{
            p = npos;
        }
        
    }

    cout << ans + p + 1 << endl;
}

Measured memory_bytes: 1724
#include<iostream>
#include<algorithm>
#include<vector>

using namespace std;

int N, T;

int dp[3000 + 10][3000 + 10][2];//dp[i][j][k] := i品目まで食べるかを選んで、jの時間がかかったときのおいしさの最大値 
//kが0の時は、最後に食べるものをまだ選んでない 1の時は最後に食べるものをもう選んでる状態
vector<int> A, B;

int main() {
	cin >> N >> T;
	for (int i = 0; i < N; i++) {
		int a, b;
		cin >> a >> b;
		A.push_back(a), B.push_back(b);
	}
	
	dp[0][0][0] = 0;
	for (int i = 1; i <= N; i++) {
		for (int j = 0; j <= T - 1; j++) {
			for (int k = 0; k < 2; k++) {
				dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j][k]);
				if (j - A[i - 1] >= 0)
					dp[i][j][k] = max(dp[i][j][k], dp[i - 1][j - A[i - 1]][k] + B[i - 1]);
				//最後に食べるとする
				if (k == 0) {
					dp[i][j][1] = max(dp[i][j][1], dp[i - 1][j][k] + B[i - 1]);
				}
			}
		}
	}
	int ans = 0;
	for (int i = 0; i <= T - 1; i++)for (int j = 0; j < 2; j++)
		ans = max(ans, dp[N][i][j]);
	cout << ans << endl;
	return 0;
}


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

#define ll long long
ll n;

int main() {
	while (scanf("%lld", &n) != EOF) {
		ll res = 0;
		for (ll i = 1, j; i <= n; i = j + 1) {
			j = n / (n / i);
			ll x = n / i;
			if (n % x == 0) {
				ll m = n / x - 1;
				if (m >= i && m <= j) {
					res += m;
				}
			}
		}
		printf("%lld\n", res);
	}
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <memory.h>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <map>
#include <cmath>
using namespace std;

#define rep(i, n) for(int i = 0; i< n; i++)
#define rep2(i, m, n) for(int i = m; i < n; i++)
typedef long long ll;
typedef pair<int, int> P;

int dp[310][310];
int parx[310][310];
int pary[310][310];

int main(){
  string s;
  while(cin >> s && s != "#END"){
    int n = s.size();
    string res;
    for(int i = 1; i < n; i++){
      string a(s.begin(), s.begin() + i);
      string b(s.begin() + i, s.end());
      int sza = a.size(), szb = b.size();
      if(min(sza,szb) <= (int)res.size())continue;

      memset(dp, 0, sizeof(dp));
      memset(parx, -1, sizeof(parx));
      memset(pary, -1, sizeof(pary));

      rep2(i,1,sza+1)rep2(j,1,szb+1){
	if(dp[i][j] < dp[i-1][j]){
	  dp[i][j] = dp[i-1][j];
	  parx[i][j] = i-1;
	  pary[i][j] = j;
	}
	if(dp[i][j] < dp[i][j-1]){
	  dp[i][j] = dp[i][j-1];
	  parx[i][j] = i;
	  pary[i][j] = j-1;
	}
	if(a[i-1] == b[j-1] && dp[i][j] < dp[i-1][j-1] + 1){
	  dp[i][j] = dp[i-1][j-1] + 1;
	  parx[i][j] = i-1;
	  pary[i][j] = j-1;
	}
      }
      string lss;
      int x = sza;
      int y = szb;
      while(x != -1){
	int nx = parx[x][y];
	int ny = pary[x][y];
	if(x - nx == 1 && y - ny == 1 && x > 0)lss.push_back(a[x-1]);
	x = nx;
	y = ny;
      }
      reverse(lss.begin(), lss.end());
      if(lss.size() > res.size()) res = lss;
    }
    cout << res << endl;
  }
  return 0;
}

Measured memory_bytes: 0
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <string>
#include <cassert>
#include <functional>

using namespace std;
typedef long long ll;


#define SIZE 1000
#define INF 1000000000
#define LLINF 1000000000000000000LL

int a,b;
vector<string> ans;

void dfs(int x,int y,string s){

  if(a==x && b==y){
    ans.push_back(s);
    return;
  }

  if((x>=5 || y>=5) && abs(x-y)>=2) return;

  if(a<x || b<y) return;

  if(x<5 || (x==5 && y>=4)) dfs(x+1,y,s+"A");
  if(y<5 || (y==5 && x>=4)) dfs(x,y+1,s+"B");
}

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

  dfs(0,0,"");

  sort(ans.begin(),ans.end());

  for(int i=0;i<ans.size();i++){
    cout << ans[i] << endl;
  }

  return 0;
}

Measured memory_bytes: 1232
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.math.BigInteger;
import java.util.StringTokenizer;

public class Main
{
    static BigInteger nCr(int n, int r)
    {
        return fact(n).divide(fact(r).multiply(fact(n - r)));
    }
    static BigInteger fact(int n)
    {
        BigInteger res =  new BigInteger("1");
        for (int i = 2; i <= n; i++)
           res = res.multiply(BigInteger.valueOf(i));
        return res;
    }
    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

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

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

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

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

        String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }
    }
    public static void main(String args[])
    {
        FastReader obj = new FastReader();
        int n = obj.nextInt(),m = obj.nextInt();

        System.out.println(nCr(n,2).add(nCr(m,2)));
    }
}


Measured memory_bytes: 22612
#include <iostream>
#include<bits/stdc++.h>
#define ll long long
#define   ull unsigned long long 
const int MAX=3e5;
const int mod=1e9+7;
using namespace std;
int cnt[MAX];
int dp[200][200];
int main(){
	int a,b, t;
	cin>>a>>b>>t;
	int cnt=1;
	int ans=0;
	while(a*cnt<=t){
		ans+=b;
		cnt++;
	}
	cout<<ans;
}

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

int main(){
        int a,b,max=0;
        if(scanf("%d",&a)==1);
        if(scanf("%d",&b)==1);

        max=a+b;
        if(max < a*b)max=a*b;
        if(max < a-b)max=a-b;

        printf("%d\n",max);

}


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

int main(){
  string S;
  cin >> S;

  for(int i=0;i<S.size()-1;i++){
    if(S.at(i)=='A' && S.at(i+1)=='C'){
      cout << "Yes" << endl;
      return 0;
    }
  }
  cout << "No" << endl;

  return 0;
}

Measured memory_bytes: 256
import java.util.*;
class Main {

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        String s=in.next();
        String []S={"SUN","MON","TUE", "WED", "THU", "FRI", "SAT"};
        for(int i=0;i<7;i++){
            if(s.equals(S[i])){
                System.out.println(7-i);
                return;
            }
        }
    }
}


Measured memory_bytes: 21844
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

#include <algorithm>
#include <iostream>

using namespace std;

typedef long long ll;

const int MAX_N = 100000;

int N, x;
ll A[MAX_N];

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

    cin >> N >> x;

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

    ll sum = 0;

    for (int i = 0; i < N - 1; i++) {
        if (A[i] + A[i + 1] > x) {
            sum += A[i] + A[i + 1] - x;
            if (A[i] > x) {
                A[i + 1] = 0;
            } else {
                A[i + 1] = x - A[i];
            }
        }
    }

    cout << sum << "\n";

    return 0;
}

Measured memory_bytes: 4428
#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
typedef long long int ll;
void swap(ll *x,ll *y){ll temp;temp=*x;*x=*y;*y=temp;}
ll compare_asc(const void *a,const void *b){return *(ll*)a-*(ll*)b;}
ll compare_desc(const void *a,const void *b){return *(ll*)b-*(ll*)a;}
ll max(ll x,ll y){return x>y?x:y;}
ll min(ll x,ll y){return x>y?y:x;}
/*void qsort(配列のアドレス,配列のサイズ,sizeof(配列の型),比較関数(昇順or降順)) */

int main(){
    char str_a[200],str_b[200],str_ab[200];
    int i=0;

    scanf("%s %s",str_a,str_b);
    strcat(str_a,str_b);
    int x=atoi(str_a);

    for(i=1;1;i++){
        if(i*i==x){
            printf("Yes\n");
            return 0;
        }else if(i*i>x){
            printf("No\n");
            return 0;
        }
    }

    
}

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

int n,a,b;

int main(){
	scanf("%d%d%d",&n,&a,&b);
	int i=0;
	while(true){
		++i;
		if(a==b-1) break;
		if(i&1) ++a;
		else --b;
	}
	if(i&1) puts("Borys");
	else puts("Alice");
	return 0;
}

Measured memory_bytes: 256
//In the name of Allah
#include <bits/stdc++.h>
using namespace std;
#define MAX 100011
#define mod 1000000007
#define inf 1000000000000000000
#define ll long long
#define endl '\n'
ll dp[111][MAX],sum[MAX];
int a[111];

int main(){
	ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	int n,k;
	cin>>n>>k;
	for(int i = 0 ; i < n ; i++)cin>>a[i];
	sort(a,a+n);
	reverse(a,a+n);
	memset(dp,0,sizeof dp);
	memset(sum,0,sizeof sum);
	for(int j = 0; j <= a[0] ; j++)dp[0][j] = 1;
	sum[0] = 1;
	for(int j = 1; j <= k ; j++)sum[j] = sum[j-1] + dp[0][j];

	for(int i = 1 ; i < n ; i++){
		dp[i][0] = 1;
		sum[0] = 1;

		for(int j = 1;j <= k; j++){
			if(j - a[i] - 1 >= 0)
				dp[i][j] = (sum[j] - sum[j - a[i] - 1] + mod)%mod;
			else
				dp[i][j] = sum[j];
		}
		for(int j = 1; j <= k ; j++)sum[j] = (sum[j-1] + dp[i][j])%mod;	
	}
	cout<<dp[n-1][k];
	return 0; 
} 

Measured memory_bytes: 87808
#include <iostream>

int main() {
  int n, y;
  std::cin >> n >> y;

  int a { -1 };
  int b { -1 };
  int c { -1 };

  for(int i = 0; i <= n; ++i) {
    for(int j = 0; i + j <= n; ++j) {
      const auto k { n - i - j };
      const auto total { 10000 * i + 5000 * j + 1000 * k };
      if(total == y) {
        a = i;
        b = j;
        c = k;
        break;
      }
    }
  }

  std::cout << a << " " << b << " " << c << std::endl;
  return 0;
}

Measured memory_bytes: 256
n = gets.to_i
ss = $stdin.read.split.map(&:to_i)

def find_min(ls)
  tmp = 101
  ls.each do |x|
    next if (x % 10).zero?
    tmp = x if x < tmp
  end
  tmp
end

sum = ss.inject(:+)
if (sum % 10).zero?
  minimum = find_min(ss)
  if minimum == 101
    puts 0
  else
    puts(sum - minimum)
  end
else
  puts sum
end

Measured memory_bytes: 1788
//#include "debug.h"
#include <string.h>
#include <limits.h>
#include <map>
#include <set>
#include <vector>
#include <algorithm>
using namespace std;

#define MAXN 200000

int n;

int input() {
        if (scanf("%d", &n) < 0) return 0;
        return 1;
}

void init() {
}

int solve() {
        int k = n/100;
        int x = n%100;
        if (x > 5*k) return 0;
        return 1;
}

void output(int ans) {
        printf("%d\n", ans);
}

void cleanup() {
}

int main() {
        //int ca; scanf("%d", &ca);
        while (input()) {
                init();
                output(solve());
                cleanup();
                //break;
        }
}


Measured memory_bytes: 128
s = input()
s1=''
s2=''
for i in range(len(s)//2):
    s1+='01'
    s2+='10'
if len(s)%2==1:
    s1+='0'
    s2+='1'
ans1=0
ans2=0
for i in range(len(s)):
    if s[i]!=s1[i]:
        ans1+=1
    if s[i]!=s2[i]:
        ans2+=1
print(min(ans1,ans2))

Measured memory_bytes: 3316
import collections

def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

S = list(map(int,input().split()))
A = min(S)
B = max(S)
  
C = collections.Counter(prime_factorize(A))
count = 1
for p in C.keys():
    if B % p == 0:
        count += 1
print(count)


Measured memory_bytes: 3316
n = int(input())
l = [int(x) for x in input().split()]
l = sorted(l)
m = {}
for x in l:
    if x in m:
        m[x] += 1
    else:
        m[x] = 1

awa = []
last = -1
for x in l:
    if x == last:
        continue
    awa.append(x)
    last = x

num = 0
for x in range(len(awa)-2):
    for y in range(x+1,len(awa)-1):
        for z in range(y+1,len(awa)):
            if awa[x] + awa[y] > awa[z] and awa[x] + awa[z] > awa[y] and awa[y] + awa[z] > awa[x]:
                num += m[awa[x]] * m[awa[y]] * m[awa[z]]

print(num)



Measured memory_bytes: 9236
class Dice:
    def __init__(self, face_vals):
        self.faces = dict(zip(['top', 'front', 'right',
                               'left', 'back', 'bottom'], face_vals.split()))

    def roll(self, direction):
        if direction == 'N':
            self.faces['top'], self.faces['front'], self.faces['bottom'], \
            self.faces['back'] = self.faces['front'], self.faces['bottom'], \
            self.faces['back'], self.faces['top']
        elif direction == 'S':
            self.faces['top'], self.faces['front'], self.faces['bottom'], \
            self.faces['back'] = self.faces['back'], self.faces['top'], \
            self.faces['front'], self.faces['bottom']
        elif direction == 'E':
            self.faces['top'], self.faces['right'], self.faces['bottom'], \
            self.faces['left'] = self.faces['left'], self.faces['top'], \
            self.faces['right'], self.faces['bottom']
        else:
            self.faces['top'], self.faces['right'], self.faces['bottom'], \
            self.faces['left'] = self.faces['right'], self.faces['bottom'], \
            self.faces['left'], self.faces['top']

    def _revolve(self, direction):
        if direction == 'R':
            self.faces['front'], self.faces['left'], self.faces['back'], \
            self.faces['right'] = self.faces['right'], self.faces['front'], \
            self.faces['left'], self.faces['back']
        else:
            self.faces['front'], self.faces['left'], self.faces['back'], \
            self.faces['right'] = self.faces['left'], self.faces['back'], \
            self.faces['right'], self.faces['front']
            
    def show_right_face(self, top, front):
        if front == self.faces['back']:
            if top == self.faces['top']:
                self._revolve('R')
                self._revolve('R')
            else:
                self.roll('S')
                self.roll('S')
        elif front == self.faces['top']:
            self.roll('S')
        elif front == self.faces['right']:
            self._revolve('R')
        elif front == self.faces['left']:
            self._revolve('L')
        elif front == self.faces['bottom']:
            self.roll('N')
        if top == self.faces['bottom']:
            self.roll('E')
            self.roll('E')
        elif top == self.faces['right']:
            self.roll('W')
        elif top == self.faces['left']:
            self.roll('E')
        print(self.faces['right'])


import sys

face_vals = sys.stdin.readline()

dice = Dice(face_vals)

n = int(sys.stdin.readline())

for i in range(n):
    top, front = sys.stdin.readline().split()
    dice.show_right_face(top, front)

Measured memory_bytes: 7908
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

int main(int argc, char const* argv[]) {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N;
    cin >> N;
    vector<int> a(N);
    for (int i=0; i<N; ++i) {
        cin >> a[i];
    }
    int n = *max_element(a.begin(), a.end());
    a.erase(max_element(a.begin(), a.end()));
    int r = 0;
    double diff = n;
    for (const int ai: a) {
        if (fabs(ai-(double)n/2) < diff) {
            r = ai;
            diff = fabs(ai - (double)n / 2);
        }
    }
    cout << n << " " << r << '\n';
    return 0;
}


Measured memory_bytes: 1272
#include<stdio.h>

int isPrime(int x) {
  int i;
  if ( x < 2 ) return 0;
  else if ( x == 2 ) return 1;
  if ( x % 2 == 0 ) return 0;
  for ( i = 3; i*i <= x; i+=2 )
    if ( x % i == 0) return 0;
  return 1;
}

int main() {
  int n, x, i;
  int cnt = 0;
  scanf("%d", &n);
  for ( i = 0; i < n; i++ ) {
    scanf("%d", &x);
    if ( isPrime(x) ) cnt++;
  }
  printf("%d\n", cnt);

  return 0;
}


Measured memory_bytes: 2036
#include <bits/stdc++.h>
#define rep(i,cc,n) for(int i=cc;i<=n;++i)
#define drep(i,cc,n) for(int i=cc;i>=n;--i)
#define sz(s) (int)(s.size())
#define vecprint(v) rep(i,0,v.size()-1)cout << v[i] << " ";cout << endl;
#define mod 1000000007

using namespace std;
class CompareFirst
{
public:
  bool operator()(pair<int,int> n1,pair<int,int> n2) {
    return n1.first>n2.first; //>:desc <:asc
  }
};


int main(){

  string s,ans;
  int n;
  vector<string> vs;
  vector<int> vi;
  pair<int,int> pr;
  //unordered_map<string,int> mp;
  //priority_queue<int> pq; // default ‘å‚«‚¢‡
  //priority_queue<pair<int,int>,vector<pair<int,int>>,CompareFirst> pq;

  cin >> s;
  if(s == "Sunny")ans = "Cloudy";
  if(s == "Cloudy")ans = "Rainy";
  if(s == "Rainy")ans = "Sunny";

  cout << ans << endl;
//  printf("%.10f\n",ans);

  return 0;

}

Measured memory_bytes: 256
// Mon Aug 24 16:24:09 IST 2020        
#include <bits/stdc++.h>        
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#define forn(ii,a,b)       for(int ii = (int)a ; ii < (int)b  ; ii++ )
#define scan(any)          for(auto &i:any) cin>>i;
#define debug(x)           cerr << #x << " " << x << " -- \n"
#define I__O               ios::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define int64              long long   
#define all(x)             (x).begin(),(x).end() 
#define ff                 first
#define ss                 second
#define pppp               pair <int,int> 
#define flushOff           fflush(stdout) 
#define precise(x)         cout << fixed << setprecision(12) << x << '\n'; 
using namespace std ;    
// policy based   
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_set ; 
 
const int MOD1 = 1e9+7;
const int MOD2 = 1e9+9;
const double pi = 3.141592653589793238;
const int INF = 2e9+7; 

struct compare{
    bool operator()(pair <int,int> A, pair <int,int> B){
        if(A.first == B.first)
            return A.second > B.second;
        return A.first > B.first;
    }
}; 
int tests(){ 
    string s1,s2;
    cin >> s1 >> s2;
    if(s1.size() > s2.size())
        swap(s1,s2);
    int ans = INF;
    for(int i = 0 ; i < (int)s2.size() ;i++)
        {
            int t = s1.size();
            if(i+t <= (int)s2.size()){
                int mex = 0;
                forn(j,0,t)
                    mex += s1[j] != s2[i+j];
                ans = min(ans,mex);
            }
        }
    cout << ans << '\n';
    return 0;
}
int main(){
    I__O ;      
    int cases = 1 ;  
    // cin >> cases ;
    while(cases--)
        tests(); 
    return 0 ; 
}
 

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

deque<int> Q;

int main() {
    int n, num;
    cin >> n;
    bool flag = 1;
    while (n--) {
        scanf("%d", &num);
        if (flag)
            Q.push_front(num);
        else
            Q.push_back(num);
        flag = !flag;
    }
    if (!flag) {
        for (auto i = Q.begin(); i != Q.end(); i++) {
            if (i == Q.begin())
                cout << *i;
            else
                cout << " " << *i;
        }
        cout << endl;
    } else {
        for (auto i = Q.rbegin(); i < Q.rend(); i++) {
            if (i == Q.rbegin())
                cout << *i;
            else
                cout << " " << *i;
        }
        cout << endl;
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 2944
use std::io;
use std::str::FromStr;

fn input_tuple() -> (u64, u64) {
    let mut line: String = String::new();
    io::stdin().read_line(&mut line);
    let vec: Vec<u64> = line.split_whitespace().map(|s| s.parse().unwrap()).collect();
    (vec[0], vec[1])
}

fn main() {
    let (k, x) = input_tuple();
    if k * 500 >= x {
        println!("Yes");
    } else {
        println!("No");
    }
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
///Welcome to Nasif's Code
#define bug printf("bug\n");
#define bug2(var) cout<<#var<<" "<<var<<endl;
#define co(q) cout<<q<<endl;
#define all(q) (q).begin(),(q).end()
typedef long long int ll;
typedef unsigned long long int ull;
const int MOD = (int)1e9+7;
const int MAX = 1e6;
#define pi acos(-1)
#define inf 1000000000000000LL
#define FastRead    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll arr[MAX];
int main()
{
    FastRead
    //freopen("output.txt", "w", stdout);
    int n;
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>arr[i];
        arr[i]-=i+1;
    }
    sort(arr,arr+n);
    ll B=arr[n/2],ans=0;
    for(int i=0;i<n;i++){
        ans+=abs(B-arr[i]);
    }
    cout<<ans<<endl;

    return 0;
}


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

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

using ll = long long;

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

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

int main() {
  string s;
  int K;
  cin>>s>>K;
  int l = s.size();
  vector<int> v(l);
  rep(i,l){
    v[i]=s[i]-'a';
  }
  rep(i,l){
    if(v[i]==0&&i!=l-1)continue;
    if(K>=26-v[i]) {
      K-=(26-v[i]);
      v[i]=0;
    }
    if(K!=0&&i==l-1) {
      v[i]+=K;
      v[i]%=26;
    }
  }
  for(auto x:v){
    char c = 'a'+x;
    cout<<c;
  }
  cout<<endl;
}

Measured memory_bytes: 3828
/*
　　　  ∧＿∧　やあ
　　 （´・ω・｀)　　　　　/　　　　　ようこそ、バーボンハウスへ。
　　 ／∇y:::::＼　　　 [￣]　　　　　このテキーラはサービスだから、まず飲んで落ち着いて欲しい。
　　 |:⊃:|:::::|　　　|──|
￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣|　うん、「また」なんだ。済まない。
￣￣￣￣￣￣￣￣￣￣￣￣￣￣￣|￣　  仏の顔もって言うしね、謝って許してもらおうとも思っていない。
￣￣￣￣￣￣￣￣￣￣￣￣￣￣／|
　　　　∇　∇　∇　∇　　　／.／|　　　でも、この提出を見たとき、君は、きっと言葉では言い表せない
　　　　┴　┴　┴　┴　／ ／　  |　　　「ときめき」みたいなものを感じてくれたと思う。
￣￣￣￣￣￣￣￣￣￣|／　　  |　　　殺伐としたコンテストの中で、そういう気持ちを忘れないで欲しい
￣￣￣￣￣￣￣￣￣￣　　　　 |　　　そう思って、この提出を投げたんだ。
　　　(⊆⊇)　(⊆⊇)　(⊆⊇)　　|
　    ||　　 ||　　||　　|　　　 じゃあ、判定を聞こうか。
　　.／|＼　／|＼ ／|＼
*/

#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <array>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
using namespace std;
#define fst first
#define snd second
#define mp make_pair
#define ALL(obj) (obj).begin(),(obj).end()
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i = (b-1);i>=a;i--)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n) 
#define SIZE(x) ((int)(x).size())
#define debug(x) cerr << #x << " -> " << x << " (line:" << __LINE__ << ")" << '\n';
#define debugpair(x, y) cerr << "(" << #x << ", " << #y << ") -> (" << x << ", " << y << ") (line:" << __LINE__ << ")" << '\n';
typedef long long lint;
typedef pair<int, int> pint;
typedef pair<lint, lint> plint;
typedef vector<lint> vec;
typedef vector<vector<lint>> matrix;
typedef priority_queue<lint> p_que;
typedef priority_queue<lint, vector<lint>, greater<lint>> p_que_rev;
const lint INF = INT_MAX;
const lint LINF = LLONG_MAX;
const lint MOD = 1000000000 + 7;
const double EPS = 1e-9;
const double PI = acos(-1);
const int di[]{0, -1, 0, 1, -1, -1, 1, 1};
const int dj[]{1, 0, -1, 0, 1, -1, -1, 1};

lint gcd(lint a, lint b) {
    lint r;
    while (b != 0) {
        r = a % b;
        a = b; 
        b = r;
    }
    return a;
}

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

lint power(lint x, lint n, lint mod = MOD) {
    lint ret = 1;
    while(n > 0) {
        if(n & 1){
            (ret *= x) %= mod;
        }
        (x *= x) %= mod;
        n >>= 1;
    }
    return ret;
}

vector<lint> make_power(int n, lint base){
    lint num = 1;
    vector<lint> ret;
    for (int i=0; i<=n; ++i){
        ret.push_back(num);
        num *= base;
    }
    return ret;
}

int main()
{
    cin.tie(0);
    ios_base::sync_with_stdio(false);
    int m, d;
    cin >> m >> d;
    lint ans = 0;
    for (int i=1; i<=m; ++i){
        for (int day=20; day<=d; ++day){
            int d10 = day / 10;
            int d1 = day % 10;
            if(d10 >= 2 && d1 >= 2 && d10 * d1 == i){
                ans++;
                //cout << i << " " << d10 << d1 << endl;
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
/*input
4
1 2 3 4
*/
/**
    Author: Kristopher Paul
    Date Created: 01-09-2019
    Contest Name:
                _/    _/   _/_/_/_/   _/   _/_/_/_/
               _/  _/     _/    _/   _/   _/
              _/_/       _/_/_/_/   _/   _/_/_/_/
             _/  _/     _/  _/     _/         _/
            _/    _/   _/    _/   _/   _/_/_/_/
**/
#include<bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define int ll
#define pb push_back
#define INF 1e18
#define MOD 1000000007
#define mp make_pair
const double PI=3.141592653589793238462643383279502884197169399375105820974944;
#define REP(i,n) for (int i = 0; i < n; i++)
#define FOR(i,a,b) for (int i = a; i < b; i++)
#define REPD(i,n) for (int i = n-1; i >= 0; i--)
#define FORD(i,a,b) for (int i = a; i >= b; i--)
#define remax(a,b) a = max(a,b)
#define remin(a,b) a = min(a,b)
#define umap unordered_map
#define pii pair<int,int>
#define F first
#define S second
#define mii map<int,int>
#define vi vector<int>
#define vvi vector<vi>
#define itr :: iterator it
#define all(v) v.begin(),v.end()
#define WL(t) while(t--)
#define gcd(a,b) __gcd((a),(b))
#define lcm(a,b) ((a)*(b))/gcd((a),(b))
#define out(x) cout << #x << " is " << x << endl
#define FastIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
using namespace std;
//using namespace __gnu_pbds;

//typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> pbds; // set
//typedef tree<int,null_type,less_equal<int>,rb_tree_tag,tree_order_statistics_node_update> pbds; // multiset

int ModExp(int x,int y,int m){
    int res = 1;
    x = x % m;
    while (y > 0)
    {
        if (y & 1)
            res = (res*x) % m;

        y = y>>1;
        x = (x*x) % m;
    }
    return res;
}

void solve(){
    int n;
    cin >> n;
    int arr[n];
    FOR(i,0,n){
        cin >> arr[i];
    }
    int l = 0;
    int ans = 1;
    FOR(i,1,n){
        if(arr[i] > arr[i-1]){
            remax(ans,i-l);
            l = i;
        }
    }
    remax(ans,n-l);
    cout << ans-1 << endl;
}

signed main(){
    FastIO;
    int t = 1;
//    cin >> t;
    WL(t){
        solve();
    }
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
    int main(){
      int a,b;cin>>a>>b;
      string ans1,ans2;
      for(int i=0;i<a;i++){
          ans1+=to_string(b);
      }
      for(int i=0;i<b;i++){
          ans2+=to_string(a);
      }
      if(ans1<=ans2) cout<<ans1<<endl;
      else cout<<ans2<<endl;

    }
        






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

int main() {
  long a {0}, b {0};
  cin >> a >> b;
  if (b > a) {
    long tmp = a;
    a = b;
    b = tmp;
  }
  while (b > 1) {
    long tmp = b;
    b = a % b;
    a = tmp;
  }
  if (b == 1) {
    cout << 1 << endl;
  } else {
    cout << a << endl;
  }
}



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

using namespace std;

const int INF = 1e9 + 5;
const int N = 2e5 + 5;
const int MOD = 998244353;
const double EPS = 1e-9;

const double PI = acos(-1);



int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0), cout.tie(0);
    int k, a, b;
    cin >> k >> a >> b;
    int add = k;
    while (true) {
        if (k <= b && k >= a) {
            cout << "OK";
            return 0;
        }
        k += add;
        if (k > b)
            break;
    }
    cout << "NG";
}

Measured memory_bytes: 3640
s = [input() for i in range(1)] 
s0 = int(s[0])
t = [input() for i in range(s0)]
ac_count=0
wa_count=0
tle_count=0
re_count=0

for j in range(s0):
    s1 = t[j]
    if s1 == "AC":
        ac_count+=1
    if s1 == "WA":
        wa_count+=1
    if s1 == "TLE":
        tle_count+=1
    if s1 == "RE":
        re_count+=1
print("AC x ",ac_count)
print("WA x ",wa_count)
print("TLE x ",tle_count)
print("RE x ",re_count)




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

using namespace std;
typedef long long ll;
const ll mx = 10000007;
const ll mod = 1e9 + 7;
const double pi = acos(-1);
#define gcd(a, b) __gcd((a), (b))
#define lcm(a, b) ((a) / __gcd((a), (b)) * (b))
#define FIO ios_base::sync_with_stdio(false);  cin.tie(NULL);

int main() {
    FIO;
    ll n, b;
    cin >> n >> b;
    vector<ll>v;
    for (ll i = 0; i < n; i++){
        ll x;
        cin >> x;
        v.push_back(x);
    }
    sort(v.begin(), v.end());
    ll s = 0;
    for (ll i = 0; i < b; i++) {
        s +=  v[i];
    }
    cout << s << endl;
}




Measured memory_bytes: 3672
#include <iostream>
#include <fstream>
#include <cstring>

using namespace std;

ifstream fin ("reversi.in");
ofstream fout ("reversi.out");

char a[100001];
int rez, n;
int main()
{
    cin >> a;
    n = strlen(a);

    for (int i = 0; i < n; i++)
    {
        if (i == 0 || a[i] != a[i-1])rez++;
    }
    cout << rez - 1;
    return 0;
}


Measured memory_bytes: 384