akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <cstdio>
#include <bitset>
#include <queue>
#include <deque>
#include <algorithm>
#include <numeric>
#include <cassert>
#include <functional>
#include <stack>
#include <cmath>
#include <string>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx")

using namespace std;

#define REP(i, N) for (int i = 0; i < (int)N; i++)
#define FOR(i, a, b) for (int i = a; i < (int)b; i++)
#define ALL(x) (x).begin(), (x).end()
#define INF (1 << 30)
#define LLINF (1LL << 62)
#define DEBUG(...) debug(__LINE__, ":" __VA_ARGS__)

constexpr int MOD = 1000000007;
using ll = long long;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

inline int popcount(ll x) { return __builtin_popcountll(x); }
inline int div2num(ll x) { return __builtin_ctzll(x); }
inline bool bit(ll x, int b) { return (x >> b) & 1; }

constexpr int SZ = 100000;
constexpr int prs = 10;
ll pre[1 << prs][SZ + 1];

int main() {
  int N;
  cin >> N;
  vector<int> V(N + 1), W(N + 1);
  REP(i, N) cin >> V[i + 1] >> W[i + 1];
  FOR(i, 1, min(N + 1, 1 << prs)) {
    if (i != 1) copy(pre[i / 2], pre[i / 2] + SZ + 1, pre[i]);
    for (int j = SZ; j >= W[i]; --j)
      pre[i][j] = max(pre[i][j], pre[i][j - W[i]] + V[i]);
    REP(j, SZ) pre[i][j + 1] = max(pre[i][j + 1], pre[i][j]);
  }
  int Q;
  cin >> Q;
  while (Q--) {
    int v, L;
    cin >> v >> L;
    if (v < (1 << prs)) {
      cout << pre[v][L] << "\n";
    } else {
      int bi = 32 - __builtin_clz(v) - prs;
      ll ans = 0;
      REP(b, 1 << bi) {
        int w = 0;
        ll va = 0;
        REP(i, bi) {
          if (bit(b, i)) {
            w += W[v >> i];
            va += V[v >> i];
          }
          if (w > L) break;
        }
        if (w <= L) ans = max(ans, pre[v >> bi][L - w] + va);
      }
      cout << ans << "\n";
    }
  }
  return 0;
}


Measured memory_bytes: 804480
D = int(input())
c = list(map(int,input().split()))
s = [list(map(int,input().split())) for i in range(D)]
t = [int(input()) for i in range(D)]

score = 0
last = [0]*26
for d in range(D):
    score += s[d][t[d]-1]
    last[t[d]-1] = d+1
    for i in range(26):
        score -= c[i]*(d+1-last[i])
    print(score)


Measured memory_bytes: 9256
#include <bits/stdc++.h>
using namespace std;
using ll=long long int;
using ld=long double;
using VI=vector<ll>;
using VD=vector<ld>;
using VVI=vector<VI>;
using VC=vector<char>;
using VVC=vector<VC>;
using VS=vector<string>;
using PLL =pair<ll,ll>;
using PLD=pair<ld,ld>;
using VPLL=vector<PLL>;
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=(a);i<=(b);i++)
#define FORD(i,a,b) for(ll i=(a);i>=(b);i--)
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
#define SIZE(x) ((ll)(x).size())
#define MAX(x) *max_element((x).begin(),(x).end())
#define MIN(x) *min_element((x).begin(),(x).end())
#define SORTR(x) sort((x).rbegin(),(x).rend())
#define SORT(x) sort((x).begin(),(x).end())
#define SUM(x) accumulate((x).begin(),(x).end(), 0)
#define FILL(x,a) fill(x.begin(),x.end(),a)
#define EACH(i,x) for(typeof((x).begin()) i=(x).begin(); i!=(x).end(); ++i)

const int INF  = 1<<30;
const ld EPS   = 1e-10;
const int MOD  = int(1e9)+7;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
template <class BidirectionalIterator>
bool next_partial_permutation(BidirectionalIterator first, BidirectionalIterator middle,BidirectionalIterator last){reverse(middle, last); return next_permutation(first , last);}
#define COUT(x) cout<<x<<"\n"

void Main()
{
	ll N;
	string result="No";
	string S;
	cin>>S;
	if(S[2]==S[3]&&S[4]==S[5]) result="Yes"	;
	cout << result << "\n";
	return;
}

