akhauriyash/Code-Regression huggingface dataset:
#include<cstdio>
#include<vector>
#include<set>
#include<algorithm>

using namespace std;

vector<vector<int> > ans;

int L;
vector<int> d;
int N;

void output(vector<int> vec){
	printf("(");
	for(int i=0;i<vec.size();i++) printf("%d ",vec[i]);
	printf(")\n");
}

bool validate(vector<int> vec){
	sort(vec.begin(),vec.end());
	vector<int> ds;
	for(int i=0;i<N;i++) for(int j=i+1;j<N;j++){
		ds.push_back(abs(vec[i]-vec[j]));
	}
//	output(vec);
	sort(ds.begin(),ds.end());
//	output(ds);
	if(ds==d) return true;
	else return false;
}

multiset<int,greater<int> > se;
void dfs(vector<int> &cur){
	if(cur.size()==N){
		bool flg=validate(cur);
		if(flg) ans.push_back(cur);
		return;
	}
	int x=*se.begin();
	int nxt[]={x,L-x};
	for(int i=0;i<2;i++){
		int p=nxt[i];
		vector<int> erased;
		for(int j=0;j<cur.size();j++){
			int d=abs(cur[j]-p);
			multiset<int,greater<int> >::iterator it=se.find(d);
			if(it==se.end()){
				for(int k=0;k<erased.size();k++) se.insert(erased[k]);
				goto nxtPos;
			}
			se.erase(it);
			erased.push_back(d);
		}
//		printf("add %d\n",p);
		cur.push_back(p);
		dfs(cur);
		cur.pop_back();
//		printf("erase %d\n",p);
		for(int j=0;j<erased.size();j++) se.insert(erased[j]);
		nxtPos:;
	}
}

vector<vector<int> > ans2;
vector<int> translate(vector<int> &vec){
	vector<int> res;
	sort(vec.begin(),vec.end());
	for(int i=0;i+1<vec.size();i++){
		res.push_back(vec[i+1]-vec[i]);
	}
	return res;
}

void init(){
	ans.clear();
	ans2.clear();
	d.clear();
	se.clear();
}

int main(){
	while(true){
		init();
		scanf("%d",&N);
		if(N==0) break;
		for(int i=0;i<(N*(N-1))/2;i++){
			int in;
			scanf("%d",&in);
			se.insert(in);
			d.push_back(in);
		}
		reverse(d.begin(),d.end());
		L=*se.begin();
		se.erase(se.begin());
		vector<int> tmp;
		tmp.push_back(0);
		tmp.push_back(L);
		dfs(tmp);
		for(int i=0;i<ans.size();i++) ans2.push_back(translate(ans[i]));
		sort(ans2.begin(),ans2.end());
		ans2.erase(unique(ans2.begin(),ans2.end()),ans2.end());
		for(int i=0;i<ans2.size();i++){
			for(int j=0;j<ans2[i].size();j++){
				printf("%d%c",ans2[i][j],j+1==ans2[i].size()?'\n':' ');
			}
		}
		printf("-----\n");
	}
	return 0;
}

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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define intpow(a, n) (int)pow((long double) a, (long double) n)
#define int long long

