akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

template<class T> inline T sqr(T x) {return x*x;}

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef unsigned long long ULL;

#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

const double EPS = 1e-10;
const double PI  = acos(-1.0);

#define CLR(a) memset((a), 0 ,sizeof(a))

#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

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



int main() {
  int m, n, len;
  string s;  

  while(cin >> m >> n, m+n) {
    int angle = 0;
    PII p(1,1); 
    
    while(cin >> s) {
      if(angle < 0) angle += 4;
      if(s == "STOP") break;  
      else if(s == "FORWARD") {
	int x;
	cin >> x;
	if(angle%4 == 0) p.second += x;
	else if(angle%4 == 1) p.first -= x;
	else if(angle%4 == 2) p.second -= x;
	else p.first += x;
      }
      else if(s == "BACKWARD") {
	int x;
	cin >> x;
	if(angle%4 == 0) p.second -= x;
	else if(angle%4 == 1) p.first += x;
	else if(angle%4 == 2) p.second += x;
	else p.first -= x;
      }
      else if(s == "RIGHT") angle--;
      else if(s == "LEFT") angle++;
      if(p.first < 1) p.first = 1;
      if(p.first > m-1) p.first = m;
      if(p.second < 1) p.second = 1;
      if(p.second > n-1) p.second = n;
    }
    cout << p.first << ' ' << p.second << endl;
  }
}

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

int main(){
  int N,M;
  cin>>N>>M;
  int K;
  int A;
  map<int,int> map;
  for(int i=0;i<N;++i){
    cin>>K;
    for(int j=0;j<K;++j){
      cin>>A;
      ++map[A];
    }
  }

  int count=0;
  for(auto p:map){
    if(p.second==N){
      ++count;
    }
  }

  cout<<count<<endl;
}

Measured memory_bytes: 256
package main

import (
	"fmt"
	"sort"
)

func main() {
	var s string
	var K int
	fmt.Scan(&s, &K)
	n := len(s)

	lst := []string{}
	for i := 0; i < n; i++ {
		lst = append(lst, s[i:])
	}
	sort.Strings(lst)
	dic := map[string]struct{}{}

	cnt := 0
	for i := range lst {
		for j := 0; j < len(lst[i]) && j < K; j++ {
			tmp := lst[i][:j+1]
			if _, in := dic[tmp]; !in {
				cnt++
				dic[tmp] = struct{}{}
			}
			if cnt == K {
				fmt.Println(tmp)
				return
			}
		}
	}
}


Measured memory_bytes: 1024
#include<iostream>
#include<algorithm>
#include<string>
#include<cmath>
#include<vector>
#include<map>
using namespace std;
int main() {
    int A, B, C, D, E, F;
    cin >> A >> B >> C >> D >> E >> F;
    double max = 0.0;
    int situryou = 100*A, yousitu = 0;
    int a = 0, b = 0, c = 0, d = 0;
    for(a = 0; a <= 30;a++){
        for(b = 0; b <= 30;b++){
            int l = 100*A*a + 100*B*b;
            for(c = 0; c <= 100;c++){
                for(d = 0; d <= 100;d++){        
                    int m = C*c + D*d;
                    if(l == 0) break;
                    if(l/100*E >= m && l + m <= F){
                        //比較をする時はdouble型で格納するのが良い
                        double noudo = (double)100*m/(l + m);
                        if(max < noudo){
                            max = noudo;
                            situryou = 100*a*A+100*b*B+C*c+D*d;
                            yousitu  = C*c+D*d; 
                        }
                    } 
                }
            }
        }
    }
    cout << situryou << " " << yousitu << endl;
    return 0;
}

Measured memory_bytes: 3668
#include<bits/stdc++.h>
using namespace std;
int main(){
  int a[1000],n;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>a[i];
  }
  int p;
  cin>>p;
  for(int i=0;i<p;i++){
    int x,y,z;
    cin>>x>>y>>z;
    rotate(a+x,a+y,a+z);
  }
  for (int i=0;i<n;i++){
    if(i!=0) cout<<" ";
    cout<<a[i];
  }
  cout<<endl;
  
  return 0;
}


Measured memory_bytes: 3112
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main{
	public static void main(String args[]) throws IOException {
		int Ans = 0;

		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String s1 = new String(in.readLine());

		String[] a = s1.split(" +");
		
		int N = Integer.parseInt(a[0]);

		int A = Integer.parseInt(a[1]);
		int B = Integer.parseInt(a[2]);
		
		int C = Integer.parseInt(a[3]);
		int D = Integer.parseInt(a[4]);
		
		int n_a = N / A + ((N % A) == 0? 0 : 1 );
		
		int n_c = N / C +  ((N % C) == 0? 0 : 1 );
	
		Ans = (n_a * B < n_c * D ? n_a * B : n_c * D);
		
		System.out.println(Ans);
	}
}


Measured memory_bytes: 24640
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <tuple>
#include <vector>

using namespace std;
typedef long long ll;

#define rep(i, n) for (ll i = 0; i < (n); i++)
#define reps(i, f, n) for (ll i = (f); i < (n); i++)
#define repr(i, n) for (ll i = n; i >= 0; i--)
#define repv(v) for (auto it = (v).begin(); it != (v).end(); it++)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define pb push_back
#define INIT    \
    cin.tie(0); \
    ios::sync_with_stdio(false);

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

ll const INF = 1LL << 60;
ll const MOD = 1000000007;

int main() {
    INIT;

    ll N;
    cin >> N;
    vector<ll> L(N);
    rep(i, N) cin >> L[i];

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

    ll cnt = 0;
    for (ll i = N - 1; i >= 2; i--) {
        for (ll j = i - 1; j >= 1; j--) {
            ll rest = L[i] - L[j];
            for (ll k = j - 1; k >= 0; k--) {
                if (L[i] == L[j] || L[j] == L[k] || L[k] == L[i]) continue;

                if (rest < L[k]) {
                    // cout << i << ", " << j << ", " << k << endl;
                    cnt++;
                }
            }
        }
    }

    cout << cnt << endl;

    return 0;
}

Measured memory_bytes: 3644
#include <iostream>
#include <cstdio>
//#include <cstdlib>
#include <cmath>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <set>
#include <queue>
//#include <stack>
//#include <limits>
#include <sstream>
//#include <functional>
using namespace std;

