akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>

int main() {
    int x;
    int y;
    int tmp;
    scanf("%d %d",&x,&y);
    while (!(x==0 && y==0)){//
        if(x>y){
            tmp=x;
            x=y;
            y=tmp;
        }
        printf("%d %d\n",x,y);
        scanf("%d %d",&x,&y);
    }
    return 0;
}

Measured memory_bytes: 596
#include <bits/stdc++.h>
#define int long long 
using namespace std;
int32_t main(){
    int n;cin>>n;
    vector<pair<int,int>> arrmv;
    for(int i=0;i<n;i++){
        int c,r;cin>>c>>r;
        arrmv.push_back({c+r,c-r});
        }
    sort(arrmv.begin(),arrmv.end());
    int sz=arrmv.size();
    int nr=-1e9-1;
    int ans=0;
    for(int i=0;i<sz;i++){
        if(arrmv[i].second<nr)continue;
        nr=arrmv[i].first;
        ans++;
    }
    cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 2420
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ABC128_C_Switches
{
	class Program
	{
		static void Main(string[] args)
		{
			string[] nm = Console.ReadLine().Split(' ');
			int n = int.Parse(nm[0]);
			int m = int.Parse(nm[1]);
			int[] k = new int[m];
			List<int[]> switcheList = new List<int[]>();
			for(int i = 0; i < m; i++)
			{
				int[] input = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
				k[i] = input[0];
				int[] switches = new int[k[i]];
				for(int j = 0; j < k[i]; j++)
				{
					switches[j] = input[j + 1] - 1;
				}
				switcheList.Add(switches);
			}
			int[] p = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();

			int ans = 0;
			for(int i = 0; i < Math.Pow(2, n); i++)
			{
				int lightCnt = 0;
				char[] status = Convert.ToString(i, 2).PadLeft(n, '0').ToCharArray();
				for(int j = 0; j < m; j++)
				{
					int onCnt = 0;
					foreach (int x in switcheList[j])
					{
						if(status[x] == '1')
						{
							onCnt++;
						}
					}
					if(onCnt % 2 == p[j])
					{
						lightCnt++;
					}
				}
				if(lightCnt == m)
				{
					ans++;
				}
			}

			Console.WriteLine(ans);
		}
	}
}


Measured memory_bytes: 13396
N, K = map(int, input().split())
d = []
A = []
for i in range(K):
    d.append(input())
    A.append(list(map(int,input().split())))

sunuke = [0] * N
for i in range(K):
    for x in A[i]:
        sunuke[x-1] += 1

print(sunuke.count(0))

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

int a[10] = { 0,1,2,3,4,5,6,7,8,9 };
int n, s, r;

void dfs(int i, int sum, int n) {
	if (n == 0 && sum == s) {
		r++;
		return;
	}
	if (i == 10 || !n)return;
	dfs(i + 1, sum + a[i], n - 1);
	dfs(i + 1, sum, n);
	return;
}

int main() {
	while (cin >> n >> s) {
		if (n == 0 && s == 0)break;
		r = 0;
		dfs(0, 0, n);
		cout << r << endl;
	}
	return 0;

}

Measured memory_bytes: 2988
const stdin = require('fs').readFileSync('/dev/stdin', 'utf8')

const [x, y] = stdin
  .split('\n')[0]
  .split(' ')
  .map(Number)

const grp = [4, 6, 9, 11]

const res = _ => {
  if (x === 2 || y === 2) {
    return 'No'
  } else if (grp.indexOf(x) > -1) {
    if (grp.indexOf(y) > -1) {
      return 'Yes'
    } else {
      return 'No'
    }
  } else if (grp.indexOf(y) > -1) {
    return 'No'
  } else {
    return 'Yes'
  }
}

console.log(res())


Measured memory_bytes: 7372
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()
using ll = long long;
template <typename T> using posteriority_queue = priority_queue<T, vector<T>, greater<T> >;
const int INF = 0x3f3f3f3f;
const ll LINF = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-8;
const int MOD = 1000000007;
// const int MOD = 998244353;
const int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1};
// const int dy[] = {1, 1, 0, -1, -1, -1, 0, 1}, dx[] = {0, -1, -1, -1, 0, 1, 1, 1};
template <typename T, typename U> inline bool chmax(T &a, U b) { return a < b ? (a = b, true) : false; }
template <typename T, typename U> inline bool chmin(T &a, U b) { return a > b ? (a = b, true) : false; }
int popcount(int val) { return __builtin_popcount(val); }
int popcountll(ll val) { return __builtin_popcountll(val); }
template <typename T> void unique(vector<T> &a) { a.erase(unique(ALL(a)), a.end()); }
struct IOSetup {
  IOSetup() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(20);
  }
} iosetup;

int main() {
  int n, m, t; cin >> n >> m >> t;
  vector<int> x(m), y(m);
  REP(i, m) {
    cin >> x[i] >> y[i]; --x[i]; --y[i];
  }
  if (t == 1) {
    vector<bitset<50000> > bit(n, bitset<50000>(0));
    REP(i, n) bit[i].set(i);
    REP(i, m) bit[x[i]] = bit[y[i]] = bit[x[i]] | bit[y[i]];
    REP(i, n) {
      if (bit[i].count() < n) continue;
      vector<char> ans(m);
      vector<bool> visited(n, false);
      visited[i] = true;
      for (int j = m - 1; j >= 0; --j) {
        if (visited[x[j]]) {
          ans[j] = '^';
          visited[y[j]] = true;
        } else if (visited[y[j]]) {
          ans[j] = 'v';
          visited[x[j]] = true;
        } else {
          ans[j] = '^';
        }
      }
      REP(j, m) cout << ans[j];
      cout << '\n';
      return 0;
    }
    cout << "-1\n";
    return 0;
  } else if (t == 2) {
    if (n == 2) {
      cout << "-1\n";
      return 0;
    }
    vector<int> b(n), cnt(n, 1);
    iota(ALL(b), 0);
    vector<char> ans(m);
    for (int i = m - 1; i >= 0; --i) {
      if (cnt[b[x[i]]] >= 2) {
        ans[i] = 'v';
        --cnt[b[x[i]]];
        b[x[i]] = b[y[i]];
        ++cnt[b[x[i]]];
      } else {
        ans[i] = '^';
        --cnt[b[y[i]]];
        b[y[i]] = b[x[i]];
        ++cnt[b[y[i]]];
      }
    }
    REP(i, m) cout << ans[i];
    cout << '\n';
    return 0;
  }
}


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