signed main(){
    string s; cin >> s;
    int n = 0;
    rep(i,4) n += s[i]=='+' ? 1 : -1;
    cout << n << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define double long double
using namespace std;
int n,k;
struct PT {
  double x, y;
  PT() {}
  PT(double x, double y) : x(x), y(y) {}
  PT(const PT &p) : x(p.x), y(p.y)    {}
  PT operator + (const PT &p)  const { return PT(x+p.x, y+p.y); }
  PT operator - (const PT &p)  const { return PT(x-p.x, y-p.y); }
  PT operator * (double c)     const { return PT(x*c,   y*c  ); }
  PT operator / (double c)     const { return PT(x/c,   y/c  ); }
} p[65];

double dot(PT p, PT q)     { return p.x*q.x+p.y*q.y; }
double dist2(PT p, PT q)   { return dot(p-q,p-q); }
double cross(PT p, PT q)   { return p.x*q.y-p.y*q.x; }
ostream &operator<<(ostream &os, const PT &p) {
  return os << "(" << p.x << "," << p.y << ")";
}

// rotate a point CCW or CW around the origin
PT RotateCCW90(PT p)   { return PT(-p.y,p.x); }
PT RotateCW90(PT p)    { return PT(p.y,-p.x); }
PT RotateCCW(PT p, double t) {
  return PT(p.x*cos(t)-p.y*sin(t), p.x*sin(t)+p.y*cos(t));
}

double INF = 1e100;
double EPS = 1e-12;

vector<PT> CircleCircleIntersection(PT a, PT b, double r, double R) {
  vector<PT> ret;
  double d = sqrt(dist2(a, b));
  if (d > r+R || d+min(r, R) < max(r, R)) return ret;
  double x = (d*d-R*R+r*r)/(2*d);
  double y = sqrt(r*r-x*x);
  PT v = (b-a)/d;
  ret.push_back(a+v*x + RotateCCW90(v)*y);
  if (y > 0)
    ret.push_back(a+v*x - RotateCCW90(v)*y);
  return ret;
}
bool check(double X){
    //cout << "test " << X << endl;
    for (int i = 0; i < n; i++){
        for (int j = i; j < n; j++){
            if (i == j){
                int ans = 0;
                for (int k = 0; k < n; k++){
                    double D = sqrt(dist2(p[i],p[k]));
                    if (D-X <= EPS){
                        ans++;
                    }
                }
                if (ans == n) return true;
                continue;
            }
            vector<PT> check = CircleCircleIntersection(p[i],p[j],X,X);
            for (auto x : check){
                int ans = 0;
                for (int k = 0; k < n; k++){
                    double D = sqrt(dist2(x,p[k]));
                    //cout << x << " " << p[k] <<  " " << D << endl;
                    if (D-X <= EPS){
                        ans++;
                    }
                }
                //cout << x << " " << ans << endl;
                if (ans == n) return true;
            }
        }
    }
    return false;
}
int main(){
    scanf("%d",&n);
    for (int i = 0,x,y; i < n; i++){
        scanf("%d%d",&x,&y);
        p[i].x = (double)x;
        p[i].y = (double)y;
    }
    double lo = 0, hi = 5000;
    while (hi-lo > 1e-6){
        double mid = (lo+hi)/2;
        if (check(mid)){
            hi = mid;
        }
        else lo = mid;
    }
    printf("%.6Lf",lo);

}


Measured memory_bytes: 256
n = int(input())
A = [int(i) for i in input().split()]

q = int(input())
m = [int(i) for i in input().split()]

def solve(i, m, target):
    if m == target:
        return True
    if i >= n or m > target:
        return False
    if m + sum(A[i:]) < target:
        return False
    
    return solve(i+1, m, target) or solve(i+1, m + A[i], target)

for i in m:
    if solve(0, 0, i):
        print('yes')
    else:
        print('no')


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

using namespace std;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, i = 0,j=-1;
    string str;
    cin >> str;
    N = str.length();
    for(;i<=N/2 && j!=N-i;++i){
        for(j=i;j<N-i-1;++j){
            if(str[j] != str[j+1]){
                break;
            }
        }
    }
    cout << N+1-i << "\n";
    return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define sz(x) ((int) (x).size())
#define forn(i,n) for (int i = 0; i < int(n); ++i)
typedef long long ll;
typedef long long i64;
typedef long double ld;
const int inf = int(1e9) + int(1e5);
const ll infl = ll(2e18) + ll(1e10);

const int maxn = 105;
vector<int> a[maxn];

void e(int a1, int a2, int a3, int a4) {
    a[a1].push_back(a2);
    a[a2].push_back(a3);
    a[a3].push_back(a4);
    a[a4].push_back(a1);
}

void E(int a1, int a2, int a3, int a4) {
    e(a4, a3, a2, a1);
}

void build(int l, int r) {
    int n = r - l;
    if (n % 2) {
        for (int i = l; i < r; ++i) {
            forn (step, n - 1)
                a[i].push_back((i + step + 1 - l) % n + l);
        }
        return;
    }

    if (n == 4) {
        a[l + 0].push_back(l + 1);
        a[l + 0].push_back(l + 3);
        a[l + 0].push_back(l + 2);

        a[l + 1].push_back(l + 2);
        a[l + 1].push_back(l + 0);
        a[l + 1].push_back(l + 3);

        a[l + 2].push_back(l + 0);
        a[l + 2].push_back(l + 3);
        a[l + 2].push_back(l + 1);

        a[l + 3].push_back(l + 0);
        a[l + 3].push_back(l + 1);
        a[l + 3].push_back(l + 2);
        return;
    }

    int c = (l + r) / 2;
    build(l, c);
    build(c, r);

    int hn = n / 2;
    for (int i = l; i < r; ++i) {
        int id = i >= c ? i - c : i - l;
        forn (step, hn) {
            int add = i >= c ? hn - step : step + 1;
            int id2 = (id + add) % hn;
            int to = i >= c ? l + id2 : c + id2;
            a[i].push_back(to);
        }
    }
}

void check(int n) {
    forn (i, n) {
        assert(sz(a[i]) == n - 1);
        set<int> s;
        for (int j: a[i]) {
            assert(j != i);
            assert(j >= 0 && j < n);
            s.insert(j);
        }
        assert(sz(s) == n - 1);
    }
    forn (i, n)
        forn (j, n - 1) {
            int to = a[i][j];
            assert(a[to][j] != i);
        }
}

int main() {
    #ifdef LOCAL
    assert(freopen("i.in", "r", stdin));
    #else
    #endif
    int n;
    cin >> n;
    forn (i, n)
        a[i].clear();
    if (n == 2) {
        cout << -1 << '\n';
        return 0;
    }
    build(0, n);
    check(n);
    forn (i, n) {
        for (int j: a[i])
            cout << j + 1 << ' ';
        cout << '\n';
    }
}


Measured memory_bytes: 384
package main
 
import (
	"bufio"
	"fmt"
	"log"
	"os"
	"strconv"
)
 
func run() {
	n := nextInt()

	if(n % 2 == 0){
		Println(0.5)
		return
	}
	
	Println(float64(((n/2)+1))/float64((n)))
	
}

// --- template ---
// Thanks https://gist.github.com/halllllll/853ab587fd82ee3ffe6f7fb7fb499695
 
var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)
 
// Caution: You will get unexpected result if a single token is larger than this size.
const BufferSize = 64 * 1024 * 1024
 
func Print(a ...interface{}) (n int, err error) {
	return fmt.Fprint(out, a...)
}
 
func Printf(format string, a ...interface{}) (n int, err error) {
	return fmt.Fprintf(out, format, a...)
}
 
func Println(a ...interface{}) (n int, err error) {
	return fmt.Fprintln(out, a...)
}
 
func next() string {
	sc.Scan()
	return sc.Text()
}
 
func nextInt() int {
	a, err := strconv.Atoi(next())
	if err != nil {
		log.Fatal(err)
	}
	return a
}
 
func nextFloat() float64 {
	a, err := strconv.ParseFloat(next(), 64)
	if err != nil {
		log.Fatal(err)
	}
	return a
}

 
func main() {
	sc.Buffer(make([]byte, 0, BufferSize), BufferSize)
	sc.Split(bufio.ScanWords)
	run()
	out.Flush()
}


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

// --------------------------------------------------------------------------------
#define fastio	ios_base::sync_with_stio(false),cin.tie(NULL),cout.tie(NULL)
#define ll long long 
#define mset(arr,val) memset(arr,val,sizeof(arr))
#define deb(name,value) cout <<"->>  "<<name<< "= " <<value<<" "
#define frepi(a,b,k) for(int i=a;i<=b;i+=k)
#define frepj(a,b,k) for(int j=a;j<=b;j+=k)
// --------------------------------------------------------------------------------


void solve_main()
{
   	char c;cin>>c;
   	cout<<(char)(c+1);
}

int main()
{
	// #ifndef ONLINE_JUDGE
 //    	freopen("/home/suryakant/input.txt","r",stdin);
 //        freopen("/home/suryakant/output.txt","w",stdout);
 //    #endif
    int t=1;
    // cin>>t;
    while(t--)
    {
        solve_main();
    }
    
}