int main()
{
	std::cin.tie(0);
	std::ios_base::sync_with_stdio(false);
	std::cout << std::fixed << std::setprecision(15);
	Main();
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.IO;
using static System.Console;
using Pair = System.Collections.Generic.KeyValuePair<int, int>;
//using System.Numerics;
//using static System.Math;

class Program
{
    static void Main()
    {
        //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
        new Program().solve();
        Out.Flush();
    }
    Scanner cin = new Scanner();
    readonly int[] dd = { 0, 1, 0, -1, 0 };
    readonly int mod = 1000000007;
    readonly string alfa = "abcdefghijklmnopqrstuvwxyz";
    readonly string ALFA = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

    int T;
    void solve()
    {
        T = cin.nextint;
        for (int i = 0; i < T; i++)
        {
            int N = cin.nextint;
            int D = cin.nextint;
            int ans = D;
            for (int j = 0; j < N - 1; j++)
            {
                ans -= D;
                D = D ^ 127;
                ans += 127 + D;
            }
            WriteLine(ans);
        }
    }

}

class Scanner
{
    string[] s; int i;
    char[] cs = new char[] { ' ' };
    public Scanner() { s = new string[0]; i = 0; }
    public string[] scan { get { return ReadLine().Split(); } }
    public int[] scanint { get { return Array.ConvertAll(scan, int.Parse); } }
    public long[] scanlong { get { return Array.ConvertAll(scan, long.Parse); } }
    public double[] scandouble { get { return Array.ConvertAll(scan, double.Parse); } }
    public string next
    {
        get
        {
            if (i < s.Length) return s[i++];
            string st = ReadLine();
            while (st == "") st = ReadLine();
            s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
            i = 0;
            return next;
        }
    }
    public int nextint { get { return int.Parse(next); } }
    public long nextlong { get { return long.Parse(next); } }
    public double nextdouble { get { return double.Parse(next); } }
}

Measured memory_bytes: 13268
// We only fail when we stop trying
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define endl '\n'
#define D(x) cerr << #x << " = " << (x) << '\n'
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(), (x).end()



int main()
{
  long long a, b, c;
  cin >> a >> b >> c;
  long long r = c - a - b;
  if(r < 0) return cout << "No" << endl, 0;
  r = r * r;
  if(4 * a * b < r) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include <string>
#include<vector>
#include<algorithm>
#include<utility>
using namespace std;
typedef long long ll;
bool cmp(pair<int, int> a, pair<int, int> b) {
	return a.first < b.first;
}

int output(int i) {
	if (i<10) {
		cout << "00000" << i;
	}
	else if (i < 100) {
		cout << "0000" << i;
	}
	else if (i < 1000) {
		cout << "000" << i;
	}
	else if (i < 10000) {
		cout << "00" << i;
	}
	else if (i < 100000) {
		cout << "0" << i;
	}
	else  {
		cout << i;
	}
	return 0;
}

int main() {
	int n, m;
	cin >> n >> m;
	vector<vector<pair<int, int>>> simo(n + 1);
	vector<int> pre(m + 1);
	vector<int> ban(m + 1);
	for (int i = 1; i <= m; i++) {
		int p, y;
		cin >> p >> y;
		simo[p].push_back(make_pair(y, i));
		pre[i] = p;
	}
	for (int i = 1; i <= n; i++) {
		sort(simo[i].begin(), simo[i].end(), cmp);
	}
	for (int i = 1; i <=n; i++) {
		for (int j = 0; j < simo[i].size(); j++) {
			ban[simo[i][j].second] = j + 1;
		}
	}
	for (int i = 1; i <= m; i++) {
		output(pre[i]);
		output(ban[i]);
		cout << endl;
	}
}

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

int main(){
  int  N,Q; cin >> N >> Q;
  string S;
  cin >> S;
  vector<int> cnt(S.size());

  int now_AC = 0;

  cnt[0] = 0;

  for(int i = 1;i < N;i++){
    if(S[i-1] == 'A' && S[i] == 'C')now_AC++;
    cnt[i] = now_AC;
  }

  vector<int> answers;

  for(int i = 0;i < Q;i++){
    int l,r; cin >> l >> r;
    answers.push_back(cnt[r-1] - cnt[l-1]);
  }

  for(int i = 0;i < Q;i++)cout << answers[i] << endl;



  return 0;
}


Measured memory_bytes: 1912
/*
  AUTHOR:SOURABH
  CREATED:19:01:20
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#define ordered_set tree<ll , null_type, less< ll >, rb_tree_tag, tree_order_statistics_node_update>
#define ll long long int
#define ld long double
#define fi first
#define se second
#define pb push_back
#define pob pop_back
#define W while
#define fn(i,x) for(i=0;i<x;i++)
#define fs(i,s,x) for(i=s;i<x;i++)
#define fr(i,x) for(i=x;i>=0;i--)
#define fit(it,s) for(it=s.begin();it!=s.end();it++)
#define mp make_pair
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vii vector<int>
#define vll vector<ll>
#define mii map<int,int>
#define mll map<ll,ll>
#define mod 1000000007
#define MAX 100005
#define M 32

using namespace std;
using namespace __gnu_pbds;

ll c[10][10];

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);

    //freopen("in.txt","r",stdin);
    //freopen(2 "out.txt","w",stdout);

    ll n,i,j,s,e,ans=0;
    cin>>n;
    fs(i,1,n+1)
    {
        e=i%10;
        j=i;
        W(j)
        {
            s=j;
            j/=10;
        }
        c[s][e]++;
    }
    fn(i,10)
    {
        fn(j,10)
        ans+=c[i][j]*c[j][i];
    }
    cout<<ans;
}










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

using namespace std;

int n,a[1000006];

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

    for(int i=0; i<n; i++)
    {
        scanf("%d",&a[i]);
    }

    reverse(a,a+n);

    for(int i=0; i<n; i+=2)
    {
        printf("%d ",a[i]);
    }

    for(int i=n-1; i>0; i--)
    {
        if(i%2==0) i--;
        printf("%d ",a[i]);
    }
}


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

#define int long long
#define For(i, a, b) for (int i = (a); i <= static_cast<int>(b); i++)
#define Forr(i, a, b) for (int i = (a); i >= static_cast<int>(b); i--)
#define rep(i, n) For(i, 0, n - 1)
#define repall(i, arr) for (auto& i : (arr))
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define dump(x) cerr << #x << " = " << (x) << '\n'
#define dump2(x, y) \
    cerr << #x << " = " << (x) << " " << #y << " = " << (y) << '\n'

template <typename T>
using pq = priority_queue<T>;
template <typename T>
using pqr = priority_queue<T, vector<T>, greater<T>>;
const int INF = LLONG_MAX / 2;
constexpr int MOD = 1e9 + 7;
using P = pair<int, int>;
using vec = vector<int>;
using mat = vector<vec>;

template <typename T1, typename T2>
ostream& operator<<(ostream& stream, const pair<T1, T2>& p) {
    return stream << p.first << " " << p.second;
}
template <typename T>
void print(const vector<vector<T>> matrix) {
    repall (vec, matrix)
        print(vec);
}
template <typename T>
void print(const vector<T> vec) {
    unsigned int len = vec.size();
    rep (i, len - 1)
        cout << vec[i] << ' ';
    cout << vec[len - 1] << '\n';
}
template <typename Arg>
void print(const Arg arg) {
    cout << arg << '\n';
}
template <typename Head, typename... Args>
void print(const Head head, const Args... args) {
    cout << head << " ";
    print(args...);
}
template <typename T>
T sum_(vector<T> vec, T init = 0) {
    return std::accumulate(all(vec), T(init));
}

void yn(bool tf) { print(tf ? "Yes" : "No"); }
void YN(bool tf) { print(tf ? "YES" : "NO"); }

template <typename T>
void init(vector<T>& v) {
    rep (i, v.size())
        cin >> v[i];
}

template <typename T, typename U>
void init(vector<T>& v, vector<U>& w) {
    assert(v.size() == w.size());
    rep (i, v.size())
        cin >> v[i] >> w[i];
}

int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }

// -------------------------------------------------------------------
// sort 1 2 3 4
// pqr 1 2 3 must impl >

signed main() {
    cin.tie(0), cout.tie(0), ios::sync_with_stdio(false);
    int x, a;
    cin >> x >> a;
    print(x < a ? 0 : 10);

    return 0;
}


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

int n, k, x, a[10];

bool f(int n) {
	while (n > 0) {
		if (a[n % 10]) return true;
		n /= 10;
	}
	return false;
}

int main() {
	cin >> n >> k;
	while (k--) {
		cin >> x;
		a[x] = true;
	}
	while (f(n)) n++;
	cout << n << endl;
}

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

int gcd(int a, int b) { return b ? gcd(b, a%b) : a;}

int main() {
    int n, s;
    cin >> n >> s;
    vector<int> x(n);
    rep(i,n) cin >> x.at(i);
    x.push_back(s);
    sort(x.begin(), x.end());
    vector<int> d(n);
    rep(i,n) d.at(i) = x.at(i+1) - x.at(i);
    if (d.size() == 1) {
        cout << d.at(0) << endl;
        return 0;
    }
    int ans = gcd(d.at(0), d.at(1));
    for (int i = 2; i < n; ++i) ans = gcd(ans, d.at(i));
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 3956
import sys
from collections import defaultdict

def load(vtype=int):
    return vtype(input().strip())

def load_list(seplator=" ", vtype=int):
    return [vtype(v) for v in input().strip().split(seplator)]

def exit():
    import sys
    sys.exit(0)

a, b, k = load_list()

if a > k:
    print(a-k, b)
else:
    print(0, max(a+b-k, 0))


Measured memory_bytes: 3316
#include <stdio.h>
#include <string.h>
#include <limits.h>

int main(void) {
    long long int N;
    long long int  mod = 1000000007;
    scanf("%lld",&N);
    
    long long int A [N];
    
    for(long long int i=0;i<N;i++){
        scanf("%lld",&A[i]);
    }
    
    long long int  sub = 0;
    long long int zenbu = 0;
    long long int p = N-1;
    long long int X [N] ;
    

    
    while(p>=0){
        X[p] = A[p] % mod;
        p--;
}
     
    long long int q = N-1;
   
    while(q>=0){
        zenbu += X[q];
        zenbu %= mod;
        q--;
        }
    
    for(long long int j= N-1;j>=1;j--){
        zenbu -=X[j];
        while(zenbu<0){zenbu += mod;}
              sub += X[j]*zenbu;
      sub %= mod;
     }
    
    

    
    
    
   
    printf("%lld",sub);
    
    
    return 0;
}

Measured memory_bytes: 4852
n = int(input())
s = []
for _ in range(n):
    s.append(input())
st=list(map(''.join,zip(*s)))

def plusa(s,a):
    ns = []
    for ss in s:
        ns.append(ss[a:]+ss[:a])
    return ns

def plusb(s,b):
    global n
    ns = []
    for i in range(n-b):
        ns.append(s[b+i])
    for i in range(b):
        ns.append(s[i])
    return ns

res = 0
for i in range(n):
    if plusa(st,i) == plusb(s,i):
        res += n

print(res)

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

#define rep(i, n) for (ll i = 0; i < (n); i++)
#define rep2(i, a, b) for (ll i = (a); i < (b); i++)
#define chmax(x, v)                                                            \
  do {                                                                         \
    x = max(x, v);                                                             \
  } while (0)
#define chmin(x, v)                                                            \
  do {                                                                         \
    x = min(x, v);                                                             \
  } while (0)
typedef uint64_t ull;
typedef int64_t ll;
typedef std::pair<ll, ll> PLL;

using namespace std;
// Segment Tree {{{
template <typename T>
class SegTree {
 private:
    int _n;
    T _init_val;
    std::vector<T> _data;
    std::function<T(T, T)> _f;

    T _query(int a, int b, int k, int l, int r) {
        // [a b)と[l r]が交差しない
        if (r <= a || b <= l) return _init_val;

        // [a b)が[l r]を含む
        if (a <= l && r <= b) return _data[k];

        T vl = _query(a, b, k*2+1, l, (l+r)/2);
        T vr = _query(a, b, k*2+2, (l+r)/2, r);

        return _f(vl, vr);
    }

 public:
    SegTree(int n, T init_val, std::function<T(T, T)> f) {
        _init_val = init_val;
        _n = 1;
        _f = f;

        while (_n < n)
            _n *= 2;
        _data.resize(2 * _n, init_val);
    }

    T get(int k) {
        return _data[k + _n - 1];
    }

    void update(int k, T a) {
        k += _n-1;
        _data[k] = a;
        while (k > 0) {
            k = (k-1)/2;
            _data[k] = _f(_data[k*2+1], _data[k*2+2]);
        }
    }

    // [a b)の範囲でfを適用
    T query(int a, int b) {
        return _query(a, b, 0, 0, _n);
    }

    // 先頭からチェックし，はじめてxを満たしたインデックス
    int lower_bound(T x) {
        return _lower_bound(x, 0);
    }

    int _lower_bound(T x, int k) {
        if (k >= _n-1) {
            return k - (_n - 1);  // 葉
        } else if (_data[k] < x) {
            return _n;  // 該当なし
        } else if (x <= _data[k * 2 + 1]) {
            return _lower_bound(x, k * 2 + 1);
        } else {
            return _lower_bound(x - _data[k * 2 + 1] , k * 2 + 2);
        }
    }
};
// }}}

signed main() {
  ll N, K;
  cin >> N >> K;
  SegTree<ll> st(N, 0, [](const ll &x, const ll &y) { return x+y; });
  rep(i, N) {
    ll x;
    cin >> x;
    st.update(i, 1+x);
  }
  ll ans = 0;
  for (ll i=0; i+(K-1) < N; i++) {
    chmax(ans, st.query(i, i+K));
  }
  printf("%.10f\n", ans/2.0);
  return 0;
}


Measured memory_bytes: 4352
#include <iostream>
using namespace std;
int f[100001];
int c[100001];
int n, l, r;
int main()
{
	for (int i=2; i<=100000; i++) 
	{
    	if (!f[i])
    	{
    		for (int j=2*i; j<=100000; j+=i)
				f[j] = 1;
		}
  	}
	for (int i=3; i<=100000; i+=2)
	{
		if (!f[i] && !f[(i+1)/2])
    	c[i] += 1;
	}

	for (int i=3; i<=100000; i++)
	{
    	c[i] += c[i-1];
  	}

  	cin >> n;
  	while(n--) {
    	cin >> l >> r;
    	cout << c[r]-c[l-1] << endl;
  	}
  	return 0;
}


Measured memory_bytes: 1408
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<stack>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef int Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
//#define mt make_tuple
//typedef tuple<int,int,int> tp;
//typedef vector<tp> vt;
const double PI=acos(-1);
const double EPS=1e-7;
const int inf=1e9;
const ll INF=2e18;
int dx[]={0,1,0,-1};
int dy[]={1,0,-1,0};
int main(){
	int n;
	cin>>n;
	string s;
	cin>>s;
	string out=s;
	int t=0;
	rep(i,s.size()){
		if(s[i]=='(')t++;
		else t--;
		if(t<0){
			out="("+out;
			t=0;
		}
	}
	out+=string(t,')');
	cout<<out<<endl;
}










Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const long long MOD = 1000000007;
const long long INF = 1LL << 60;

int main()
{
  int N, M;
  cin >> N >> M;
  priority_queue<long long> que;
  for (int i = 0; i < N; i++)
  {
    long long A;
    cin >> A;
    que.push(A);
  }
  for (int i = 0; i < M; i++)
  {
    long long t = que.top();
    que.pop();
    que.push(t / 2);
  }
  long long ans = 0;
  while (!que.empty())
    ans += que.top(), que.pop();
  cout << ans << endl;
}

Measured memory_bytes: 1400
#include <stdio.h>

#define SIN_60 0.86602540378443864

typedef struct {
	double x;
	double y;
} Point;

void devide(Point left, Point right, Point* m_left, Point* m_right) {
	Point len;
	len.x = (right.x - left.x) / 3.0;
	len.y = (right.y - left.y) / 3.0;
	m_left->x = left.x + len.x;
	m_left->y = left.y + len.y;
	m_right->x = right.x - len.x;
	m_right->y = right.y - len.y;
}

Point make_tri(Point left, Point right) {
	Point vec, vec2, tri;
	vec.x = right.x - left.x;
	vec.y = right.y - left.y;
	vec2.x = vec.x * 0.5 - vec.y * SIN_60;
	vec2.y = vec.x * SIN_60 + vec.y * 0.5;
	tri.x = left.x + vec2.x;
	tri.y = left.y + vec2.y;
	return tri;
}

void koch(Point left, Point right, int depth) {
	Point m_left, m_right, top;
	
	if (depth == 0) {
		printf("%f %f\n", right.x, right.y);
		return;
	}
	
	devide(left, right, &m_left, &m_right);
	top = make_tri(m_left, m_right);
	
	koch(left, m_left, depth - 1);
	koch(m_left, top, depth - 1);
	koch(top, m_right, depth - 1);
	koch(m_right, right, depth - 1);
}

int main(){
	int n;
	Point left, right;
	
	left.x = 0.0;
	left.y = 0.0;
	right.x = 100.0;
	right.y = 0.0;
	
	scanf("%d", &n);
	
	printf("%f %f\n", left.x, left.y);
	koch(left, right, n);
	
	return 0;
}

Measured memory_bytes: 636
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
 
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define RFOR(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define REP(i,n) for(int i=0;i<(n);i++)
#define RREP(i,n) for(int i=(n)-1;i>=0;i--)
#define VSORT(v) sort(v.begin(), v.end())
#define DVSORT(v) sort(v.begin(), v.end(),greater<int>())
#define SORT(v, n) sort(v, v+n)
#define DSORT(v,n) sort(v, v+n,greater<int>())
#define vi vector<int>
#define pb push_back
#define P pair<int,int>
#define Pll pair<ll,ll>

template <class T> void chmin(T&a,const T&b) { a = min(a,b); }
template <class T> void chmax(T&a,const T&b) { a = max(a,b); }
 
void print(){cout<<endl;}
template <class Head, class... Tail>
void print(Head&& h,Tail&&... t){ 
	if(sizeof...(t)==0)
		cout<<h;
	else
		cout<<h<<' ';
	print(move(t)...);
}
 
const double EPS =1e-9;
const int INF =2e+9;
const ll INFL =9e+18;
const long MOD =1e+9+7;
#define PI 3.14159265258979

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

int main(void){
	int N,B[100000],tem;
	ll sum=0;
	vi A,C;

	cin>>N;
	REP(i,N){
		cin>>tem; 
		A.pb(tem);
	}
	REP(i,N) cin>>B[i];
	REP(i,N){
		cin>>tem;
		C.pb(tem);
	}
	VSORT(A); VSORT(C);
	
	REP(i,N){
		vector<int>::iterator itr1,itr2;
		itr1 = lower_bound(A.begin(),A.end(),B[i]);
		itr2 = upper_bound(C.begin(),C.end(),B[i]);
		sum+=distance(A.begin(),itr1)*distance(itr2,C.end());
	}
	print(sum);

	return 0;
}




Measured memory_bytes: 1784
N, K = map(int, input().split())
H = list(map(int, input().split()))

H = [0] + H
dp = [0] * (N+1)

for i in range(2, N+1):
    dp[i] = dp[i-1] + abs(H[i]-H[i-1])
    for k in range(2, K+1):
        if i-k >= 1:
            dp[i] = min(dp[i], dp[i-k]+abs(H[i]-H[i-k]))

res = dp[N]
print(res)

Measured memory_bytes: 85412
s = gets.chomp
b=0
w=0
s.size.times do |i|
  b += 1 if i.even? and s[i] == "0"
  b += 1 if i.odd? and s[i] == "1"
  w += 1 if i.even? and s[i] == "1"
  w += 1 if i.odd? and s[i] == "0"
end
p [b, w].min


Measured memory_bytes: 1916
n = int(input())
s = input()
res = 0

for i in range(n-1):
    s1 = s[0:i+1]
    s2 = s[i+1:n]
    res_1 = 0
    for alp in range(ord('a'),ord('z')+1):
        if s1.find(chr(alp)) > -1:
            if s2.find(chr(alp)) > -1:
                res_1 = res_1 + 1
    if res < res_1:
        res = res_1

print(res)

Measured memory_bytes: 3064
#include<iostream>
#include<algorithm>
#include<cstring>
#include<cstdio>
using namespace std;
struct point{
  double x,y,z;
};

double calc(point a,point b){
  return (a.x-b.x)*(a.x-b.x) +
    (a.y-b.y)*(a.y-b.y) +
    (a.z-b.z)*(a.z-b.z);
}

int main(){
  int n,m;
  point p[20];
  cin>>n>>m;
  for(int i=0;i<n;i++){
    cin>>p[i].x>>p[i].y>>p[i].z;
  }
  double adj[n][n];
  for(int i=0;i<n;i++){
    for(int j=i;j<n;j++){
      adj[i][j]=adj[j][i]=calc(p[i],p[j]);
    }
  }

  double ans=0;
  bool position[n];
  for(int i=0;i<(1<<n);i++){
    memset(position,0,sizeof(position));
    double tmp=0;
    int count=0;
    for(int j=0;j<n;j++){
      if(((i>>j) & 1)==1){
	count++;
	position[j]=true;
      }
    }
    if(count>m)continue;
    for(int j=0;j<n;j++){
      for(int k=j;k<n;k++){
	if(position[j]==true && position[k]==true)
	  tmp+=adj[j][k];
      }
    }
    //cout << "tmp:" << tmp << endl;
    ans=max(tmp,ans);
  }
  printf("%.15lf",ans);
  return 0;
}

Measured memory_bytes: 1252
#include<bits/stdc++.h>
using namespace std;
signed main(){
string q;
int  i=0,c,a,b[10000]={}; 
while(true){
    cin>>q;
    if(q=="0") break;
    c=0;
    while(true){
      if(q.size()==c){
	break;
      }
      b[i]=b[i]+((int)q[c]-48);
      c++;
    }
    i++;
  }
  for(int j=0;j<i;j++){
    cout<<b[j]<<"\n";
  }
}



Measured memory_bytes: 3208
parseInt(x)=parse(Int,x)
parseMap(x::Array{SubString{String},1})=map(parseInt,x)

function main()
	n,k = readline() |> split |> parseMap
	total = 0
	for b in k+1:n
		p = div(n+1-b,b)
		total += (p+1)*(b-k)
		total += max(n-(p+1)*b-k+1,0)
	end
	println(k==0?n^2:total)
end
main()

Measured memory_bytes: 111412
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n,k;
  cin >> n >> k;
vector<long int> a(n);
  long int max,sum;
  sum=0;
  for(int i=0;i<n;++i)
  {
  cin >> a.at(i);
  a[i]=(a[i]+1);
    if(i<k) sum=sum+a.at(i);
  }
  max=sum;
  
  for(int i=0;i<n-k;++i)
  {
  sum=sum-a.at(i)+a.at(i+k);
  if(sum > max) max=sum;
  }
  if(max%2==0) cout << max/2;
  else cout << (max/2) << ".5";
return 0;}

Measured memory_bytes: 4740
#line 2 "../../library/template.hpp"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pl = pair<ll, ll>;
using vl = vector<ll>;
#define rep(i, n) for(ll i = 0; i < (ll)n; i++)
#define rep3(i, l, r) for(ll i = l; i < (ll)r; i++)
#define per(i, n) for(ll i = (ll)n-1; i >= 0; i--)
#define per3(i, l, r) for(ll i = (ll)r-1; i >= (ll)l; i--)
#define all(v) begin(v), end(v)
template<class T, class U> inline void cmax(T &a, U b) { if (a < b) a = b; }
template<class T, class U> inline void cmin(T &a, U b) { if (a > b) a = b; }
constexpr char el = '\n';
template<class T, class U> ostream &operator<<(ostream &os, const pair<T, U> &p) { os << p.first << " " << p.second; return os; }
template<class T, class U> istream &operator>>(istream &is, pair<T, U> &p) { is >> p.first >> p.second; return is; }
template<class T> ostream &operator<<(ostream &os, const vector<T> &v) { rep(i, v.size()) os << v[i] << (i+1 != v.size() ? " " : ""); return os; }
template<class T> istream &operator>>(istream &is, vector<T> &v) { for(T &i : v) is >> i; return is; }
struct IoSetup {
  IoSetup() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); cerr << fixed << setprecision(15); }
} io_setup;
#line 2 "a.cpp"

int main() {
  ll a, b;
  cin >> a >> b;
  cout << a*b << el;
}


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

typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
static const double EPS = 1e-12;
static const double PI = acos(-1.0);
static const ll MOD = 1000000007;

#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 ALL(a) (a).begin(), (a).end()
#define DEBUG(x) cout << #x << ": " << x << endl

ll calc_score(ll D, const vector<ll> &c, const vector<vector<ll>> &s, const vector<ll> &t) {
  vector<ll> last(26, -1);
  ll score = 0;
  REP(d, D) {
    ll i = t[d];
    score += s[d][i];
    last[i] = d;
    REP(j, 26) {
      score -= c[j] * (d - last[j]);
    }
  }
  return score;
}

ll area(ll D, ll d, const vector<ll> &t, ll target) {
  ll l = -1;
  for (int i = d - 1; i >= 0; i--) {
    if (t[i] == target) {
      l = i;
      break;
    }
  }
  ll r = D;
  FOR(i, d + 1, D) {
    if (t[i] == target) {
      r = i;
      break;
    }
  }
  ll x = r - d;
  ll y = d - l;
  return x * y;
}

ll calc_diff(ll D, ll pre, ll next, const vector<ll> &c, const vector<vector<ll>> &s, ll d, const vector<ll> &t) {
  ll diff = s[d][next] - s[d][pre];
  diff += c[next] * area(D, d, t, next);
  diff -= c[pre] * area(D, d, t, pre);
  return diff;
}

void solve(ll D, vector<ll> c, vector<vector<ll>> s) {
  vector<ll> t(D, 0);
  REP(d, D) {
    ll m = 0;
    ll cur = 0;
    FOR(i, 1, c.size()) {
      t[d] = i;
      ll diff = calc_diff(d + 1, 0, i, c, s, d, t);
      if (diff > m) {
        m = diff;
        cur = i;
      }
    }
    t[d] = cur;
  }

  auto start = std::chrono::system_clock::now();
  std::mt19937 mt{1};
  std::uniform_int_distribution<int> dist2(0, D - 1);
  std::uniform_int_distribution<int> dist3(0, 25);
  ll count = 0;
  while (std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now() - start).count() <
         1970) {
    count++;
    if (count % 2 == 0) {
      ll d = dist2(mt);
      ll d2 = dist2(mt);
      ll pre = t[d];
      ll next = t[d2];
      t[d] = next;
      ll diff = calc_diff(D, pre, next, c, s, d, t);
      t[d2] = pre;
      diff += calc_diff(D, next, pre, c, s, d2, t);
      if (diff > 0) {
        // cout << "swap" << endl;
      } else {
        swap(t[d], t[d2]);
      }
    } else {
      ll d = dist2(mt);
      ll pre = t[d];
      ll next = dist3(mt);
      t[d] = next;
      ll diff = calc_diff(D, pre, next, c, s, d, t);
      if (diff > 0) {
        // cout << "change" << endl;
      } else {
        t[d] = pre;
      }
    }
  }

  REP(d, D) {
    cout << t[d] + 1 << "\n";
  }
}

int main() {
  ll D;
  scanf("%lld", &D);
  vector<ll> c(26);
  for (int i = 0; i < 26; i++) {
    scanf("%lld", &c[i]);
  }
  vector<vector<ll>> s(D, vector<ll>(26));
  for (int i = 0; i < D; i++) {
    for (int j = 0; j < 26; j++) {
      scanf("%lld", &s[i][j]);
    }
  }
  solve(D, move(c), move(s));
  return 0;
}


Measured memory_bytes: 3772
#include <iostream>
#include <string>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cctype>
#include <map>
#include <vector>

using namespace std;

int BubSort(int x[], int n)
{
	int i, j, temp;

	for (i = 0; i < n - 1; i++) {
		for (j = n - 1; j > i; j--) {
			if (x[j - 1] > x[j]) {  /* 前の要素の方が大きかったら */
				temp = x[j];        /* 交換する */
				x[j] = x[j - 1];
				x[j - 1] = temp;
			}
		}
	}
	return 0;
}