# define C continue;
# define R return

# define D double
# define I insert
# define ll long long
# define ld long double

# define ull unsigned long long
# define ui unsigned int

# define pb push_back
# define pf push_front

# define vi vector < int >
# define vc vector < char >
# define vs vector < string >
# define vb vector < bool >
# define vd vector < D >
# define vll vector < ll >
# define vull vector < ull >
# define vld vector < ld >
# define PQ priority_queue

# define vvi vector < vector < int > >
# define vvb vector < vector < bool > >
# define vvc vector < vector < char > >
# define vvs vector < vs >
# define vvll vector < vector < ll > >
# define vvd vector < vector < D > >
# define vvld vector < vector < ld > >

# define all(v) (v).begin() , (v).end()
# define allrev(v) (v).rbegin() , (v).rend()
# define allcomp(v) v.begin() , v.end() , comp
# define allrevcomp(v) v.rbegin() , v.rend() , comp

# define pii pair < int , int >
# define pll pair < ll , ll >
# define pld pair < ld , ld >
# define pDD pair < D , D >

# define vpld vector < pld >
# define vpii vector < pii >
# define vpll vector < pll >
# define vpDD vector < pDD >

# define vvpii vector < vector < pii > >
# define F first
# define S second
# define mp make_pair

# define dist(a,b,p,q) sqrt((p-a)*(p-a) + (q-b)*(q-b))

# define pp(n) printf("%.10Lf",n);
# define line cout<<"\n";
# define fast ios_base::sync_with_stdio(false) ; cin.tie(0) ; cout.tie(0);

string vow = "aeiou";
int month[] = {-1, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};

const int dxhorse[] = {-2, -2, -1, -1, 1, 1, 2, 2};
const int dyhorse[] = {1, -1, 2, -2, 2, -2, 1, -1};

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

const ld pie = 3.1415926535897932384626 ;
const ll mod = 1e9 + 7 ;

/// Tip : If a and b are positive integers ; we may say - ceil (a/b) = 1 + floor ( (a-1)/b ) .

void solve ( int test_case )
{
    int x , y ;
    cin >> x >> y ;

    int t = y - 2*x ;
    int c = 4*x - y ;

    if ( c%2 + t%2 ) { cout << "No" ; line ; return ; }
    if ( c < 0 || t < 0 ) { cout << "No" ; line ; return ; }

    t >>= 1 ;
    c >>= 1 ;

    if ( c + t == x ) { cout << "Yes" ; line ; return ; }
    cout << "No" ; line ;
}

int main()
{
    int t = 1;
    // cin >> t;

    for ( int i = 1 ; i <= t ; i ++ )
    {
        solve ( i ) ;
    }

    return 0;
}


Measured memory_bytes: 3640
#include<bits/stdc++.h>
using namespace std;
int main()
{
    map<string,long long>mp;
    long long a,b,c,d,i;
    string sr;
    cin>>a;
  for(i=0;i<a;i++)
  {
      cin>>sr;
      mp[sr]++;
  }
  cout<<mp.size();


}


Measured memory_bytes: 19260
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <algorithm>
#include <iomanip>
#include <numeric>
#include <queue>
#include <cmath>
using namespace std;



int main() {
    int n;
    cin >> n;
    vector<long long int> v;
    for (int i = 0; i < n + 1; i++) {
        long long int t;
        cin >> t;
        v.push_back(t);
    }
    if (n == 0 && v[0] == 1) {
        cout << 1 << endl;
        return 0;
    }
    if (v[0] != 0) {
        cout << -1 << endl;
        return 0;
    }

    vector<long long int> max_node(n + 1, 1);
    long long int last = v.back();
    max_node[n] = v.back();
    for (int i = n - 1; i >= 0; i--) {
        max_node[i] = last + v[i];
        last = max_node[i];
    }
    long long int res = 1;
    last = 1;
    for (int i = 1; i <= n; i++) {
        if (last * 2 < v[i] || (i == n && last > v[i])) {
            cout << -1 << endl;
            return 0;
        }
        last = min(max_node[i] - v[i], last * 2 - v[i]);
        res += last + v[i];
    }
    cout << res << endl;
}


Measured memory_bytes: 4768
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <stdio.h>
using namespace std;
#define int long long
int MOD = 1000000007; 
int N;
struct T {
	int l;
	int r;
	int a;
	int idx;
	bool operator<(const T& right) const {
		return a < right.a;
	}
};
vector<T> A;
vector<int> rr;
vector<int> ll;
int solve(int a) {
	int res = 0;
	vector<int> k;
	int l = -1;
	int r = N;
	while (true) {
		if (a == 0) {
			l++;
			//cerr << rr[l] << endl;
			k.push_back(rr[l]);
		}
		else {
			r--;
			//cerr << ll[r] << endl;
			k.push_back(ll[r]);
		}
		if (r < N && l >= 0) {
			if (A[rr[l]].r >= A[ll[r]].l) {
				k.pop_back();
				break;
			}
		}
		a = 1 - a;
	}
	/*for (int i = 0; i < k.size(); i++) {
		cerr << k[i] << " ";
	}
	cerr << endl;*/
	int p = 0;
	for (int i = 0; i < k.size(); i++) {
		if (p < A[k[i]].l) {
			res += A[k[i]].l - p;
			p = A[k[i]].l;
		}
		else if (p > A[k[i]].r) {
			res += p - A[k[i]].r;
			p = A[k[i]].r;
		}
	}
	res += abs(p);
	return res;
}
signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cin >> N;
	A.resize(N);
	int res = 0;
	int l, r;
	for (int i = 0; i < N; i++) {
		cin >> l >> r;
		A[i].l = l;
		A[i].r = r;
		A[i].idx = i;
	}
	vector<T> B = A;
	rr.resize(N);
	ll.resize(N);
	for (int i = 0; i < N; i++) {
		B[i].a = B[i].r;
	}
	sort(B.begin(), B.end());
	for (int i = 0; i < N; i++) {
		rr[i] = B[i].idx;
	}
	for (int i = 0; i < N; i++) {
		B[i].a = B[i].l;
	}
	sort(B.begin(), B.end());
	for (int i = 0; i < N; i++) {
		ll[i] = B[i].idx;
	}
	//cerr << "ok" << endl;
	res = solve(0);
	res = max(res, solve(1));
	cout << res << endl;
}

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