#define len(array)  (sizeof (array) / sizeof *(array))
#define rep(i, s, e) for(int i = s;i < e;i++)
#define rrep(i, e, s) for(int i = e;s <= i;i--)
#define vrange(v) v.begin(), v.end()
#define vrrange(v) v.rbegin(), v.rend()
#define vsort(v) sort(vrange(v))
#define vrsort(v) sort(vrrange(v))
#define arange(a) a, a + len(a)
#define asort(a) sort(arange(a))
#define arsort(a, t) sort(arange(a), greater<t>())
#define afill(a, v) fill(arange(a), v)
#define afill2(a, v, t) fill((t *)a, (t *)(a + len(a)), v)
#define fmax(a, b) (a < b? b : a)
#define fmin(a, b) (a > b? b : a)
#define fabs(a) (a < 0? -a : a)
typedef unsigned int ui;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
const int INF = (int)1e9;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-10;
//const int dx[] = {1, -1, 0, 0, 1, -1, -1, 1};
//const int dy[] = {0, 0, 1, -1, -1, -1, 1, 1};
//const int weight[] = {0,1,10,100,1000,10000,100000,1000000,10000000};
//priority_queue< int, vector<int>, greater<int> > q;

void doIt(){
	int n, r, count = 0, p1, c1, res;
	string s = "", pre, mid,suf;
	while(true){
		cin >> n >> r;
		if(n + r == 0) break;
		s = "";
		count = 0;
		for(char c = 'a'; c <= 'z'; c++){
			if(count < n) s = c + s;
			count++;
		}
		for(char c = 'A'; c <= 'X'; c++){
			if(count < n) s = c + s;
			count++;
		}
		while(r--){
			cin >> p1 >> c1;
			pre = s.substr(0, p1-1);
			mid = s.substr(p1-1, c1);
			suf = s.substr(c1+p1-1);
			// cout << pre << endl;
			// cout << mid << endl;
			// cout << suf << endl;
			s = mid + pre + suf;
			// cout << s << endl;
		}
		if('a' <= s[0] && s[0] <= 'z'){
			res = s[0] - 'a';
		}
		else{
			res = s[0] - 'A' + 26;
		}
		// cout << s[0] << endl;
		cout << res + 1 << endl;

	}

}

int main() {
	doIt();
	return 0;
}

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

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ld, int> pii;

#define fi first
#define se second
#define mp make_pair
#define fastIO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);

const int N = (int)5e5 + 9;
int lf[N];
int rf[N];

int main(){
  fastIO;
  string t;
  cin >> t;
  int n = t.size();
  int x = 0;
  for(int i = 0 ; i < n; i ++ ){
    if(t[i] == '<') x ++ ;
    else x = 0;
    lf[i + 1] = x;
  }
  x = 0;
  for(int i = n - 1; i >= 0 ; i -- ){
    if(t[i] == '>') x ++ ;
    else x = 0;
    rf[i] = x;
  }
  ll ans = 0;
  for(int i = 0 ; i <= n; i ++ ){
    ans += max(lf[i], rf[i]);
  }
  cout << ans;
  return 0;
}

Measured memory_bytes: 4764
#include <iostream>
#include <iomanip>
#include <fstream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>

#define _GLIBCXX_DEBUG
#define rep(i, n) for (int64_t i = 0; i < (int64_t)(n); i++)
using namespace std;
using vi = vector<int64_t>;
using vvi = vector<vi>;

int main(int argc, const char * argv[]) {
    // fasten cin
    cin.tie(0);
    ios::sync_with_stdio(false);
    // implement
    int64_t n,time;
    cin >> n >> time;
    vector<int64_t> t(n);
    rep(i,n) cin >> t.at(i);
    int64_t dt, res=0;
    rep(i,n-1){
        dt = t.at(i+1) - t.at(i);
        if(dt <= time){
            res += dt;
        }else{
            res += time;
        }
    }
    res += time;
    cout << res << endl;
}


Measured memory_bytes: 1792
S = input()

#K = 1
K = int(input())

mycnt = 0
mynum = 1
for i in range(len(S)-1):
    if S[i] == S[i+1]:
        mynum += 1
        
    else: 
        mycnt += mynum//2
        mynum = 1
    #print('mycnt=', mycnt)
if mynum > 1:
    mycnt += mynum//2 

