akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <iostream>
#include <vector>
#include <queue>
#include <set>
#include <string>
#include <map>
#include <cmath>
#include <cstring>

#define fi first
#define se second
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rrep(i,n) for (int i = 1; i < (n); ++i)
#define drep(i,n) for (int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define all(x) (x).begin(), (x).end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define pb push_back
#define sz(x) (int)(x).size()
#define PQ(T) priority_queue<T, v(T), greater<T> >

using namespace std;
typedef long long ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;

const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;

const int mod = 1000000007;

int main() {
    int n, m;
    string s;
    cin >> n >> m >> s;
    vector<int> dp(n+1,INF);
    queue<int> q;
    dp[n] = 0;
    q.push(0);
    for (int i=n-1; i>=0; --i) {
        while(1) {
            if (q.size() == 0) {
                puts("-1");
                return 0;
            }
            if (q.front()!=INF && q.size()<=m) break;
            q.pop();
        }
        if (s[i] == '0') dp[i] = q.front()+1;
        q.push(dp[i]);
    }
    vector<int> ans;
    int x = 0;
    while (x<n) {
        int i = 1;
        int now = dp[x];
        --now;
        //cout << x << ' ' << now << endl;
        while(1) {
            if (now==dp[x+i]) break;
            ++i;
        }
        ans.pb(i);
        x+=i;
        //cout << x << ' ' << i << endl;
    }
    rep(i,ans.size()) cout << ans[i] << ' ';
    cout << endl;
    return 0;
}











Measured memory_bytes: 1528
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


s = S()
ans = 'Yes'
for i in range(len(s)):
    # print(s[i])
    if i % 2 == 0 and s[i] in {'R', 'U', 'D'}:
        # print('goo even')
        continue
    elif i % 2 != 0 and s[i] in {'L', 'U', 'D'}:
        # print('goo odd')
        continue
    # print('no...')
    ans = 'No'
    break
print(ans)


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

void abc(int n,int m){
  unsigned long long s=1;

  if(n==m) s=2;
  while(n>0&&m>0){
    if(n>m){
      s*=n;
      n--;
    }
    else{
      s*=m;
      m--;
    }
    s%=1000000007;
  }
  printf("%llu\n",s);
}

int main(void){
  int n,m;

  scanf("%d %d",&n,&m);
  if(abs(m-n)>1)
    printf("0\n");
  else
    abc(n,m);

  return 0;
}


Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <cmath>
#include <queue>
#include <deque>
#include <set>
#include <string>
#include <map>
#include <algorithm>
#include <stack>
#include <cstdlib>
#include <iomanip>
#include <ctime>
using namespace std;

using ll = long long;
using ull = unsigned long long;
using ld = long double;
#define ff first
#define ss second

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int k;
  	cin >> k;
  	for (int i = 0; i < k; i++)
    	cout << "ACL";
    return 0;
}

Measured memory_bytes: 3576
using System;
using System.Linq;

public class ITP1_10_C{
    public static void Main(){
        while (true)
        {
            var n = int.Parse(Console.ReadLine());
            if (n == 0)
            {
                break;
            }
            
            var score = Console.ReadLine().Split().Select(double.Parse);
            
            var avg = score.Sum() / n;
            
            var variance = score.Select(x => Math.Pow(x - avg, 2)).Sum() / n;
            var sdev = Math.Sqrt(variance);
            
            Console.WriteLine(sdev);
        }
    }
}



Measured memory_bytes: 18328
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class AtCoderC
{
    static void Main()
    {
        var sc = new Scanner();

        int n = sc.NextInt();

        string[] s = new string[n];
        for(int i = 0; i < n; i++)
        {
            s[i] = sc.Next();
        }

        int answer = s.Distinct().Count();

        Console.WriteLine(answer);
    }

    class Scanner
    {
        private string[] _line;
        private int _index;
        private const char Separator = ' ';

        public Scanner()
        {
            _line = new string[0];
            _index = 0;
        }

        public string Next()
        {
            while (_index >= _line.Length)
            {
                _line = Console.ReadLine().Split(Separator);
                _index = 0;
            }

            return _line[_index++];
        }

        public int NextInt() => int.Parse(Next());
        public long NextLong() => long.Parse(Next());
        public double NextDouble() => double.Parse(Next());
        public decimal NextDecimal() => decimal.Parse(Next());
        public char NextChar() => Next()[0];
        public char[] NextCharArray() => Next().ToCharArray();

        public string[] Array()
        {
            _line = Console.ReadLine().Split(Separator);
            _index = _line.Length;
            return _line;
        }

        public int[] IntArray() => Array().Select(int.Parse).ToArray();
        public long[] LongArray() => Array().Select(long.Parse).ToArray();
        public double[] DoubleArray() => Array().Select(double.Parse).ToArray();
        public decimal[] DecimalArray() => Array().Select(decimal.Parse).ToArray();
    }
}

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

using namespace std;
using ll = long long;

int main() {
    int n; scanf("%d", &n);
    ll a[n + 5];
    ll c[n + 5];
    for (int i = 0; i <= n; i++) scanf("%lld", &a[i]);

    if (n == 0) {
        if (a[0] != 1) puts("-1");
        else puts("1");
        return 0;
    } else {
        if (a[0] != 0) {
            puts("-1");
            return 0;
        }
    }

    c[n] = a[n];
    for (int i = n - 1; i > 0; i--) {
        c[i] = a[i] + c[i + 1];
    }

    ll ans = 1;
    ll b = 1;
    for (int i = 1; i <= n; i++) {
        ll bd = 2 * b;
        bd = min(bd, c[i]);
        if (a[i] > bd) {
            puts("-1");
            return 0;
        }

        ans += bd;
        b = bd - a[i];
    }

    printf("%lld\n", ans);
}

Measured memory_bytes: 5176
import sys
ia,ma,sa,ea=map(int,input().split())
ib,mb,sb,eb=map(int,input().split())
sum_a=ia+ma+sa+ea
sum_b=ib+mb+sb+eb
if(sum_a>=sum_b):
    print(sum_a)
else:
    print(sum_b)



Measured memory_bytes: 5600
#include <bits/stdc++.h>
using namespace std;
#define REP(i,b,e) for(int i=(b);i<(e);++i)
#define RREP(i,b,e) for(int i=(b)-1;i>=e;--i)
#define rep(i,e) for(int i=0;i<(e);++i)