int main() {
  
  int a,b,c,d;
  cin >> a >> b >> c >> d;
  
  if ( abs(a-c) <= d ){
    cout << "Yes" << endl;
  }else if ( abs(a - b) <= d && abs( b - c ) <= d ){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  
  
}



Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<utility>
#include<algorithm>
#include<cstdio>
#include<iomanip>
#include<queue>
#include<stack>

#define ll int64_t
#define Rep(i, n) for (ll i = 0; i < n; i++)

using namespace std;

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

    string S;
    ll K;
    cin >> S >> K;

    ll n = S.size();
    vector<ll> length;
    vector<char> run;
    Rep (i, n) {
        run.push_back(S[i]);
        ll num = 1;
        while (S[i] == S[i+1]) {
            num++;
            i++;
        }
        length.push_back(num);
    }

    // Rep (i, length.size()) {
    //     cout << run[i] << " " << length[i] << "\n";
    // }

    ll ans = 0;
    ll l = run.size();
    if (l == 1) {
        ans = length[0] * K / 2;
    } else if (run[0] != run[l-1]) {
        Rep (i, run.size()) {
            ans += length[i] / 2;
        }
        ans *= K;
    } else {
        for (ll i = 1; i <= l-2; i++) {
            ans += length[i] / 2;
        }
        ans *= K;
        ans += length[0] / 2;
        ans += length[l-1] / 2;
        ans += (length[0] + length[l-1]) / 2 * (K-1);
    }

    cout << ans << endl;

}

Measured memory_bytes: 256
package main

import "fmt"

func main() {
	var n int
	fmt.Scan(&n)
	d := make([]int, n)
	for i := range d {
		fmt.Scan(&d[i])
	}
	ans := 0
	for i := 0; i < n; i++ {
		for j := i + 1; j < n; j++ {
			ans += d[i] * d[j]
		}
	}
	fmt.Println(ans)
}


Measured memory_bytes: 512
A = list(input())
N = len(A)
letter0 = ord('a')
L = [0]*26
for i in range(N):
    L[ord(A[i])-letter0]+=1
out1 = 0
for i in range(26):
    out1 += L[i]*(L[i]-1)//2

out2 = N*(N-1)//2+1
print(out2-out1)

Measured memory_bytes: 61680
n = int(input())

A = [[0] * n for _ in range(n)]

for _ in range(n):
    u, k, *v = list(map(int, input().split()))
    for j in v:
        A[u-1][j-1] = 1

# for row in A:
#     print(' '.join(list(map(str,row))))

t = 0
d = [None] * n
f = [None] * n

def dfs_recursive(u):
    global t
    t += 1
    d[u] = t
    for v in range(n):
        if A[u][v] == 1 and d[v] is None:
            dfs_recursive(v)
    t += 1
    f[u] = t

def dfs_stack(root):
    global t
    stack = []
    stack.append(root)
    while stack:

        # 一番最後の要素をなめる
        u = stack[-1]

        # 未訪問の場合は訪問済みにする
        if d[u] is None:
            t += 1
            d[u] = t

        # 次の訪問先を探す
        has_next_node = False
        for v in range(n):
            if A[u][v] == 1 and d[v] is None:
                stack.append(v)
                has_next_node = True
                break

        # 次の訪問先がなければ訪問終了
        if not has_next_node:
            t += 1
            # スタックから取り出す
            stack.pop()

            # 時刻を記録
            f[u] = t
            
for i in range(n):
    if d[i] is None:
        dfs_recursive(i)
        # dfs_stack(i)

for i in range(n):
    print(i+1, d[i], f[i])        


Measured memory_bytes: 5796
N, M = [int(i) for i in input().split()]
A = [int(i) for i in input().split()]

# N, M = map(int, input().split())
# A = list(map(int, input().split()))

# print(len(A))

max_p = max(A)

X = max_p



cnt = [0 for x in range(100001)]
hpp = [0 for x in range(100001)]


# print(A)

for i in A:
    # print(i)
    # if cnt[i] != 0:
    #     continue
    cnt[i] += 1
    hpp[i] += i
# print(cnt[:100])

for i in range(1, 100001)[::-1]:
    cnt[i - 1] += cnt[i]
    hpp[i - 1] += hpp[i]

def countpair(left, x):
    # return cnt[x - left + 1] if (x - left > 0) else N
    if x - left <= 0:
        return N
    elif x - left > 100000:
        return 0
    else:
        return cnt[x - left]

def get_hpp(left, x):
    if x - left <= 0:
        return hpp[0]
    elif x - left > 100000:
        return 0
    else:
        return hpp[x - left]
# print(hpp[:100])


# print(cnt[:100])

small = 0
large = max_p * 2
threshold = 0
# d_c = 0

# mems = []

while (small <= large):
    # d_c += 1
    # print(small, large)
    X = (small + large) // 2

    nums = 0
    for i in range(N):
        left = A[i]
        # print(len(A))
        nums += countpair(left, X)

    if nums >= M:
        threshold = X
        small = X + 1
    else:
        large = X - 1

X = threshold

# print("X:", X)
# print("threshold:", threshold)

Y = X + 1

hpp_sum = 0
num_sum = 0

for i in range(N):
    # print("-----------")
    left = A[i]
    cnt_num = countpair(left, Y)
    num_sum += cnt_num
    # print("left:", left)
    # print("cnt_num:", cnt_num)
    hpp_sum += left * cnt_num
    # print("get_hpp:", get_hpp(left, Y))
    hpp_sum += get_hpp(left, Y)
    # print("hpp_sum:", hpp_sum)


hpp_sum += X * (M - num_sum) if (M - num_sum > 0) else 0

print(hpp_sum)


# print(out)

# for i in range(N):


Measured memory_bytes: 17800
n=int(input())

if n<10:
  print(n)
elif 10<=n<100:
  print(9)
elif 100<=n<1000:
  print(n-90)
elif 1000<=n<10000:
  print(909)