if len(set(S)) == 1:
    print(len(S)*K//2)

elif S[0] != S[-1]:
    
    print(mycnt * K)

else:
    myleft = 1
    myright = 0
    mys = S[0]
    i = 1
    while S[i] == mys:
        myleft += 1
        i += 1
    
    myright = 0
    i = -1
    while S[i] == mys:
        myright += 1
        i -= 1
    #print(myleft, myright)
    print( (mycnt * K) - ( myleft//2 + myright//2 - (myright + myleft)//2 ) * ( K - 1 ) )

Measured memory_bytes: 3064
#include <iostream>
#include <limits.h>
using namespace std;
int main() {
    int n, p;
    cin >> n;
    int list[n] = {};
    int maxim[n] = {};
    for (int i = 0; i < n; i++) {
        cin >> p;
        list[i] = p;
    }

    int lowest =INT_MAX;
    for (int i = 0; i < n - 1; i++) {
        int max = INT_MIN;
        int maxnum = 0;
        if(list[i] < lowest){
            lowest = list[i];
            for (int j = i + 1; j < n; j++) {
                if(list[j] > maxnum) {
                    max = list[j] - list[i];
                    maxnum = list[j];
                }
            }
        }
        maxim[i] = max;
    }
    int max = -1000000000;
    for(int i = 0; i < n - 1; i++) {
        if(maxim[i] > max) {
            max = maxim[i];
        }
    }
    cout << max << endl;
}


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

int main(){
    int S,h,m,s;
    cin >> S;
    h = S/3600;
    m = (S%3600)/60;
    s = (S%3600)%60;
    cout << h << ":" << m << ":" << s << endl;
    return 0;
}


Measured memory_bytes: 3088
import copy
from scipy.misc import comb
n = int(input())
#x, y, a, b, c = map(int, input().split())
#s= list(input())
a = list(map(int, input().split()))
an = [0] * n
for i in range(n):
    an[a[i]-1] += 1

ac2 = []
ac2_diff = []
for i in range(n):
    ac2.append(comb(an[i], 2, exact=True))
    ac2_diff.append(ac2[i]-comb(an[i]-1, 2, exact=True))
sum = sum(ac2)
for i in range(n):
    print(sum - ac2_diff[a[i]-1])

Measured memory_bytes: 37252
#include<bits/stdc++.h>
// Begin Header {{{
#define all(x) (x).begin(), (x).end()
#define lli long long int
#define rep(i,n) for(lli i=0; i<n; i++)
#define loop(i, j, n) for(lli i=j; i<n; i++)
#define Max(a, b) ((a) > (b) ? (a) : (b))
#define Min(a, b) ((a) < (b) ? (a) : (b))
constexpr int INF  = 0x3f3f3f3f;
const long long mod=1e9+7;
//Function
lli combi(lli n, lli r)
{
	if(r==0 || r==n) return 1;
	else return combi(n-1,r) + combi(n-1,r-1);
}
lli sigma1(lli n){return n*(n+1)/2;}
lli sigma2(lli s, lli n){return sigma1(n) - sigma1(s -1);}
using namespace std;
// }}} End Header

lli body(lli a, lli b){
	return (a-b)*(a-b);
}
int main()
{
	ios::sync_with_stdio(false); cin.tie(nullptr);
	lli n;
	cin >> n;
	vector<string> ss(n);
	set<string> t;
	rep(i,n){
		cin >> ss[i];
		t.insert(ss[i]);
	}
	cout << t.size() << endl;
	return 0;
}


Measured memory_bytes: 25040
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define int long long
#define pb push_back
const int N=100005;
const int MOD=1e9+7;
 

// lower_bound - which does not compare less than val
// upper_bound - which compares greater than val
#define trace1(x)                cerr<<#x<<": "<<x<<endl
#define trace2(x, y)             cerr<<#x<<": "<<x<<" | "<<#y<<": "<<y<<endl
#define trace3(x, y, z)          cerr<<#x<<":" <<x<<" | "<<#y<<": "<<y<<" | "<<#z<<": "<<z<<endl
#define trace4(a, b, c, d)       cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<endl
#define trace5(a, b, c, d, e)    cerr<<#a<<": "<<a<<" | "<<#b<<": "<<b<<" | "<<#c<<": "<<c<<" | "<<#d<<": "<<d<<" | "<<#e<< ": "<<e<<endl
 
 
 
int32_t main()
{
  
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  /* stuff you should look for
  * int overflow, array bounds
  * special cases (n=1?)
  * do smth instead of nothing and stay organized
*/

string res;
  string s,t;
  cin>>s>>t;
  int n=s.size();
  int m=t.size();
  int dp[n+1][m+1];
  memset(dp,0,sizeof(dp));
  for(int i=1;i<=n;i++)
  {
	  for(int j=1;j<=m;j++)
	  {
		  if(s[i-1]==t[j-1])
		  {
			  //res.pb(s[i-1]);
			  dp[i][j]=1+dp[i-1][j-1];
		  }
		  else
		  dp[i][j]=max(dp[i-1][j],dp[i][j-1]);
	  }
	  
  }
  //for abcd && abc
 /*
 0 0 0 0
0 0 0 0
0 1 1 1
0 1 2 2
0 1 2 3
*/

while(n&&m)
{
	if(s[n-1]==t[m-1])
	{
		res=s[n-1]+res;
		n--;
		m--;
		continue;
	}
	if(dp[n-1][m]>dp[n][m-1])
	n--;
	else
	m--;
}
cout<<res;



}



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

int main(){
    vector<int> x(3);// a, b, c
    cin >> x[0] >> x[1] >> x[2];
    sort(x.begin(), x.end());

    int ans = x[2] - x[1];
    x[0] += ans;
    while(x[0] < x[2]){
        x[0] += 2;
        ans  += 1;
    }
    if(x[0] > x[2]) ans += 1;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
/*    ####################  */
/*   # I_LOVE_THUY_LINH #  */
/*  ####################  */
#include <bits/stdc++.h>
#define ll long long
#define db double
#define ld long double
#define ii pair<int,int>
#define pb push_back
#define eb emplace_back
#define vi vector<int>
#define vii vector<ii>
#define matrix vector<vector<ll>>
#define fir first
#define sec second
#define all(s) s.begin(),s.end()
#define rall(s) s.rbegin(),s.rend()
#define uni(a) (a).erase(unique(all(a)),(a).end())
#define sz(a) int((a).size())
#define ms(s,val) memset(s,val,sizeof(s))
#define bitcount(n) __builtin_popcountll(n)
#define getbit(s,k) ((s >> k)&1)
#define turnbit(s,k) (s | (1<<k))
#define offbit(s,k) (s & ~(1<<k))
#define flipbit(s,k) (s ^ (1<<k))
#define prec(n) fixed<<setprecision(n)
#define sqr(x) (ll)(x)*(ll)(x)
#define lcm(a,b) ((ll)a/__gcd((ll)a,(ll)b)*(ll)(b))
#define gcd(a,b) __gcd(a,b)
using namespace std;
const int INF = int(1e9);

int main(){
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    string s;
    cin >> s;
    if (s[2] == s[3] && s[4] == s[5]) cout << "Yes";
    else cout << "No";
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <queue>
using namespace std;
#define rep(i,n) for(int i = 0;i<n;i++)
const long long MOD = 1000000007LL;
const string alpha = "abcdefghijklmnopqrstuvwxyz";
int main(){
    int a,p;
    cin >> a >> p;
    cout << (3*a + p)/2 << endl;
}

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

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

int main(){
	
	int a;
	string s;
	cin >> a >> s;
	if(a < 3200) cout << "red" << endl;
	else cout << s << endl;

  return 0;
}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main{

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String bloodType;
		int type[] = new int [4];
		while ((bloodType = br.readLine()) != null){
			String i[] = bloodType.split(",");
			if (i[1].equals("A")){
				type[0]++;
			}else if (i[1].equals("B")){
				type[1]++;
			}else if (i[1].equals("AB")){
				type[2]++;
			}else if (i[1].equals("O")){
				type[3]++;
			}
		}
		  for(int j = 0 ; j < 4 ; j++){
			  System.out.println(type[j]);
		  }

	}

}

Measured memory_bytes: 24228
#include <bits/stdc++.h>
using namespace std;
 
int main() {
    vector <char> S(3);
    for (int i=0;i<3;i++) {
        cin >> S.at(i);
    }
    int count =0;
    int R=0;
    for (int i=0;i<3;i++) {
        if(S.at(i)=='R') {
            count++;
            R=max(count,R);
        }
        else {
            count=0;
        }
    }
    cout << R << endl;
}

Measured memory_bytes: 3628
#include <stdio.h>
 
int main(void)
{
    int a, b, c, d;
 
    scanf("%d %d %d", &a, &b, &c);
 
    if (a > b) {
        d = b;
        b = a;
        a = d;
    } 
     
    if (b > c) {
        d = c;
        c = b;
        b = d;
    }
 
    if (a > b) {
        d = b;
        b = a;
        a = d;
    }
 
    printf("%d %d %d\n", a, b, c);
 
    return 0;
}

Measured memory_bytes: 596
#include <algorithm>
#include <cmath>
#include <iostream>
#include <queue>
#include <set>
#include <stdio.h>
#include <string>
#include <vector>

#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
const double PI = 3.1415926535897932;

/* a と b の最大公約数を返す関数 */
long long GCD(long long a, long long b) {
	if (b == 0) return a;
	else return GCD(b, a % b);
}

int main()
{
	int N, M;
	cin >> N >> M;
	vector<int> Km(M);
	vector<vector<int>> Smk(M, vector<int>(10, -1));
	vector<int> Pi(M);
	
	rep(i, M)
	{
		cin >> Km[i];
		rep(j, Km[i])
		{
			cin >> Smk[i][j];
		}
	}

	rep(i, M) cin >> Pi[i];

	int ans = 0;
	for (int i = 0; i < pow(2, N); ++i)
	{
		vector<int> Sc(M, 0);
		// j : 調べるスイッチのビット位置
		for (int j = 0; j < N; ++j)
		{
			if ((i >> j & 1) == 1)
			{
				// k番目の電球を調べる
				for (int k = 0; k < M; ++k)
				{
					for (int q = 0; q < Km[k]; ++q)
					{
						if (Smk[k][q] == (j+1))
						{
							Sc[k] += 1;
						}
					}
				}
			}
		}

		//組み合わせ確認
		int cnt = 0;
		for (int ck = 0; ck < M; ++ck)
		{
			if (Pi[ck] == 0 && Sc[ck] % 2 == 0)
			{
				cnt += 1;
			}
			else if (Pi[ck] == 1 && Sc[ck] % 2 == 1)
			{
				cnt += 1;
			}
		}
		if (cnt == M) ans += 1;
	}

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

Measured memory_bytes: 4052
#include <iostream>
#include <string>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)n ; i++)

int main(){
    string a;
    string b;
    string c;
    cin >> a >> b >> c;
    cout << a[0] << b[1] << c[2] << endl;
}

Measured memory_bytes: 3596
#include<bits/stdc++.h>
#define MOD 1000000007
#define md 998244353
#define INF LLONG_MAX
#define F first
#define S second
#define sz(x) (long long)x.size()
#define vi vector<int>
#define vll vector<long long>
#define vpl vector<pair<long long,long long> >
#define vpi vector<pair<int,int> >
#define pb push_back
#define debug(x) cerr<<#x<<"= "<<x<<endl
#define all(v) v.begin(),v.end()
#define TT ll test;cin>>test; while(test--)
#define rep(i,a,n) for(ll i=a;i<(long long)n;++i)
#define repr(i,n,a) for(ll i=n;i>(long long)a;--i)
#define endl '\n'
#define MAXN 200005
typedef long long ll;
typedef long double ld;
using namespace std;

int main(){
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    ld r;
    cin>>r;
    cout<<fixed<<setprecision(12)<<(2*3.14159*r);



    return 0;
}

Measured memory_bytes: 3804
// eddy1021
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
typedef double D;
typedef long double LD;
typedef long long LL;
typedef pair<int,int> PII;
typedef pair<LL,LL> PLL;
#define mod9 1000000009LL
#define mod7 1000000007LL
#define INF  1023456789LL
#define INF16 10000000000000000LL
#define eps 1e-9
#define SZ(x) (int)(x).size()
#define ALL(x) (x).begin(), (x).end()
#ifndef ONLINE_JUDGE
#define debug(...) printf(__VA_ARGS__)
#else 
#define debug(...)
#endif
inline LL getint(){
  LL _x=0,_tmp=1; char _tc=getchar();    
  while( (_tc<'0'||_tc>'9')&&_tc!='-' ) _tc=getchar();
  if( _tc == '-' ) _tc=getchar() , _tmp = -1;
  while(_tc>='0'&&_tc<='9') _x*=10,_x+=(_tc-'0'),_tc=getchar();
  return _x*_tmp;
}
inline LL add( LL _x , LL _y , LL _mod = mod7 ){
  _x += _y;
  return _x >= _mod ? _x - _mod : _x;
}
inline LL sub( LL _x , LL _y , LL _mod = mod7 ){
  _x -= _y;
  return _x < 0 ? _x + _mod : _x;
}
inline LL mul( LL _x , LL _y , LL _mod = mod7 ){
  _x *= _y;
  return _x >= _mod ? _x % _mod : _x;
}
LL mypow( LL _a , LL _x , LL _mod ){
  if( _x == 0 ) return 1LL;
  LL _ret = mypow( mul( _a , _a , _mod ) , _x >> 1 , _mod );
  if( _x & 1 ) _ret = mul( _ret , _a , _mod );
  return _ret;
}
LL mymul( LL _a , LL _x , LL _mod ){
  if( _x == 0 ) return 0LL;
  LL _ret = mymul( add( _a , _a , _mod ) , _x >> 1 , _mod );
  if( _x & 1 ) _ret = add( _ret , _a , _mod );
  return _ret;
}
inline bool equal( D _x ,  D _y ){
  return _x > _y - eps && _x < _y + eps;
}
#define Bye exit(0)
int __ = 1 , _cs;
/*********default*********/

void build(){

}
LL h , w;
void init(){
  h = getint();
  w = getint();
}
LL vl( LL a , LL b , LL c ){
  return max( a , max( b , c ) ) -
         min( a , min( b , c ) );
}
void solve(){
  if( h % 3 == 0 or w % 3 == 0 ){
    puts( "0" );
    Bye;
  }
  LL ans = h * w;
  for( int _ = 0 ; _ < 2 ; _ ++ ){
    for( LL i = 1 ; i < h ; i ++ ){
      LL p1 = i * w;
      if( h - i > 1 ){
        LL one = ( h - i     ) / 2 * w;
        LL two = ( h - i + 1 ) / 2 * w;
        ans = min( ans , vl( p1 , one , two ) );
      }
      if( w > 1 ){
        LL one = ( h - i ) * ( w / 2 );
        LL two = ( h - i ) * ( w - w / 2 );
        ans = min( ans , vl( p1 , one , two ) );
      }
    }
    swap( h , w );
  }
  cout << ans << endl;
}
int main(){
  build();
  //__ = getint();
  while( __ -- ){
    init();
    solve();
  }
}


Measured memory_bytes: 256
import java.util.Scanner;
class Main{
    public static void main(String[] av){
	Scanner sc = new Scanner(System.in);
	int a = sc.nextInt();
	int b = sc.nextInt();
        int c = sc.nextInt();
	int i = 0,cnt = 0; 
	while(cnt < c){
	    i++;
	    cnt += a;
	    if(i % 7 == 0){cnt += b;}
	    
	}
	System.out.println(i);
    }
}


Measured memory_bytes: 26404
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
typedef pair<int,int> pi;
typedef pair<ll,ll> pll;
#define Max 1000001
#define inf INT_MAX
#define llinf LONG_LONG_MAX
#define rep(i,a,b) for(i=a;i<=b;i++)
#define rrep(i,a,b) for(i=a;i>=b;i--)
#define fast ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define pb push_back
#define F first
#define S second
#define ub upper_bound
#define lb lower_bound
#define all(v) v.begin(),v.end()
#define PI 3.14159265358979311599796346854418516159057617187500
#define endl '\n'
const ll N=150000+5,mod=1e9+7,bit=31;
signed main()
{
    fast;
    ll pro=1,temp,t,m,k,i,j,l,r,mid,x,y,z,rem,carry=0,ind,ans=0,mx=-llinf,mn=llinf,cnt=0,curr=0,prev,nxt,sum=0,flag=1,i1=-1,i2=-1;
	string s;
	cin>>x>>s;
	if(x>=3200)
	{
		cout<<s;
	}
	else
	{
		cout<<"red";
	}
	return 0;
}

Measured memory_bytes: 256
package main

import (
	"fmt"
)

func main() {
	var N int
	fmt.Scan(&N)

	inputs := scanNums(2*N + 1)

	As := inputs[0 : N+1]
	Bs := inputs[N+1:]

	var killCount int
	for i, v := range Bs {
		if v > As[i] {

			killCount += As[i]
			cap := v - As[i]

			if As[i+1] < cap {
				killCount += As[i+1]
			} else {
				killCount += cap
			}

			if As[i+1]-(v-As[i]) < 0 {
				As[i+1] = 0
			} else {
				As[i+1] = As[i+1] - (v - As[i])
			}
		} else {
			killCount += v
		}
	}
	fmt.Println(killCount)
}

func scanNums(len int) (nums []int) {
	var num int
	for i := 0; i < len; i++ {
		fmt.Scan(&num)
		nums = append(nums, num)
	}
	return
}


Measured memory_bytes: 8704
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"
#include "ctime"

using namespace std;

//constexpr long long int MOD = 1000000007;
constexpr int MOD = 1000000007;
//constexpr int MOD = 998244353;
//constexpr long long int MOD = 998244353;
constexpr double EPS = 1e-8;

//int N, M, K, H, W, L, R;
long long int N, M, K, H, W, L, R;


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

	cin >> N;
	for (int i = 0; i <= N; i++) {
		M = i * 108 / 100;
		if (M == N) {
			cout << i << endl;
			return 0;
		}
	}
	cout << ":(" << endl;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main() {
    int a, b;

    cin >> a >> b;

    if (a >= 13) {
        cout << b << endl;
    }
    else if (a >= 6 && a <= 12) {
        cout << b / 2 << endl;
    }
    else{
        cout << 0 << endl;
    }

    return 0;
}

Measured memory_bytes: 256
def dubious_document(N: int, S: list)->str:
    ret = ''
    for c in 'abcdefghijklmnopqrstuvwxyz':
        ret += c * min(s.count(c) for s in S)

    return ret


if __name__ == "__main__":
    N = int(input())
    S = [input() for _ in range(N)]
    ans = dubious_document(N, S)
    print(ans)


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

using ll = long long;

#define mod 1000000007
#define REP(i, n) for (int i = 0; i < n; i++)
#define INF (1 << 29)

using namespace std;

//long C(long n, long r);
//long long gcd(long long a, long long b);
//long long lcm(long long a, long long b);

void solve()
{
    int h, w;
    cin >> h >> w;
    int c[10][10];
    for (int i = 0; i <= 9; i++)
    {
        for (int j = 0; j <= 9; j++)
            cin >> c[i][j];
    }
    for (int k = 0; k <= 9; k++)
    {
        for (int i = 0; i <= 9; i++)
        {
            for (int j = 0; j <= 9; j++)
            {
                if (c[i][j] > c[i][k] + c[k][j])
                    c[i][j] = c[i][k] + c[k][j];
            }
        }
    }
    int ans = 0;
    for (int i = 1; i <= h; i++)
    {
        for (int j = 1; j <= w; j++)
        {
            int a;
            cin >> a;
            if(a == -1) continue;
            if(a != 1) ans += c[a][1];
        }
    }
    cout << ans << endl;
}

int main()
{
    solve();
    return 0;
}


Measured memory_bytes: 256
#include <iostream> // cin, cout, cerr
#include <algorithm> // minmax, sort, swap
#include <numeric> // iota
#include <cstdio> // printf, scanf
#include <string> // string, stoi, to_string
#include <vector> // vector
#include <queue> // queue, priority_queue
#include <deque> // deque
#include <map> // key-value pairs sorted by keys
#include <set> // set
#include <iomanip> // cout<<setprecision(n)
#include <functional> // function<void(int)>
#include <cmath>
#include <cassert>
#include <bitset>

#ifdef DEBUG
#include "debug.hpp"
#else
#define debug(...)
#endif

// #define int long long // at least int64 > 9*10^18
#define EL '\n'
#define rep(i,n) for(int i = 0; i < (n); i++)
#define print(i) std::cout << (i) << '\n'
#define all(v) (v).begin(), (v).end()
/* libraries */

signed main() {
	const int MOD=998244353;
	int n,x;
	std::cin >> n >> x;
	int dp[501][2010];
	dp[0][0]=1;
	rep(m,x+1) rep(i,n) rep(j,2*x+1) {
		if(dp[i][j]) {
			dp[i+1][j^m]+=dp[i][j];
			dp[i+1][j^m]%=MOD;
		}
	}
	print(dp[n][x]);
	return 0;
}



Measured memory_bytes: 6116
#include <iostream>
using namespace std;
 
int pow2(int);
 
int main() {
	int a, b, c, k;
	cin >> a >> b >> c >> k;
	if(a>=b && a>=c){
		cout << pow2(k)*a+b+c << endl;
		return 0;
	}
	else if(b>=c){
		cout << pow2(k)*b+a+c << endl;
		return 0;
	}
	cout << pow2(k)*c+a+b << endl;
	return 0;
}
 
int pow2(int k){
	if(k==0)return 1;
	return 2*pow2(k-1);
}

Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <string>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <set>

using namespace std;

int main() {
    int W, H, N;

    cin >> W >> H >> N;

    vector<int> x(N), y(N), a(N);
    vector<int> A = {W, H};
    vector<int> B = {0, 0};

    for (int i = 0; i < N; i++) {
        cin >> x.at(i) >> y.at(i) >> a.at(i);
    }

    for (int i = 0; i < N; i++) {
        switch(a.at(i)) {
            case 1:
                if (B.at(0) < x.at(i)) B.at(0) = x.at(i);
                break;
            case 2:
                if (A.at(0) > x.at(i)) A.at(0) = x.at(i);
                break;
            case 3:
                if (B.at(1) < y.at(i)) B.at(1) = y.at(i);
                break;
            case 4:
                if (A.at(1) > y.at(i)) A.at(1) = y.at(i);
                break;
            default:
                break;
        }
    }
    if ((A.at(0) - B.at(0) > 0) && (A.at(1) - B.at(1) > 0)) {
        cout << (A.at(0) - B.at(0)) * (A.at(1) - B.at(1)) << endl;
    } else {
        cout << 0 << endl;
    }

    return 0;
}

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

int main() {

	long ans = 0; 
	string S; cin >> S;
	int bcount = 0;
	 
	for (int i = 0; i <= (int) S.length() - 1; i++) {

		if (S[i] == 'B') bcount++; else ans += bcount;

	}

	cout << ans << endl;

}

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

const long long N = 1e3 + 17;
ll a[N], b[N], cnt, ans, lnt, n, m, r1, r0, l1, l0, sum, mx, h, c[N], t[N], mn = N, x, y, k;
pair<ll,ll>pr[N];
vector<ll>v,v2;
map<ll,ll>mp;
bool used[N];
char ch[1005][1005];
ll prime[N] = {2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53};

int main()
{
    //freopen("input.txt", "r", stdin);
    //freopen("output.txt", "w", stdout);
    cin >> x >> y;
    while(x >= 500)
    {
        x -= 500;
    }
    if(x <= y)
    {
        cout << "Yes";
        return 0;
    }
    cout << "No";
}


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

int main(){
	int n,i,d[100000]={0},deff,m[100000]={0},count=0;
	long long sum=0,p;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&d[i]);
		sum+=d[i];
	}
	
	for(i=0;count<n-1;i+=2){
		count++;
		deff=d[i%n]-d[(i+1)%n];
		if(deff>=0){m[(i+2)%n]+=m[i%n]-2*deff;sum=sum-m[(i+2)%n];}
		else {m[(i+2)%n]+=m[i%n]+(-deff)*2;sum=sum-m[(i+2)%n];}
	}
	//for(i=0;i<n;i++)printf("%d ",m[i]);printf("\n");
	
	p=sum/n;
	//printf("%d\n",p);
	for(i=0;i<n;i++){
		if(i)printf(" ");
		printf("%d",p+m[i]);
	}		
	return 0;
}

Measured memory_bytes: 2048
#include <iostream>
#include <queue>
#include <utility>


using namespace std;

int main()
{
  int n, q;
  cin >> n >> q;
  queue< pair<string, int> > Q;

  string name;
  int time;
  for (int i = 0; i < n; ++i) {

    cin >> name >> time;
    Q.push(make_pair(name, time));
  }

  int time_stamp = 0;
  pair<string, int> candidate;

  while (!Q.empty()) {
    candidate = Q.front();
    if (candidate.second <= q) {
      time_stamp += candidate.second;
      cout << candidate.first << " " << time_stamp  << endl; //output
      Q.pop();
    } else {
      time_stamp += q;
      candidate.second -= q;
      Q.pop();
      Q.push(candidate);
    }
  }
  return 0;
}

Measured memory_bytes: 4404
#include <iostream>
#include <cctype>
#include <cstdio>

int main() {
  char ch;
  char line[1200];

  /*                                                                            
    ????????\???????????????????????????????????????                                            
    cin?????¨???getline()???????????????????????????                                        
    scanf?????¨???????????????????????§?????????????????????                                     
   */

  for (int i = 0;i < 1200;i++) {
    scanf("%c", &ch);
    if (ch == '\n') {
      line[i] = '\0';
      break;
    }
    if (isupper(ch)) {
      line[i] = (char)tolower(ch);
    } else if (islower(ch)) {
      line[i] = (char)toupper(ch);
    } else {
      line[i] = ch;
    }
  }

  std::cout << line << std::endl;
  return 0;
}

Measured memory_bytes: 3224
#![allow(non_snake_case)]
#![allow(unused_variables)]
#![allow(dead_code)]

fn main() {
    let (N, A, B): (i64, i64, i64) = {
        let mut line: String = String::new();
        std::io::stdin().read_line(&mut line).unwrap();
        let mut iter = line.split_whitespace();
        (
            iter.next().unwrap().parse().unwrap(),
            iter.next().unwrap().parse().unwrap(),
            iter.next().unwrap().parse().unwrap()
        )
    };

    let mut a = A;
    let mut b = B;
    let mut t = 0;
    while true {
        if t == 1 && (a == N - 1 && b == N || a == 2 && b == 1) {
            println!("Alice");
            return;
        }
        if t == 0 && (a == N && b == N - 1 || a == 1 && b == 2) {
            println!("Borys");
            return;
        }
        if t == 0 {
            if a < b && b - a >= 2 || a > b && a - b == 1 {
                a += 1;
            } else {
                a -= 1;
            }
            t = 1;
        }
        else {
            if b < a && a - b >= 2 || b > a && b - a == 1 {
                b += 1;
            } else {
                b -= 1;
            }
            t = 0;
        }
    }
}


Measured memory_bytes: 4352
import java.util.Scanner;

public class Main{
	public static void main(String args[]){

		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		long sum = 0;
		int[] x = new int[N];

		for (int i = 0; i < N; i++) {
			x[i] = sc.nextInt();
		}
		int max = x[0];
		int min = x[0];

		for (int i = 0; i < N; i++) {

			if (max < x[i]) {
				max = x[i];
			}

			if (min > x[i]) {
				min = x[i];
			}

			sum = sum + x[i];
		}
		System.out.println(min + " " + max + " " + sum);
	}
}

Measured memory_bytes: 41520
n=int(input())
a=[[] for i in range(n)]
for i in range(n):
    c=int(input())
    for j in range(c):
        x,y = map(int, input().split())
        a[i].append([x,y])
from itertools import permutations, combinations,combinations_with_replacement,product
ans3 = 0
for ans  in product([0,1],repeat=n):
    flag = True
    for i, check in enumerate(a):
        if ans[i]==0:
            continue
        
        for x, y in check:
            if y != ans[x-1]:
                flag = False
                break
    if flag:
        ans3=max(sum(ans), ans3)
print(ans3)


Measured memory_bytes: 3064
use std::io::{stdout, BufWriter, Write};
use std::thread;

fn run() {
    let input = read_input();
    let mut input = input.split_whitespace();
    let in_n: i64 = input.next().unwrap().parse().unwrap();
    let in_x: Vec<i64> = input.map(|s| s.parse().unwrap()).collect();

    let mut y = in_x.clone();
    y.sort();
    let x1 = y[in_n as usize / 2 - 1];
    let x2 = y[in_n as usize / 2];

    let out = stdout();
    let mut out = BufWriter::new(out.lock());
    for x in in_x {
        writeln!(out, "{}", if x <= x1 { x2 } else { x1 }).unwrap();
    }
}

fn main() {
    thread::Builder::new()
        .stack_size(32 * 1024 * 1024) // 32MB
        .spawn(run)
        .unwrap()
        .join()
        .unwrap();
}

/// ローカル環境なら _in.txt から入力を受ける
fn read_input() -> String {
    use std::fs::File;
    use std::io::Read;
    let mut s = String::new();
    match option_env!("LOCAL") {
        Some(_) => File::open("src/_in.txt")
            .expect("File not found")
            .read_to_string(&mut s)
            .unwrap(),
        None => std::io::stdin().read_to_string(&mut s).unwrap(),
    };
    s
}


Measured memory_bytes: 17656
#define _USE_MATH_DEFINES
#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;

int main(){

	int a,b,ans;
	char op;

	for(;;){
		cin >> a >> op >> b;

		if(op == '+') ans = a + b;
		else if(op == '-') ans = a - b;
		else if(op == '*') ans = a * b;
		else if(op == '/') ans = a / b;
		else if(op == '?') break;
		else continue;

		cout << ans << endl;
	}


	return 0;
}


Measured memory_bytes: 3120
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int main(){
   int n;
   cin >> n;
   int i=n;
   for(int i=n; i < 1000; i++){
      if(i % 111 == 0){
         cout << i << endl;
         return 0;
      }
   }

   return 0;
}

Measured memory_bytes: 888
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <cstdio>
#include <string>
#include <cmath>
#include <queue>
#include <tuple>
#include <set>
#include <assert.h>
#include <sstream>
#include <string>
//#include <bits/stdc++.h>
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repr(i, n) for (int i = (n) - 1; i >= 0; i--)
#define FOR(i,i0,n) for(int (i)=(i0);(i)<(n);(i)++)
#define FORR(i,i0,n) for(int (i)=(n)-1; (i)>=(i0);(i)--)
#define SORT(x) sort(x.begin(),x.end())
#define SORTR(x) sort(x.begin(),x.end(),greater <>())
#define rn return
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple
using namespace std;
using ll = long long;
typedef std::pair<ll,ll> P;
//#include <boost/multiprecision/cpp_int.hpp>
//using bint = boost::multiprecision::cpp_int;
const int mod = 1000000007;

int main(){
    vector<vector<int>> A(3,vector<int>(3));
    rep(ii,3) rep(j,3) cin >> A[ii][j];
    int n;
    cin >> n;
    rep(k,n){
        int b;
        cin >> b;
        rep(ii,3) rep(j,3) if (A[ii][j] == b) A[ii][j] = -1;
    }
    int ans = 100000;
    
    rep(ii,3){
        int temp = 0;
        rep(j,3){
            temp += A[ii][j];
        }
        ans = min(temp,ans);
    }
    
    rep(i,3){
        int temp = 0;
        rep(jj,3){
            temp += A[jj][i];
        }
        ans = min(temp,ans);
    }
    int temp = 0;
    rep(i,3){
        temp += A[i][i];
    }
    ans = min(ans,temp);
    
    temp = 0;
    rep(i,3){
        temp += A[i][2-i];
    }
    ans = min(ans,temp);
    cout << (ans==-3? "Yes":"No");
}


Measured memory_bytes: 256
l, r = map(int, input().split())


if int(l / 2019) == int(r / 2019):
    l = int(l % 2019)
    r = int(r % 2019)
    m = 2018
    for i in range(l, r):
        for j in range(i + 1, r + 1):
            if m > int((i * j) % 2019):
                m = int((i * j) % 2019)

else:
    m = 0

print(m)

Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define MOD			1000000007
#define FOR(i,l,r)	for(int i=l;i<=r;i++)
#define REP(i,n)	for(int i=1;i<=n;i++)
#define REP0(i,n)	for(int i=0;i<n;i++)
#define PB			push_back
#define MP			make_pair
#define PII			pair<int,int>
#define VI			vector<int>
#define ALL(x)		(x).begin(),(x).end()
int n,a[100005],ans;
int main(){
	cin>>n;
	for(int i=1;i<=n;i++)	cin>>a[i];
	int cnt=0;
	a[0]=0x3f3f3f3f;
	a[n+1]=0x3f3f3f3f;
	for(int i=1;i<=n+1;i++){
		if(a[i]>a[i-1]){
//			cout<<cnt<<endl;
			ans=max(ans,cnt-1);
			cnt=1;
		}
		else	cnt++;
	}
	cout<<ans<<endl;
	return 0;
}

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

int main() {
  int okane;
  int uresisa = 0;
  
  cin >> okane;
  
  uresisa += okane / 500 * 1000;
  okane = okane % 500;
    
  uresisa += okane / 5 * 5;
  
  cout << uresisa << endl;
  return 0;
}


Measured memory_bytes: 256
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        String s = sc.next();
        char[] alpha = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};        
        char[] c = new char[s.length()];
        
        for(int i=0; i<s.length(); i++){
            c[i] = s.charAt(i);
            int flg = 0;
            
            for(int j=0; j<26; j++){
                if(c[i]==alpha[j] && flg==0){
                    if(j+n<26){
                        //System.out.print(c[i]);
                        c[i] = alpha[j+n];
                    }else if(j+n>=26){
                        //System.out.print(c[i]);
                        c[i] = alpha[j+n-26];
                    }
                    flg=1;
                }
            }
            System.out.print(c[i]);
        }
        
        //System.out.println();
    }
}