int main()
{
	int n = 0;
	int a[4800];
	cin >> n;
	for (int i = 0; i < n; i++)
	{
		cin >> a[i];
	}
	int color[8] = { 0 };
	int over = 0;
	for (int j =0 ; j < n; j++)
	{
		if (1 <= a[j] && a[j] <= 399)color[0] = 1;
		if (400 <= a[j] && a[j] <= 799)color[1] = 1;
		if (800 <= a[j] && a[j] <= 1199)color[2] = 1;
		if (1200 <= a[j] && a[j] <= 1599)color[3] = 1;
		if (1600 <= a[j] && a[j] <= 1999)color[4] = 1;
		if (2000 <= a[j] && a[j] <= 2399)color[5] = 1;
		if (2400 <= a[j] && a[j] <= 2799)color[6] = 1;
		if (2800 <= a[j] && a[j] <= 3199)color[7] = 1;
		if (3200 <= a[j])over++;
	}
	//min
	int min = 0;
	for (int k = 0; k < 8; k++)
	{
		min += color[k];
	}
	if (min == 0)min = 1;
	
	//max
	int max = 0;
	for (int l = 0; l < 8; l++)
	{
		max += color[l];
	}
	max += over;
	cout << min << " " << max << endl;;

	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
const int inf=1e9+7;
const ll mod=1e9+7;
const ll big=1e18;

int DP[505][505];

int main() {
    int N, M, Q;
    cin>>N>>M>>Q;
    int L, R;
    for(int i=0;i<M;++i){
        cin>>L>>R;
        DP[L][R]++;
    }
    for(int i=1;i<=N;++i){
        for(int j=1;j<=N;++j){
            DP[i][j] += DP[i-1][j] + DP[i][j-1] - DP[i-1][j-1];
        }
    }
    int p, q;
    int ans[Q];
    for(int i=0;i<Q;++i){
        cin>>p>>q;
        ans[i] = DP[q][q] - DP[q][p-1] - DP[p-1][q] + DP[p-1][p-1];
    }
    for(int i=0;i<Q;++i){
        cout<<ans[i]<<endl;
    }
}


Measured memory_bytes: 2304
#include <iostream>

using namespace std;

long long solve(long long H, long long W){
    if(min(H, W) == 1) return 1;
    return H*W/2 + ((H%2 == 1 && W%2 == 1) ? 1 : 0);
}

int main(){
    long long H, W;
    while(cin >> H >> W){
        cout << solve(H, W) << endl;
    }
}

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

using namespace std;

/*******  All Required define Pre-Processors and typedef Constants *******/
#define SCD(t) scanf("%d", &t)
#define SCLD(t) scanf("%ld", &t)
#define SCLLD(t) scanf("%lld", &t)
#define SCC(t) scanf("%c", &t)
#define SCS(t) scanf("%s", t)
#define SCF(t) scanf("%f", &t)
#define SCLF(t) scanf("%lf", &t)
#define MEM(a, b) memset(a, (b), sizeof(a))
#define FOR(i, j, k, in) for (int i = j; i < k; i += in)
#define RFOR(i, j, k, in) for (int i = j; i >= k; i -= in)
#define REP(i, j) FOR(i, 0, j, 1)
#define RREP(i, j) RFOR(i, j, 0, 1)
#define all(cont) cont.begin(), cont.end()
#define rall(cont) cont.end(), cont.begin()
#define FOREACH(it, l) for (auto it = l.begin(); it != l.end(); it++)
#define IN(A, B, C) assert(B <= A && A <= C)
#define MP make_pair
#define PB push_back
#define INF (int)1e9
#define EPS 1e-9
#define PI 3.1415926535897932384626433832795
#define MOD 1000000007
const double pi = acos(-1.0);
typedef pair<int, int> PII;
typedef vector<PII> VPII;
typedef vector<VPII> VVPII;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef vector<VS> VVS;
typedef map<int, int> MII;
typedef unordered_map<int, int> UMII;
typedef set<int> SI;
typedef unordered_set<int> USI;
typedef multiset<int> MSI;
typedef unordered_multiset<int> UMSI;
typedef long long ll;
typedef unsigned long long ull;

/****** Template of some basic operations *****/
template <typename T, typename U>
inline void amin(T &x, U y)
{
	if (y < x)
		x = y;
}
template <typename T, typename U>
inline void amax(T &x, U y)
{
	if (x < y)
		x = y;
}
/**********************************************/

/******* Debugging Class Template *******/
struct dummy_struct
{
	static bool a_very_long_variable_name_that_i_wont_happen_to_use_it_again;

	static void debug(string seperator)
	{
		cerr << endl;
		a_very_long_variable_name_that_i_wont_happen_to_use_it_again = true;
	}

	template <typename T, typename... Args>
	static void debug(string seperator, T &&top, Args &&... args)
	{
		if (a_very_long_variable_name_that_i_wont_happen_to_use_it_again)
		{
			a_very_long_variable_name_that_i_wont_happen_to_use_it_again = false;
		}
		else
		{
			cerr << seperator;
		}
		cerr << top;
		debug(seperator, args...);
	}
};
bool dummy_struct::a_very_long_variable_name_that_i_wont_happen_to_use_it_again = true;
template<typename... Args>
void debug(Args&&... args)
{
	dummy_struct::debug(forward<Args>(args)...);
}


int main()
{
    int l, r, d; cin >> l >> r >> d;
    int res=0;
    for (int i = l; i <= r; ++i)
    {
        if (i % d == 0)
            ++res;
    }
    cout << res << endl;
}

Measured memory_bytes: 3632
package main

import "fmt"

func main() {
	var s int
	fmt.Scan(&s)
	h := s / (60 * 60)
	hA := s % (60 * 60)
	m := hA / 60
	ss := hA % 60

	fmt.Printf("%d:%d:%d\n", h, m, ss)
}



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

using ll = long long;
#define ALL(c) (c).begin(), (c).end()
const int MOD = 1000000007;

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

    if (a <= c) {
        if (b <= c) {
            cout << 0 << endl;
        } else {
            cout << min(b, d) - c << endl;
        }
    } else {
        if (a >= d) {
            cout << 0 << endl;
        } else {
            cout << min(b, d) - a << endl;
        }
    }
}


