akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <bitset>
#include <cassert>
#include <deque>
#include <fstream>
#include <iostream>
#include <map>
#include <math.h>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stdio.h>
#include <string>
#include <vector>

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define POW(n) ((n) * (n))
#define ALL(a) (a).begin(), (a).end()

using namespace std;

namespace Dump {
#define dump(...) Dump::print(#__VA_ARGS__, __VA_ARGS__)
static std::vector<string> dumpKey;
static string dumpKeyBuf;

void print() { cerr << endl; }
template <class Head, class... Tail> void print(Head &&head, Tail &&... tail) {
  if (dumpKey.empty()) {
    dumpKeyBuf = head;
    dumpKeyBuf.erase(std::remove_if(dumpKeyBuf.begin(), dumpKeyBuf.end(),
                                    [](char c) { return c == ' '; }),
                     dumpKeyBuf.end());

    std::istringstream stream(dumpKeyBuf);
    string field;
    while (std::getline(stream, field, ','))
      dumpKey.push_back(field);

    reverse(dumpKey.begin(), dumpKey.end());
  } else {
    cerr << dumpKey.back() << ":" << head << "  ";
    dumpKey.pop_back();
  }
  Dump::print(std::move(tail)...);
}
}

typedef long long ll;
typedef unsigned long long ull;

typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<long long> vll;
typedef vector<unsigned long long> vull;
typedef pair<int, int> pii; // p.first p.second

// ll n = to_T<ll>("114514")
template <class T> T to_T(const string &s) {
  istringstream is(s);
  T res;
  is >> res;
  return res;
}
template <class T> string to_s(const T &a) {
  ostringstream os;
  os << a;
  return os.str();
}

void solve(long long a, long long b) { cout << ((a + b + 1) / 2) << endl; }

int main() {
  ios::sync_with_stdio(false);
  long long b;
  long long a;
  cin >> a;
  cin >> b;
  solve(a, b);
  return 0;
}


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

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

Measured memory_bytes: 3088
#include <stdio.h>

const int WHITE = 0;
const int GRAY = 1;
const int BLACK = 2;
const int N = 100;
const int INF = 2000000000;

int g[N + 1][N + 1];
int d[N + 1], p[N + 1], color[N + 1];
int n;

void prim()
{
	for (int i = 1; i <= n; i++)
	{
		color[i] = WHITE;
		d[i] = INF;
		p[i] = -1;
	}
	d[1] = 0;

	while (true)
	{
		int min = INF;
		int u = -1;
		for (int i = 1; i <= n; i++)
		{
			if (color[i] != BLACK && d[i] < min)
			{
				min = d[i];
				u = i;
			}
		}
		if (u == -1)
			break;

		color[u] = BLACK;

		for (int i = 1; i <= n; i++)
		{
			if (color[i] != BLACK && g[u][i] != INF && d[i] > g[u][i])
			{
				d[i] = g[u][i];
				color[i] = GRAY;
				p[i] = u;
			}
		}
	}
	int sum = 0;
	for (int i = 1; i <= n; i++)
	{
		if (p[i] != -1)
			sum += g[p[i]][i];
	}
	printf("%d\n", sum);
}

int main()
{
	scanf("%d", &n);
	for (int i = 1; i <= n; i++)
		for (int j = 1; j <= n; j++)
		{
			scanf("%d", &g[i][j]);
			if (g[i][j] == -1)
				g[i][j] = INF;
		}
	prim();

	return 0;
}




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

int main() {
  int N;
  ll ans = 0;
  cin >> N;
  vector<ll> A(N);
  vector< bitset<100010> > B(60, bitset<100010>(0));
  ll all_a = 0;
  REP(i, N) {
    ll ain;
    cin >> A[i];
    all_a ^= A[i];
  }
  // 全部XORを取った値で、1 になったbitはどのような分け方をしても、片方は偶数、もう片方は奇数になるので、
  // そのbitは考慮しなくてOK。
  // 最終的に和を求める際に、そのbitは 0+1 か 1+0 にしかならないので、和は 1 になる。
  // つまり、この all_a そのものを足せばいい。
  // 0 になった bit は 偶数と偶数、奇数と奇数 のどちらかになる。
  // 当然、奇数＋奇数になったほうが和は大きいので、それを目指す。

  // 考慮しないbitの情報を消す
  REP(i,N) A[i] &= ~all_a;

  // 考慮しない桁の和は 1 になるので、先に足しておく
  ans = all_a;
  
  // 掃き出し法が使えるように
  //  B[0] = [ A[0].bit59, A[1].bit59,,, A[N-1].bit59, 1 ] 
  //  B[1] = [ A[0].bit58, A[1].bit58,,, A[N-1].bit58, 1 ] 
  // という2次元配列に格納
  REP(i,60) {
    REP(j,N) {
      B[59-i][j] = (A[j] >> i) & 1;
    }
    B[59-i][N] = 1;
  }
  
  // 掃き出し法
  //  ただし、できるだけ上位Bitが1になる解がいいので、上位側から優先して判定する
  //  上記で考慮しないbitにした桁は、対応する行の値が全て 0 になっている。
  //  そのため、pivotに選ばれることはないし、0 なので xor 演算の対象になることもない。
  //  なので、最後まで同じ形 (0 0 0...0 | 1) をしているはず
  vector<bool> use(60,false);
  REP(col,N) {
    int pivot = -1;
    // Pivot探す
    REP(row,60) {
      if (use[row]) continue;
      if (B[row][col] == 1) {
        pivot = row;
        break;
      }
    }
    if (pivot == -1) continue;
    
    // 見つかったpivot以外の行の、現在の列の値を 0 にしていく
    REP(row,60) {
      if ((row != pivot) && (B[row][col] == 1)) {
        B[row] ^= B[pivot];
      }
    }
    use[pivot] = true;
  }

  
  // (0 0 0 0 | 1) となっている桁は無視
  REP(row,60) {
    bool ok = false;
    if ( (B[row][N] == 0) ) ok = true;
    REP(col,N)
      if ( B[row][col] == 1 ) ok = true;
    // 2グループのどちらも 1 になるので、合計値はその桁が 2 になったものになる
    if (ok) 
      ans += (2LL << (59-row));
  }

  cout << ans << endl;
}


Measured memory_bytes: 1792
#include <iostream>
#include <cmath>
#include <vector>
#include <map>
#include <iomanip>
#include <algorithm>
#include <sstream>
#include <string>
#include <math.h>
#include <set>
#include <deque>
#include <queue>
#include <list>
using namespace std;
typedef long long ll;
const int mod = 1000000007;

int main() {
    ios::sync_with_stdio(false);
   	int a, b, x;
   	cin >> a >> b >> x;
   	if (a <= x && a + b >= x) cout << "YES";
   	else cout << "NO";
}

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

int N, K;
string s;
 