Measured memory_bytes: 3524
#include <bits/stdc++.h>
using namespace std;
long long modpow(long long a,long long n,long long p = 1e9+7){
    long long result = 1;
    while(n > 0){
        if(n & 1) (result *= a) %= p;
        (a*=a) %= p;
        n >>= 1;
    }
    return result;
}
#define debug(x) cerr << x << " = "(x) << endl;
#define ll long long
#define rep(i,x,y) for(int i=x;i<y;i++)
#define rel(i,x,y) for(int i=x-1;i>=y;i--)
#define all(x) x.begin(),x.end()

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    ll n; cin >> n;
    vector<ll> a(n);
    rep(i,0,n) cin >> a[i];
    sort(all(a));
    if(a[0]>1){
        cout << 0 << endl;
        return 0;
    }
    if(n==1){
        if(a[0]==0) cout << 1 << endl;
        else cout << 0 << endl;
        return 0;
    }
    bool gusu;
    if(a[0]==0) gusu = true;
    else gusu = false;
    if(gusu){
        if(a[0] == a[1]){
            cout << 0 << endl;
            return 0;
        }
    }else{
        if(a[0] != a[1]){
            cout << 0 << endl;
            return 0;
        }
    }
    ll locate = (gusu ? 0 : 1);
    bool shift=(gusu ? true : false);
    rep(i,1,n){
        if(shift){
            if(a[i] == locate+2){
                locate+=2;
                shift = false;
            }else{
                cout << 0 << endl;
                return 0;
            }
        }else{
            if(a[i]==locate){
                shift=true;
            }else{
                cout << 0 << endl;
                return 0;
            }
        }
    }
    cout << modpow(2,a.size()/2) << endl;


}

Measured memory_bytes: 1024
#include <stdio.h>

int main(void)
{
    int i, j, score, sum[2] = {0,0};
    for(i = 0; i < 2; i ++){
        for(j = 0; j<4; j++){
            scanf("%d", &score);
            sum[i] += score;
        }
    }
    if(sum[0] > sum[1])
        printf("%d\n", sum[0]);
    else
        printf("%d\n", sum[1]);
    
    return 0;
}

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

struct node{
  struct node *right;
  struct node *left;
  struct node *parent;
  int key;
};
typedef struct node * Node;
#define NIL NULL

Node root;

Node treeMinimum(Node x){
  while(x->left != NIL) x = x->left;

  return x;
}

Node treeMaximum(Node x){
  while(x->right != NIL) x = x->right;

  return x;
}
Node treeSearch(Node u, int k){
  if(u == NIL || k == u->key) return u;
  if(k < u->key) return treeSearch(u->left, k);
  else return treeSearch(u->right, k);
}

Node treeSuccessor(Node x){
  if(x->right != NIL) return treeMinimum(x->right);
  Node y = x->parent;
  while(y != NIL && x == y->right){
    x = y;
    y = y->parent;
  }
  return y;
}

void treeDelete(Node z){
  Node y; // node to be deleted
  Node x; // child of y

  if(z->left == NIL || z->right == NIL) y = z;
  else y = treeSuccessor(z);

  if(y->left != NIL) x = y->left;
  else x = y->right;

  if(x != NIL) x->parent = y->parent;

  if(y->parent == NIL) root = x;
  else if(y == y->parent->left) y->parent->left = x;
  else y->parent->right = x;

  if(y != z) z->key = y->key;

}
void insert(int k){
  Node y = NIL;
  Node x = root;
  Node z;

  z = malloc(sizeof(struct node));
  z->key = k;
  z->left = NIL;
  z->right = NIL;

  while(x != NIL)
    {
      y = x;
      if(z->key < x->key)
	{
	  x = x->left;
	}
      else
	{
	  x = x->right;
	}
    }
  z->parent = y;
  if(y == NIL)
    {
      root = z;
    }
  else
    {
      if(z->key < y->key)
	{
	  y->left = z;
	}
      else
	{
	  y->right = z;
	}
    }
}

void inorder(Node u){
  if(u != NIL)
    {
      inorder(u->left);
      printf(" %d",u->key);
      inorder(u->right);
    }
}
void preorder(Node u){
  if(u != NIL)
    {
      printf(" %d",u->key);
      preorder(u->left);
      preorder(u->right);
    }
}


int main(){
  int n, i, x;
  char com[20];
  scanf("%d", &n);
  
  for ( i = 0; i < n; i++ ){
    scanf("%s", com);
    if ( com[0] == 'f' ){
      scanf("%d", &x);
      Node t = treeSearch(root, x);
      if ( t != NIL ) printf("yes\n");
      else printf("no\n");
    } else if ( com[0] == 'i' ){
      scanf("%d", &x);
      insert(x);
    } else if ( com[0] == 'p' ){
      inorder(root);
      printf("\n");
      preorder(root);
      printf("\n");
    }
      else if ( com[0] == 'd' ){
      scanf("%d", &x);
      treeDelete(treeSearch(root, x));
    }
  }
  return 0;
}



Measured memory_bytes: 20548
from collections import deque
h,w=map(int,input().split())
G=[["#"]*(w+2) for i in range(h+2)]
for i in range(1,h+1):
  G[i]=["#"]+list(input())+["#"]
ans=0
for sx in range(1,h+1):
  for sy in range(1,w+1):
    if G[sx][sy]==".":
      B=[[0]*(w+2) for i in range(h+2)]
      for i in range(h+2):
        for j in range(w+2):
          if G[i][j]=="#":
            B[i][j]=1
      INF=10**4
      A=[[INF]*(w+2) for i in range(h+2)]
      C=[-1,1,0,0]
      D=[0,0,-1,1]
      A[sx][sy]=0
      E=deque([sx,sy])
      while len(E)>0:
        x=E[0]
        E.popleft()
        y=E[0]
        E.popleft()
        B[x][y]=1
        for i in range(4):
          if B[x+C[i]][y+D[i]]==0:
            A[x+C[i]][y+D[i]]=A[x][y]+1
            a=A[x+C[i]][y+D[i]]
            B[x+C[i]][y+D[i]]=1
            E.append(x+C[i])
            E.append(y+D[i])
      if ans<a:
        ans=a
    else:
      continue
print(ans)