Measured memory_bytes: 256
X = int(input())
if X>=0 and X<=10**9:
    a, b = divmod(X, 500)
    if X >= 500:
        c = int(b/5)
        d = int(a*1000) + c*5
        print(d)
    elif X >= 5 and X <500:
        c = int(X/5)*5
        print(c)
    else:
        print(0)

Measured memory_bytes: 3060
# -*- coding: utf-8 -*-
import math,string,itertools,fractions,heapq,collections,re,array,bisect

def s():
    return raw_input().strip()
def n():
    return int(raw_input())
def d():
    return float(raw_input())

def ls():
    return raw_input().strip().split()
def ln():
    return map(int, raw_input().strip().split())
def ld():
    return map(float, raw_input().strip().split())

def fs():
    return [raw_input().strip() for i in xrange(input())]
def fn():
    return [int(raw_input().strip()) for i in xrange(input())]
def fd():
    return [float(raw_input().strip()) for i in xrange(input())]

EPS = 1e-9

#http://www.deqnotes.net/acmicpc/2d_geometry/lines
def dot(a, b):
    return a.real * b.real + a.imag * b.imag

def cross(a, b):
    return a.real * b.imag - a.imag * b.real

def distance(a, b, c):
    if dot(b-a, c-a) <= EPS:
        return abs(c-a)
    if dot(a-b, c-b) <= EPS:
        return abs(c-b)
    return abs(cross(b-a, c-a)/(b-a))