int main() {
    cin >> N >> K;
    cin >> s;
    vector<int> rows; //連続してる人数をリストアップ
    //計算しやすくするため先頭と末尾は必ず1の連続個数として扱う
    if (s[0] == '0') {
        rows.push_back(0);
    }
    int count = 0;
    char last = 'f';
    for (auto c : s) {
        if (c == last) {
            count++;
        } else if (last == 'f') {
            count = 1;
        } else {
            rows.push_back(count);
            count = 1;
        }
        last = c;
    }
    rows.push_back(count);
    if (last == '0') {
        rows.push_back(0);
    }
    int rowLen = rows.size();
    char first = s[0];    
    int left = 0;
    int right = 0;
    int maxNum = 0;
    int checkLen = min(rowLen, K * 2 + 1);
    if (rowLen <= checkLen) {
        cout << s.length() << endl;
        return 0;
    }

    int currNum = 0;
    bool useEven = (K % 2 == 0);
    while (left < rowLen) {
        if (right == rowLen || right - left >= checkLen) {
            currNum -= rows[left];
            left++;
        } else {
            currNum += rows[right];
            right++;
        }
        if ((right - left) % 2 > 0) {
            int center = (right - left) / 2 + left;
            if (useEven) {
                if ((center & 1) == 0) {
                    maxNum = max(maxNum, currNum);
                }
            } else {
                if ((center & 1) > 0) {
                    maxNum = max(maxNum, currNum);
                }
            }
        }
    }
    cout << maxNum << endl;
    return 0;
}

Measured memory_bytes: 1020
using System;
using System.Collections.Generic;

namespace AOJ.Volume0
{
    class Program0004
    {
        static void Main(string[] args)
        {
            const int N = 6;
            string input;
            Queue<double[]> queue = new Queue<double[]>();

            while ((input = Console.ReadLine()) != null)
            {
                string[] splitedInput = input.Split(' ');
                double[,] param = new double[2,3];

                for (int i = 0; i < 2; i++)
                {
                    for (int j = 0; j < 3; j++)
                    {
                        param[i, j] = double.Parse(splitedInput[i * 3 + j]);
                    }
                }

                queue.Enqueue(SolveEquation(param));
            }

            foreach (var ans in queue)
            {
                Console.WriteLine("{0:#####0.000} {1:#####0.000}", ans[0], ans[1]);
            }
        }

        static double[] SolveEquation(double[,] parameters)
        {
            double x, y;
            double a = parameters[1, 0] / parameters[0, 0];

            for (int i = 0; i < 3; i++)
            {
                parameters[1, i] -= parameters[0, i] * a;
            }

            y = parameters[1, 2] / parameters[1, 1];
            x = (parameters[0, 2] - parameters[0, 1] * y) / parameters[0, 0];

            return new[] { x, y };
        }
    }
}