Measured memory_bytes: 3316
#define onlycc ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;

typedef long long ll;

string s;

int main()
{
    onlycc;
    cin >> s;

    if(s[s.size()-1] == 'e') cout << s << 's';
    else if(s[s.size()-1] == 's') cout << s << "es";
    else cout << s << 's';

    return 0;
}


Measured memory_bytes: 3656
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES

#include "bits/stdc++.h"
#define REP(i,a,b) for(i=a;i<b;++i)
#define rep(i,n) REP(i,0,n)
#define ll long long
#define ull unsigned ll
typedef long double ld;
#define ALL(a) begin(a),end(a)
#define ifnot(a) if(not a)
#define dump(x)  cerr << #x << " = " << (x) << endl
using namespace std;

// #define int ll
bool test = 0;
int dx[] = { 0,1,0,-1 };
int dy[] = { 1,0,-1,0 };
#define INF (1 << 28)
ull mod = (int)1e9 + 7;
//.....................
#define MAX (int)1e6 + 5

int N, M, L;
int d[305], a[305], length[305], t[305];
int dp[5][10][10] = {};

int dfs(int day,int rest) {
	int i, j, k;
	int res = 0;
	if (day == 5) return 0;
	rep(i, 9) {
		if (rest >= i) {
			int i_res = dfs(day + 1, rest - i);
			if (i_res + dp[day][9][i] > res) {
				res = i_res + dp[day][9][i];
			}
		}
	}
	return res;
}

signed main(void) {
	int i, j, k, l;
	cin >> N >> M >> L;
	rep(i, M) {
		cin >> d[i] >> a[i] >> length[i] >> t[i];
		a[i]--;
	}
	int loop1;
	rep(i, 5) {
		rep(j, 9) {
			rep(loop1, M) {
				if (d[loop1] != i) continue;
				if (a[loop1] + length[loop1] != j) continue;
				rep(k, 8) {
					for (l = a[loop1]; l > -1; l--) {
						dp[i][j][k + 1]
							= max(dp[i][j][k + 1]
								, dp[i][l][k] + t[loop1]);
					}
				}
			}
		}
		rep(j, 10) {
			rep(k, 10) {
				// dp[i][9][8] = max(dp[i][9][8], dp[i][j][8]);
				// 8 -> k
				dp[i][9][k] = max(dp[i][9][k], dp[i][j][k]);
			}
		}
	}
	//dump(dp[0][2][1]);
	//dump(dp[0][2][2]);
	//dump(dp[1][2][1]);
	//dump(dp[1][4][1]);
	//dump(dp[1][9][2]);
	cout << dfs(0,L) << endl;
	return 0;
}

Measured memory_bytes: 3096
/*
このコード、と～おれ!
Be accepted!
∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
*/

#include <cstdio>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>
#include <functional>
#include <complex>
#include <list>
#include <cassert>
#include <iomanip>
#include <set>
#include <stack>
#include <bitset>
/*多倍長整数/cpp_intで宣言
#include <boost/multiprecision/cpp_int.hpp>
using namespace boost::multiprecision;
*/

//#pragma gcc target ("avx2")
//#pragma gcc optimization ("o3")
//#pragma gcc optimization ("unroll-loops")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printim(a) printf(a ? "possible\n" : "imposible\n")
#define printdb(a) printf("%.50lf\n", a) //少数出力
#define printLdb(a) printf("%.50Lf\n", a) //少数出力
#define printdbd(a) printf("%.16lf\n", a) //少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str()) //string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2LL) //等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0L)*2.0L*PI)
#define rad_to_deg(rad) (((rad)/2.0L/PI)*360.0L)
#define Please return
#define AC 0
#define manhattan_dist(a, b, c, d) (abs(a - c) + abs(b - d)) /*(a, b) から (c, d) のマンハッタン距離 */


using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const long double PI = acosl(-1.0L);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);
	while (c != '\n' && c != -1 && c != ' ') {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

ll LSB(ll n) { return (n & (-n)); }

/*-----------------------------------------ここからコード-----------------------------------------*/



int main() {

	int r;
	scanf("%d", &r);
	printLdb((long double)r * 2.0 * PI);

	Please AC;
}

Measured memory_bytes: 3872
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <string>
#include <cstring>
#include <sstream>
#include <cmath>
#include <functional>
#include <fstream>
#include <cstdlib>
typedef long long ll;
const int MOD = 1e9+7;


#define REP(i, N) for (int i = 0; i < (N); i++)
#define REPP(i, a, b) for (int i = (a); i < (b); i++)
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define VSORT(c) sort((c).begin(),(c).end())
#define SZ(x) ((int)(x).size())
//vvintを作る　マクロで　 #define vvint(N,M) vector<vector<int>>

using namespace std;


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

    int a,b;
    cin >> a >> b;
    int ans = 0;
    if(a < 10){
        ans = b+100*(10-a);
        cout << ans << endl;
    }else{
        cout << b << endl;
    }
 

    return 0;
}

Measured memory_bytes: 256
import sys
import numpy as np
from numba import njit

read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

@njit('(i8[::1],i8)', cache=True)
def test(S, A):
    def f(L, R):
        if L > R:
            return False
        for x in S:
            if x == 1:
                L, R = L + 1, R + 1
                if R > A:
                    R -= 2
            elif x == -1:
                L, R = L - 1, R - 1
                if L < 0:
                    L += 2
            else:
                L -= 1
                R += 1
                if L < 0:
                    L += 2
                if R > A:
                    R -= 2
            if L > R:
                return False
        return True

    for parity in (0, 1):
        L, R = 0, A
        if parity == 0:
            R -= A & 1
        else:
            L = 1
            R -= 1 - (A & 1)
        if f(L, R):
            return True
    return False

S = np.array(list(read().rstrip().decode()), 'U1')
Si = np.zeros(len(S), np.int64)
Si[S == '0'] = -1
Si[S == '1'] = 1
S = Si

low = 0  # むり
high = len(S) + 10  # おさめられる
while low + 1 < high:
    x = (low + high) // 2
    if test(S, x):
        high = x
    else:
        low = x

print(high)