N, A, B = ln()
S = s()

AB = A + B
d = 0
f = 0
for i in S:
    if i == 'a' and d < AB:
        d += 1
        print 'Yes'
    elif i == 'b':
        f += 1
        if d < AB and f <= B:
            d += 1
            print 'Yes'
        else:
            print 'No'
    else:
        print 'No'

Measured memory_bytes: 32488
#include <bits/stdc++.h>
using namespace std;
#define Rep(i,n) for(int i=0;i<(int)(n);i++)
#define For(i,n1,n2) for(int i=(int)(n1);i<(int)(n2);i++)
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define RREP(i,n) for(ll i=((ll)(n)-1);i>=0;i--)
#define FOR(i,n1,n2) for(ll i=(ll)(n1);i<(ll)(n2);i++)
#define RFOR(i,n1,n2) for(ll i=((ll)(n1)-1);i>=(ll)(n2);i--)
#define all(a)  (a).begin(),(a).end()
#define SORT(a) sort((a).begin(),(a).end())
#define oorret 0
#define oor(x) [&](){try{x;} catch(const out_of_range& oor){return oorret;} return x;}()
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> P;
template<typename T1, typename T2> inline bool chmin(T1& a, T2 b) { if (a > b) { a = b; return 1; }return 0; }
template<typename T1, typename T2> inline bool chmax(T1& a, T2 b) { if (a < b) { a = b; return 1; }return 0; }
template<class Type>struct is_vector : std::false_type {};
template<class ValueType, class Alloc>struct is_vector<std::vector<ValueType, Alloc>> : std::true_type {};
template <typename T> inline ostream& operator << (ostream& out, const vector<T>& v) {
	if (v.empty())return out;
	constexpr bool is_vector_v = is_vector<T>::value;
	if (is_vector_v)for (auto itr = v.begin(); itr != v.end();)out << (*itr), out << ((++itr != v.end()) ? "\n" : "");
	else for (auto itr = v.begin(); itr != v.end();)out << (*itr), out << ((++itr != v.end()) ? " " : "");
	return out;
}
inline void put() {}
template<class T> inline void put(const T& first) { std::cout << first; printf("\n"); }
template<class T, class... N> inline void put(const T& first, const N& ... rest) { std::cout << first; printf(" "); put(rest...); }
inline void putn() {}
template<class T, class... N> inline void putn(const T& first, const N& ... rest) { std::cout << first; printf("\n"); putn(rest...); }