constexpr int MOD = 1000000007;
constexpr int INF = 1LL << 30;
constexpr long long LLINF = 1LL << 62;
constexpr double EPS = 1e-9;

struct Initializer {
  Initializer() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout << fixed << setprecision(15) << boolalpha;
  }
} initializer;

template<typename T>
istream &operator>>(istream &is, vector<T> &vec) {
  for (T &x : vec) is >> x;
  return is;
}

template<typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  os << "[";
  for (auto it = vec.begin(); it != vec.end(); ++it) {
    if (it != vec.begin()) os << ", ";
    os << *it;
  }
  return os << "]";
}

template<typename T, typename U>
ostream &operator<<(ostream &os, const pair<T, U> &pa) {
  return os << "(" << pa.first << ", " << pa.second << ")";
}

template<typename Tuple, size_t N>
struct TuplePrinter {
  static void print(const Tuple &t) {
    TuplePrinter<Tuple, N-1>::print(t);
    cout << ", " << get<N-1>(t);
  }
};

template<typename Tuple>
struct TuplePrinter<Tuple, 1> {
  static void print(const Tuple &t) {
    cout << get<0>(t);
  }
};

template<typename... T>
ostream &operator<<(ostream &os, const tuple<T...> &tup) {
  os << "(";
  TuplePrinter<decltype(tup), sizeof...(T)>::print(tup);
  return os << ")";
}

template<typename T>
ostream &operator<<(ostream &os, const set<T> &se) {
  os << "{";
  for (auto it = se.begin(); it != se.end(); ++it) {
    if (it != se.begin()) os << ", ";
    os << *it;
  }
  return os << "}";
}

template<typename T, typename U>
ostream &operator<<(ostream &os, const map<T, U> &ma) {
  os << "{";
  for (auto it = ma.begin(); it != ma.end(); ++it) {
    if (it != ma.begin()) os << ", ";
    os << it->first << ": " << it->second;
  }
  return os << "}";
}

inline void print(void) { cout<<'\n'; }
template<class T> inline void print(const T &x) { cout<<x<<'\n'; }
template<class T, class... U> inline void print(const T &x, const U&... y) { cout<<x<<" "; print(y...); }
#define dump(...) cout<<#__VA_ARGS__<<": [L_"<<__LINE__<<"]"<<'\n'; print(__VA_ARGS__);cout<<'\n';

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


int main() {
  long long h; cin>>h;
  long long ans = 0;
  long long cnt = 1;
  while (h != 0) {
    h /= 2;
    ans += cnt;
    cnt *= 2;
  }
  print(ans);

  return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

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

    if(a > b){
        printf("a > b\n");
    }
    if(a < b){
        printf("a < b\n");
    }
    if(a == b){
        printf("a == b\n");
    }
    return 0;
}


Measured memory_bytes: 2100
import sys
readline = sys.stdin.buffer.readline
from collections import Counter

n = int(readline())
lst1 = list(map(int,readline().split()))

def cumsum(lst): #元のリストを保持
    res = lst[:]
    for i in range(1,len(res)):
        res[i] += res[i-1]
    return res
lst2 = [0]+cumsum(lst1)

c = Counter(lst2)

ans = 0
for i in range(len(lst2)-1):
    c[lst2[i]] -= 1
    ans += c[lst2[i]]

print(ans)

Measured memory_bytes: 85780
A, B, C = map(int, input().split())
if all(map(lambda x: x % 2 != 0, [A, B, C])):
    print(0)
    exit(0)
elif A == B == C:
    print(-1)
    exit(0)
else:
    count = 0
    while all(map(lambda x: x % 2 == 0, [A, B, C])) == 1:
        A, B, C = (B + C) / 2, (A + C) / 2, (A + B) / 2
        count += 1
    print(count)


Measured memory_bytes: 3064
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<iomanip>
#include<map>
using namespace std;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL << 60;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

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

int main(){
    int x;
    cin>>x;
    for(int i=x;;i++){
        if(isPrime(i)){
            cout<<i<<endl;
            break;
        }
    }
}

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

int main(){
    int x, y, z;
    cin >> x >> y >> z;
 
    swap(x, y);
    swap(x, z);
  
    cout << x << " " << y << " " << z << endl;
    return 0;
}

Measured memory_bytes: 3584
#include<iostream>
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <iomanip>//setprecision
#include<math.h>
#include <functional>
#include<climits>
using namespace std;
#define ll  long long 
#define rep(i, n)        for(ll i=0; i<(ll)(n); ++i)
#define mod 1000000007
  vector<ll>to[1000005];
int main(){
  ll a,b;cin>>a>>b;
  ll c=b-a*2;
  if(c%2!=0||c/2>a||c<0)cout<<"No";
  else cout<<"Yes";
}


Measured memory_bytes: 27072
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include <functional>
#include<math.h>
using namespace std;
vector<long long> code(26, 0);

vector<long long> l(51, 0);