elif 10000<=n<100000:
  print(n-9090)
elif 100000<=n:
  print(90909)

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

#define N 5000

typedef struct list
{
  int x, y;
  char ground;
  struct list *prev;
  struct list *next;
} list;

list head;
list tail;

void Insert(char);
list *FarSide(list *);
int PubbleArea(list *, list *);

int main()
{
  int i;
  char c;
  list *p;
  list *farSide;
  int pubbleCount = 0;
  int pubble[N];
  int sumPubble = 0;

  head.next = &tail;
  tail.prev = &head;


  while(1)
    {
      c = getchar();
      if(c == '\n') break;

      Insert(c);
    }

  for(p = head.next; p != &tail; p = p->next)
    {
      if(p->ground == '\\' &&
     (farSide = FarSide(p)) != NULL)
        {
      pubble[pubbleCount] = PubbleArea(p, farSide);
      sumPubble += pubble[pubbleCount];
      p = farSide;
      pubbleCount++;
        }

    }

  printf("%d\n%d", sumPubble, pubbleCount);
  for(i = 0; i < pubbleCount; i++)
    {
      printf(" %d", pubble[i]);
    }
  printf("\n");


  return 0;
}

void Insert(char c)
{
  static int xCount = 0;
  static int yCount = 0;
  list *p;

  p = (list*)malloc(sizeof(list));
  p->prev = tail.prev;
  tail.prev->next = p;
  p->next = &tail;
  tail.prev = p;

  xCount++;
  
  if(c == '/' ) yCount++;
 if(c == '\\') yCount--;
  
  p->x = xCount;
  p->y = yCount;
  p->ground = c;
}

  
list *FarSide(list *s)
{
  
  list *i_p;
  int height;
  height = s->y + 1;

  for(i_p = s->next; i_p != &tail; i_p = i_p->next){
      if(i_p->y == height) return i_p;
    }
  return NULL;
}

int PubbleArea(list *pS, list *pE)
{
  list *i_p;
  list *farSide;
  int area = 0;

  for(i_p = pS; i_p != pE; i_p = i_p->next)
    {
      if(i_p->ground == '\\')
        {
      farSide = FarSide(i_p);
      area += farSide->x - i_p->x;
        }
    }
  return area;
}

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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
const ull mod = 1e9 + 7;
#define REP(i,n) for(int i=0;i<(int)n;++i)

int main(){
	int N;
	cin >> N;
	vector<ll> x(N), y(N), h(N);
	REP(i, N){
		cin >> x[i] >> y[i] >> h[i];
	}

	ll H, cx, cy;
	H = -1;
	cx = -1;
	cy = -1;
	REP(x_tmp, 101){
		REP(y_tmp, 101){
			bool flag = true;
			ll H_tmp;
			REP(i, N){
				if(h[i]>0){
					H_tmp = h[i] + abs(x[i] - x_tmp) + abs(y[i] - y_tmp);
					break;
				}
			}
			REP(i, N){
				ll a = max(H_tmp - abs(x[i] -x_tmp) - abs(y[i] -y_tmp), 0ll);
				if( h[i] != a ) flag = false;
			}
			if (flag){
				cx = x_tmp;
				cy = y_tmp;
				H = H_tmp;
			}
		}
	}
	cout << cx << " " << cy << " " << H << endl; 

    return 0;
}

Measured memory_bytes: 256
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, srt, end) for (long long i = (srt); i < (long long)(end); i++)
#define VL vector<ll>
#define VS vector<string>

int main(){
    ll N, D;
    cin >> N >> D;
    VL x(N);
    VL y(N);
    ll ans = 0;
    rep(i,0,N){
        cin >> x[i] >> y[i];
        long double dis = sqrt(x[i]*x[i] + y[i]*y[i]);
        if(dis <= (long double)D)ans++;
    }
    cout << ans<< endl;
    return 0;
}


Measured memory_bytes: 6424
a = list(map(int, input().split()))
b = 0
for i in range(a[0] + 1):
  for f in range(a[0] - i + 1):
    if b != 0:
      break
    elif 10000 * i + 5000 * f + 1000 * (a[0] - i - f) == a[1]:
      print(str(i) + " " + str(f) + " " + str(a[0] - i - f))
      b += 1
      break
if b == 0:
  print("-1 -1 -1")
      

Measured memory_bytes: 3060
biscuit_data = list(map(int,input().split()))
biscuit_data[2] += 0.5
biscuit_num = 0
while(biscuit_data[2]-biscuit_data[0]>0):
    biscuit_num += biscuit_data[1]
    biscuit_data[2] -= biscuit_data[0]

print(biscuit_num)

Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007

int main()
{
    int n;
    cin >> n;
    int a[20001] = {0};
    a[0] = 1;
    for (int i = 3; i <= n; i++)
    {
        a[i] = a[i - 1] + a[i - 3];
        a[i] %= mod;
    }
    cout << a[n];
}

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

int main(){
    int n,a,b;
    cin >> n;
    vector<int> x(n);
    map<int,int> mp;
    for(int i=0;i<n;i++) cin >> x[i];
    for(auto iter=x.begin();iter!=x.end();iter++) mp[*iter]++;
    int sum=0;
    vector<int> v=x;
    sort(v.begin(),v.end());
    a=v[n/2];b=v[n/2-1];
    for(auto iter=mp.begin();iter!=mp.end();iter++){
        if(iter->first==a) break;
        sum+=iter->second;
    }
    int sum_2=n-sum;
    for(auto iter=x.begin();iter!=x.end();iter++){
         if(*iter<a) cout << a << endl;
         else{
             if(sum<sum_2-1) cout << a << endl;
             else cout << b << endl;
         }
    }

    return 0;
}


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

#define debug(x) cerr << #x << ": " << x << endl
#define debugArray(x,n) for(long long hoge = 0; (hoge) < (n); ++ (hoge)) cerr << #x << "[" << hoge << "]: " << x[hoge] << endl
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<ll> vll;
const ll INF = LLONG_MAX/2;
const ll MOD = 1e9+7;
const double EPS=1e-12;

signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll N,K;cin>>N>>K;
  if(K>(N-1)*(N-2)/2){
    cout<<-1<<endl;
    return 0;
  }
  cout<<N*(N-1)/2-K<<endl;
  for(ll i=1;i<N;i++){
    cout<<i<<" "<<N<<endl;
  }
  ll cnt=0;
  for(ll i=1;i<N;i++){
    for(ll j=i+1;j<N;j++)if(cnt++>=K){
      cout<<i<<" "<<j<<endl;
    }
  }
  return 0;
}


Measured memory_bytes: 384
import math

n,d=map(int,input().split())
lst=[]
for nn in range(n):
	lst.append(list(map(int,input().split())))   

cnt=0
for i in range(n-1):
	for j in range(i+1,n):
		a=0
		for dd in range(d):
			a += abs(lst[i][dd] - lst[j][dd])**2    	
		aa=math.sqrt(a)
		if aa.is_integer():
			cnt += 1
print(cnt)           

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
const LL MOD=1000000007;

LL nol[60],satu[60];

int main(){
	ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
	int n;
	LL a;
	cin >> n;
	for(int i=1;i<=n;i++){
		cin >> a;
		for(int j=0;j<60;j++){
			if(a & (1LL<<j))satu[j]++;
			else nol[j]++;
		}
	}
	LL ans=0;
	for(int i=0;i<60;i++){
		LL byk=(nol[i]*satu[i])%MOD,res=((1LL<<i))%MOD;
		ans=(ans+((byk*res)%MOD))%MOD;
	}
	cout << ans << '\n';
	return 0;
}



Measured memory_bytes: 3644
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String s = in.next();
		int[] count = new int[2];
		for(int i=0;i<s.length();i++) {
			if(s.charAt(i)=='0') count[0]++;
			else count[1]++;
		}
		System.out.println(Math.min(count[0], count[1])*2);
		in.close();
	}

}


Measured memory_bytes: 24916
import java.util.Scanner;
import java.util.Arrays;
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int x=1,y=1;
        while(x != 0 || y != 0){
            y = sc.nextInt();
            x = sc.nextInt();
            if (x == 0 && y == 0) break;
            for(int i=0;i<y;i++){
                for(int j=0;j<x;j++){
                    if(i == 0 || j == 0 || i == y-1 || j == x-1){
                        System.out.print('#');
                    }
                    else {
                        System.out.print('.');
                    }
                    
                }
                System.out.println();
            }
            System.out.println();
        }
        
        sc.close();
    }
}


Measured memory_bytes: 35844
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		s = s.replaceAll(" ", "");
		int sqrt = (int)(Math.sqrt(Double.parseDouble(s)) * 10);
		System.out.println(sqrt % 10 == 0 ? "Yes" : "No");
	}
}

Measured memory_bytes: 21460
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define repo(i,n) for(int i = 1; i < (int)(n); i++)
#define pb push_back
#define mp make_pair
#define np next_permutation
#define fi first
#define se second
#define all(x) (x).begin(),(x).end()
//#define num 1000000007
#define pi acos(-1.0)
//cout << fixed << setprecision (20);   小数点以下2０桁まで
//intの最大値2147483647 ≒ 2×10^9
//long longの最大値9223372036854775807 ≒ 9×10^18
//'0'+=16;        で大文字に
//'大文字'+=32;    で小文字に
//s[i]-'0'でchar文字→int数に;
//string s = to_string(int数);
//int n = stoi(string文字列)
//実行時間制約2秒では２×10^8回くらいまで計算できる



int main() {
  string s;
  cin >> s;
  int n=s.size();
  
  rep(i,n){
    if(i%2==0) cout << s[i];
  }
  
}


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

using namespace std;

typedef long long ll;

int main() {
  int N, h[102];
  int cnt = 0;
  int l, r;

  cin >> N;

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

  while (true) {
    bool flag = true;
    for (int i = 0; i < N; i++) {
      if (h[i]) {
        flag = false;
      }
    }
    if (flag) { break; }

    for (int i = 0; i < N; i++) {
      if (h[i] > 0) {
        l = r = i;
        break;
      }
    }
    for (int i = l+1; i < N; i++) {
      if (h[i] > 0) {
        r++;
      } else { break; }
    }
    for (int i = l; i <= r; i++) {
      h[i]--;
    }
    cnt++;
  }

  cout << cnt << endl;

  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<math.h>
#include <stdio.h>
#include<vector>
#include <iostream>
#include<stdlib.h>
//#include <algorithm>
#include <limits>
#include<string>
#define rep(i,n) for(int i = 0; i < n; i++)
typedef long long ll;
using namespace std;
#define llMAX numeric_limits<long long>::max()
#define intMAX numeric_limits<int>::max()
#define ll long long
struct work{
  ll a;
  ll b;
};
bool cmp(const work &a, const work &b)
{
    return a.b < b.b;
}
int main(void){
	ll N;
  cin >> N;
  ll a,b;
  vector<work> W;
  rep(i,N){
    cin >> a >> b;
    W.push_back({a,b});
  }
  sort(W.begin(),W.end(),cmp);
  ll now=0;
  rep(i,N){
    now += W[i].a;
    if(now>W[i].b){
      cout << "No";
      return 0;
    }
  }
  cout << "Yes" << endl;
	return 0;
}

Measured memory_bytes: 6384
#include<iostream>
#include<string>
#include<sstream>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<cmath>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<numeric>
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
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)
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;
int dx[4] = {1,0,-1,0}, dy[4] = {0,1,0,-1};