int main() {
	int a,b;
	cin >> a >> b;
	put(max({ a + b,a - b,a * b }));
	return 0;
}

Measured memory_bytes: 256
'use strict'

function main(s) {
  s = s.split('\n')[1].split(' ').map(n => Number(n));

  const points = [0, ...s, 0];
  const diff   = [];
  const answer = [];

  points.forEach((p, i, self) => {
    if (i < self.length - 1) diff.push(self[i + 1] - self[i]);
  });

  const sum = diff.map(n => Math.abs(n)).reduce((a, b) => a + b);

  for (let i = 1; i < points.length - 1; i++) {

    // 該当の地点(b)を飛ばした場合の移動距離(a to c)
    const skipped = Math.abs(points[i - 1] - points[i + 1]);

    // 飛ばす前の移動距離((a to b) + (b to c))
    const stepped = Math.abs(points[i - 1] - points[i]) + Math.abs(points[i] - points[i + 1]);

    // 変更される移動距離((a to c) - ((a to b) + (b to c)))
    const changed = skipped - stepped;

    answer.push(sum + changed);
  }

  console.log(answer.join('\n'));
}

main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 39376
a, b, k = map(int, input().split())
ans = []
for i in range(a, min(a+k, b+1)):
    ans.append(i)
for i in range(b, max(b-k, a-1), -1):
    ans.append(i)