int main() {
	int ans;
	int N;
	cin >> N;
	int max = 0;
	for (int i = 1; i <= N; i++)
	{
		int counter = 0;
		int j = i;
		while (j%2==0&&j!=0)
		{
			counter++;
			j /= 2;
		}

		if (counter >= max) {
			max = counter ;
			ans = i;
		}
	}

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


Measured memory_bytes: 256
#include<cstdio>

int s[200000],t[200000];
int main(void) {
    int ss,tt;
    for(int i=1; (ss=getchar())-10; i++) {
        s[i] = s[i-1] + ss-'A'+1;
    }
    for(int i=1; (tt=getchar())-10; i++) {
        t[i] = t[i-1] + tt-'A'+1;
    }
    int q;
    scanf("%d",&q);
    for(int i=0; i<q; i++) {
        int a,b,c,d;
        scanf("%d%d%d%d",&a,&b,&c,&d);
        puts(((s[b]-s[a-1]) - (t[d]-t[c-1])) %3 ? "NO" : "YES");
    }
    return 0;

}

Measured memory_bytes: 1280
#include <bits/stdc++.h>
using namespace std;
 
#define REP(i, s) for (int i = 0; i < s; ++i)
#define ALL(v) (v).begin(), (v).end()
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define DEBUG
#define int long long
#define INF 1e9
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T> ostream& operator << (ostream &s, set<T> P)
{ EACH(it, P) { s << "<" << *it << "> "; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }
template<class T>void show(vector<T>v){for (int i = 0; i < v.size(); i++){cerr<<v[i]<<" ";}cerr<<"\n";}
typedef long long ll;

int grid[1010][1010];
signed main(){
    int h,w,a,b;
    cin>>h>>w>>a>>b;
    for (int i = 0; i < h-b; i++)
    {
        for (int j = 0; j < a; j++)
        {
            grid[i][j]=1;
        }
        
    }
    for (int i = h-b; i < h; i++)
    {
        for (int j = a; j < w; j++)
        {
            grid[i][j]=1;
        }
        
    }
  for (int i = 0; i < h; i++)
  {
      for (int j = 0; j < w; j++)
      {
          cout<<grid[i][j];
      }
      cout<<endl;
  }
    
 
   
    return 0;
}

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

int main() {
  
  double x1, y1, x2, y2;
  cin >> x1 >> y1 >> x2 >> y2;
  
  double dx, dy, d;
  dx = x2-x1;
  dy = y2-y1;
  d = sqrt( dx*dx + dy*dy);
  
  
  printf("%.10f\n", d);
  
  return 0;
}




Measured memory_bytes: 3292
#include <bits/stdc++.h>
#define ALL(A) (A).begin(), (A).end()
#define ll long long
#define rep(i, n) for (int i = 0; i < (n); i++)

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

int dx[] = { 0, 1, -1, 0, 1, -1, 1, -1 };  // i<4:4way i<8:8way
int dy[] = { 1, 0, 0, -1, 1, -1, -1, 1 };

const ll mod = 1e9 + 7;
const ll INF = -1 * ((1LL << 63) + 1);
const int inf = -1 * ((1 << 31) + 1);

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);
    int n;
    cin >> n;
    vector<int> a(n);
    rep(i,n)cin >> a[i];
    int mx = a[0];
    ll ans = 0;
    for(int i=1;i<n;i++){
        if(a[i] < mx){
            ans += mx - a[i];
        }else mx = a[i];
    }
    cout << ans << endl;
}

Measured memory_bytes: 3912
#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <math.h>
#include <string>
#include <string.h>
#include <stack>
#include <queue>
#include <vector>
#include <utility>
#include <set>
#include <map>
#include <stdlib.h>
#include <iomanip>

using namespace std;

#define ll long long
#define vi vector<int>
#define FOR(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define REP(i,n) for(int i=0;i<(int)(n);i++)
#define pb push_back
#define pi 3.14159265359


ll gcd(ll a, ll b)
{
	ll c;
	while (a != 0) {
		c = a; a = b % a;  b = c;
	}
	return b;
}

int main() {
	ll N;
	ll a[10001];
	ll sum = 0;
	cin >> N;
	REP(i, N) {
		cin >> a[i];
	}
	REP(i, N) {
		while (a[i] % 2 == 0) {
			a[i] /= 2;
			sum++;
		}
	}
	cout << sum;

	return 0;



}

Measured memory_bytes: 384
// https://atcoder.jp/contests/abc065/tasks/arc076_b

#include <bits/stdc++.h>

using namespace std;

#define REP(i,n)   for(int i=0; i<(int)(n); i++)
#define FOR(i,b,e) for(int i=(b); i<=(int)(e); i++)
#define DUMP(a, n) REP(_i, n) printf("%d%c", a[_i], _i + 1 == n ? '\n' : ' ')
#define DUMP2D(a, n, m) REP(_i, n) REP(_j, m) printf("%d%c", a[_i][_j], _j + 1 == m ? '\n' : ' '); puts("")

//------------------------------------------------------------------------------
class UnionFindTree {
public:
  int n;
  vector<int> par;
  vector<int> rnk;

  void init(int _n) {
    n = _n;
    par.resize(n);
    rnk.resize(n, 0);
    REP(i, n) par[i] = i;
  }

  int find(int x) {
    if (par[x] == x) {
      return x;
    } else {
      return par[x] = find(par[x]);
    }
  }

  void unite(int x, int y) {
    x = find(x);
    y = find(y);
    if (x == y) return;

    if (rnk[x] < rnk[y]) {
      par[x] = y;
    } else {
      par[y] = x;
      if (rnk[x] == rnk[y]) rnk[x]++;
    }
  }

  bool same(int x, int y) {
    return find(x) == find(y);
  }
};

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

const int N_MAX = 1e5;
const int X_I_MAX = 1e9;
const int Y_I_MAX = 1e9;

struct city { int id, x, y; };
struct dist { int i, j, d; };

int N;
// int x[N_MAX];
// int y[N_MAX];

city cs[N_MAX];
dist ds[N_MAX * 2];

UnionFindTree uf;

bool compare_x_asc(const city& c1, const city& c2) {
  return c1.x < c2.x;
}

bool compare_y_asc(const city& c1, const city& c2) {
  return c1.y < c2.y;
}

bool compare_d_asc(const dist& d1, const dist& d2) {
  return d1.d < d2.d;
}

void solve() {
  uf.init(N);
  sort(cs, cs + N, compare_x_asc);
  REP(i, N - 1) ds[i] = { cs[i].id, cs[i + 1].id, cs[i + 1].x - cs[i].x };
  sort(cs, cs + N, compare_y_asc);
  REP(i, N - 1) ds[N - 1 + i] = { cs[i].id, cs[i + 1].id, cs[i + 1].y - cs[i].y };
  int M = (N - 1) * 2;
  sort(ds, ds + M, compare_d_asc);

  int ans = 0;
  REP(k, M) {
    dist d = ds[k];
    if (uf.same(d.i, d.j)) continue;
    uf.unite(d.i, d.j);
    ans += d.d;
  }
  printf("%d\n", ans);
}

void input() {
  scanf("%d", &N);
  REP(i, N) {
    int x, y;
    scanf("%d%d", &x, &y);
    cs[i] = {i, x, y};
  }
}

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


Measured memory_bytes: 4480
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
using ll = long long;
int main(){ 
    ll n;
    cin>>n;
    vector<ll> a(n);
    vector<ll> b(n);
    REP(i,n) cin>>a[i];
    REP(i,n){
    b[a[i]-1]=i+1; 
    }
    REP(i,n){
        cout<<b[i]<<' ';
    }
    return 0;
}


Measured memory_bytes: 2432
#coding:utf-8
H,W = map(int,input().split())
mtrx = []
for i in range(H):
    col = list(input())
    mtrx.append(col)
    