Measured memory_bytes: 118968
#[allow(unused_macros)]
macro_rules! scan {
    () => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().to_string()
        }
    };
    (;;) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().split_whitespace().map(|s| s.to_string()).collect::<Vec<String>>()
        }
    };
    (;;$n:expr) => {
        {
            (0..$n).map(|_| scan!()).collect::<Vec<_>>()
        }
    };
    ($t:ty) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.trim().parse::<$t>().unwrap()
        }
    };
    ($($t:ty),*) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            let mut iter = line.split_whitespace();
            (
                $(iter.next().unwrap().parse::<$t>().unwrap(),)*
            )
        }
    };
    ($t:ty;;) => {
        {
            let mut line: String = String::new();
            std::io::stdin().read_line(&mut line).unwrap();
            line.split_whitespace()
                .map(|t| t.parse::<$t>().unwrap())
                .collect::<Vec<_>>()
        }
    };
    ($t:ty;;$n:expr) => {
        (0..$n).map(|_| scan!($t;;)).collect::<Vec<_>>()
    };
    ($t:ty; $n:expr) => {
        (0..$n).map(|_|
                    scan!($t)
        ).collect::<Vec<_>>()
    };
    ($($t:ty),*; $n:expr) => {
        (0..$n).map(|_|
                    scan!($($t),*)
        ).collect::<Vec<_>>()
    };
}

fn main() {
    let n = scan!(i64);
    let vs = scan!(i64;5);
    let m = vs.iter().min().unwrap();
    let k = (n + m - 1) / m;
    println!("{}", 5 + k - 1);
}


Measured memory_bytes: 4352
from math import pi, atan

A, B, X = map(float, input().split())
X /= A
if X > 1/2 * A*B:
    theta = atan((A*B - X) / (1/2 * A**2))
else:
    theta = atan(1/2 * B**2 / X)
print(180 / pi * theta)


Measured memory_bytes: 2940
using System;

namespace TestConsole
{
    class Program
    {
        static void Main(string[] args)
        {
            var input = Console.ReadLine().Split(' ');
            var a = int.Parse(input[0]);
            var b = int.Parse(input[1]);

            var area = a * b;
            var line = a * 2 + b * 2;
            Console.WriteLine($"{area} {line}");
        }
    }
}



Measured memory_bytes: 15976
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
	public static void main(String[] args) {
		InputStream inputStream = System.in;
		OutputStream outputStream = System.out;
		FastScanner in = new FastScanner(inputStream);
		PrintWriter out = new PrintWriter(outputStream);
		ProblemA solver = new ProblemA();
		solver.solve(1, in, out);
		out.close();
	}

	static class ProblemA {
		public void solve(int testNumber, FastScanner in, PrintWriter out) {
			int n = in.nextInt();
			int a = in.nextInt();
			int b = in.nextInt();
			int d = Math.abs(a - b);
			if (d % 2 == 0) {
				out.println("Alice");
			} else {
				out.println("Borys");
			}
		}

	}

	static class FastScanner {
		private BufferedReader in;
		private StringTokenizer st;

		public FastScanner(InputStream stream) {
			in = new BufferedReader(new InputStreamReader(stream));
		}

		public String next() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					String rl = in.readLine();
					if (rl == null) {
						return null;
					}
					st = new StringTokenizer(rl);
				} catch (IOException e) {
					throw new RuntimeException(e);
				}
			}
			return st.nextToken();
		}

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

	}
}



Measured memory_bytes: 22996
#include <iostream>
#include <climits>
#include <vector>
#include <queue>
 
#define MAX_V 1024
using namespace std;
 
void get_map();
void check();
struct edge
{
  int to;
  int weight;
};
 
 
#define INF INT_MAX/4
vector<edge> g[2000];
int graph[MAX_V][MAX_V];
int dist[MAX_V];
int numofedge;
int vertex;
int start;
int flag=0;
 
int main()
{
  get_map();
  check();
  {
    for(int j=0;j<vertex;j++) {
      if(graph[start][j]<INF/2 && graph[j][j]<0) {
          cout << "NEGATIVE CYCLE" <<endl;
          return 0;
      }
    }
  }
  
  for(int i=0;i<vertex;i++) {
    if(graph[start][i]>=INF/2) {
      cout << "INF" << endl;
    } else {
      cout << graph[start][i] << endl;
    }
  }
  return 0;
}
 
inline int fastmin(int a, int b) {
  return (((a-b)>>31)&(a-b))+b;
}

int c = 0;

int mymin_slow(int a, int b) {
  int t;
  if (a < b) {
    t = a;
    c--;
  } else {
    t = b;
    c++;
  }
  return t;
}
 
void check()
{
  for(int k=0;k<vertex;k++) {
    for(int i=0;i<vertex;i++) {
      int gik= graph[i][k];
      for(int j=0;j<vertex;j++) {
        graph[i][j]= mymin_slow(graph[i][j], gik+graph[k][j]);
      }
    }
  }
}
 
void get_map()
{
  int edge, from ,to;
  cin >> vertex >> numofedge >> start;
   
  fill(graph[0], graph[vertex], INF);
   
  for(int i=0;i<vertex;i++)
    {
      for(int j=0;j<vertex;j++)
        {
          if(i==j)
            {
              graph[i][j]=0;
            }
          /*else
            {
            graph[i][j]=INF;
            }*/
        }
    }
 
  /*for(int i=0;i<vertex;i++)
    {
    dist[i]=INF;
    }
  */
  for(int i=0;i<numofedge;i++)
    {
      cin>>from>>to;
      cin >> graph[from][to];
    }
 
  /*  for(int i=0;i<numofedge;i++)
      {
      int from, to, weight; 
      cin >> from >> to >> weight;
      g[from].push_back({to , weight});
      }
  */ 
 
  /*  for(int i=0;i<vertex;i++)
      {
      for(int j=0;j<vertex;j++)
      {
      cout << graph[i][j] << " ";
      }
      cout << endl;
      }*/
  // dist[start]=0;
   
  /*  cout << vertex << endl;
      for(int i=0;i<vertex;i++)
      {
      for(int j=0;j<vertex;j++)
      {
      cout << graph[i][j] << " ";
      }  
      cout << endl;    
      }*/
   
 
}