int main()
{
    int K,X;
    cin >> K >> X;

    if(K*500>=X) cout << "Yes" << endl;
    else
    {
        cout << "No" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#ifdef _WIN32
#include "stdc++.h"
#else
#include <bits/stdc++.h>
#endif

// 継承可能な型
template <class Type>
struct IN : Type
{
	IN()
	{
		std::cin >> *this;
	}
};

// 継承不可能な型
template <class Type>
struct IN_
{
	Type val;

	IN_()
	{
		std::cin >> val;
	}

	operator Type&()
	{
		return val;
	}

	IN_<Type>& operator=(const Type& _value)
	{
		val = _value;
		return *this;
	}
};

template <class Char, class Type>
std::basic_ostream<Char>& operator <<(std::basic_ostream<Char>& os, const IN_<Type>& value)
{
	return os << value.val;
}

template <class Char, class Type>
std::basic_istream<Char>& operator >>(std::basic_istream<Char>& is, IN_<Type>& value)
{
	return is >> value.val;
}

template <class Type>
void OUT(const Type& value)
{
	std::cout << value << std::endl;
}

template <class Type, class ... Args>
void OUT(const Type& value, const Args& ... args)
{
	std::cout << value << ' ';
	OUT(args...);
}

void Yes()
{
	OUT("Yes");
}
void No()
{
	OUT("No");
}

using ll = long long;
using inll = IN_<ll>;
using vll = std::vector<ll>;
using setll = std::set<ll>;
using msetll = std::multiset<ll>;
using instr = IN<std::string>;

#define FOR(i, m, n) for (ll (i) = (m); (i) < (n); ++(i))
#define REP(i, n) for (ll (i) = 0; (i) < (n); ++(i))
#define REPR(i, n) for (ll (i) = (n); (i) >= 0; --(i))
#define ITRREP(it, v) for (auto (it) = (v).begin(); (it) != (v).end(); ++(it))
#define ITRREPR(it, v) for (auto (it) = (v).rbegin(); (it) != (v).rend(); ++(it))
#define DIVUP(a, b) (((a) + (b) - 1) / (b))

void Main();

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

	Main();

#ifdef _DEBUG
	system("pause");
#endif

	return 0;
}

using namespace std;

//////////////////////////////

void Main()
{
	inll a, b, x;

	return a + b >= x && a <= x  ? OUT("YES") : OUT("NO");
}


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <chrono>
#define _USE_MATH_DEFINES
#include <cmath>
#include <cstdio>
#include <cstring>
#include <ctime>
#include <deque>
#include <functional>
#include <iostream>
#include <iterator>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <sstream>
#include <string>
#include <tuple>
#include <utility>
#include <vector>
using namespace std;

#define FOR(i,m,n) for(int i=(m);i<(n);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) (v).begin(),(v).end()

const int INF = 0x3f3f3f3f;
const long long LINF = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-8;
const int MOD = 1000000007; // 998244353;
const int dy[] = {1, 0, -1, 0}, dx[] = {0, -1, 0, 1};
/*-------------------------------------------------*/
int main() {
  cin.tie(0); ios::sync_with_stdio(false);
  // freopen("input.txt", "r", stdin);

  int n, m; cin >> n >> m;
  if (m & 1) {
    cout << -1 << '\n';
    return 0;
  }
  vector<vector<int> > edge(n);
  vector<int> a(m), b(m);
  REP(i, m) {
    cin >> a[i] >> b[i]; --a[i]; --b[i];
    edge[a[i]].emplace_back(i);
    edge[b[i]].emplace_back(i);
  }
  vector<vector<int> > graph(n);
  vector<bool> visited(n, false), used(m, false);
  visited[0] = true;
  function<void(int)> dfs = [&](int ver) {
    for (int idx : edge[ver]) {
      int dst = (a[idx] == ver ? b[idx] : a[idx]);
      if (!visited[dst]) {
        visited[dst] = true;
        used[idx] = true;
        graph[ver].emplace_back(dst);
        dfs(dst);
      }
    }
  };
  dfs(0);
  vector<int> c, d, deg(n, 0);
  REP(i, m) if (!used[i]) {
    c.emplace_back(a[i] + 1);
    d.emplace_back(b[i] + 1);
    ++deg[a[i]];
  }
  vector<int> v;
  queue<int> bfs;
  bfs.emplace(0);
  while (!bfs.empty()) {
    int ver = bfs.front(); bfs.pop();
    v.emplace_back(ver);
    for (int e : graph[ver]) bfs.emplace(e);
  }
  while (!v.empty()) {
    int ver = v.back(); v.pop_back();
    for (int e : graph[ver]) {
      if (deg[e] % 2 == 0) {
        c.emplace_back(ver + 1);
        d.emplace_back(e + 1);
        ++deg[ver];
      } else {
        c.emplace_back(e + 1);
        d.emplace_back(ver + 1);
        ++deg[e];
      }
    }
  }
  REP(i, m) cout << c[i] << ' ' << d[i] << '\n';
  return 0;
}


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

typedef long long LL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define DECIM8  fixed<<setprecision(8) 
#define SZ(a) int((a).size())
#define SORT(c) sort((c).begin(),(c).end())

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

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

//clear memory
#define CLR(a) memset((a), 0 ,sizeof(a))

using namespace std;
int main(void)
{
  for(;;){
    int e;
    cin >> e;
    if(!e) return 0;
    int answer=e;
    REP(z,128){
      if(z*z*z>e) break;
      REP(y,1024){
	if(z*z*z+y*y>e) break;
	answer=min(answer,e-z*z*z-y*y+y+z);
      }	
    }
    cout << answer << endl;
  }
}

Measured memory_bytes: 1160
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.StandardCharsets;


public class Main {
	
	public static void main(String[] args) throws IOException {
		InputStreamReader reader = new InputStreamReader(System.in, StandardCharsets.UTF_8);
	    BufferedReader in = new BufferedReader(reader);
		
		String s = in.readLine();
		int n = Integer.parseInt(s);
		s = in.readLine();
		String[] as = s.split(" ");
		int[] a = new int[n];
		for(int i = 0; i < n; i++) {
			a[i] = Integer.parseInt(as[i]);
		}
		output(a);
		insertionSort(a,n);
	}

	private static void insertionSort(int[] a, int n) {
		// TODO Auto-generated method stub
		for(int i = 1; i < n; i++) {
			int v = a[i];
			int j = i - 1;
			while(j >= 0 && a[j] > v) {
				a[j+1] = a[j];
				j--;
			}
			a[j+1] = v;
			output(a);
		}
	}

	private static void output(int[] a) {
		// TODO Auto-generated method stub
		for(int i = 0; i < a.length-1; i++) {
			System.out.print(a[i] + " ");
			
		}
		
		System.out.println(a[a.length-1]);
	}
	
	
}


Measured memory_bytes: 29704
s = gets.split("").map(&:to_i)
8.times do |i|
  ret = s[0]
  3.times do |j|
    ret += s[j+1]*(-1)**(1&(i >> j))
  end
  if ret == 7
    print s[0]
    3.times do |j|
      print (1&(i >> j)) == 0 ? "+" : "-"
      print s[j+1]
    end
    puts "=7"
    exit
  end
end

Measured memory_bytes: 3836
import sys
sys.setrecursionlimit(10000000)
input=sys.stdin.readline
mod = 10 ** 9 + 7

n,k = map(int,input().split())

fac = [1]*(n+1)
inv = [1]*(n+1)
for i in range(1,n+1):
  fac[i] = (fac[i-1]*i) % mod  
inv[n] = pow(fac[n], mod-2, mod)
for i in range(n, 0, -1):
  inv[i-1] = (inv[i]*i) % mod
    
def cmb(n, r):
  if r < 0 or r > n: return 0
  return (((fac[n] * inv[r])%mod) * inv[n-r]) % mod
 


ans=0
k=min(k,n-1)
for i in range(k+1):
    ans += cmb(n,i) * cmb(n-1,i) %mod

print(ans%mod)


Measured memory_bytes: 18804
import math
n, h = map(int, input().split())

a = []
b = []
for i in range(n):
    a_, b_ = map(int, input().split())
    a.append(a_)
    b.append(b_)

a_max = max(a)
b.sort(reverse=True)


idx = 0
count = 0
while h > 0:
    if idx < n and b[idx] > a_max:
        h -= b[idx]
        idx += 1
    else:
        count += math.ceil(h / a_max)
        break
    count += 1
print(count)

Measured memory_bytes: 11312
#include "bits/stdc++.h"
#include <math.h>
#include <time.h>
using namespace std;
void solve(){
    long long n;
    long long mod;
    mod = 1000000007;
    cin >> n;
    vector<long long> say(n);//各人の発言の記録vector
    for(long long i = 0; i < n; i++){
        cin >> say.at(i);
    }//入力完了
    vector<long long> cnt(3);//それぞれの色のカウンター
    long long num = 0;
    long long ans = 1;
    for(long long i = 0; i < n; i++){//i人目について考える
        for(long long j = 0; j < 3; j++){
            if(cnt.at(j) == say.at(i)){
                if(cnt.at(0) == cnt.at(1) && cnt.at(1) == cnt.at(2)){
                    num = 3;
                }
                else if((j == 0 && (cnt.at(0) == cnt.at(1))) || (j == 1 && (cnt.at(1) == cnt.at(2)))){
                    num = 2;
                }
                else {
                    num = 1;
                }
                ans *= num;
                ans %= mod;
                cnt.at(j)++;
                break;//該当人数のところを足していく
            }
            if(j == 2){
                ans = 0;
            }
        }
    }
    cout << ans % mod << endl;

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


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

int main() {
  int A, B;
  cin >> A >> B;
  int num = 0;
  for (int i = A; i <= B; i++) {
    if (i % 10 == i / 10000 && i % 100 / 10 == i % 10000 / 1000) {
      num++;
    }
  }
  cout << num << endl;
}

Measured memory_bytes: 256
// agrawal117
//chahatagrawal117
#pragma GCC optimize("O3", "unroll-loops")
#pragma GCC target("avx2")
#include<bits/stdc++.h>
#define endl '\n'
using namespace std;
typedef long long int ll;
#define MAX 1005
int main()
{
    ll n;
    cin>>n;
    map<string,ll> mp;
    for(int i=1;i<=n;i++){
        string s; cin>>s;
        mp[s]++;
    }
    ll mx=0;
    for(auto it=mp.begin();it!=mp.end();it++){
        mx=max(mx,ll(it->second));
    }
    vector<string> v;
    for(auto it=mp.begin();it!=mp.end();it++){
        if(it->second==mx) v.push_back(it->first);
    }
    sort(v.begin(),v.end());
    for(int i=0;i<v.size();i++) cout<<v[i]<<endl;
    cout<<endl;
    
}

Measured memory_bytes: 26868
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <iomanip>
using namespace std;
typedef long long ll;
template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;

#define EPS (1e-7)
#define INF (1e15)
#define PI (acos(-1))
#define MOD 1000000007

#define REP(i,n) for(int i=0;i<n;i++)
#define REPS(i,f,n) for(int i=(f);i<(n);i++)
#define EACH(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)

#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define arrdump(n,a) for(int i=0;i<n;i++) {cout<<((i>0)? " ":"")<<a[i];}cout<<"\n";


typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

int dy4[]={0, 0, 1, -1};
int dx4[]={1, -1, 0, 0};
int dx8[]={0, 0, 1, -1, 1, 1, -1, -1};
int dy8[]={1, -1, 0, 0, 1, -1, -1, 1};

// http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_3_A&lang=jp

int top = 0;
int stk[100005];

static void push(int x) {
    stk[++top] = x;
}

static int pop() {
    return stk[top--];
}

int main() {

    char c[50];
    int a, b;
    while(scanf("%s", c) != EOF) {
        char op = c[0];
        if (op == '+') {
            a = pop();
            b = pop();
            push(a+b);
        }
        else if (op == '-') {
            a = pop();
            b = pop();
            push(b-a);
        }
        else if (op == '*') {
            a = pop();
            b = pop();
            push(b*a);
        }
        else {
            push(atoi(c));
        }
    }

    cout << pop() << "\n";

    return 0;
}



Measured memory_bytes: 3252
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
const int INF=1e9,MOD=1e9+7,ohara=1e6+10;
const ll LINF=1e18;
using namespace std;
    
#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define Size(n) (n).size()
#define Cout(x) cout<<(x)<<endl
#define doublecout(a) cout<<fixed<<setprecision(15)<<a<<endl;
#define Cerr(x) cerr<<(x)<<endl
#define fi first
#define se second
#define P pair<ll,ll> 
#define m_p make_pair
#define V vector<ll> 
#define U_MAP unordered_map<ll,ll>
#define pq priority_queue<ll>
#define rpq priority_queue<ll,vector<ll>,greater<ll>>
#define p_b push_back
    
ll n,cnt,ans,a[ohara],b,c,d,tmp,tmpp,m,h,w,x,y,sum,pos,k;
ld doua;
int dy[]={1,0,-1,0};
int dx[]={0,1,0,-1};
//int dy[]={-1,0,1,-1,1,-1,0,1};
//int dx[]={-1,-1,-1,0,0,1,1,1};
string alph("abcdefghijklmnopqrstuvwxyz"),s;
bool fl;
struct edge{int to,cost;};
    
//-------------------------↓↓↓↓↓↓------------------------
    
//------ 自分を天才だと信じる ------
    
int main(void){
    cin.tie(0);
    cout.tie(0);
    ios::sync_with_stdio(false);
    
    cin>>n;
    rep(i,n)cin>>a[i];
    rep(i,n-1){
        if(a[i]>=a[i+1])cnt++;
        else{
            ans=max(ans,cnt);
            cnt=0;
        }
    }
    ans=max(ans,cnt);
    Cout(ans);
    return 0;
}

Measured memory_bytes: 1024
#include <iostream>

using namespace std;

int main()
{
  int a,b,ans;
  cin >> a >> b;

  if(b==0)ans = a<0 ? 0:a;
  else if(a<0){
    if(b<0)ans = a*b;
    else ans = a+b;
  }
  else if(b<0)ans = a-b;
  else ans = (a*b>a+b) ? a*b:a+b;

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define sp ' '
#define nyan "(=^・ω・^=)"
#define mkp make_pair
#define intmax 2147483647
#define llmax 9223372036854775807
#define lP pair<ll,ll>
#define iP pair<int,int>
typedef long long ll;
using namespace std;
const int mod = 1000000007;

ll N, W, w, v, dp[111][555], www, res;

int main() {
	cin >> N >> W;
	for (int i = 0; i != N; ++i) {
		cin >> w >> v;
		if (!i)www = w;
		for (int j = 100; j != -1; --j) {
			for (int k = 0; k != 401; ++k) {
				dp[j + 1][k + w - www] = max(dp[j + 1][k + w - www], dp[j][k] + v);
			}
		}
	}
	for (int i = 0; i != 101; ++i) {
		for (int j = 0; j != 401; ++j) {
			if (i*www + j <= W)res = max(res, dp[i][j]);
		}
	}
	cout << res << endl;
	return 0;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
    using namespace std ;
     
    int main ()
    {
        int k,s,cnt=0;
        cin>>k>>s;
        for(int x=0;x<=k;x++){
            for(int y=0;y<=k;y++){
                int z=(s-x-y);
                if(z<=k && z>=0 )
                cnt++;
            }
        }
        cout<<cnt<<endl;
    }

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
N = int(input())
import collections
a_frq_dict = collections.Counter(map(int, input().split(' ')))

n = len(a_frq_dict)

if n == 1:
    if a_frq_dict[0]:
        print('Yes')
        exit()

elif n == 2:
    if N % 3 == 0 and a_frq_dict[0] == (N//3):
        print('Yes')
        exit()

elif n == 3:
    if N % 3 == 0:
        if all([f == (N//3) for f in a_frq_dict.values()]):
            values = list(a_frq_dict.keys())
            v = values[0] ^ values[1] ^ values[2]
            if v == 0:
                print('Yes')
                exit()

print('No')




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

public class Main {

    public static void main(String[] args) {
        new Main().solve();
    }

    void solve() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] a = new int[N];
        int[] b = new int[N];
        int ans = Integer.MAX_VALUE;
        boolean check = true;
        long num = 0;
        for (int i = 0; i < N; i++) {
            a[i] = sc.nextInt();
            b[i] = sc.nextInt();
            if (a[i] > b[i] && b[i] < ans) {
                check = false;
                ans = b[i];
            }
            num += a[i];
        }
        if (check) {
            System.out.println("0");
            return;
        }
        System.out.println(num - ans);
    }
}

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

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define debug(x) cout << #x << ": " << x << endl
#define out(x) cout << x << endl
//#define int long long int
const int MOD = 1000000007;
const ll LINF = (ll)1e18 - 1;
const int INF = 1e9 - 1;
const double EPS = 0.000000001;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};

auto print = [](auto &v) {
  for(auto x : v) {
    cout << x << " ";
  }
  cout << endl;
};

bool judge(const VI &a, ll mid, ll m) {
  ll count = 0;
  for(int i : a) count += a.size() - distance(a.begin(), lower_bound(all(a), mid - i));
  return count >= m;
}

tuple<ll, ll> solve(const VI &a, const VL &sum, ll x) {
  ll ans = 0;
  ll count = 0;
  for(int i : a) {
    int idx = distance(a.begin(), lower_bound(all(a), x - i));
    count += a.size() - idx;
    ans += (sum[sum.size() - 1] - sum[idx]) + (a.size() - idx) * i;
  }
  return make_tuple(ans, count);
}

signed main()
{
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n, m;
  cin >> n >> m;
  VI a(n);
  rep(i, n) cin >> a[i];
  sort(all(a));
  VL sum(n + 1, 0);
  rep(i, n) sum[i + 1] = sum[i] + a[i];
  ll l = -1;
  ll r = INF;
  while(r - l > 1) {
    ll mid = l + (r - l) / 2;
    if(judge(a, mid, m)) l = mid;
    else r = mid;
  }
  ll ans, count;
  tie(ans, count) = solve(a, sum, l);
  out(ans - (count - m) * l);
  return 0;
}


Measured memory_bytes: 1408
import java.util.*;
import java.text.*;

public class Main {

    Scanner sc = new Scanner(System.in);

    public static void main(String[] args) {
        new Main().run();
    }

    void run() {
        int x = sc.nextInt();
        int n = sc.nextInt();
        List<Integer> list = new ArrayList<>();

        for (int i=-200; i<=200; i++) {
            list.add(i);
        }

        for (int i=0; i<n; i++) {
            int t = sc.nextInt();
            list.remove((Integer)t);
        }

        int res = 1000;
        int diff = 10000;

        for (Integer i: list) {
            if (Math.abs(x-i)<diff) {
                diff = Math.abs(x-i);
                res = i;
            }
        }

//        System.out.println(list);

        System.out.println(res);
    }


}


Measured memory_bytes: 35928
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < n; i++)
#define vi vector<int>
#define all(a) (a).begin(),(a).end()

int main(){
  int n; cin >> n;
  vi a(n); rep(i, n) cin >> a[i];
  // unique 真に unique にするための前処理で sort
  sort(all(a));
  a.erase(unique(all(a)), a.end());

  int ans = a.size();
  if(ans%2 == 0) ans--;

  std::cout << ans << '\n';
}


Measured memory_bytes: 640