Measured memory_bytes: 6200
/*Always success does not build on success,success build on failure*/
#include <bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define vec         vector<int>
#define map         map<int,int>
#define scn(t)      scanf("%d",&t)
#define lscn(t)      scanf("%lld",&t)
#define mod         1000000007
#define rep(i,a,b)  for(int i=a;i<b;i++)
#define endl        "\n"
using namespace std;
const int N=1e5+5;
int main()
{
   ll n;
   lscn(n);
   ll k=2;
   //lscn(k);
   ll arr[n];
   
   for(ll i=0;i<n;i++)
   lscn(arr[i]);
   
   ll ans[n];
   
   memset(ans,-1,sizeof(ans));
   ans[0]=0;
   for(ll i=0;i<n-1;i++)
   {
       for(ll j=1;j<=k;j++)
       {
           if(i+j<n)
          {
           if(ans[i+j]==-1)
           ans[i+j]=ans[i]+abs(arr[i]-arr[i+j]);
           else
           ans[i+j]=min(ans[i+j],ans[i]+abs(arr[i]-arr[i+j]));
          }
          else
          {
             break;
          }
       }
   }
//   for(auto it:ans)
//   cout<<it<<" ";
//   cout<<endl;
   cout<<ans[n-1]<<endl;
   return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
#include <atcoder/dsu.hpp>
using namespace std;
using namespace atcoder;

//#define int long long
using ll = long long;
using ld = long double;
using intpair = pair<int, int>;
using intmap = map<int, int>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
const int MOD = 1e9 + 7;
inline int mod (ll a, int m = MOD) { return (a % m + m) % m; }
inline bool bit (ll b, ll i) { return b & (1 << i); }
inline ll ceiv (ll a, ll b) { return (a + b - 1) / b; }
//struct Fast {Fast(){cin.tie(0);ios::sync_with_stdio(0);}} fast;

#define debug(x) cerr << #x << ": " << x << '\n'
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()

int main() {
    int n, q;
    cin >> n >> q;
    dsu uf(n);
    
    while(q--){
        int t, u, v;
        cin >> t >> u >> v;
        if(t == 0){
            uf.merge(u, v);
        }else{
            cout << uf.same(u, v) << endl;
        }
    }
}

Measured memory_bytes: 3984
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
using namespace std;
int main(int argc, const char * argv[]) {
    int count = 0;
    int N;
    cin>>N;
    vector<int> D1(N);
    vector<int> D2(N);

    for (int i = 0;i < N;i++){
        cin>>D1[i]>>D2[i];
        if (D1[i] == D2[i]){
            count += 1;
        }
        else {
            count = 0;
        }
        if (count >= 3){
            cout<<"Yes"<<endl;
            break;
        }
    }
    if (count < 3){
        cout<<"No"<<endl;
    }
   
}


Measured memory_bytes: 3624
#include <bits/stdc++.h>
     
    using namespace std;
     
    using ll = long long;
    using pii = pair<int,int>;
    using pll = pair<ll,ll>;
    using vi = vector<int>;
    using vl = vector<ll>;
     
    using _loop_int = int;
    #define REP(i,n) for(_loop_int i=0; i<(_loop_int)(n); i++)
    #define FOR(i,a,b) for(_loop_int i=(_loop_int)(a); i<(_loop_int)(b); i++)
    #define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1; i>=(_loop_int)(a); i--)
     
    #define CHMIN(a,b) (a)=min((a),(b))
    #define CHMAX(a,b) (a)=max((a),(b))
    #define ALL(v) (v).begin(),(v).end()
     
    #define DEBUG(x) cerr<<#x<<": "<<(x)<<endl
    #define DEBUG_VEC(v) cerr<<#v<<": ";REP(__i,(v).size())cerr<<((v)[__i])<<", ";cerr<<endl
     
    const ll MOD = 1000000007ll;
     
    int n;
    int s[1<<18];
     
    int main(){
        scanf("%d",&n);
        const int m = 1<<n;
        REP(i,m)scanf("%d",s+i);
        // sort(s,s+m);
        // reverse(s,s+m);
        multiset<int> S;
        REP(i,m)S.insert(-s[i]);
        vector<int> cur, nxt;
        cur.push_back(*S.begin()); S.erase(S.begin());
        REP(i,n){
            nxt = cur;
            for(int x : cur){
                auto it = S.upper_bound(x);
                if(it == S.end()){
                    puts("No");
                    return 0;
                }
                nxt.push_back(*it);
                S.erase(it);
            }
            cur = nxt;
        }
        puts("Yes");
        return 0;
    }

Measured memory_bytes: 15348
#include <stdio.h>
#include <string.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <limits.h>
#include <math.h>
#include <assert.h>
typedef int64_t ll;
typedef uint64_t ull;
int acs(const void *a, const void *b){return *(int*)a - *(int*)b;} /* 1,2,3,4.. */
int des(const void *a, const void *b){return *(int*)b - *(int*)a;} /* 8,7,6,5.. */
#define min(a,b) (a < b ? a: b)
#define max(a,b) (a > b ? a: b)

#define MAXN (3000)
#define MOD (1000000007)

typedef struct
{
    ll a;
    ll b;
} st;

int acs_st(const void *a, const void *b){return ((st*)a)->a - ((st*)b)->a;} /* 1,2,3,4.. */

st r[MAXN];
ll sc[MAXN*2];
int main(void)
{
    ll n,t;
    scanf("%ld %ld",&n,&t);

    for(int i=0;i<n;i++)
    {
        scanf("%ld %ld",&r[i].a,&r[i].b);
    }
    qsort(r,n,sizeof(st),acs_st);

    for(int i=0;i<n;i++)
    {
        for(int j=t-1+r[i].a;j>=r[i].a;j--) 
        {   
            sc[j] = max(sc[j],sc[j-r[i].a]+r[i].b);
        }
    }
    ll m = 0;
    for(int i=0;i<MAXN*2;i++) m = max(m,sc[i]);
    
    printf("%ld\n", m);
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(){
	int n,x,count;
	while(true){
		scanf("%d %d",&n,&x);
		if(n == 0 && x == 0) break;
		count = 0;
		for(int min = 1; min < x/3 && min <= n-2;min++){
			for(int middle = min+1;middle < x - (min+middle) && middle <= n-1; middle++){
				if(x-(min+middle) <= n) count++;
			}
		}
		printf("%d\n",count);
	}

}

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

#define MAX 100
#define INF (1LL<<60)


int main(){
	int v,e,from,to;
	long long graph[MAX][MAX];
	for(int i=0;i<MAX;i++){
		for(int j=0;j<MAX;j++){
			graph[i][j]=INF;
		}
		graph[i][i]=0;
	}

	cin>>v>>e;
	for(int i=0;i<e;i++){
		cin>>from>>to;
		cin>>graph[from][to];
	}

	for(int k=0;k<v;k++){
		for(int i=0;i<v;i++){
			if(graph[i][k]==INF) continue;
			for(int j=0;j<v;j++){
				if(graph[k][j]==INF)continue;
				graph[i][j]=min(graph[i][j], graph[i][k]+graph[k][j]);
			}
		}
	}

	bool negative=false;
	for(int i=0;i<v;i++){
		if(graph[i][i]<0){
			negative=true;
			break;
		}
	}



	if(negative){
		cout<<"NEGATIVE CYCLE"<<endl;
	}else{
		for(int i=0;i<v;i++){
			for(int j=0;j<v;j++){
				if(j) cout<<" ";

				if(graph[i][j]==INF) cout<<"INF";
				else cout<<graph[i][j];
			}
			cout<<endl;
		}
	}



	return 0;
}



Measured memory_bytes: 3192
#include <bits/stdc++.h>
#define y1 y1_

typedef long long ll;
const int N = 2000054, mod = 1000000007;

int x1, x2, x3, x4, x5, x6;
int y1, y2, y3, y4, y5, y6;
int fact[N], finv[N];

ll PowerMod(ll a, int n, ll c = 1) {for (; n; n >>= 1, a = a * a % mod) if (n & 1) c = c * a % mod; return c;}

void init() {
	int i;
	for (*fact = i = 1; i < N; ++i) fact[i] = (ll)fact[i - 1] * i % mod;
	--i, finv[i] = PowerMod(fact[i], mod - 2);
	for (; i; --i) finv[i - 1] = (ll)finv[i] * i % mod;
}

inline ll Ct(int a, int b) {return (ll)fact[a + b] * finv[a] % mod * finv[b] % mod;}

int solve(int xL, int yL, int xR, int yR) {
	int x, y, ret = 0;
	for (x = x3; x <= x4; ++x)
		ret = (ret - Ct(x - xL, y3 - yL - 1) * Ct(xR - x, yR - y3) % mod * (x + y3)) % mod,
		ret = (ret + Ct(x - xL, y4 - yL) * Ct(xR - x, yR - y4 - 1) % mod * (x + y4 + 1)) % mod;
	for (y = y3; y <= y4; ++y)
		ret = (ret - Ct(x3 - xL - 1, y - yL) * Ct(xR - x3, yR - y) % mod * (x3 + y)) % mod,
		ret = (ret + Ct(x4 - xL, y - yL) * Ct(xR - x4 - 1, yR - y) % mod * (x4 + y + 1)) % mod;
	return ret + (ret >> 31 & mod);
}

int main() {
	ll ans = 0; init();
	scanf("%d%d%d%d%d%d%d%d%d%d%d%d", &x1, &x2, &x3, &x4, &x5, &x6, &y1, &y2, &y3, &y4, &y5, &y6);
	ans = (ll)solve(x1 - 1, y1 - 1, x5,     y5    )
			- solve(x1 - 1, y1 - 1, x5,     y6 + 1)
			- solve(x1 - 1, y1 - 1, x6 + 1, y5    )
			+ solve(x1 - 1, y1 - 1, x6 + 1, y6 + 1)
			- solve(x1 - 1, y2,     x5,     y5    )
			+ solve(x1 - 1, y2,     x5,     y6 + 1)
			+ solve(x1 - 1, y2,     x6 + 1, y5    )
			- solve(x1 - 1, y2,     x6 + 1, y6 + 1)
			- solve(x2,     y1 - 1, x5,     y5    )
			+ solve(x2,     y1 - 1, x5,     y6 + 1)
			+ solve(x2,     y1 - 1, x6 + 1, y5    )
			- solve(x2,     y1 - 1, x6 + 1, y6 + 1)
			+ solve(x2,     y2,     x5,     y5    )
			- solve(x2,     y2,     x5,     y6 + 1)
			- solve(x2,     y2,     x6 + 1, y5    )
			+ solve(x2,     y2,     x6 + 1, y6 + 1);
	ans %= mod, ans += ans >> 63 & mod;
	printf("%d\n", (int)ans);
	return 0;
}

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

int main(){
  int N;
  cin >> N;
  double ans;
  if(N%2==0) ans=0.5;
  else ans=(double(N)+1)/2/(double(N));
  std::cout << std::setprecision(18) << ans <<endl;
}

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

#define int long long int
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() )

using namespace std;

typedef pair<int, int> P;

const int INF = 1e15;
const int MOD = 1e9+7;

template <typename T>
using vector2 = vector<vector<T>>;
template <typename T>
vector2<T> initVec2(size_t n0, size_t n1, T e = T()){
    return vector2<T>(n0, vector<T>(n1, e));
}

template <typename T>
using vector3 = vector<vector<vector<T>>>;
template <typename T>
vector3<T> initVec3(size_t n0, size_t n1, size_t n2, T e = T()){
    return vector3<T>(n0, vector2<T>(n1, vector<T>(n2, e)));
}

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

    int n;
    cin >> n;
    vector<P> b(n - 1);
    rep(i, n - 1){
        int x;
        cin >> x;
        b[i] = {x, i};
    }
    sort(ALL(b), greater<P>());

    vector<int> a(n);
    rep(i, n - 1){
        int x = b[i].first;
        int id = b[i].second;
        a[id] = a[id+1] = x;
    }
    int ans = 0;
    rep(i, n) ans += a[i];
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 384
Program Catcoder4;
//uses crt;
var l,r,i,j,min :longint;
//--------------------------
begin
readln(l,r);
min:=2019;
if r-l+1 >=2019 then Writeln(0) else begin
                                     for i:=l to r-1 do
                                     for j:=i+1 to r do begin
                                                        if ((i mod 2019)*(j mod 2019)) mod 2019 < min then min :=((i mod 2019)*(j mod 2019)) mod 2019;
                                                        end;
                                     Writeln(min);
                                     end;
//readln;
end.



Measured memory_bytes: 128
#include<iostream>
#include<queue>
#include <math.h>
using namespace std;

typedef long long ll;

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

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin >> n ;
    bool ans = false;
    REP(i, 10){
        REP(j, 10){
            if(i*j == n) ans = true;
        }
    }

    if(ans) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
import sys
import copy
import collections
from bisect import bisect_left
from bisect import bisect_right
from collections import defaultdict
from heapq import heappop, heappush
import numpy as np

def main():
	N = int(input())
	
	if N == 0:
		print(0)
		sys.exit()
	
	ans = []
	if N % 2 == 0:
		ans.append("0")
	else:
		ans.append("1")
		N -= 1
		
	i = 1
	#for v in range(5):
	while True:
		tmp = (-2)**i
		i += 1
		
		if (N / tmp) % 2 == 0:
			ans.append("0")
		else:
			ans.append("1")
			N = N - tmp
		
		#print(N)
		if N == 0:
			break
	
	s = ""	
	for i in ans:
		s += i
	print(s[::-1])
		
	
if __name__ == "__main__":
	main()


Measured memory_bytes: 13812
#include <bits/stdc++.h>
#define MAX 100005
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
using namespace std;

typedef long long ll;

int lg(int n)
{
    int cnt = 0;
    while(n){
        n /= 10;
        cnt++;
    }

    return cnt;
}

int main()
{
    ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int n;

    cin>>n;

    int ans = 0;
    for(int i = 1; i <= n; i++){
        if(lg(i) % 2){
            ans++;
        }
    }

    cout<<ans<<endl;

    return 0;
}



Measured memory_bytes: 256
import fractions
import math
from functools import reduce
def getinputdata():

    # 配列初期化
    array_result = []
    
    data = input()
    
    array_result.append(data.split(" "))

    flg = 1

    try:

        while flg:

            data = input()

            if(data != ""):
                
                array_result.append(data.split(" "))

            else:

                flg = 0
    finally:

        return array_result

def lcm(*args):
    return reduce(lambda a,b: a * b // fractions.gcd(a, b), args)

arr_data = getinputdata()

n = int(arr_data[0][0])

arr=[int(arr_data[i][0]) for i in range(1,1+n)]

print(lcm(*tuple(arr)))



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

int main() {
	string S;
	string T;

	cin >> S >> T;

	int i = 0;
	string ans = "Yes";

	while (S[i] != '\0') {
		if (S[i] != T[i]) {
			ans = "No";
			break;
		}
		i++;
	}
	cout << ans;
	return 0;
}

Measured memory_bytes: 3624
#include<iostream>
#include<cstdio>
using namespace std;
const int N=105;
int n,m,K;
int P;
int C[N][N];
int Pw[N][N*N];
int add(const int &x,const int &y)
{
	int t=x+y;
	if(t>=P) t-=P;
	return t;
}
int sub(const int &x,const int &y)
{
	int t=x-y;
	if(t<=0) t+=P;
	return t;
}
void init(int n=100)
{
	for(int i=0;i<=n;i++)
	{
		C[i][0]=1;
		for(int j=1;j<=i;j++)
			C[i][j]=add(C[i-1][j],C[i-1][j-1]);
	}
	for(int i=0;i<=n;i++)
	{
		Pw[i][0]=1;
		for(int j=1;j<=n*n;j++)
			Pw[i][j]=1LL*Pw[i][j-1]*i%P;
	}
	return;
}
int f[2][N][N];
int cur;
int main()
{
	scanf("%d%d%d",&n,&m,&K);
	scanf("%d",&P);
	init();
	int cur=0;
	f[0][0][0]=1;
	for(int k=1;k<=K;k++)
	{
		cur^=1;
		for(int i=0;i<=n;i++)
			for(int j=0;j<=m;j++)
				if(f[cur^1][i][j])
				{
					int pw=1LL*Pw[k][m-j]*Pw[K-k+1][j]%P,fac=f[cur^1][i][j];
					for(int a=0;i+a<=n;a++)
					{
						int res=1LL*C[n-i][a]*fac%P;
						f[cur][i+a][j]=add(f[cur][i+a][j],res);
						fac=1LL*fac*pw%P;
					}
				}
		for(int i=0;i<=n;i++)
			for(int j=0;j<=m;j++)
				f[cur^1][i][j]=0;
		cur^=1;
		for(int i=0;i<=n;i++)
			for(int j=0;j<=m;j++)
				if(f[cur^1][i][j])
				{
					int pw=1LL*Pw[k][n-i]*Pw[K-k+1][i]%P,fac=f[cur^1][i][j];
					for(int b=0;j+b<=m;b++)
					{
						int res=1LL*C[m-j][b]*fac%P;
						f[cur][i][j+b]=add(f[cur][i][j+b],res);
						fac=1LL*fac*pw%P;
					}
				}
		for(int i=0;i<=n;i++)
			for(int j=0;j<=m;j++)
				f[cur^1][i][j]=0;
		cur^=1;
		for(int i=0;i<=n;i++)
			for(int j=0;j<=m;j++)
				if(f[cur^1][i][j])
				{
					int pw=1LL*Pw[k][m-j]*Pw[K-k][j]%P,fac=f[cur^1][i][j];
					for(int c=0;i+c<=n;c++)
					{
						int res=1LL*C[n-i][c]*fac%P;
						if(c&1) f[cur][i+c][j]=sub(f[cur][i+c][j],res);
						else f[cur][i+c][j]=add(f[cur][i+c][j],res);
						fac=1LL*fac*pw%P;
					}
				}
		for(int i=0;i<=n;i++)
			for(int j=0;j<=m;j++)
				f[cur^1][i][j]=0;
		cur^=1;
		for(int i=0;i<=n;i++)
			for(int j=0;j<=m;j++)
				if(f[cur^1][i][j])
				{
					int pw=1LL*Pw[k][n-i]*Pw[K-k][i]%P,fac=f[cur^1][i][j];
					for(int d=0;j+d<=m;d++)
					{
						int res=1LL*C[m-j][d]*fac%P;
						if(d&1) f[cur][i][j+d]=sub(f[cur][i][j+d],res);
						else f[cur][i][j+d]=add(f[cur][i][j+d],res);
						fac=1LL*fac*pw%P;
					}
				}
		for(int i=0;i<=n;i++)
			for(int j=0;j<=m;j++)
				f[cur^1][i][j]=0;
	}
	printf("%d",f[cur][n][m]);
	return 0;
}


Measured memory_bytes: 8292
#include<bits/stdc++.h>
using namespace std;
int main(){
int N;
  cin>>N;
  vector<double> V(N);
  for(int i=0;i<N;i++)
    cin>>V.at(i);
  sort(V.begin(),V.end());
  double sum=V.at(0)/pow(2,N);
  for(int i=0;i<N;i++)
    sum+=V.at(i)/pow(2,N-i);
  
  cout<<setprecision(8)<<sum<<endl;
  return 0;
}

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

int main(void) {
  int x;
  cin >> x;
  cout << (x==1?'0':'1') << endl;
  return 0;
}

Measured memory_bytes: 3624
using System;
using System.Collections.Generic;
using System.Linq;
class Program{
	const int mod=1000000007;
	static void Main(){
		int[] s=Array.ConvertAll(Console.ReadLine().Split(),int.Parse);
		int n=s[0],k=s[1];
		int[] a=Array.ConvertAll(Console.ReadLine().Split(),int.Parse);
		long[,] dp=new long[n,k+2];
		long[,] r=new long[n,k+2];
		for(int i=0;i<=a[0];i++){dp[0,k-i]=1;}
		for(int j=k;j>=0;j--){r[0,j]=dp[0,j]+r[0,j+1];}
		for(int i=1;i<n;i++){
			for(int j=k;j>=0;j--){
				dp[i,j]=r[i-1,j];
				if(a[i]+j<=k){dp[i,j]=(dp[i,j]+mod-r[i-1,a[i]+j+1])%mod;}
				r[i,j]=(dp[i,j]+r[i,j+1])%mod;
			}
		}
		Console.WriteLine("{0}",dp[n-1,0]);
	}
}

Measured memory_bytes: 169176
#include <stdio.h>
#include <stdint.h>
#include <iostream>
#include <vector>
#include <algorithm>

int main()
{
    uint32_t N;
    uint32_t i;
    std::vector<uint32_t> L;
    uint32_t sum = 0;

    scanf("%u", &N);
    for (i = 0; i < 2*N; i++) {
        uint32_t l;
        scanf("%u", &l);
        L.push_back(l);
    }
    std::sort(L.begin(), L.end());

    for (i = 0; i+1 < 2*N; i += 2) {
        uint32_t n = std::min(L[i], L[i+1]);
        sum += n;
    }

    printf("%u\n", sum);

    return 0;
}



Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include <algorithm>
#include<cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include<iostream>
#include<list>
#include<queue>
#include<set>
#include<string>
#include<utility>
#include <vector>

#define ll long long
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define FORR(i,a,b) for(int i=(a);i>=(b);--i)
#define REPR(i,n)   FORR(i,n,0)

using namespace std;


int main() {
	int D, G, p[10], c[10];
	cin >> D >> G;
	REP(i, D) {
		cin >> p[i] >> c[i];
	}

	int ans = 1e+9;
	REP(mask, (1 << D)) {
		int s = 0, rest_max = -1, num = 0;

		REP(i, D) {
			if (mask >> i & 1) {
				s += 100 * (i + 1)*p[i] + c[i];
				num += p[i];
			}
			else {
				rest_max = i;
			}
		}

		if (s < G) {
			int s1 = 100 * (rest_max + 1);
			int need = (G - s + s1 - 1) / s1;
			if (need <= p[rest_max]) {
				num += need;
			}
			else {
				continue;
			}
		}
		ans = min(ans, num);
	}

	cout << ans << endl;


	return 0;
}

Measured memory_bytes: 256
N, M = list(map(int, input().split()))
WA = [0]*N
AC = [False]*N
for _ in range(M):
    p, S = input().split()
    p = int(p)-1
    if S == 'WA':
        if AC[p] == False:
            WA[p] += 1
    else:
        AC[p] = True

ans = [0, 0]
for i in range(N):
    if AC[i] == False:
        continue
    ans[0] += 1
    ans[1] += WA[i]

print(*ans)

Measured memory_bytes: 75004
//BISMILLAHIR RAHMANIR RAHIM
                                               //BY THE NAME OF ALLAH
                                               //FAISAL AHAMMED SHAWON
#include<iostream>
#include<algorithm>
#include<cmath>
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<utility>
#include<set>
#include<map>
#include<iterator>
#include<numeric>
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define REP(i,a,b) for(int i=a;i<=b;i++)
#define SQ(a) (a)*(a)
#define pi acos(-1.0)
const int MAX=100001;
const int MOD=1e9+7;
int ara[MAX];
typedef long long ll;
typedef unsigned long long ull;
using namespace std;
void fast()
{
ios::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
}
ll gcd(ll a,ll b)
{
    if(b==0)
    return a;
    else
    gcd(b,a%b);
}
ll lcd(ll a,ll b)
{
    return (a*b)/gcd(a,b);
}

bool f(ll a,ll b)
{
    return a>b;
}
ll max_sum_subarrays(ll ara[],ll n)
{
    ll ans=0,sum=0;
    for(ll k=0;k<n;k++){
        sum=max(ara[k],sum+ara[k]);
        ans=max(ans,sum);
    }
    return ans;
}
ll num_divisors(ll n)
{
    long long cnt=0;
    for(int i=1;i*i<=n;i++)
    {
        if(n%i==0 && i*i==n)
            cnt+=1;
        if(n%i==0 && i*i!=n)
                cnt+=2;
    }
    return cnt;
}
ll comb(ll m, ll n)
{
    ll x = max(m-n,n),ans = 1,i=1;
    for(ll k=m;k>=x+1;k--){
        ans*=k;
        ans/=i;
        i++;
    }
    return ans;
}
ll binsearch(ll low,ll high,ll target)
{
    while(low<=high)
    {
        ll mid=(low+high)/2;
        if(ara[mid]>target)
            high=mid-1;
        else if(ara[mid]<target)
            low=mid+1;
        else return mid;
    }
    return -1;
}
void solve()
{
    int a,b,c,f=0,s=0;
    cin>>a>>b>>c;
    vector<int>v;
    v.PB(a);
    v.PB(b);
    v.PB(c);
    for(int i=0;i<3;i++)
    {
        if(v[i]==5)
            f++;
        else if(v[i]==7)
            s++;
    }
    if(f==2 && s==1)
        cout<<"YES"<<endl;
    else
        cout<<"NO"<<endl;
}
int main()
{
    fast();
    solve();
    return 0;
}


Measured memory_bytes: 3604
#include<bits/stdc++.h>
using namespace std;
const int inf=1e9,mod=1e9+7;
typedef long long ll;
int read() {
	int x=0,f=1;
	char c=getchar();
	while(c<'0'||c>'9') f=(c=='-')?-1:1,c=getchar();
	while(c>='0'&&c<='9') x=x*10+c-'0',c=getchar();
	return x*f;
}
int a[2000001],b[2000001],sum[2000001];
int calc(int x) {
	if(sum[x]%2==0) return a[x];
	else return a[x]^1;
}
main() {
	int n=read(),ans=0;
	for(int i=1; i<=n; i++)
		a[i]=read();
	for(int i=n; i>=1; i--) {
		b[i]=calc(i);
		ans+=b[i];
		if(b[i])
			for(int j=1; j*j<=i; j++) {
				if(i%j==0) {
					sum[j]++;
					if(i/j!=j)
						sum[i/j]++;
				}
			}
	}
	cout<<ans<<endl;
	for(int i=1; i<=n; i++)
		if(b[i])
			cout<<i<<" ";
}

Measured memory_bytes: 9856
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <cstdio>
#include <cstring>
using namespace std;

int main()
{
    int n, m;
    cin >> n >> m;

    int inf = 0x10000000;
    vector<vector<int>> g(n, vector<int>(n, inf));
    for (int i = 0; i < m; i++) {
        int a, b, c;
        cin >> a >> b >> c;
        a--, b--;
        g[a][b] = c;
        g[b][a] = c;
    }
    vector<vector<int>> og = g;

    for (int k = 0; k < n; k++) {
        for (int i = 0; i < n; i++) {
            for (int j = 0; j < n; j++) {
                g[i][j] = min(g[i][j], g[i][k] + g[k][j]);
            }
        }
    }

    int ans = 0;
    for (int i = 0; i < n; i++) {
        for (int j = i + 1; j < n; j++) {
            if (og[i][j] != inf && og[i][j] > g[i][j]) {
                ans++;
            }
        }
    }

    cout << ans << endl;

    return 0;
}


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

using namespace std;

using ll = long long;

const double eps = 1e-10;
const int MOD = 1000000007;
const int INF = 1000000000;
const ll LINF = 1ll<<50;

template<typename T>
void printv(const vector<T>& s) {
  for(int i=0;i<(int)(s.size());++i) {
    cout << s[i];
    if(i == (int)(s.size())-1) cout << endl;
    else cout << " ";
  }
}

int n;
int dp[1<<16];

int dfs(int s, const vector<vector<int>> &a) {
  if(dp[s] > -1) return dp[s];

  if(s == (1<<n) - 1) {
    return 0;
  }

  int ret = INF;

  for(int i=0;i<n;++i) {
    if(!(s & (1<<i))) {
      int ind = 0;
      int val = a[i][0];

      for(int j=0;j<n;++j) {
        if((s & (1 << j)) && a[i][j+1] < val) {
          ind = j;
          val = a[i][j+1];
        }
      }

      ret = min(ret, val + dfs(s + (1<<i), a));
    }
  }

  return dp[s] = ret;


}

int main () {
  cin.tie(0);
  cout << fixed << setprecision(10);

  while(1) {
    cin >> n;
    if(n == 0) break;
    vector<vector<int>> a(17, vector<int>(17, 0));
    for(int i=0;i<n;++i) {
      for(int j=0;j<n+1;++j) {
        cin >> a[i][j];
      }
    }

    memset(dp, -1, sizeof(dp));
    cout << dfs(0, a) << endl;
  }
}



Measured memory_bytes: 3360
#![allow(dead_code, unused_imports, non_snake_case)]

use std::io::*;
use std::cmp::{max, min, Ordering};
use std::collections::*;
use std::str::FromStr;

const MOD: i32 = 1_000_000_007;

mod util {
    use std::fmt::Debug;
    use std::io::{stdin, stdout, BufWriter, StdoutLock};
    use std::str::FromStr;

    pub fn line() -> String {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        line.trim().to_string()
    }

    pub fn chars() -> Vec<char> {
        line().chars().collect()
    }

    pub fn gets<T: FromStr>() -> Vec<T>
        where
            <T as FromStr>::Err: Debug,
    {
        let mut line: String = String::new();
        stdin().read_line(&mut line).unwrap();
        line.split_whitespace()
            .map(|t| t.parse().unwrap())
            .collect()
    }

    pub fn with_bufwriter<F: FnOnce(BufWriter<StdoutLock>) -> ()>(f: F) {
        let out = stdout();
        let writer = BufWriter::new(out.lock());
        f(writer)
    }
}

macro_rules! max {($x:expr)=>{$x};($x:expr,$($xs:tt)+)=>{max($x,max!($($xs)+))};}
macro_rules! min {($x:expr)=>{$x};($x:expr,$($xs:tt)+)=>{min($x,min!($($xs)+))};}
macro_rules! get {($t:ty)=>{{let mut line:String=String::new();stdin().read_line(&mut line).unwrap();line.trim().parse::<$t>().unwrap()}};($($t:ty),*)=>{{let mut line:String=String::new();stdin().read_line(&mut line).unwrap();let mut iter=line.split_whitespace();($(iter.next().unwrap().parse::<$t>().unwrap(),)*)}};($t:ty;$n:expr)=>{(0..$n).map(|_|get!($t)).collect::<Vec<_>>()};($($t:ty),*;$n:expr)=>{(0..$n).map(|_|get!($($t),*)).collect::<Vec<_>>()};($t:ty;;)=>{{let mut line:String=String::new();stdin().read_line(&mut line).unwrap();line.split_whitespace().map(|t|t.parse::<$t>().unwrap()).collect::<Vec<_>>()}};($t:ty;;$n:expr)=>{(0..$n).map(|_|get!($t;;)).collect::<Vec<_>>()};}
macro_rules! debug {($($a:expr),*)=>{eprintln!(concat!($(stringify!($a),"={:?},"),*),$($a),*);}}

fn main() {
    let n = get!(usize);
    let mut cnt = vec![255; 26];
    for _ in 0..n {
        let s = util::chars();
        let mut part = vec![0; 26];
        for x in s {
            part[(x as u8 - 'a' as u8) as usize] += 1;
        }
        for i in 0..26 {
            cnt[i] = min(cnt[i], part[i]);
        }
    }
    for i in 0..26 {
        for _ in 0..cnt[i] {
            print!("{}", ('a' as u8 + i as u8) as char);
        }
    }
    println!();
}

Measured memory_bytes: 4352
#include<iostream>
#include<string>
#include<cstdio>
#include<algorithm>
using namespace std;

int main()
{
	int N, K, num[200001] = { 0 };
	int i,a, count = 0, n = 0,sum=0;

	cin >> N >> K;

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

	sort(num, num + i + 1);

	for (i = 0; i < K; i++)
	{
		sum += num[n - i];
	}

	cout << N - sum << endl;

	return 0;
}

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

int main()
{
	ll N,D;
	cin >> N >> D;
	vector<ll> X;
	vector<ll> Y;
	for(ll i = 0; i< N; i ++)
	{
		ll x,y;
		cin >> x >> y;
		X.push_back(x);
		Y.push_back(y);
	}

	ll cnt=0;
	for(ll i = 0; i< N; i ++)
	{
		if(X[i]*X[i] + Y[i]*Y[i] <= D * D)
		{
			cnt++;
		}
	}


	cout << cnt << endl;
	
    return 0;
}




Measured memory_bytes: 6648
import java.awt.Point;
import java.util.ArrayDeque;
import java.util.Arrays;
import java.util.BitSet;
import java.util.Scanner;
import java.util.TreeSet;

public class Main {

	static Scanner sc = new Scanner(System.in);
	static int[] DX = { 1, 0, -1, 0 };
	static int[] DY = { 0, 1, 0, -1 };
	static int w, h;

	static void bfs(BitSet[] fill, int x, int y) {
		ArrayDeque<Point> q = new ArrayDeque<Point>();
		q.add(new Point(x, y));
		fill[y].set(x);
		while (!q.isEmpty()) {
			Point p = q.poll();
			for (int i = 0; i < 4; ++i) {
				int nx = p.x + DX[i];
				int ny = p.y + DY[i];
				if (nx < 0 || w <= nx || ny < 0 || h <= ny || fill[ny].get(nx)) continue;
				fill[ny].set(nx);
				q.add(new Point(nx, ny));
			}
		}
	}

	public static void main(String[] args) {
		while (true) {
			int W = sc.nextInt();
			int H = sc.nextInt();
			if (W == 0) break;
			int N = sc.nextInt();
			TreeSet<Integer> xset = new TreeSet<Integer>();
			TreeSet<Integer> yset = new TreeSet<Integer>();
			xset.add(0);
			xset.add(W);
			yset.add(0);
			yset.add(H);
			int[] x = new int[N * 2];
			int[] y = new int[N * 2];
			for (int i = 0; i < N * 2; ++i) {
				x[i] = sc.nextInt();
				xset.add(x[i]);
				y[i] = sc.nextInt();
				yset.add(y[i]);
			}
			w = xset.size() - 1;
			int[] xa = new int[w + 1];
			int p = 0;
			for (int xp : xset) {
				xa[p++] = xp;
			}
			h = yset.size() - 1;
			int[] ya = new int[h + 1];
			p = 0;
			for (int yp : yset) {
				ya[p++] = yp;
			}
			BitSet[] fill = new BitSet[h];
			for (int i = 0; i < h; ++i) {
				fill[i] = new BitSet(w);
			}
			for (int i = 0; i < N; ++i) {
				int x1 = Arrays.binarySearch(xa, x[2 * i]);
				int x2 = Arrays.binarySearch(xa, x[2 * i + 1]);
				int y1 = Arrays.binarySearch(ya, y[2 * i]);
				int y2 = Arrays.binarySearch(ya, y[2 * i + 1]);
				for (int j = y1; j < y2; ++j) {
					fill[j].set(x1, x2);
				}
			}
			int ans = 0;
			for (int i = 0; i < h; ++i) {
				for (int j = 0; j < w; ++j) {
					if (!fill[i].get(j)) {
						++ans;
						bfs(fill, j, i);
					}
				}
			}
			System.out.println(ans);
		}
	}

	static void print(BitSet[] fill) {
		for (int i = 0; i < h; ++i) {
			for (int j = 0; j < w; ++j) {
				System.out.print(fill[i].get(j) ? "1" : "0");
			}
			System.out.println();
		}
	}

}

Measured memory_bytes: 13000
//*******Abhijit Burman***********//
//Jalpaiguri Government Engineering College//

#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mk make_pair
#define MAXX (1000000000000000000+7)
#define fio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL)

void solve()
{
	ll n;
	cin>>n;
	ll a[n];
	ll flag=0;
	for(int i=0;i<n;i++)
	{
		cin>>a[i];
		if(a[i]%2==0 && (a[i]%3!=0 && a[i]%5!=0))
		{
			flag=1;
		}
	}
	
	cout<<(flag == 1? "DENIED" : "APPROVED")<<endl;
	//cout<<a<<" "<<b<<" "<<c<<endl;
}

int main()
{
	/*#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
	#endif*/

    //main code starts here//
    fio;
    ll t=1;
    //cin>>t;
    while(t--)
    {
    	solve();
    }


    //code ends///
    /*#ifndef ONLINE_JUDGE
    cout<<"\nTime Elapsed: " << 1.0*clock() / CLOCKS_PER_SEC << " sec\n";
	#endif*/
	return 0;

		
}

Measured memory_bytes: 256
#-*- coding:utf-8 -*-
import sys
N, Cost = map(int, input().split())

a_out, b_out = -1, -1

for i in range(N+1):
  for j in range(N-i+1):
    if 10000*i + 5000*j + 1000*(N-i-j) == Cost:
        print(i, j, N-i-j)
        sys.exit()

print('-1 -1 -1')

Measured memory_bytes: 2940
#include<iostream>
#include<vector>
using namespace std;
int main()
{
  int n;
  cin >> n;
  vector<int> v(n), c(n);
  for (int i = 0; i < n; i++) {
    cin >> v[i];
  }
  for (int i = 0; i < n; i++) {
    cin >> c[i];
  }
  int ans = 0;
  for(int i = 0; i < n; i++){
    int profit = v[i] - c[i];
    if(profit > 0){
      ans += profit;
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <vector>
#include <numeric>
#define PI 3.14159265358979323846
#define MAXINF 1e18L
#define INF 1e9L
#define EPS 1e-9
#define REP(i, n) for(int i=0;i<int(n);++i)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define RREP(i, n) for(int i=int(n)-1;i>=0;--i)
#define ALL(v) v.begin(),v.end()
#define FIND(v,x) (binary_search(ALL(v),(x)))
#define SORT(v) sort(ALL(v))
#define RSORT(v) sort(ALL(v));reverse(ALL(v))
#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl
#define Yes(n) cout<<((n)?"Yes":"No")<<endl
#define pb push_back
using namespace std;
template<class A>void pr(A a){cout << (a) << endl;}
template<class A,class B>void pr(A a,B b){cout << a << " "  ;pr(b);}
template<class A,class B,class C>void pr(A a,B b,C c){cout << a << " " ;pr(b,c);}
template<class A,class B,class C,class D>void pr(A a,B b,C c,D d){cout << a << " " ;pr(b,c,d);}
typedef long long ll;
typedef pair<int, int> pii;

int main(void)
{
    ll n;
    cin >> n;
    ll ans = 0;
    for (ll i = 1; i*i < n; i++) {
        ll a = (n-i);
        if((a%i)==0) {
            ll b = a/i;
            if(n/b!=i)continue;
            ans += b;
        }
    }
    pr(ans);
}

Measured memory_bytes: 256
package main

import "fmt"

func main() {
	var a,b,k int
	fmt.Scan(&a,&b,&k)

	if a - k >= 0 {
		fmt.Println(a-k, b)
	} else if a+b < k {
		fmt.Println(0, 0)
	} else {
		fmt.Println(0, b+a-k)
	}
}



Measured memory_bytes: 512
#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
using namespace std;
typedef string::const_iterator State;
#define Ma_PI 3.141592653589793
#define eps 0.00000001
#define LONG_INF 1e18
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define MOD 998244353
#define seg_size 262144
#define REP(i,n) for(long long i = 0;i < n;++i)
int main() {
#define int long long
	int n;
	cin >> n;
	map<int,int> nya;
	REP(i, n) {
		long long b;
		cin >> b;
		nya[b]++;
	}
	if (nya.find(0) != nya.end()) {
		//0 is here!
		if (nya.size() == 1) {
			cout << "Yes" << endl;
			return 0;
		}
		else if (nya.size() == 2) {
			vector<pair<int, int>> geko;
			for (auto i = nya.begin(); i != nya.end(); ++i) {
				geko.push_back(make_pair(i->first, i->second));
			}
			if (geko[1].second == geko[0].second * 2) {
				cout << "Yes" << endl;
				return 0;
			}
			else {
				cout << "No" << endl;
				return 0;
			}
		}
		else if (nya.size() == 3) {
			int cnt = 0;
			int bobo = 0;
			for (auto i = nya.begin(); i != nya.end(); ++i) {
				if (i == nya.begin()) {
					cnt = i->second;
				}
				else {
					if (cnt != i->second) {
						cout << "No" << endl;
						return 0;
					}
				}
				bobo ^= i->first;
			}
			if (bobo == 0) {
				cout << "Yes" << endl;
				return 0;
			}
			else {
				cout << "No" << endl;
				return 0;
			}
		}
		else {
			cout << "No" << endl;
			return 0;
		}
	}
	else {
		//0 is not here
		if (nya.size() != 3) {
			cout << "No" << endl;
			return 0;
		}
		int cnt = 0;
		int bobo = 0;
		for (auto i = nya.begin(); i != nya.end(); ++i) {
			if (i == nya.begin()) {
				cnt = i->second;
			}
			else {
				if (cnt != i->second) {
					cout << "No" << endl;
					return 0;
				}
			}
			bobo ^= i->first;
		}
		if (bobo == 0) {
			cout << "Yes" << endl;
			return 0;
		}
		else {
			cout << "No" << endl;
			return 0;
		}
	}
}

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

int main() {
  int N, S, A = 100000000;
  S = 0;
  cin >> N;
  int O = N;
  for(int i = 0; i < 9; i++){
    S = S + O / A;
    O = O % A;
      A = A / 10;
  }
  if(N % S == 0){
    cout << "Yes";
  }
  else{
    cout << "No";
  }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i, n) for(int i=0;i<(n);++i)
#define per(i, n) for(int i=(n)-1;i>=0;--i)
#define repa(i, n) for(int i=1;i<(n);++i)
#define foreach(i, n) for(auto &i:(n))
#define pii pair<int, int>
#define pll pair<long long, long long>
#define all(x) (x).begin(), (x).end()
#define bit(x) (1ll << (x))
using namespace std;
using ll = long long;
const ll MOD = (ll)1e9+7;
//const ll MOD = 998244353;
//const ll MOD = 924844033;
const int INF = (ll)1e9+7;
const ll INFLL = (ll)1e18;
const double EPS = 1e-5;
using namespace std;
template<class t>
using vvector = vector<vector<t>>;
template<class t>
using vvvector = vector<vector<vector<t>>>;
template<class t>
using priority_queuer = priority_queue<t, vector<t>, greater<t>>;
template<class t, class u> bool chmax(t &a, u b){if(a<b){a=b;return true;}return false;}
template<class t, class u> bool chmin(t &a, u b){if(a>b){a=b;return true;}return false;}

#ifdef DEBUG
#define OUTPUT(x) (output(x), outendl())
#else
#define OUTPUT(x) (void)0
#endif

ll modpow(ll x, ll b){
	ll res = 1;
	while(b){
		if(b&1)res = res * x % MOD;
		x = x * x % MOD;
		b>>=1;
	}
	return res;
}

ll modinv(ll x){
	return modpow(x, MOD-2);
}

bool was_output = false;
template<class t>
void output(t a){
	if(was_output)cout << " ";
	cout << a;
	was_output = true;
}
void outendl(){
	was_output = false;
	cout << endl;
}
const int MAX_N = 1e5+1;
int n;
vector<ll> line;
vvvector<ll> dp(MAX_N,vvector<ll>(2,vector<ll>(2,INFLL)));

int	func(vector<int> line){
	int n = line.size();
	vector<int> now;
	rep(i,n){
		now.push_back(i+1);
	}
	int cnt = 0;
	do{
		if(line == now) return cnt;
		++cnt;
	}while(next_permutation(all(now)));
	return 0;
}

int main(){
	int n;
	cin >> n;
	vector<int> a(n);
	vector<int> b(n);
	foreach(i,a){
		cin >> i;
	}
	foreach(i,b){
		cin >> i;
	}
	cout << abs(func(a) - func(b)) << endl;
	return 0;
}


Measured memory_bytes: 15104
#include<bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=(a),i##_end=(b);i<=i##_end;++i)
#define per(i,a,b) for(int i=(b),i##_end=(a);i>=i##_end;--i)
#define For(i,a,b) for(int i=(a),i##_end=(b);i<i##_end;++i)
#define foe(i,a) for(__typeof(a.begin())i=a.begin();i!=a.end();++i)
#define X first
#define Y second
#define mp make_pair
#define pb push_back
#define SZ(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
typedef double ld;
typedef long long L;
typedef vector<int> vi;
typedef pair<int,int> pa;
const int N=1e5+11,P=1e9+7;
char s[N];
int f[N],pr[N],g[N];
void inc(int &x,int y){x=x+y>=P?x+y-P:x+y;}
void dec(int &x,int y){x=x-y<0?x-y+P:x-y;}
int n;
int main(){
	cin>>n>>s+1;
	f[0]=1;
	//int an=0;
	rep(i,1,n){
		int x=s[i];
		++g[x];
	}
	int an=1;
	rep(i,'a','z')an=1LL*an*(g[i]+1)%P;
	//inc(f[n],an);
	cout<<an-1;
}


Measured memory_bytes: 384
#include <iostream>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <unordered_map>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <climits>
using namespace std;
#define Rep(i,n) for(int i = 0; i < n; ++i)
#define For(i, s, e) for(int i = s; i <= e; ++i)
typedef long long ll;
ll n;

int main()
{
	scanf("%lld", &n);
	ll m = n;
	int k = m % 10;
	while (m > 0) {
		m = m / 10;
		k += m % 10;
	}
	if( 0 == n % k) printf("Yes");
	else printf("No");
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <math.h>
#include <vector>
#include <string>
#include <queue>
#include <numeric>

using namespace std;

typedef long long int ll;
typedef long int li;

bool compare_by_b(pair<int, int> a, pair<int, int> b) {
    if(a.second != b.second){
        return a.second < b.second;
    }else{
        return a.first < b.first;
    }
}

int main(){
    ll ans=0;
    ll a,b,t,x;
    cin >> a >> b >> t;
    x=floor(t/a);
    ans=x*b;
    
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 256