Measured memory_bytes: 5300
// Your code here!
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char) 
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().split_whitespace()
        .map(|e| e.parse().ok().unwrap()).collect()
}

use std::collections::BinaryHeap;

fn main(){
    let mut q = std::collections::BinaryHeap::new();
    
    let mut nm:Vec<usize> = read_vec();
    let mut a:Vec<i64> = read_vec();
    
    for i in 0..nm[0] {
        q.push(a[i])
    }
    
    for i in 0..nm[1] {
        let mut top:i64 = q.pop().unwrap();
        top/=2;
        q.push(top);
    }
    
    let mut ans:i64 = 0;
    
    for i in 0..nm[0] {
        let mut top:i64 = q.pop().unwrap();
        ans+=top;
    }
    
    println!("{}",ans);
}




Measured memory_bytes: 8444
H, W, K = map(int, input().split())
items = []

start = []
diff = float("inf")
p = []
prev = [[False] * W for _ in range(H)]
for i in range(H):
    items.append(list(input()))
    for j in range(W):
        s = items[i][j]
        if s == "S":
            start = [i, j]
            diff = min(diff, min(i, H - 1 - i, min(j, W - 1 - j)))
            p = [i, j]
            prev[i][j] = True

from collections import deque

que = deque([])

dx = [-1, 0, 0, 1]
dy = [0, 1, -1, 0]

for i in range(4):
    x = dx[i]
    y = dy[i]
    if 0 <= start[0] + y <= H - 1 and 0 <= start[1] + x <= W - 1:
        tmp = items[start[0] + y][start[1] + x]
        if tmp == ".":
            que.append((start[0] + y, start[1] + x))
            prev[start[0] + y][start[1] + x] = True
k = K
while len(que) != 0:
    q = que.popleft()
    a = q[0]
    b = q[1]
    if abs(start[0] - a) + abs(start[1] - b) > K:
        continue
    c = min(min(a, H - 1 - a), min(b, W - 1 - b))
    if c < diff:
        diff = c
        p = (a, b)

    for i in range(4):
        x = dx[i]
        y = dy[i]
        if 0 <= a + y <= H - 1 and 0 <= b + x <= W - 1:
            if prev[a + y][b + x]:
                continue
            tmp = items[a + y][b + x]
            if tmp == ".":
                que.append((a + y, b + x))
                prev[a + y][b + x] = True

ans = 1
if diff == 0:
    print(ans)
else:
    print(ans + (K - 1 + diff) // K)


Measured memory_bytes: 91864
#include"bits/stdc++.h"
#define int long long
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(a);i<(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define itr(i,x) for(auto i=(x).begin();i!=(x).end();++i)
#define All(x) (x).begin(),(x).end()
#define gridif(a,x,b) if((a)<=(x)&&(x)<(b))

using namespace std;
using Graph = vector<vector<int>>;
typedef pair<int,int> P;
const int mod=1000000007;

int digitsum(int n,int b){
	if(b<2) return -1;
	if(n<b) return n;
	return digitsum(n/b,b)+n%b;
}
int mpow(int a,int x);
int m_inv(int n);
vector<int> split(int n,int a);
string xal_number(int n,int x);
int gcd(int x,int y){return y?gcd(y,x%y):x;}
int lcm(int x,int y){return x*y/gcd(x,y);}
class Factorial{
private:
	vector<int> fac;
public:
	Factorial(int N){
		fac.push_back(1);
		rep(i,N) fac.push_back(fac[i]*(i+1)%mod);
	}
	int fact(int a){return fac[a];}
	int ifac(int a){return m_inv(fac[a]);}
	int cmb(int n,int r);
};
struct UnionFind {
    vector<int> par; // 親ノード
    UnionFind(int n = 1) { init(n);}
    void init(int n = 1) {
        par.resize(n);
        rep(i,n) par[i] = -1;
    }
    int root(int x) {
        if (par[x] <0) return x;
        else return par[x] = root(par[x]);      
    }
    int size(int x){ return -par[root(x)];}
    bool issame(int x, int y) {return root(x)==root(y);}
    bool connect(int x, int y);
};

signed main(){
	int H,W;
	cin>>H>>W;
	int ans=INT_MAX;
	int Smax,Smin;
	rep(i,2){
		Smin=((W+1)/3)*H;
		Smax=H*W-2*Smin;
		ans=min(ans,abs(Smax-Smin));
		swap(H,W);
	}
	rep(i,2){
	    Smin=((W+1)/3)*H;
		Smax=(H/2)*(W-Smin/H);
		ans=min(ans,max(abs(Smax-Smin),abs(Smin-(H*W-Smax-Smin))));
		swap(H,W);
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 256
// clang-format off
#include <bits/stdc++.h>

#define mp make_pair
#define fst first
#define snd second
#define forn(i,n) for (int i = 0; i < int(n); i++)
#define forn1(i,n) for (int i = 1; i <= int(n); i++)
#define popcnt __builtin_popcount
#define ffs __builtin_ffs
#define ctz __builtin_ctz
#define clz __builtin_clz
#define all(a) (a).begin(), (a).end()
 
using namespace std;

using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pli = pair<ll,int>;
using pil = pair<int,ll>;
using pll = pair<ll,ll>;
template <typename T> using vec = vector<T>;
using vi = vec<int>;
using vl = vec<ll>;
template <typename T> using que = queue<T>;
template <typename T> using deq = deque<T>;

template <typename T> T id(T b) {return b;};
template <typename T> void chmax(T &x, T y) {if (x < y) x = y;}
template <typename T> void chmin(T &x, T y) {if (x > y) x = y;}
template <typename S, typename K> bool contains(S &s, K k) { return s.find(k) != s.end(); }
void fastio() { ios_base::sync_with_stdio(false); cin.tie(nullptr); }
constexpr ll TEN(int n) { if (n == 0) return 1LL; else return 10LL*TEN(n-1); }
// clang-format on

const int INF = 1'000'000'000;
const int MAX_H = 1000;
int h, w;
int ch, cw, dh, dw;
string grid[MAX_H];
int dist[MAX_H][MAX_H];
int dx[4] = { 0, 1, 0, -1 };
int dy[4] = { -1, 0, 1, 0 };

bool ok(int x, int y) {
    return 0 <= x and x < h and 0 <= y and y < w and grid[x][y] == '.';
}

int main() {
    fastio();

    cin >> h >> w >> ch >> cw >> dh >> dw;
    ch--, cw--, dh--, dw--;

    forn(i, h) cin >> grid[i];
    forn(i, h) forn(j, w) dist[i][j] = INF;

    deque<pii> q({ mp(ch, cw) });
    dist[ch][cw] = 0;

    while (!q.empty()) {
        auto [x, y] = q.front();
        q.pop_front();

        forn(i, 4) {
            int newx = x + dx[i];
            int newy = y + dy[i];
            if (ok(newx, newy) and dist[newx][newy] > dist[x][y]) {
                dist[newx][newy] = dist[x][y];
                q.push_front(mp(newx, newy));
            }
        }

        for (int a = -2; a <= 2; a++) {
            for (int b = -2; b <= 2; b++) {
                int newx = x + a;
                int newy = y + b;
                if ((a == 0 and b == 0) or !ok(newx, newy) or dist[newx][newy] <= dist[x][y] + 1) continue;

                dist[newx][newy] = dist[x][y] + 1;
                q.push_back(mp(newx, newy));
            }
        }
    }

    if (dist[dh][dw] == INF) {
        cout << -1 << endl;
    } else {
        cout << dist[dh][dw] << endl;
    }

    return 0;
}

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

int main() {
    int h,w,m; cin>>h>>w>>m;
    vector <int> C(w+1), R(h+1);
    set < pair<int,int> > s;
    int maxR=0, maxC=0; 
    vector <int> mR,mC;

    for(int i=0 ; i<m ; i++){
        int x,y; cin>>x>>y;
        s.insert({x,y});
        R[x]++; C[y]++;
        maxR = max(maxR,R[x]);
        maxC = max(maxC,C[y]);
    }
    
    for(int i=1 ; i<=h; i++) if(R[i]==maxR) mR.push_back(i);
    for(int i=1 ; i<=w; i++) if(C[i]==maxC) mC.push_back(i);

     int flag=0, ans = maxR + maxC - 1;;

    for(auto i:mR){
        for(auto j:mC){
            if(s.find({i,j})==s.end()){
                 ans++; flag=1; break;
            }        
        }
          if(flag==1) break;
    }
     
         cout<<ans;  
}

Measured memory_bytes: 23864
#include<iostream>
#include<vector>
using namespace std;
long long fib(long long n)
{
    
    vector<long long >f(n+1);
    int i;

    
    f[0] = 2;
    f[1] = 1;

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

    return f[n];
}
int main() {
    long long n; cin >> n;
    cout<<fib(n);
  
    return 0;
}

Measured memory_bytes: 3116
#include "bits/stdc++.h"
using namespace std;
#define PIGRECO 3.141592653589793
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
	*this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
///////////////////////////////////////////////////////////////////////////
//////////////////// DO NOT TOUCH BEFORE THIS LINE ////////////////////////
///////////////////////////////////////////////////////////////////////////
#define int long long
const int mod=1e9+7;

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

    int n;
    cin>>n;

    vector<int>a(n);

    vector<int>pref(n);

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

        if(i==0)
            continue;

        if(i==1)
          pref[i]=a[i-1];

        else{
            pref[i]=(pref[i-1]+a[i-1])%mod;
        }


    }

    int ans=0;

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

         if(i==0)continue;

         ans=(ans+((a[i]*pref[i])%mod))%mod;

    }

    cout<<ans<<endl;




}


Measured memory_bytes: 6364
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 100010;

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

    if(a+b > c+d) {
        out("Left");
    }
    else if(a+b < c+d) {
        out("Right");
    }
    else {
        out("Balanced");
    }

    re0;
}

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