cross = [[0,1],[-1,0],[0,-1],[1,0]]

def check(i,j):
    if mtrx[i][j] == "#":
        for ij in cross:
            [im,jm] = ij
            iNew = i + im
            jNew = j + jm
            if 0 <= iNew < H and 0 <= jNew <W:
                if mtrx[iNew][jNew] == "#":
                    return
        else:
            return True
    

for i in range(H):
    for j in  range(W):
        if check(i,j):
            print("No")
            break
    else:
        continue
    break
else:
    print("Yes")


Measured memory_bytes: 3064
#include <iostream>

int main()
{
    long long X, A ,B;
    std::cin >> X >> A >> B;

    if (A >= B){
       std::cout << "delicious" << std::endl;
    }else{
        if (B - A <= X){
            std::cout << "safe" << std::endl;
        }else{
            std::cout << "dangerous" << std::endl;
        }
    }

    return 0;
}


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

int x,h,m,s;

int main(){
  cin >> x;
  h = x/3600;
  m = (x-3600*h)/60;
  s = x-3600*h-60*m;
  cout << h << ":" << m << ":" << s << endl;

  return 0;
  }

Measured memory_bytes: 3096
void main(){
  import std.stdio, std.string, std.conv, std.algorithm;
  
  int a, b, c; rd(a, b, c);
  
  int[int] cnt;
  cnt[a]=1;
  if(b in cnt) writeln(c);
  else if(c in cnt) writeln(b);
  else writeln(a);
}

void rd(T...)(ref T x){
  import std.stdio, std.string, std.conv;
  auto l=readln.split;
  foreach(i, ref e; x){
    e=l[i].to!(typeof(e));
  }
}

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

int main(){
  int n, m, hm, j=0;
  cin >> n >> m;
  priority_queue<int> que;
  int a;
  rep (i, n){
    cin >> a;
    que.push(a);
  }

  rep(i, m){
    que.push(que.top()/2);
    que.pop();
  }


  long long sum = 0;
  rep(i, n){
    sum += que.top();
    que.pop();
  }
  cout << sum << endl;

  return 0;
}


Measured memory_bytes: 892
#include <iostream>
#include <stdio.h>
using namespace std;


int main()
{
	int nW, nH;
	while (cin >> nH >> nW)
	{
		if (0 == nW && 0 == nH)
		{
			break;
		}
		for (int i = 0; i < nW; ++i)
		{
			cout << "#";
		}
		cout << endl;
		//End of First

		for (int i = 1; i < nH - 1; ++i)
		{
			cout << "#";
			for (int j = 1; j < nW - 1; j++)
			{
				cout << ".";
			}
			cout << "#" << endl;
		}
		//End of middle

		for (int i = 0; i < nW; ++i)
		{
			cout << "#";
		}
		//End of Last
		cout << endl << endl;
	}

	//system("pause");
	return 0;
}

Measured memory_bytes: 3024
import numpy as np

S = list(int(x) for x in input())
L1 = [0 if x%2 == 0 else 1 for x in range(len(S))]
L2 = [0 if x%2 == 1 else 1 for x in range(len(S))]

print(min(sum(np.logical_xor(S, L1)), sum(np.logical_xor(S,L2))))

Measured memory_bytes: 16708
import sys

read = sys.stdin.read
readline = sys.stdin.readline
readlines = sys.stdin.readlines
sys.setrecursionlimit(10 ** 9)
INF = 1 << 60
MOD = 1000000007


def main():
    N, *A = map(int, read().split())
    A = [list(map(int, f'{a:0>20b}')) for a in A]

    ans = 0
    right = 0
    digits = [0] * 20

    for left in range(N):
        while right < N and all(d + b <= 1 for d, b in zip(digits, A[right])):
            for i in range(20):
                digits[i] += A[right][i]
            right += 1

        ans += right - left

        if left == right:
            right += 1
        else:
            for i in range(20):
                digits[i] -= A[left][i]

    print(ans)
    return


if __name__ == '__main__':
    main()


Measured memory_bytes: 63704
#!/usr/bin/env python3
from collections import defaultdict
from collections import deque
from heapq import heappush, heappop
import sys
import math
import bisect
import random
import itertools
sys.setrecursionlimit(10**5)
stdin = sys.stdin
bisect_left = bisect.bisect_left
bisect_right = bisect.bisect_right
def LI(): return list(map(int, stdin.readline().split()))
def LF(): return list(map(float, stdin.readline().split()))
def LI_(): return list(map(lambda x: int(x)-1, stdin.readline().split()))
def II(): return int(stdin.readline())
def IF(): return float(stdin.readline())
def LS(): return list(map(list, stdin.readline().split()))
def S(): return list(stdin.readline().rstrip())
def IR(n): return [II() for _ in range(n)]
def LIR(n): return [LI() for _ in range(n)]
def FR(n): return [IF() for _ in range(n)]
def LFR(n): return [LI() for _ in range(n)]
def LIR_(n): return [LI_() for _ in range(n)]
def SR(n): return [S() for _ in range(n)]
def LSR(n): return [LS() for _ in range(n)]
mod = 1000000007
inf = float('INF')

#A
def A():
    n = II()
    a = [7,5,3]
    if n in a:
        print("YES")
    else:
        print("NO")
    return

#B
def B():
    s = S()
    ans = inf
    for i in range(len(s) - 2):
        ans = min(ans, abs(753-int("".join(s[i:i + 3]))))
    print(ans)
    return

#C
def C():
    return

#D
def D():
    return

#Solve
if __name__ == '__main__':
    B()


Measured memory_bytes: 38512
#include<iostream>
#include<algorithm>
#include<vector>
#include<numeric>
#include<string>
#include<cmath>
#include<set>
#include<queue>
#include<deque>
#include<bitset>
#include<iomanip>
#include<cctype>
#include<map>
#include<cstring>
#include<bitset>
#include<cassert>

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep2(i,a,b) for (int (i)=a;(i)<(b);(i)++)
#define all(x) (x).begin(),(x).end()

using namespace std;
using ll = long long int;

const int inf = 1001001000;
const long long int Inf = 1001001001001001000;