ans = list(set(ans))
ans.sort()
for i in ans:
    print(i)

Measured memory_bytes: 3064
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.StringTokenizer;

public class Main {

	public static void main(String[] args) {
		FastScanner fs = new FastScanner();
		int n=fs.nextInt();
		int l[]=new int[n];
		for(int i=0;i<n;i++)
		{
			l[i]=fs.nextInt();                       // 4 5 6 2 7 3 
		}
		
		int c=0;
		Arrays.sort(l);
		for(int i=0;i<n-2;i++)
		{
			for(int j=i+1;j<n-1;j++)
			{
				for(int k=j+1;k<n;k++)
				{
					if(l[i]+l[j]>l[k]  && l[i]!=l[j] && l[j]!=l[k] && l[i]!=l[k])
					{
						c++;
						
					}
				}
			}
		}
		System.out.println(c);
		
		
	}	
	
	
	
	
	
	static class FastScanner
    { 
        BufferedReader br; 
        StringTokenizer st; 
  
        public FastScanner() 
        { 
            br = new BufferedReader(new
                     InputStreamReader(System.in)); 
        } 
  
        String next() 
        { 
            while (st == null || !st.hasMoreElements()) 
            { 
                try
                { 
                    st = new StringTokenizer(br.readLine()); 
                } 
                catch (IOException  e) 
                { 
                    e.printStackTrace(); 
                } 
            } 
            return st.nextToken(); 
        } 
  
        int nextInt() 
        { 
            return Integer.parseInt(next()); 
        } 
  
        long nextLong() 
        { 
            return Long.parseLong(next()); 
        } 
  
        double nextDouble() 
        { 
            return Double.parseDouble(next()); 
        } 
  
        String nextLine() 
        { 
            String str = ""; 
            try
            { 
                str = br.readLine(); 
            } 
            catch (IOException e) 
            { 
                e.printStackTrace(); 
            } 
            return str; 
        } 
    }
	
	

}