using namespace std;    
typedef long long ll;
typedef pair<ll, ll> pll;
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
const bool DEBUG = true;

ll N;
ll M;
ll X;

ll ans = -1;

struct  Book
{
    ll price;
    vector<ll> wakaru;
};
vector<Book> books;

void dfs( vector<bool> &used, int depth ){

    if(depth == N){
        ll tmp = 0;
        vector<ll> wakata(M, 0);
        for(int i = 0; i < N; i++){
            if(used[i]){
                tmp += books[i].price;
                for(int j = 0; j < M; j++){
                    wakata[j] += books[i].wakaru[j];
                }
            }
        }

        for(int i = 0; i < M; i++){
            if(wakata[i] < X) return;
        }

        if(ans == -1) ans = tmp;
        ans = min(ans, tmp);

        return;
    }

    for(int i = 0; i < 2; i++){
        used[depth] = i;
        dfs( used, depth + 1 );
    }


}


int main(){


    cin >> N >> M >> X;

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

        books[i].wakaru.resize(M);
        for(int j = 0; j < M; j++){
            cin >> books[i].wakaru[j] ;
        }
    }

    vector<bool> used(N, false);
    dfs(used, 0);
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
#define rep(i,n) for ((i)=1;(i)<=(n);(i)++)
#define foreach(c,it) for (__typeof((c).begin()) it=(c).begin();it!=(c).end();++it)
using namespace std;
string st;
int main(){
	cin>>st;
	cout<<st.substr(0,3)<<endl;
	return 0;
}

Measured memory_bytes: 3624
/************************************
 TEMPLATE FOR PROGRAM COMPETITION
 ***********************************/
#include <stdio.h>
#include <cstdio>
#include <iostream>
#include <queue>
#include <set>
#include <vector>
#include <cstring>