Measured memory_bytes: 39888
#pragma warning(disable:4996)
#include <bits/stdc++.h>

using namespace std;

//macro
#define FOR(i,a,b) for(ll i=(ll)(a);i<(ll)(b);i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define EPS (1e-8)
#define equals(a,b)(fabs((a)-(b))<EPS)

using ll = long long;
using ull = unsigned long long;
using vb = vector<bool>;
using vi = vector<int>;
using vll = vector<ll>;
using vs = vector<string>;
using vvb = vector<vb>;
using vvi = vector<vi>;
using vvll = vector<vll>;
//func
template<typename A, typename T>void assign2d(A&arr, ll H, ll W, T t) { arr.resize(H); REP(i, H) arr[i].assign(W, t); }
template<class T> ostream &operator<<(ostream &os, const vector<T> &v) { int n = v.size(); REP(i, n)os << v[i] << (i == n - 1 ? "" : " "); return os; }
template <class T = int> inline T IN() { T x; cin >> x; return x; }
template<class T> inline void OUT(const T &x) { cout << x << "\n"; }
void YESNO(bool c) { OUT(c ? "YES" : "NO"); };
void YesNo(bool c) { OUT(c ? "Yes" : "No"); };
struct pre_ { pre_() { cin.tie(nullptr); ios::sync_with_stdio(false); /*cout << fixed << setprecision(6);*/ } } pre__;