void print(vector<vector<int>> a){
	for (int i = 0; i < a.size(); i++)
	{
		for (int j=0;j<a[i].size();j++){
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
}

void print(vector<vector<long long int>> a){
	for (int i=0;i<a.size();i++){
		for (int j=0;j<a[i].size();j++){
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
}

void print(vector<int> a){
    int n = a.size();
    for (int j=0;j<n;j++) {
        if (j != n-1) cout << a[j] << " ";
        else cout << a[j] << endl;
    }
}

void print(vector<long long int> a){
    int n = a.size();
    for (int j=0;j<n;j++) {
        if (j != n-1) cout << a[j] << " ";
        else cout << a[j] << endl;
    }
}

void print(set<int> a){
	for (auto x:a)
		cout << x << " ";
	cout << endl;
}

//nの約数を返す関数.sortされてない.
vector<long long int> divisors(long long int n){
	vector<long long int> res;
	for (long long int i = 1; i * i <= n;i++){
		if (n % i == 0){
			res.push_back(i);
			if(i * i != n){
				res.push_back(n / i);
			}
		}
	}
	return res;
}


int main(){
	int n;
	cin >> n;
	vector<int> a(n);
	rep(i, n) cin >> a[i];
	vector<int> b(n+1, 0);
	vector<int> ans;
	for (int i = n; i > 0;i--){
		int j = i - 1;
		if ((a[j] + b[i])%2==1){
			vector<ll> res = divisors(i);
			for(auto x:res)
				b[x]++;
			ans.push_back(i);
		}
	}
	sort(all(ans));
	if(ans.size()){
		cout << ans.size() << endl;
		print(ans);
	} else {
		cout << 0 << endl;
	}

	return 0;
}

Measured memory_bytes: 3576
// Problem : D - Not Divisible
// Contest : AtCoder - AtCoder Beginner Contest 170
// URL : https://atcoder.jp/contests/abc170/tasks/abc170_d
// Memory Limit : 1024 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
#define F first
#define S second
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define pb push_back
#define mk make_pair
#define fast                    \
  ios_base::sync_with_stdio(0); \
  cin.tie(0);                   \
  cout.tie(0);
#define rep(i, a, b) for (ll i = a; i < b; i++)
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
#define sz(x) (int)x.size()
#define mem(a, val) memset(a, val, sizeof(a))
#define deci(x) cout << fixed << setprecision(x);
#define bitcount(x) __builtin_popcountll(x)

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

const long long int mod = 1e9 + 7;
const long double EPS = 1e-12;
const int N = 2e6 + 20;

ll vis[N];

void solve() {
  ll n;
  cin >> n;
  map<ll, ll> mp;
  vector<ll> v;
  ll ans = 0;
  rep(i, 0, n) {
    ll temp;
    cin >> temp;
    mp[temp]++;
  }
  for (auto i : mp) {
    if (i.S > 1) continue;
    if (i.F == 1) {
      ans += 1;
      continue;
    }
    if (i.F > 1 && mp.find(1) != mp.end()) {
      continue;
    }
    bool flag = true;
    for (ll j = 2; j * j <= i.F; j++) {
      if (i.F % j == 0) {
        ll d1 = i.F / j, d2 = j;
        if (mp.find(d1) != mp.end()) {
          flag = false;
          break;
        }
        if (mp.find(d2) != mp.end()) {
          flag = false;
          break;
        }
      }
    }
    ans += flag;
  }

  cout << ans;
}
int main() {
  fast;
  ll t;
  t = 1;

  // cin>>t;

  while (t--) {
    solve();
  }

  return 0;
}


Measured memory_bytes: 16160
#include<iostream>
#include<algorithm>
#include<cmath>
using ul = unsigned long long;

ul L,R;
int main(){
	std::cin >> L >> R;
	
	 ul _min = 2018;
	for (ul i = L; i <= R; i++)
	{
		for (ul j = L+1; j <= R; j++)
		{
			if(i>=j)
				continue;
          	if(_min == 0)
              	break;
			_min = std::min((i*j) % 2019,_min);
		}
      if(_min == 0)
              	break;
	}
	
	std::cout << _min;
	return 0;
}

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

using ll = long long;
using vi = vector<int>;
#define rp(i,n) for(int i=0;i<(n);i++)
#define up(i,s,e,d) for(int i=(s);i<(e);i+=(d))

int main(){
	int N,T; cin>>N>>T;
	vi start(N); rp(i,N)cin>>start[i];
	ll ans = 0;
	int e = T;
	up(i,1,N,1){
		ans += e>=start[i]? start[i]-start[i-1]: T;
		e = start[i] + T;
	}
	cout<< ans + T <<endl;
}

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

int main ()
{
	long long n, x[20000], sum=0, max, min;
	cin >> n; max=0;
	
	for (int i=0; i<n; i++)
	{
		cin >> x[i];
		if (n==1)
		{
			min = max = sum = x[i];
			break; }
		sum += x[i];
		if (x[i]>max)
			max = x[i];
	}
	min = max;
	for (int i=0; i<n; i++)
	{
		if (n==1)
			break;
		if (x[i]<min)
			min = x[i];
	}
	
	cout << min << " " << max << " " << sum << endl;
	return 0;
}

Measured memory_bytes: 3124
#include<stdio.h>
typedef struct{
  int k;
  char mozi;
}card;
   
int main(){
  int i,j,m,min;
  card num[36],suit[36],temp;
    
  scanf("%d",&m);
  for(i = 0; i < m; i++){
    scanf(" %c%d", &num[i].mozi, &num[i].k);
    suit[i].mozi = num[i].mozi;
    suit[i].k = num[i].k;
  }
   
  for(i = 0; i < m; i++){
    for(j = m-1; j > i; j--){
      if(num[j].k < num[j-1].k){
    temp = num[j];
    num[j] = num[j-1];
    num[j-1] = temp;
      }
    }
  }
  
  for(i = 0; i < m-1; i++){
    printf("%c%d ",num[i].mozi, num[i].k);
  }
  printf("%c%d\nStable\n",num[i].mozi, num[i].k);
  
  for(i = 0; i < m-1; i++){
    min = i;
    for(j = i; j <= m-1; j++){
      if(suit[j].k < suit[min].k) min = j;
    }
    temp = suit[i];
    suit[i]=suit[min];
    suit[min]=temp;
  }
  
  for(i = 0; i < m-1; i++){
    printf("%c%d ",suit[i].mozi,suit[i].k);
  }
  printf("%c%d\n",suit[i].mozi,suit[i].k);
   
  for(i = 0; i < m; i++){
    if(suit[i].mozi != num[i].mozi) {
      printf("Not stable\n");
      break;
    }
  }
  if(i == m)printf("Stable\n");
  return 0;
}

Measured memory_bytes: 608
#include "bits/stdc++.h"
using namespace std;
#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__) << "] "

using ll = long long;
using ii = pair<int,int>;
using vi = vector<int>;
using vii = vector<ii>;
const int oo = 1e9+7;

int main() {
    
    int n, w;
    scanf("%d%d",&n,&w);
    
    int maxValue = 1e3 * n;
    
    vector<ll> dp(maxValue+7, oo);
    dp[0] = 0;
    
    for(int i = 1; i <= n; ++i) {
        
        int weight, value;
        scanf("%d%d", &weight, &value);
        
        for(int prevValue = maxValue-value; prevValue >= 0; --prevValue) {
            dp[prevValue+value] = min(dp[prevValue+value], dp[prevValue]+(ll)weight);
        }
        
    }
    
    for(int value = maxValue; value >= 0; --value) {
        if(dp[value] <= w) {
            printf("%d\n", value);
            break;
        }
    }
    
    return 0;
}




Measured memory_bytes: 1024
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<sstream>
#include<string>
#include<string.h>
#include<cmath>
#include<stack>
#include<queue>
#include<vector>
#include<map>
#define E (2.71828182)
#define PI (3.1415926535898)
#define	mem(a,b)	memset(a,b,sizeof(a))
#define	_max(a,b,c)	(max(a,b)>c?max(a,b):c)
#define mod	1000000007
#include<set>
#define gc getchar
#define debug(a) cout << "*" << a << "*" << endl
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<float, int> P;
const int N = 200000;
const long long  MAX_V = 5005, INF = 2147483647, MOD = 998244353;
#include <iostream>
using namespace std;
int n, a[400005], b[200005], ga[400005], gb[200005];
int nex[200005];
void getNext() {
 	 int *p = gb;
     nex[0] = -1;
     int j = 0;
     int k = -1;
     while (j < n - 1) {
        if (k == -1 || p[j] == p[k]) {
 		//	if (p[++j] == p[++k])
        //    next[j] = next[k];
        //    else
            nex[++j] = ++k;
        } else {
            k = nex[k];
        }
     }
 }
bool KMP() {
	bool f = false;
	int *t = ga, *p = gb;
	int i = 0; // 主串的位置
	int j = 0; // 模式串的位置
	while (i < 2 * n - 1) {
		if (j == -1 || t[i] == p[j]) { // 当j为-1时，要移动的是i，当然j也要归0
            i++;
            j++;
        	if (j == n)
        	{
        		f = true;
        		printf("%d %d\n", i - j, b[0] ^ a[i - j]);
        		j = nex[j - 1] + 1;
			}
        } else {
            // i不需要回溯了
            // i = i - j + 1;
            j = nex[j]; // j回到指定位置
 
        }
 
     }
     return f;
}
int main()
{
	while (~scanf("%d", &n))
	{
		for (int i = 0; i < n; i++)	
		{
			scanf("%d", &a[i]);
			if (i)
				ga[i - 1] = a[i - 1] ^ a[i]; 
		}
		ga[n - 1] = a[n - 1] ^ a[0];
		for (int i = 0; i < n; i++)	
		{
			scanf("%d", &b[i]);
			if (i)
				gb[i - 1] = b[i - 1] ^ b[i]; 
		}
		gb[n - 1] = b[n - 1] ^ b[0];
		for (int i = n; i < 2 * n; i++)	ga[i] = ga[i - n];
		getNext();
		if(!KMP())	printf("\n");
	}
}


Measured memory_bytes: 8192
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using P = pair<int, int>;
#define PI acos(-1)
#define Mod (int)1000000007
#define INFTY (int)INT_MAX
#define Rep(i, n) for (int i = 0; i < (int)(n); i++)
#define BitRep(i, n) for (int i = 0; i < (int)(1 << n); i++)
#define All(vec) vec.begin(), vec.end()
#define Sum(vec) accumulate(vec.begin(), vec.end(), 0)
#define Sort(vec) sort(vec.begin(), vec.end())
#define Reverse(vec) reverse(vec.begin(), vec.end())
#define Count(vec, x) count(vec.begin(), vec.end(), x)
#define Next_permutation(vec) next_permutation(vec.begin(), vec.end())
#define Find(S, s) S.find(s) != string::npos

int main() {
	int a, b;
	cin >> a >> b;
	cout << a * b << " " << (a + b) * 2 << endl;
	return 0;
}


Measured memory_bytes: 2996
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define sz(x) int(x.size())
#define pb push_back
#define eb emplace_back
using ll=long long;
using P = pair<int,int>;
using LP=pair<ll,ll>;
#define chmax(x,y) x = max(x,y)
#define chmin(x,y) x = min(x,y)
const ll MOD=1000000007,MOD2=998244353;



int main() {
    ll N,K;
    cin>>N>>K;
    vector<ll> A(N);
    rep(i,N)cin>>A.at(i);
    ll pos=1e9,imp=0;
    while(pos-imp>1){
        ll m=(pos+imp)/2;
        ll cnt=0;
        rep(i,N){
            ll now=A.at(i);
            ll plu=0;
            plu=(now-1)/m;
            /*while(now>m*(plu+1)){
                plu++;
            }*/
            cnt+=plu;
        }
        if(cnt>K)imp=m;
        else pos=m;
    }
    
    cout<<pos<<endl;
}

Measured memory_bytes: 4784
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<iomanip>
#include<set>
#include<queue>

using namespace std;

int main()
{
	int a[5];
	for(int i=0;i<5;i++)
		cin >> a[i];
	int ans=0;
	for(int i=0;i<5;i++)
		ans+=((a[i]-1)/10)+1;
	ans*=10;

	int level=ans;
	for(int i=0;i<5;i++)
	{
		if(a[i]%10!=0 and level-(10-a[i]%10)<ans)
			ans=level-(10-a[i]%10);
	}
	cout << ans << endl;
		






}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
      ll n,i;
      cin>>n;
      ll x[n],y[n];
      for(i=0;i<n;i++){
            cin>>x[i];
      }
      for(i=0;i<n;i++)
      {
            if(i==0){
                  y[i]=0;
            }
            else if(i==1){
                  y[i]=abs(x[i]-x[i-1]);
            }
            else{
                  y[i]=min(y[i-1]+abs(x[i]-x[i-1]),y[i-2]+abs(x[i]-x[i-2]));
            }
      }
      cout<<y[n-1]<<"\n";
}

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

int main() {
    ll n,a,b;
    cin>>n>>a>>b;
    if(a%2 == b%2)  {
        cout<<(b-a)/2;
    }
    else {
        cout<<min(a-1,n-b) + (b-a-1)/2 + 1;
    }
}

Measured memory_bytes: 256
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <queue>
using namespace std;
using ll = long long;
struct Int2
{
	ll x;
	int y;
	Int2() {}
	Int2(ll x, int y) :x(x), y(y) {}

	bool operator<(const Int2& other) const {
		if (x != other.x)
			return x < other.x;
		return y < other.y;
	}
	bool operator>(const Int2& other) const {
		if (x != other.x)
			return x > other.x;
		return y > other.y;
	}
};
struct edge {
	int to;
	ll cost;

	edge(int to, ll cost) :to(to), cost(cost) {}
};
int main() {
	int n, a, b, q, k, x, y;
	ll c, dp[100000];
	vector<edge> EDGES[100000];

	scanf("%d", &n);
	for (int i = 1; i < n; i++) {
		scanf("%d %d %lld", &a, &b, &c);
		a--, b--;
		EDGES[a].emplace_back(b, c);
		EDGES[b].emplace_back(a, c);
	}
	for (int i = 0; i < n; i++)
		dp[i] = 0x7fffffffffffffffll;
	scanf("%d %d", &q, &k);
	k--;
	priority_queue<Int2> que;
	que.emplace(0, k);
	dp[k] = 0;
	while (!que.empty()) {
		Int2 cur(que.top());
		que.pop();
		for (edge e : EDGES[cur.y])
			if (e.cost + cur.x < dp[e.to]) {
				que.emplace(e.cost + cur.x, e.to);
				dp[e.to] = e.cost + cur.x;
			}
	}

	ll costs;
	for (int i = 0; i < q; i++) {
		scanf("%d %d", &x, &y);
		x--, y--;
		costs = dp[x] + dp[y];
		printf("%lld\n", costs);
	}
}

Measured memory_bytes: 11120
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef double ld;

#define for0(i, n) for (ll i = 0; i < (ll)(n); ++i) // 0 based indexing
#define for1(i, n) for (ll i = 1; i <= (ll)(n); ++i) // 1 based indexing
#define forc(i, l, r) for (ll i = (ll)(l); i <= (ll)(r); ++i) // closed interver from l to r r inclusive
#define forr0(i, n) for (ll i = (ll)(n) - 1; i >= 0; --i) // reverse 0 based.
#define forr1(i, n) for (ll i = (ll)(n); i >= 1; --i) // reverse 1 based

#define tc ll t;cin >> t;while(t--)

#define ff first
#define ss second
#define pb push_back

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	ll a,b;
	ld h,m;
	cin >> a >> b >> h >> m;
	ld angle1 = (m/60)*2*3.14159265358979323846 , angle2 = ((h+(m/60))/12 )*2*3.14159265358979323846;
	ld angle = (long double) fabs(angle1 - angle2);
	// cout << (h+(m/60))/6 << " " << ((h+(m/60))/6)<<endl;
	if(angle > 3.14159265358979323846){
		angle = 3.14159265358979323846*2 - angle;
	}
	ld ans = sqrtl(a*a + b*b - 2*a*b*cosl(angle));
	printf("%.20f\n",ans);
	return 0;
}


Measured memory_bytes: 4108
#include "bits/stdc++.h"
using namespace std;
const int MOD = 1e9 + 7;
typedef long long lint;
const int INF = 1e7;
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define trep(i, k, n) for (int i = (k); i < (int)(n); ++i)
typedef pair<int, int> P;
typedef vector<int> vi;
typedef vector<vi> vvi;
int main()
{
    int n;
    cin >> n;
    int a[n];
    rep(i, n)
    {
        cin >> a[i];
    }
    int cc = 0;
    rep(i,n)
    {
        if (a[i] == a[i + 1])
        {
            continue;
        }
        if (a[i] < a[i + 1])
        {
            while (a[i] < a[i + 1] || a[i] == a[i + 1])
            {
                i++;
            }
            cc++;
            continue;
        }
        if (a[i] > a[i + 1])
        {

            while (a[i] > a[i + 1] || a[i] == a[i + 1])
            {
                i++;
            }
            cc++;
            continue;
        }
    }
    cout << cc << endl;
    return 0;
}


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

const int64_t MOD = 998244353;

int main() {
  int n, s;
  cin >> n >> s;
  int64_t dp[s + 1], result = 0;
  for (int i = 0; i <= s; ++i) {
    dp[i] = 0;
  }
  for (int a; cin >> a; ) {
    dp[0] += 1;
    for (int j = s; j > 0; --j) {
      if (j >= a) {
        dp[j] = (dp[j] + dp[j - a]) % MOD;
      }
    }
    result = (result + dp[s]) % MOD;
  }
  cout << result;
  return 0;
}


Measured memory_bytes: 3188
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define ld long double
#define fi first
#define se second
#define pb push_back
#define all(v) v.begin(),v.end()
#define repf(i,a,b) for(ll i=a;i<b;i++)
#define repb(i,a,b) for(ll i=a;i>=b;i--)
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define mod 1000000007
#define MOD 998244353 

using namespace std;
using namespace __gnu_pbds;

template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

ordered_set<ll> ods;

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

ll power(ll a, ll n, ll m)
{
    ll ans=1;
    while(n)
    {
        if(n&1) ans=(ans*a)%m;
        n>>=1;
        a=(a*a)%m;
    }
    return ans;
}

ll invmod(ll a, ll m)
{
    return power(a,m-2,m);
}

ll c[200001];

void solve(ll t)
{
    // cout<<"Case #"<<t<<":\n";
    ll n;
    cin>>n;
    repf(i,1,n)
    {
        ll x;
        cin>>x;
        c[x]++;
    }
    repf(i,1,n+1) cout<<c[i]<<endl;
}

int main()
{
    IOS;
    ll t;
    // cin>>t;
    t=1;
    ll tt=1;
    while(t--)
    {
        solve(tt);
        tt++;
    }
}     


Measured memory_bytes: 5220
<?php
/*
    Problem URL : https://beta.atcoder.jp/contests/abc063/tasks/abc063_b

    Score  :
    Result :
    Time   : ms
    Memory : KB
 */


// define('DEBUG', true);
define('DEBUG', false);

ini_set('error_reporting', E_ALL & ~E_NOTICE);

fscanf(STDIN, "%s", $S);
$arr = str_split($S);
$len = count($arr);
$m = array();
$flg = true;

for ($i = 0; $i < $len; $i++) {
    $cord = ord($arr[$i]);
    if ($m[$cord] != 0) {
        $flg = false;
    } else {
        $m[$cord]++;
    }
}

echo $flg ? "yes\n" : "no\n";


Measured memory_bytes: 4604
#include <iostream>
#include <queue>

using namespace std;

#define WH 32

int main(int argc, char const *argv[])
{
	int w,h;
	int f[WH][WH];
	int yoko[WH][WH];
	int tate[WH][WH];
	int x,y;

	while(1){
		cin>>w>>h;
		if(w+h==0) break;

		for(int i1=0;i1<WH;i1++){
			for(int i2=0;i2<WH;i2++){
				f[i1][i2]=0;
				yoko[i1][i2]=1;
				tate[i1][i2]=1;
			}
		}

		for(int i1=1;i1<2*h;i1++){
			if(i1%2==1){
				for(int i2=1;i2<w;i2++){
					cin>>yoko[i1/2+1][i2+1];
				}
			}
			else {
				for(int i2=1;i2<=w;i2++){
					cin>>tate[i1/2+1][i2];
				}
			}
		}

		queue<pair<int,int> > q;
		q.push(make_pair(1,1));
		f[1][1]=1;

		while(!q.empty()){
			x=q.front().first;
			y=q.front().second;
			q.pop();

			if(yoko[y][x+1]==0 && f[y][x+1]==0 ){
				f[y][x+1]=f[y][x]+1;
				q.push(make_pair(x+1,y));
			}
			if(yoko[y][x]==0 && f[y][x-1]==0){
				f[y][x-1]=f[y][x]+1;
				q.push(make_pair(x-1,y));
			}
			if(tate[y+1][x]==0 && f[y+1][x]==0){
				f[y+1][x]=f[y][x]+1;
				q.push(make_pair(x,y+1));
			}
			if(tate[y][x]==0 && f[y-1][x]==0){
				f[y-1][x]=f[y][x]+1;
				q.push(make_pair(x,y-1));
			}

		}
		cout<<f[h][w]<<endl;

	}
	return 0;
}

Measured memory_bytes: 1228
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define R cin>>
#define Z class
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
template<Z A>void pr(A a){cout<<a;ln;}
template<Z A,Z B>void pr(A a,B b){cout<<a<<' ';pr(b);}
template<Z A,Z B,Z C>void pr(A a,B b,C c){cout<<a<<' ';pr(b,c);}
template<Z A,Z B,Z C,Z D>void pr(A a,B b,C c,D d){cout<<a<<' ';pr(b,c,d);}
template<Z A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}ln;}
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}
const ll MAX=1e9+7,MAXL=1LL<<61,dx[4]={-1,0,1,0},dy[4]={0,1,0,-1};
typedef pair<int,int> P;