Measured memory_bytes: 33112
#include<bits/stdc++.h>
#define P push
typedef long long ll;
using namespace std;
int main()
{
   queue<ll> lunlun; int k, j; ll x;
   cin>>k;
   for(j = 1; j <= 9; ++j) {lunlun.P(j); if(j == k) {cout<<lunlun.back(); return 0;}}; j--;
   while(1)
   {
       x = lunlun.front();
       if(x%10 != 0) {lunlun.P(10*x + x%10 - 1); j++; if(j == k) break;}
       lunlun.P(10*x + x%10); j++; if(j == k) break;
       if(x%10 != 9) {lunlun.P(10*x + x%10 + 1); j++; if(j == k) break;}
       lunlun.pop();
   }
   cout<<lunlun.back();
   return 0;
}


Measured memory_bytes: 4096
W, H, N = [ int(x) for x in input().split() ]
xyas = [ [ int(x) for x in input().split() ] for _ in range(N) ]

area = [ [ 0 for _ in range(W) ] for _ in range(H) ]
for xya in xyas:
    x, y, a = xya
    if a == 1:
        for i in range(x):
            for j in range(H):
                area[j][i] = 1
    elif a == 2:
        for i in range(x, W):
            for j in range(H):
                area[j][i] = 1
    elif a == 3:
        for i in range(W):
            for j in range(y):
                area[j][i] = 1
    else:
        for i in range(W):
            for j in range(y, H):
                area[j][i] = 1
ans = 0
for s in area:
    for t in s:
        if t == 0:
            ans += 1

print(ans)



Measured memory_bytes: 3188
// ABC 158-A
// 2020.3.7 bal4u

#include <stdio.h>

int main()
{
	int i, A, B;
	char S[5];

	A = B = 0;
	scanf("%s", S);
	for (i = 0; i < 3; ++i) {
		if (S[i] == 'A') A++;
		else B++;
	}
	puts((A && B)? "Yes": "No");
	return 0;
}


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


int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n,k;
    cin>>n>>k;
    int r,s,p;
    cin>>r>>s>>p;
    string str;
    cin>>str;
    vector<char> dp(n);
    ll ans=0;
    for(int i=0;i<n;++i)
    {
    	if(str[i]=='r')
    	{
    		if(i-k>=0&&str[i-k]==str[i])
    		{
    			if(dp[i-k]=='r')
    			{
    				ans+=p;
    				dp[i]='p';
    			}
    			else
    			{
    				dp[i]='r';
    			}
    			
    		}
    		else
    		{
    			ans+=p;
    			dp[i]='p';
    		}

    	}
    	if(str[i]=='p')
    	{
    		if(i-k>=0&&str[i-k]==str[i])
    		{
    			if(dp[i-k]=='p')
    			{
    				ans+=s;
    				dp[i]='s';
    			}
    			else
    			{
    				dp[i]='p';
    			}
    			
    		}
    		else
    		{
    			ans+=s;
    			dp[i]='s';
    		}

    	}
    	if(str[i]=='s')
    	{
    		if(i-k>=0&&str[i-k]==str[i])
    		{
    			if(dp[i-k]=='s')
    			{
    				ans+=r;
    				dp[i]='r';
    			}
    			else
    			{
    				dp[i]='s';
    			}
    			
    		}
    		else
    		{
    			ans+=r;
    			dp[i]='r';
    		}

    	}
    }
    cout<<ans<<endl;


}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);++i)
int main(){
  int x;
  vector<int> v(3);
  rep(i,3) cin>>v[i];
  cin>>x;
  sort(v.begin(),v.end());
  rep(i,x) v[2]*=2;
  cout<<v[0]+v[1]+v[2]<<endl;
}


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

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

  long long total=0; 

  for  (int i=0;i<N;i++){
      total=total+a[i]-1;
  }

  cout <<total<<endl;

  return 0;
}


Measured memory_bytes: 256
<?php
$s = trim(fgets(STDIN));

// とりあえず60個用意
const REF_LEN = 60;
const REF_0 = '010101010101010101010101010101010101010101010101010101010101';
const REF_1 = '101010101010101010101010101010101010101010101010101010101010';

$count0 = 0;
$count1 = 0;

$len = strlen($s);
$pos = 0;

while ($len > $pos) {
    $sub = substr($s, $pos, REF_LEN);
    $binSub = bindec($sub);
    $l = strlen($sub);
    $pos = $pos + $l;

    // 比較用の文字列を取得
    if ($l < REF_LEN) {
        $bin0 = bindec(substr(REF_0, 0, $l));
        $bin1 = bindec(substr(REF_1, 0, $l));
    } else {
        $bin0 = bindec(REF_0);
        $bin1 = bindec(REF_1);
    }

    // バイナリで比較
    $xor0 = decbin($binSub ^ $bin0);
    $xor1 = decbin($binSub ^ $bin1);

    $count0 = $count0 + substr_count($xor0, '1');
    $count1 = $count1 + substr_count($xor1, '1');
}

printf("%d\n", min([$count0, $count1]));


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

long long nCr(int n, int r) {
    long long ans = 1;
    for (int i = n; i > n - r; i--) ans *= i;
    for (int i = r; i >= 1; i--) ans /= i;
    return ans;
}

int main() {
    int n, m, a[100000];
    cin >> n >> m;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        a[i] %= m;
    }

    map<int, int> rest_num;
    rest_num[0] = 1;
    int bi = 0;
    for (int i = 0; i < n; i++) {
        bi = (bi + a[i]) % m;
        if (rest_num.find(bi) == rest_num.end()) {
            rest_num[bi] = 1;
        } else {
            rest_num[bi] = rest_num[bi] + 1;
        }
    }

    long long ans = 0;
    for (auto table_i : rest_num) {
        int rest_num_i = table_i.second;
        if (rest_num_i >= 2) ans += nCr(rest_num_i, 2);
    }

    cout << ans << endl;
}

Measured memory_bytes: 3584
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;
const int MOD = (int)(1e9+7);
const int INF = (int)(1e9+1e7);
const ll INFL = (ll)(1e17);
const double EPS = 1e-8;
using namespace std;
int main()
{
  string s,t;
  cin >> s >> t;
  cout << t << s << endl;
}

Measured memory_bytes: 256
#include<queue>
#include<stack>
#include<map>
#include<set>
#include<cstdio>
#include<vector>
#include<iostream>
#include<string>
#include<algorithm> 
using namespace std;
int main(){
	int a,b,c,k,x,y,z;
	cin>>a>>b>>c>>k;
	if(a>b && a>c){
		for(int i=1;i<=k;i++){
			a*=2;
		}
	}else{
		if(b>c && b>a){
			for(int i=1;i<=k;i++){
				b*=2;
			}
		}else{
			for(int i=1;i<=k;i++){
					c*=2;
			}
		}
	}
	cout<<a+b+c;
	return 0;
}

Measured memory_bytes: 256