int main() {
	set<int> S;
	REP(i, 3) {
		int x = IN();
		S.insert(x);
	}
	OUT(S.size());
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

int main(){
  int a, b; cin >> a >> b;
  if(a<=8 && b<=8) cout << "Yay!" << endl;
  else cout << ":(" << endl;   
}

Measured memory_bytes: 256
#
# 　　  ⋀_⋀　 
#　　  (･ω･)  
# .／ Ｕ ∽ Ｕ＼
#  │＊　合　＊│
#  │＊　格　＊│ 
#  │＊　祈　＊│ 
#  │＊　願　＊│ 
#  │＊　　　＊│ 
#      ￣
#
import sys
input=sys.stdin.readline
from math import floor,ceil,sqrt,factorial,log #log2ないｙｐ
from heapq import heappop, heappush, heappushpop
from collections import Counter,defaultdict
from itertools import accumulate,permutations,combinations,product,combinations_with_replacement
from bisect import bisect_left,bisect_right
inf=float('inf')
mod = 10**9+7
def INT_(n): return int(n)-1
def MI(): return map(int,input().split())
def MF(): return map(float, input().split())
def MI_(): return map(INT_,input().split())
def LI(): return list(MI())
def LI_(): return [int(x) - 1 for x in input().split()]
def LF(): return list(MF())
def LIN(n:int): return [I() for _ in range(n)]
def LLIN(n: int): return [LI() for _ in range(n)]
def LLIN_(n: int): return [LI_() for _ in range(n)]
def LLI(): return [list(map(int, l.split() )) for l in input()]
def I(): return int(input())
def F(): return float(input())
def ST(): return input().replace('\n', '')
def main():
    N, M = MI()
    edge = [[] for _ in range(N)]
    for _ in range(M):
        u,v = MI_()
        edge[u].append(v)
    S, T = MI_()

    queue = [S]
    checked = set()
    for i in range(1,max(3*N+1,3*M+2)):
        tmp = set()
        while queue:
            s = queue.pop()
            if i % 3 == 0:
                if s in checked:
                    continue
                else:
                    checked.add(s)
            for to in edge[s]:
                if to == T:
                    if i%3==0:
                        print(i//3)
                        exit()
                tmp.add(to)
        queue = tmp
    print(-1)
            

if __name__ == '__main__':
    main()

Measured memory_bytes: 63612
import java.util.*;
class Main{
        public static void main(String [] args){
        Scanner sc = new Scanner(System.in);
                int n = sc.nextInt();
        int s = sc.nextInt();
        List<String> res = new ArrayList();

        for(int i = 0; i <= n; i++){
                res.add(sc.nextLine());
        }

        Collections.sort(res);
        StringBuffer ret = new StringBuffer();
        for(String a : res)
          ret.append(a);

        System.out.println(ret.toString());
    }
}

Measured memory_bytes: 21844
#include<bits/stdc++.h>
#define ll long long int
#define ull unsigned long long 
#define ff first
#define ss second
#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define pb push_back 
#define mp make_pair
#define inf 2000000009
#define mod 1000000007
using namespace std;


int main()
{ 
    fast;

    ll n,k;
    cin>>n>>k;

    ll a[n];
    for(ll i=0;i<n;i++)
    	cin>>a[i];

    sort(a,a+n);

    ll fact[n+5],inv[n+5],finv[n+5];
    fact[0]=fact[1]=inv[0]=inv[1]=finv[0]=finv[1]=1;
  

    for(ll i=2;i<n+5;i++)
    {
      fact[i]=fact[i-1]*i%mod;
      inv[i]=mod-inv[mod%i]*(mod/i)%mod;
      finv[i]=finv[i-1]*inv[i]%mod;
    }

    ll pos=0,neg=0;

    for(ll i=0;i<n;i++)
    {
    	if(n-1-i>=k-1)
    		neg=(neg + (fact[n-1-i]*finv[k-1]%mod* finv[n-i-k]%mod*a[i]%mod))%mod;
    	if(i>=k-1)
    		pos=(pos + (fact[i]*finv[k-1]%mod*finv[i-k+1]%mod*a[i]%mod))%mod;
    }

    cout<<(pos-neg+mod)%mod<<endl;
    
  }

Measured memory_bytes: 3328
#include<bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
const long long mod = 1e9+7;
const int dx[4] = {0,1,0,-1};
const int dy[4] = {1,0,-1,0};
//////////////////////////////////

int main() {
    int n; cin >> n;
    vector<int> h(n);
    int ans = 0;
    int cnt = 0;
    int ph = 1e9;
    cin >> ph;
    for(int i=1; i<n; i++) {
        cin >> h[i];
        if(ph >= h[i]) {
            ph = h[i];
            cnt++;
        }else{
            ans = max(cnt, ans);
            cnt = 0;
            ph = h[i];
        }
    }
    ans = max(cnt, ans);
    cout << ans << endl;

    return 0;
}

// EOF


Measured memory_bytes: 640
#include <iostream>
#include <string>
#include <cmath>
#include <vector>
#include <algorithm>
#include <functional>

using namespace std;

int main() {
    int l;
    int length = 3;
    //int input[length];
    vector<int> input(length);
    for(int i = 0;i < length && cin>>l;i++){
        input[i] = l;
    }
    sort(input.begin(), input.end());
    cout << input[0] << " " << input[1] << " " << input[2] << endl;
    return 0;
}



Measured memory_bytes: 3128
import scala.math

object Main extends App {
  val sc = new java.util.Scanner(System.in)
  def divisors(n: Int): List[Int] =
    for (i <- (1 to n).toList if n % i == 0) yield i

  var s = sc.next()
  if(s == "Sunny") println("Cloudy")
  if(s == "Cloudy") println("Rainy")
  if(s == "Rainy") println("Sunny")
}


Measured memory_bytes: 55388