int main(){
  
  long long int N, tmp;
  std::vector<long long int> H;
  
  scanf("%lld", &N);
  
  for(long long int i = 0; i < N; i++){
    scanf("%lld", &tmp);
    H.push_back(tmp);
  }
  
  long long int ans = 0;
  long long int tmp_move = 0;
  
  for(long long int i = 0; i < N-1; i++){
    // if it is possible to move right
    if(H[i+1] <= H[i]){
      tmp_move++;
      ans = std::max(ans, tmp_move);
    }
    // if it is impossible to move right
    else{
      tmp_move = 0;
    }
  }

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


Measured memory_bytes: 1400
#include<iostream>
#include<iomanip>
#include<stack>
#include<queue>
#include<numeric>
#include<algorithm>
#include<string>
#include<map>
#include<bitset>
#include<set>
#include<cmath>
#define int long long
const int inf=893810114514l;
const int mod=1000000007ll;
const int dd[]={0,-1,0,1,0};
using namespace std;
int pri[10001];
int ps;
struct A{
	vector<A*> e;
};
using pa=vector<A*>;
int p[401][401];
signed main(){
	int n,j,k,a,b;
	fill(p[0],p[0]+401*401,inf);
	cin>>n>>a>>b;
	p[0][0]=0;
	for(int i=0;i<n;i++){
		int u,v,w;
		cin>>u>>v>>w;
		for(j=400-u;j>=0;j--){
			for(k=400-v;k>=0;k--){
				p[j+u][k+v]=min(p[j+u][k+v],p[j][k]+w);
			}
		}
	}
	int ans=inf;
	for(int i=1;;i++){
		if(i*a>400||i*b>400)
			break;
		ans=min(ans,p[i*a][i*b]);
	}
	if(ans==inf)
		cout<<"-1"<<endl;
	else
		cout<<ans<<endl;
}

Measured memory_bytes: 1536
# include <bits/stdc++.h>
using namespace std;
# define pb push_back
const int N = 100005;
typedef long long i64;

char g[25][25];
int n, m;
bool vis[25][25];
int ps[4][2] = {0,1,0,-1,1,0,-1,0};
struct Node{
    int x, y, d;
};

int BFS(int x, int y) {
    queue<Node> que;
    Node t;
    t.x = x, t.y = y, t.d = 0;
    que.push(t);
    Node tmp;
    memset(vis, false, sizeof(vis));
    vis[x][y] = true;
    int ans = 0;
    while (!que.empty()) {
        tmp = que.front(); que.pop();
        for (int i = 0; i < 4; ++i) {
            int dx = tmp.x + ps[i][0];
            int dy = tmp.y + ps[i][1];
            if (dx >= 0 && dx < n && dy >= 0 && dy < m && vis[dx][dy] == false && g[dx][dy] == '.') {
                t.x = dx, t.y = dy, t.d = tmp.d+1;
                que.push(t);
                vis[dx][dy] = true;
                ans = max(ans, tmp.d+1);
            }
        }
    }
    return ans;
}
int main ()
{
    int ans = 0;
    cin >> n >> m;
    for (int i = 0; i < n; ++i) cin >> g[i];
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < m; ++j) {
            if (g[i][j] == '.') ans = max(ans, BFS(i, j));
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
int main(void){
   int A,B,C,count;
   count = 0;
   scanf("%d %d %d",&A,&B,&C);
    if (A >= B && A >= C){
        count = B + C;
    }else if (B >= A && B >= C){
        count = A + C;
    }else{
        count = A + B;
    }
   
   printf("%d",count);
}

Measured memory_bytes: 128
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE BangPatterns #-}

import Control.Applicative
import Control.Monad
import Control.Arrow
import Data.List
import Data.Maybe
import Data.Char
import qualified Data.ByteString.Char8 as B
import Text.Printf

readInt = ( readLn :: IO Int )
readInts = map ( read :: String -> Int ) . words <$> getLine

getList = map ( fst . fromJust . B.readInt ) . B.words <$> B.getLine

which a b f = if f then a else b
mp [ a, b ] = ( a, b )

main = do
	x <- readInt
	print $ maximum $ do
		b <- [ 1 .. x ]
		p <- [ 2 .. 10 ]
		let
			a = b ^ p
		guard $ a <= x
		return a

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

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef vector<ld> vd;
typedef vector<ll> vll;
typedef vector<string> vstr;
typedef vector<vector<ll>> vvll;
typedef vector<pair<ll, ll>> vpll;
typedef priority_queue<ll, vector<ll>, greater<ll>> spqll;  // 小さい順に取り出し
typedef priority_queue<ll, vector<ll>, less<ll>> bpqll;     // 大きい順に取り出し

#define REP(i, n) for (ll i = 0; i < (ll)(n); i++)
#define FOR(i, a, b) for (ll i = (ll)a; i < (ll)b; i++)
#define IREP(i, v) for (auto i = (v).begin(); i != (v).end(); i++)
#define FI first
#define SE second
#define MP make_pair
#define MT make_tuple
#define PB push_back
#define TS to_string
#define NP next_permutation
#define ALL(v) (v).begin(), (v).end()
#define SZ(x) (ll) x.size()
#define SP(x) setprecision((ll)x)


ll INF = 1e9;
ll MOD = 1000000007;
ll LINF = 1e18;
ld EPS = 1e-9;
ld PI = M_PI;
vll dx = {1, 0, -1, 0, 1, -1, -1, 1};
vll dy = {0, 1, 0, -1, 1, 1, -1, -1};
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a;} //最大公約数
ll lcm(ll a, ll b) { return a / gcd(a, b) * b;}     //最小公倍数

void yes(){ cout << "yes" << endl;}
void no(){ cout << "no" << endl;}

//-----------------------------------------
template<class T>
class Dice{
  private:
    T a, b, c, d, e, f;
  public:
    void make(T A, T B, T C, T D, T E, T F){
      a = A;
      b = B;
      c = C;
      d = D;
      e = E;
      f = F;
    }

    void rot(char s){
      if(s == 'W'){
        T tmp = a;
        a = c;
        c = f;
        f = d;
        d = tmp;
      }
      else if(s == 'E'){
        T tmp = a;
        a = d;
        d = f;
        f = c;
        c = tmp;
      }
      else if(s == 'S'){
        T tmp = a;
        a = e;
        e = f;
        f = b;
        b = tmp;
      }
      else{
        T tmp = a;
        a = b;
        b = f; 
        f = e;
        e = tmp;
      }
    }

    T co(){
      return a;
    }
};

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

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);

  Dice<int> dis;
  int a, b, c, d, e, f;
  cin >> a >> b >> c >> d >> e >> f;
  dis.make(a,b,c,d,e,f);
  string s;
  cin >> s;
  REP(i,SZ(s)){
    dis.rot(s[i]);
  }
  cout << dis.co() <<endl;


  return 0;
}






Measured memory_bytes: 3248