void Main() {
  ll n,m;
  cin >> n >> m;
  string s[n];
  rep(i,n) R s[i];
  bool u[n][m];
  mem(u);
  rep(i,n) {
    set<char> se;
    rep(j,m) se.in(s[i][j]);
    if(se.size()==1&&*se.begin()=='.') rep(j,m) u[i][j]=1;
  }
  rep(i,m) {
    set<char> se;
    rep(j,n) se.in(s[j][i]);
    if(se.size()==1&&*se.begin()=='.') rep(j,n) u[j][i]=1;
  }
  vector<string> v;
  rep(i,n) {
    string t="";
    rep(j,m) {
      if(!u[i][j]) t+=s[i][j];
    }
    if(t.size()) v.pb(t);
  }
  rep(i,v.size()) pr(v[i]);
}

int main(){ios::sync_with_stdio(0);cin.tie(0);Main();return 0;}


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

#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))

typedef long long LL;

int main(){
  LL x,y;
  cin >> x >> y;
  if(max(x-y,y-x)<=1) cout << "Brown" << endl;
  else cout << "Alice" << endl;
  return 0;
}


Measured memory_bytes: 256
using System.Linq;
using static System.Console;
using static System.Math;
class Z { static void Main() => new _K(); }
class _K
{
	int[] G => Strs.Select(int.Parse).ToArray();
	string[] Strs => ReadLine().Split();
	int K, L;
	readonly int[,] sum;
	public _K()
	{
		var I = G;
		K = I[1];
		L = 4 * K;
		sum = new int[L + 1, L + 1];
		for (var i = 0; i < I[0]; i++)
		{
			var S = Strs;
			if (S[2] == "B") Add(int.Parse(S[0]) % (2 * K) + 1, int.Parse(S[1]) % (2 * K) + 1);
			else Add((int.Parse(S[0]) + K) % (2 * K) + 1, int.Parse(S[1]) % (2 * K) + 1);
		}
		for (var x = 0; x < L; x++) for (var y = 0; y <= L; y++) sum[x + 1, y] += sum[x, y];
		for (var x = 0; x <= L; x++) for (var y = 0; y < L; y++) sum[x, y + 1] += sum[x, y];
		var max = 0;
		for (var i = 0; i < K; i++) for (var j = 0; j < K; j++)
			{
				var s = Sum(i, j) + Sum(i + K, j + K);
				max = Max(max, Max(s, I[0] - s));
			}
		WriteLine(max);
	}
	void Add(int x, int y)
	{
		sum[x, y]++;
		sum[x + 2 * K, y]++;
		sum[x + 2 * K, y + 2 * K]++;
		sum[x, y + 2 * K]++;
	}
	int Sum(int i, int j) => sum[i + K, j + K] - sum[i + K, j] - sum[i, j + K] + sum[i, j];
}


Measured memory_bytes: 77656
import java.util.*;

public class Main {
	private static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		int n = sc.nextInt();
		Integer[] a = new Integer[n*3];
		for (int i = 0;i < 3*n;i++) {
			a[i] = sc.nextInt();
		}
		Arrays.sort(a, Collections.reverseOrder());
		long ret = 0;
		for (int i = 0;i < n;i++) {
			ret += a[i*2+1];
		}
		System.out.println(ret);
	}
}

Measured memory_bytes: 98084