akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i, n) for (int i=0; i<(int)(n); i++)
#define all(v) v.begin(), v.end()
#define allR(v) v.rbegin(), v.rend()
#define PRINT(v) for (auto x : (v)) cout <<x <<" " ; cout <<endl;
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
typedef pair<int,int> Pi;
const ll MOD = 1000000007;
const ll INF = 10000000000000000;
const int inf = 1001001001;
vector<int> x4 = {0, 1, 0, -1}, x8 = {0, 1, 1, 1, 0, -1, -1, -1};
vector<int> y4 = {1, 0, -1, 0}, y8 = {1, 1, 0, -1, -1, -1, 0, 1};
template<class T> inline bool chmin(T& a, T b){if (a>b){a = b; return true;}return false;}
template<class T> inline bool chmax(T& a, T b){if (a<b){a = b; return true;}return false;}
template<class T> inline T powerM(T a,T b){if (b==0) return 1;
T tmp = powerM(a,b/2); if (b%2==0) return tmp*tmp%MOD; else return tmp*tmp%MOD*a%MOD; }
template<class T> inline T power(T a,T b,T m=numeric_limits<T>::max()){ if (b==0) return 1;
  T tmp = power(a,b/2,m); if (b%2==0) return tmp*tmp%m; else return tmp*tmp%m*a%m; }
template<class T> inline T gcd(T a, T b){if (b==0) return a; return gcd(b, a%b);}
template<class T> inline T lcm(T a, T b){return a / gcd(a,b) * b;}
// ax+by=gcd(a,b)を解く
template<class T> inline T extgcd(T a,T b,T &x,T &y){if (b==0){x=1; y=0; return a;} T d=extgcd(b,a%b,y,x); y -= a/b*x; return d;}
void hey(){ cout <<"hey" <<endl; }

template<class T> struct edge { int to; T cost;};


int main() {
  int N; cin >>N;
  string s,t; cin >>s >>t;
  for (int i=0; i<N; i++){
    bool ok = true;
    for (int j=0; j+i<N; j++){
      if (s[i+j] != t[j]) ok = false;
    }
    if (ok){ cout <<N+i <<endl; return 0;}
  }
  cout <<N*2 <<endl;
}


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

using namespace std;

#define ll long long
#define ld long double
#define EPS 0.0000000001
#define INF 1e9
#define MOD 1000000007
#define rep(i,n) for(i=0;i<n;i++)
#define loop(i,a,n) for(i=a;i<n;i++)
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)

typedef vector<int> vi;
typedef pair<int,int> pii;


int main(void) {
  int i,j;
  int n,k,t;
  while(1){
    cin>>n>>k;
    if(n==0 && k==0)break;
    vi s(k),a(k,0);
    rep(i,k)cin>>s[i];
    rep(i,n){
      rep(j,k){
        cin>>t;
        a[j]+=t;
      }
    }
    rep(i,k)if(s[i]<a[i]){
      cout<<"No"<<endl;
      break;
    }
    if(i==k)cout<<"Yes"<<endl;
  }
}

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

using namespace std;

int a[26];

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

  for (auto c : s) {
    a[c - 'a']++;
  }
  
  bool ans = true;
  for (int i = 0; i < 26; ++i) if (a[i] > 1) ans = false;
  
  cout << (ans ? "yes" : "no") << endl;
  
  return 0; 
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
#define ALL(c) (c).begin(), (c).end()
#define SUM(x) std::accumulate(ALL(x), 0LL)
#define MIN(v) *std::min_element(v.begin(), v.end())
#define MAX(v) *std::max_element(v.begin(), v.end())
#define EXIST(v, x) (std::find(v.begin(), v.end(), x) != v.end())

using namespace std;
using ll = long long;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
constexpr int INF = 1001001001;
constexpr long long INFL = (1LL<<60);
constexpr double eps = (1e-9);

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

  int a;
  cin >> a;

  cout << a + a * a + a * a * a << endl;

  return 0;
}


Measured memory_bytes: 3680
#include <bits/stdc++.h>
#include <math.h>
#define _GLIBCXX_DEBUG
#define _LIBCPP_DEBUG 0

using namespace std;
#define ll long long
#define rep(i,n) for (int i = 0; i < n; i++)
#define MOD (1000000007)
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int, int>
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

int gcd(int a, int b) {
    if (b == 0) return a;
    else return gcd(b, a % b);
}

const ll INF = 1LL << 60;

int main(){
  int n,m; cin >> n >> m;
  vvi S(m);
  rep(i, m){
    int k; cin >> k;
    rep(j, k){
      int s; cin >> s; s--;
      S[i].pb(s);
    }
  }

  vi p(m);
  rep(i, m) cin >> p[i];

  int ans = 0;
  rep(bit, (1<<n)){
    bool ok = true;
    rep(i, m){
      int sum = 0;
      for(int s : S[i]){
        if(bit & (1<<s)) sum++;
      }
      if(sum%2 != p[i]) ok = false;
    }
    if(ok) ans++;
  }
  std::cout << ans << '\n';
}


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

#define int long long int
#define mp make_pair
#define mod 1000000007
using namespace std;

int n;
vector <int> v[100002];
bool visited[100002];
int dp[100002][4];

int fun(int node , int color)
{
    if(node == n+1){
        return 1;
    }
    int &ans = dp[node][color];
    if(ans != -1){
        return ans;
    }
    visited[node] = true;
    ans = 1;
    if(color == 0){
        for (int i = 0; i < v[node].size(); ++i) {
            if(visited[v[node][i]] == false) {
                if(v[node][i] == n+1){
                    ans = (ans*fun(v[node][i] , 0))%mod;
                }
                else {
                    ans = (ans*((fun(v[node][i], 0) + fun(v[node][i], 1))%mod))%mod;
                }
            }
        }
    }
    else{
        for (int i = 0; i < v[node].size(); ++i) {
            if(visited[v[node][i]] == false) {
                ans = (ans*fun(v[node][i], 0))%mod;
            }
        }
    }
    visited[node] = false;
    return ans;
}

int32_t main() {
    scanf("%lld", &n);
    for (int i = 0; i < n-1;++i) {
        int x,y;
        scanf("%lld", &x);
        scanf("%lld", &y);
        v[x].push_back(y);
        v[y].push_back(x);
    }
    for (int i = 2; i <= n; ++i) {
        if(v[i].size() == 1){
            v[i].push_back(n+1);
        }
    }
    for (int i = 0; i < 100002; ++i) {
        for (int j = 0; j < 4; ++j) {
            dp[i][j] = -1;
        }
    }
    int ans = fun(1 , 0) + fun(1 , 1);
    ans %=mod;
    printf("%lld",ans);
    return 0;
}

Measured memory_bytes: 16000
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)(n);++i)
#define repone(i,n) for(int i=1;i<(int)(n);++i)
#define repo(i,o,n) for(int i=o;i<(int)(n);++i)
#define Rep(j,n) for(int j=0;j<(int)(n);++j)
#define Repo(j,o,n) for(int j=o;j<(int)(n);++j)
#define Repone(j,n) for(int j=1;j<(int)(n);++j)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define int long long
#define pb(a) push_back(a)
#define eraser(v,i) (v).erase(v.begin()+(i))
#define pbpair(a,b) push_back(make_pair(a,b))
#define MOD 1000000007
const long long INF = 1LL<<60;
#define pairint pair<int,int>
signed main(){
  int x=0,y=0,z=0,w=0;
  string s;

  std::cin >> s;
  rep(i,3){
    if(s[i]=='7'){
      std::cout << "Yes" << '\n';
      return 0;
    }
  }
  std::cout << "No" << '\n';
}


Measured memory_bytes: 3624
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
namespace Program
{
    using namespace std;
    class Solver
    {
    private:
        int N;
        int T;

        vector<int> A;

        int Div = 0;
        int Min;

    public:
        Solver()
        {
            cin.tie(0);
            ios::sync_with_stdio(false);

            cin >> N >> T;
            A.resize(N);
        }

        void Solve()
        {
            cin >> A[0];
            Min = A[0];

            int ans = 1;

            for (int i = 1; i < N; ++i)
            {
                cin >> A[i];

                if (A[i] < Min) Min = A[i];

                int tmp = A[i] - Min;

                if (Div < tmp)
                {
                    Div = tmp;
                    ans = 1;
                }
                else if (Div == tmp)
                {
                    ans++;
                }
            }
            cout << ans << endl;
        }
    };
}

int main()
{
    // メモリリーク検出
    //_CrtSetDbgFlag(_CRTDBG_ALLOC_MEM_DF
    //    | _CRTDBG_DELAY_FREE_MEM_DF
    //    | _CRTDBG_CHECK_ALWAYS_DF
    //    | _CRTDBG_LEAK_CHECK_DF);

    // メンバ関数ポインタ取得
    void (Program::Solver::*pSolve)() = &Program::Solver::Solve;

    // コンストラクタ呼び出し
    Program::Solver obj;

    // .*演算子でアクセス
    (obj.*pSolve)();
    return 0;
}


Measured memory_bytes: 640
#include <iostream>

int selectionSort(int A[], int N)
{
    int sortedNum = 0;

    for (int i = 0; i < N; i++)
    {
        int minj = i;

        for (int j = i; j < N; j++)
        {
            if (A[j] < A[minj])
            {
                minj = j;
            }
        }

        if (A[i] != A[minj])
        {
            int temp = A[i];
            A[i] = A[minj];
            A[minj] = temp;
            sortedNum++;
        }
    }

    return sortedNum;
}

int main()
{
    int num;
    std::cin >> num;

    int *element = new int[num];
    for (int i = 0; i < num; i++) std::cin >> element[i];

    int sortedNum = selectionSort(element, num);

    for (int i = 0; i < num; i++)
    {
        std::cout << element[i];

        if (i < num - 1) std::cout << " ";
        else             std::cout << std::endl;
    }

    std::cout << sortedNum << std::endl;
}


Measured memory_bytes: 3084
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);i++) //これでiやjを定義しなくていいらしい
using namespace std;

double deg2rad(double degree){
    return degree * M_PI / 180.0;
}
double rad2deg(double rad){
    return rad * 180.0/M_PI;
}

int main(){
  double a,b,h,m;
  cin >> a >> b >> h >> m;

  //cout << M_PI;
  double hrad,mrad;
  mrad = (M_PI/30)*m;
  hrad = (M_PI/6)*(h + m/60);

  double theta = max(hrad,mrad) - min(hrad,mrad);
  theta = min(theta, 2*M_PI - theta);
  //theta = rad2deg(theta);
  //cout << theta << endl;

  double c;
  c = pow(a,2) + pow(b,2) - 2*a*b*cos(theta);
  c = sqrtl(c);

  cout << fixed << setprecision(20) << c << endl;

  return 0;
}


Measured memory_bytes: 4192
#include <cstdio>
#include <cstdlib>
#include <string>
#include <iostream>

using namespace std;
int H[2000001];


void printResult(int i, int n){
    printf("node %d: key = %d, ",i,H[i]);
    if(i!=1) printf("parent key = %d, ",H[i/2]);
    if(2*i<=n) printf("left key = %d, ",H[2*i]);
    if(2*i+1<=n) printf("right key = %d, ",H[2*i+1]);
    printf("\n");

}

void maxHeapify(int i, int n){
    int l=2*i; int r=2*i+1;
    int largest=i;
    if(l<=n and H[l]>=H[i]) largest=l;
    if(r<=n and H[r]>=H[largest]) largest=r;

    if(largest!=i){
        swap(H[i],H[largest]);
        maxHeapify(largest,n);
    }
}

void buildMaxHeap(int n){
    for (int i=n/2; i>0; i--)maxHeapify(i,n);
}

void heapincreasekey(int n){
    while (n>1 and H[n/2]<H[n]){
        swap(H[n],H[n/2]);
        n=n/2;
    }

}
int main()
{
    int n,i,key;
    string com;
    n=0;
    while(true){
        cin>>com;
        if(com=="insert"){
            n++;
            cin>>H[n];
            heapincreasekey(n);
        }else if(com=="extract"){
            cout<<H[1]<<endl;
            H[1]=H[n];
            n--;
            maxHeapify(1,n);
        }else if(com=="end"){
            break;
        }
    }

    return 0;
}


Measured memory_bytes: 7060
package main

import (
	"bufio"
	"fmt"
	"os"
)

func main() {
	r := bufio.NewReader(os.Stdin)
	var n int
	fmt.Fscan(r, &n)
	as := make([]int, n)
	for i := 0; i < n; i++ {
		fmt.Fscan(r, &as[i])
	}

	mp := make(map[int]int)
	for i := 0; i < n; i++ {
		mp[i+as[i]]++
	}

	ans := 0
	for i := 0; i < n; i++ {
		if v, ok := mp[i-as[i]]; ok {
			ans += v
		}
	}

	fmt.Println(ans)
}

// Union-Find
type unionFind struct {
	d []int
}

func newUnionFind(n int) *unionFind {
	uf := new(unionFind)
	uf.d = make([]int, n)
	for i := 0; i < n; i++ {
		uf.d[i] = -1
	}
	return uf
}

func (uf *unionFind) find(x int) int {
	if uf.d[x] < 0 {
		return x
	}
	uf.d[x] = uf.find(uf.d[x])
	return uf.d[x]
}

func (uf *unionFind) unite(x, y int) bool {
	rootX := uf.find(x)
	rootY := uf.find(y)
	if rootX == rootY {
		return false
	}

	if uf.d[rootX] < uf.d[rootY] {
		uf.d[rootX] += uf.d[rootY]
		uf.d[rootY] = rootX
	} else {
		uf.d[rootY] += uf.d[rootX]
		uf.d[rootX] = rootY
	}

	return true
}

func (uf *unionFind) same(x, y int) bool {
	return uf.find(x) == uf.find(y)
}

func (uf *unionFind) size(x int) int {
	return -uf.d[uf.find(x)]
}

// mod combination
func modpow(a, n, mod int) int {
	res := 1
	for n > 0 {
		if n%2 != 0 {
			res = res * a % mod
		}
		a = a * a % mod
		n = n / 2
	}
	return res
}

func modcomb(n, a, mod int) int {
	x := 1
	y := 1
	for i := 0; i < a; i++ {
		x = x * (n - i)
		x %= mod
		y = y * (i + 1)
		y %= mod
	}
	return x * modpow(y, mod-2, mod) % mod
}

func modfactorial(n, mod int) int {
	result := 1
	for i := 1; i <= n; i++ {
		result = (result * i) % mod
	}
	return result
}

// Utility

func min(x, y int) int {
	if x < y {
		return x
	}
	return y
}

func max(x, y int) int {
	if x > y {
		return x
	}
	return y
}

func abs(x int) int {
	if x < 0 {
		return -x
	}
	return x
}

func primeFactor(x int) map[int]int {
	res := make(map[int]int)
	for i := 2; i*i <= x; i++ {
		for x%i == 0 {
			res[i]++
			x = x / i
		}
	}
	if x != 1 {
		res[x] = 1
	}
	return res
}

func divisor(x int) []int {
	res := make([]int, 0)
	for i := 1; i*i <= x; i++ {
		if x%i == 0 {
			res = append(res, i)
			if i != x/i {
				res = append(res, x/i)
			}
		}
	}
	return res
}

func gcd(x, y int) int {
	if y == 0 {
		return x
	}
	return gcd(y, x%y)
}

func lcm(x, y int) int {
	return x / gcd(x, y) * y
}

func reverseString(s string) string {
	r := []rune(s)
	for i, j := 0, len(r)-1; i < len(r)/2; i, j = i+1, j-1 {
		r[i], r[j] = r[j], r[i]
	}
	return string(r)
}

// Queue ...
type Queue []int

// pop ...
func (q *Queue) empty() bool {
	return len(*q) == 0
}

// push ...
func (q *Queue) push(i int) {
	*q = append(*q, i)
}

// pop ...
func (q *Queue) pop() (int, bool) {
	if q.empty() {
		return 0, false
	} else {
		res := (*q)[0]
		*q = (*q)[1:]
		return res, true
	}
}

// Stack ...
type Stack []int

// pop ...
func (s *Stack) empty() bool {
	return len(*s) == 0
}

// push ...
func (s *Stack) push(i int) {
	*s = append(*s, i)
}

// pop ...
func (s *Stack) pop() (int, bool) {
	if s.empty() {
		return 0, false
	} else {
		index := len(*s) - 1
		res := (*s)[index]
		*s = (*s)[:index]
		return res, true
	}
}


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



int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
//    ll x;
//    x=1ll << 59;
//    ll y=(1ll << 59) - 1ll;
//    cout<<((double)(x)==(double)(x-1))<<endl;
    string s,t;ll x=0;
    cin>>s;
    cin>>t;
    for(int i=0;i<s.size();i++){
        if(s[i]!=t[i])x++;
    }
    cout<<x;
}


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

const int N = 16;
const int M = (1 << N) + 10;
const int mod = 1e9 + 7;

typedef long long LL;

inline int Pow(int x, int y) {
    int res = 1;
    for (; y; y >>= 1, x = (LL)x * x % mod) if (y & 1) res = (LL)res * x % mod;
    return res;
}

int frac[M], inv[M];

inline int C(int n, int r) {
    if (r < 0 || r > n) return 0;
    return (LL)frac[n] * inv[r] % mod * inv[n - r] % mod;
}

int fucked[17], dp[17][1 << N];

int main() {
    int n, m; scanf("%d%d", &n, &m), frac[0] = inv[0] = 1;
    for (int i = 1; i <= 1 << n; i++) 
        frac[i] = (LL)frac[i - 1] * i % mod, inv[i] = Pow(frac[i], mod - 2);
    for (int i = 1; i <= m; i++) scanf("%d", &fucked[i]);
    sort(fucked + 1, fucked + m + 1, [](int a, int b){return a > b;}), dp[0][0] = 1;
    for (int i = 1; i <= m; i++)
        for (int j = 0; j < 1 << n; j++)
            if (dp[i - 1][j]) {
                dp[i][j] = (dp[i][j] + dp[i - 1][j]) % mod;
                int upper = (1 << n) - fucked[i] - j;
                if (upper < 0) continue;
                for (int k = 1; k <= n; k++)
                    if (!(j & (1 << k - 1))) 
                        dp[i][j | (1 << k - 1)] = (dp[i][j | (1 << k - 1)] + (LL)dp[i - 1][j] * C(upper, (1 << k - 1) - 1)
                            % mod * frac[1 << k - 1]) % mod;
            }
    int res = 0;
    for (int s = 0; s < 1 << n; s++) {
        int tmp = (LL)dp[m][s] * frac[(1 << n) - s - 1] % mod;
        if (__builtin_popcount(s) & 1) res = (res - tmp + mod) % mod;
        else res = (res + tmp) % mod;
    }
    printf("%d\n", (LL)res * (1 << n) % mod);
}


Measured memory_bytes: 4352
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <queue>
#include <deque>
#include <list>
#include <map>
#include <set>
#include <cmath>
#include <cstring>
#include <string>
#include <bitset>
#include <fstream>
#include <iomanip>

using namespace std;

typedef long long ll;
typedef double db;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<double,double> pdd;
typedef vector<pii> vii;

#define INF 1000000007ll
#define PB push_back
#define MP make_pair
#define X first
#define Y second
#define cil(a,b) ( ((a)%(b) == 0)?((a)/(b)):((a)/(b)+1) )
#define SIZE 100010

int gcd (int a, int b) {
   if (a < b) swap(a, b);
   return ((b == 0) ? a : gcd (b, a % b));
}

int a[SIZE];
int main() {
   int mx = 0, n, g, k;
   cin >> n >> k;
   for (int i = 0 ; i < n ; ++i) {
      cin >> a[i];
      mx = max (a[i], mx);
      if (i == 0) g = a[i];
      else g = gcd (g, a[i]);
   }
   if ((g == 1 || k % g == 0) && k <= mx) cout << "POSSIBLE" << endl;
   else cout << "IMPOSSIBLE" << endl;

   return 0;
}

Measured memory_bytes: 640
n = int(input())
l = [0 for i in range(10**4+1)]
for i in range(1,101):
  for j in range(1,101):
    for k in range(1,101):
      tmp = i**2+j**2+k**2+i*j+j*k+k*i
      if tmp <= 10**4:
        l[tmp] += 1

for i in range(n):
  print(l[i+1])

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

int main(){
  int N;
  cin>>N;
  int count=0,gd=0;
  for(int i=1;i<=N;++i){
    for(int j=1;j<=i;++j){
      if(i%j==0)gd++;
    }
    if(gd==8&&i%2!=0)count++;
    gd=0;
  }
  cout<<count<<endl;
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>

const long long int MOD = 998244353;
const int iINF = 1000000000;
const long long int llINF = 1000000000000000000;

using namespace std;
using ll = long long int;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using vvvl = vector<vector<vector<ll>>>;

typedef pair<ll, ll> pll;
bool paircomp(const pll &a, const pll &b) {
  if (a.first == b.first)
    return a.second < b.second;
  return a.first < b.first;
}
struct multi {
  ll first;
  ll second;
  ll third;
};
bool multicomp(const multi &a, const multi &b) {
  if (a.first == b.first)
    return a.second < b.second;
  return a.first < b.first;
}
#define REP(i, n) for (ll i = 0; i < (n); i++)
#define RREP(i, n) for (ll i = (n)-1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define AUTO(i, m) for (auto &i : m)
#define ALL(a) (a).begin(), (a).end()
#define MAX(vec) *std::max_element(vec.begin(), vec.end())
#define MIN(vec) *std::min_element(vec.begin(), vec.end())
#define ARGMAX(vec)                                                            \
  std::distance(vec.begin(), std::max_element(vec.begin(), vec.end()))
#define ARGMIN(vec)                                                            \
  std::distance(vec.begin(), std::min_element(vec.begin(), vec.end()))
#define REV(T) greater<T>()
#define PQ(T) priority_queue<T, vector<T>, greater<T>>
#define VVL(a, b, c) vector<vector<ll>>(a, vector<ll>(b, c))
#define VVVL(a, b, c, d)                                                       \
  vector<vector<vector<ll>>>(a, vector<vector<ll>>(b, vector<ll>(c, d)))
#define SP(a) setprecision(a)
#define SQRT(a) sqrt((long double)(a))
#define DPOW(a, b) pow((long double)(a), (long double)(b))

ll POW(ll n, ll m) {
  if (m == 0) {
    return 1;
  } else if (m % 2 == 0) {
    ll tmp = POW(n, m / 2);
    return (tmp * tmp) % MOD;
  } else {
    return (n * POW(n, m - 1)) % MOD;
  }
}

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

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll N;
  cin >> N;
  vl A(N);
  ll sum = 0;
  REP(i, N) {
    cin >> A[i];
    sum += A[i];
  }

  vvl X = VVL(90001, 301, 0);
  X[0][0] = 1;
  auto Y = X;
  REP(i, N) {
    REP(j, 90001 - A[i]) {
      X[j + A[i]][i + 1] += X[j][i];
      X[j + A[i]][i + 1] %= MOD;
      X[j][i + 1] += (X[j][i] * 2) % MOD;
      X[j][i + 1] %= MOD;

      Y[j + A[i]][i + 1] += Y[j][i];
      Y[j + A[i]][i + 1] %= MOD;
      Y[j][i + 1] += Y[j][i];
      Y[j][i + 1] %= MOD;
    }
  }
  ll ans = 0;
  FOR(i, (sum / 2) + 1, 90001) { ans = (ans + ((X[i][N] * 3) % MOD)) % MOD; }
  if (sum % 2 == 0) {
    ans = (ans + ((((X[sum / 2][N] - (Y[sum / 2][N] * 2))) % MOD) * 3)) % MOD;
    ans = (ans + (Y[sum / 2][N] * 3) % MOD) % MOD;
  }

  cout << (MOD + POW(3, N) - ans) % MOD << endl;

  return 0;
}


Measured memory_bytes: 431232
#include <bits/stdc++.h>
using namespace std;
  int main() {
  int a;
  int b;
  cin >> a >> b;
  if ( ( ( a * b ) % 2 ) == 0 ) {
    cout << "Even" << endl;
  }
  else {
    cout << "Odd" << endl;
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(void){
	long long n,a,b;
	scanf("%lld%lld%lld",&n,&a,&b);
	if (a>b) swap(a,b);
	if ((a&1)==(b&1)){
		printf("%lld",(b-a)/2);
	}
	else{
		printf("%lld",min(a+(b-a)/2,n-b+1+(b-a)/2));
	}
	return 0;
}

Measured memory_bytes: 256
s = list(input())
t = input()
ls, lt = len(s), len(t)

def seq(inlist):
	global t
	dismatch = 0
	for i in range(len(t)):
		if t[i] != inlist[i] and inlist[i] != "?":
			dismatch = 1
			break
	return dismatch


ans = "UNRESTORABLE"
if ls >= lt:

	d = -1
	for i in range(ls-lt+1):
		if seq(s[i:i+lt]) == 0:
			d = i
	if d != -1:

		for i in range(lt):
			s[d+i] = t[i]
		for i in range(ls):
			if s[i] == "?":
				s[i] = "a"

		ans = "".join(s)

print(ans)


Measured memory_bytes: 3064
#include <iostream>
using namespace std;
int main(){
  int n,t;cin>>n>>t;
  int ans = 100000;
  for(int i = 0; n > i; i++){
    int a,b;cin>>a>>b;
    if(t >= b){
      ans = min(ans,a);
    }
  }
  if(ans == 100000){
    cout << "TLE" << endl;
  }else cout << ans << endl;
}

Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main(){
	int n;	
	while (true) {
		cin >> n;
		if (n != 0) {
			int *num = new int[n];
			for (int i = 0; i < n; i++) {
				cin >> num[i];
			}
			/*最大を更新していきたい*/
			int max_v = -999999999;
			for (int i = 0; i < n; i++) {
				int j = i, tmp_total = 0;
				for (j; j < n; j++) {
					tmp_total += num[j];
					if (tmp_total > max_v) {
						max_v = tmp_total;
					}

				}
			}
			cout << max_v << endl;

		}
		else if(n==0){
			break;
		}

	}
	return 0;
}


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

int main() {
    string s, t;
    cin >> s >> t;
    vector<int> start(26, -1);
    vector<int> goal(26, -1);
    for (int i = 0; i < s.size(); i++) {
        int a = s[i] - 'a';
        int b = t[i] - 'a';
        if (start[a] != -1 || goal[b] != -1) {
            if (start[a] != b || goal[b] != a) {
                cout << "No" << endl;
                return 0;
            }
        }
        else {
            start[a] = b;
            goal[b] = a;
        }
    }
    cout << "Yes" << endl;
}

Measured memory_bytes: 904
#include <bits/stdc++.h>
#define ll long long int
using namespace std;

int main()
{
    int n, k;
    cin >> n >> k;
    int a[n + 1];
    for (int i = 1; i <= n; i++)
        cin >> a[i];

    int  dp[n + 1][k + 1];

    memset(dp, 0, sizeof(dp));
    dp[0][0] = 1;



    const int mod = 1e9 + 7;
    for (int i = 1; i <= n; i++)
    {
        vector<int> prefixsum(k + 1);
        prefixsum[0] = dp[i - 1][0];

        for (int j = 1; j <= k; j++)
        {
            prefixsum[j] = (prefixsum[j - 1] + dp[i - 1][j]) % mod;
        }

        for (int j = 0; j <= k; j++)
        {
            if (j <= a[i])
                dp[i][j] = prefixsum[j];
            else
            {
                int h = j - a[i] - 1;
                dp[i][j] = (prefixsum[j] - prefixsum[h] + mod) % mod;
            }
        }
        prefixsum.clear();
    }
    cout << dp[n][k] << endl;
}

Measured memory_bytes: 43324
#include <iostream>
#include <cmath>
#include <cstdio>
#include <iomanip>

using namespace std;

int main(){
	
	int n,i;
	
	cin >> n;
	int x[n];
	for(i = 0; i < n; i++) cin >> x[i];
	int y[n];
	for(i = 0; i < n; i++) cin >> y[i];
	
	double d1;
	for(i = 0; i < n; i++){
		d1 += abs(x[i] - y[i]);
	}
	cout << fixed << setprecision(6) << d1 << endl;	
	
	double d2;
	for(i = 0; i < n; i++){
		d2 += abs(x[i] - y[i]) * abs(x[i] - y[i]);
	}
	d2 = sqrt(d2);
	cout << fixed << setprecision(6) << d2 << endl;
	
	double d3;
	for(int i = 0; i < n; i++){
		d3 += abs(x[i] - y[i]) * abs(x[i] - y[i]) * abs(x[i] - y[i]);
	}
	d3 = pow(d3, 1.0/3.0);
	cout << fixed << setprecision(6) << d3 << endl;	
	
	double d = abs(x[0] - y[0]);
	for(int i = 0; i < n-1; i++){
		d = max(d, abs(x[i+1] - y[i+1]));
	}
	cout << fixed << setprecision(6) << d << endl;
	
	return 0;
}

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

int main() {
  int n;
  cin >> n;
  int i, count = 0;
  for(i=1; i<=n; i++){
    if(to_string(i).length() == 1) count++;
    if(to_string(i).length() == 3) count++;
    if(to_string(i).length() == 5) count++;
  }
  cout << count << endl;
  return 0;
}


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

int H, W;
string A[1050];

queue<pair<int, int> > Q;
int INF = 99999999;
int dis[1050][1050];

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

int main(void) {

	cin >> H >> W;
	string tmp;
	for (int i = 1; i <= H; i++) {
		cin >> tmp;
		A[i] = "*" + tmp + "*";
	}
	for (int i = 0; i <= W + 1; i++) {
		A[0] += "*";
		A[H + 1] += "*";
	}

	for (int i = 1; i <= H; i++) {
		for (int j = 1; j <= W; j++) {
			dis[i][j] = INF;
		}
	}

	for (int i = 1; i <= H; i++) {
		for (int j = 1; j <= W; j++) {
			if (A[i][j] == '#') { Q.push(make_pair(i, j)); dis[i][j] = 0; }
		}
	}

	while (Q.size() > 0) {
		pair<int, int> P = Q.front();
		Q.pop();

		int u = P.first; int v = P.second;

		for (int j = 0; j <= 3; j++) {
			int nu = u + dx[j]; int nv = v + dy[j];
			if (A[nu][nv] == '.' && dis[nu][nv] == INF) { dis[nu][nv] = dis[u][v] + 1; Q.push(make_pair(nu, nv)); }
		}
	}

	int ans = 0;
	for (int i = 1; i <= H; i++) {
		for (int j = 1; j <= W; j++) {
			if (dis[i][j] == INF) { continue; }
			ans = max(ans, dis[i][j]);
		}
	}

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

Measured memory_bytes: 14608
#include<bits/stdc++.h>
using namespace std;
long long a,b,c;
long long ans;
int main()
{
    cin>>a>>b>>c;
    for(int i=0;i<a;i++)
    {
        int t;
        cin>>t;
        if(t<b)
          ans++;
        if(t>=c)
          ans++;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
import sys
import math
import collections
import itertools
import array
import inspect

# Set max recursion limit
sys.setrecursionlimit(10000)

# Debug output
def chkprint(*args):
    names = {id(v):k for k,v in inspect.currentframe().f_back.f_locals.items()}
    print(', '.join(names.get(id(arg),'???')+' = '+repr(arg) for arg in args))

# Binary converter
def to_bin(x):
    return bin(x)[2:]

# Set 2 dimension list
def dim2input(N):
    li = []
    for _ in range(N):
        li.append(list(map(int, input())))
    return li

""" input template
S = input()
N = int(input())
L = list(map(int, input().split()))
a, b = list(map(int, input().split()))
SL = list(input())
"""

# --------------------------------------------

dp = None

def main():
    C = []

    for _ in range(3):
        C.append(list(map(int, input().split())))

    a1_limit = min(C[0])+1
    a2_limit = min(C[1])+1
    a3_limit = min(C[2])+1
    b1_limit = min(C[0][0], C[1][0], C[2][0])+1
    b2_limit = min(C[0][1], C[1][1], C[2][1])+1
    b3_limit = min(C[0][2], C[1][2], C[2][2])+1

    A1, A2, A3, B1, B2, B3 = [], [], [], [], [], []
    for i in range(a1_limit):
        A1.append(i)
    for i in range(a2_limit):
        A2.append(i)
    for i in range(a3_limit):
        A3.append(i)
    for i in range(b1_limit):
        B1.append(i)
    for i in range(b2_limit):
        B2.append(i)
    for i in range(b3_limit):
        B3.append(i)

    for a1, a2, a3 in itertools.product(A1, A2, A3):
        b1 = C[0][0] - a1
        b2 = C[1][1] - a2
        b3 = C[2][2] - a3

        if a1 + b1 != C[0][0]:
            continue
        if a2 + b1 != C[1][0]:
            continue
        if a3 + b1 != C[2][0]:
            continue
        if a1 + b2 != C[0][1]:
            continue
        if a2 + b2 != C[1][1]:
            continue
        if a3 + b2 != C[2][1]:
            continue
        if a1 + b3 != C[0][2]:
            continue
        if a2 + b3 != C[1][2]:
            continue
        if a3 + b3 != C[2][2]:
            continue

        print("Yes")
        return

    print("No")

main()


Measured memory_bytes: 5016
#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 main() {
    int A,B;
    cin >> A >> B;
    if(A%2==B%2) cout << (A+B)/2 << endl;
    else cout << "IMPOSSIBLE" << endl;
}

Measured memory_bytes: 256
/* ex7_3
   bonbonc    */

#include <stdio.h> 
#include <stdlib.h>

int main(void){
    int row,column,copied_row,flag,i,j,k;
    scanf("%d %d",&row,&column);
    copied_row = row;//行数をコピー
    char **squares;//グリッドの配列ポインタ
    
    // 各行の配列へのポインタ分のメモリ領域を確保 
    squares = (char**)calloc(row, sizeof(char*));
    if (squares == NULL){
        exit(1);//エラー処理
    }
    // 各行の要素分のメモリ領域を確保 
    for ( i = 0; i < row; i++){
        squares[i] = (char*)calloc(column, sizeof(char));
        if (squares[i] == NULL){
            exit(1);//エラー処理
        }
    }
    
    for ( i = 0; i < row; i++){
        for ( j = 0; j < column; j++){
            scanf(" %c",&squares[i][j]);//入力を受け取る
        }
    }
    //白のみの行を探索してその行を削除する
    for ( i = 0; i < row; i++){
        flag = 1;
        for ( j = 0; j < column; j++){
            if (squares[i][j] == '#'){
                flag = 0;
            }
        }
        //白のみだった場合
        if (flag==1){
            for (j = i;j < row-1;j++){
                for ( k = 0; k < column; k++){
                    //行を上に平行移動
                    squares[j][k] = squares[j+1][k];
                } 
            }
            row -= 1;
            i -= 1;
        }
        
        
    }
    //白のみの列を探してその列を削除する
    for ( i = 0; i < column; i++){
        flag = 1;
        for ( j = 0; j < row; j++){
            if (squares[j][i] == '#'){
                flag = 0;
            }
            
        }
        //白のみの列だった場合
        if (flag==1){
            for ( j = i; j < column-1; j++){
                for ( k = 0; k < row; k++){
                    squares[k][j] = squares[k][j+1];//列を平行移動
                }                
            }
            column -= 1;
            i -= 1;
        }
    }
    
    for ( i = 0; i < row; i++){
        for ( j = 0; j < column; j++){
            printf("%c",squares[i][j]);//答えを出力
        }
        printf("\n"); 
    }

    for ( i = 0; i < copied_row; i++){
        free(squares[i]);//各行メモリ解放
    }
    free(squares);//メモリ解放
    return 0;
}


Measured memory_bytes: 1656
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <bitset>
#include <map>
#include <tuple>
#include <unordered_set>
#include <unordered_map>
#include <list>
#include <numeric>
#include <utility>
#include <iterator>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <ctime>
#include <cassert>
#include <random>
#include <cstring>

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

using namespace std;
using ll = long long;

const ll mod = 1000000007;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
int ddx[8]={-1,-1,0,1,1,1,0,-1};
int ddy[8]={0,1,1,1,0,-1,-1,-1};
bool debug=false;

/*---------------------------------------------------*/

int main(){
  int H, W;
  int h, w;
  cin >> H >> W >> h >> w;
  cout << H * W - w * H - W * h + h * w << endl;
  return 0;
}


Measured memory_bytes: 256
/*
    飲んだ魔剤で家が建つ。
    created at: 2020-04-18 10:44:53
*/

#include <bits/stdc++.h>
using namespace std;

#define all(x) (x).begin(),(x).end()
#define rev(x) greater<x>()
#define MOD 1000000007
#define INF 1000000000

typedef long long LL;
typedef long double LD;

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;
    }
}

LL modpower(LL n, LL m, LL mod)
{
    if (m == 0) {
        return 1;
    } else if (m % 2 == 0) {
        LL p = modpower(n, m/2, mod);
        return p*p % mod;
    } else {
        return n*modpower(n, m-1, mod) % mod;
    }
}

LL modinv(LL n, LL mod)
{
    return modpower(n, mod-2, mod);
}

LL modcombination(LL n, LL r, LL mod)
{
    LL ret = 1;

    for (int i = 0; i < r; i++) {
        ret *= (n-i);
        ret %= mod;
        ret *= modinv(i+1, mod);
        ret % mod;
    }

    return ret % mod;
}

int gcd(int k, int l)
{
    if (l > 0) return gcd(l, k%l);
    else return k;
}

struct UnionFind
{
    vector<int> par;

    UnionFind(int n) : par(n) {
        for (int i = 0; i < n; i++) par[i] = i;
    }

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

    void unite(int x, int y) {
        int rx = root(x);
        int ry = root(y);
        if (rx == ry) return;
        par[rx] = ry;
    }

    bool same(int x, int y) {
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};

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

    int ans = max(0, min(b, d) - max(a, c));
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>

using namespace std;

bool can(int N, vector<long long> H)
{
	--H[0];
	for (int i = 1; i < N; ++i) {
		if (H[i - 1] > H[i]) {
			return false;
		}
		else if (H[i - 1] < H[i]) {
			--H[i];
		}
	}
	return true;
}

int main()
{
	int N;
	cin >> N;
	vector<long long> H(N);
	for (auto &x : H) {
		cin >> x;
	}
	if (can(N, move(H))) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
}


Measured memory_bytes: 1024
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string.h>
#include <vector>
#include <cmath>
#include <iostream>
#include <unordered_map>
#include <queue>
using namespace std;
typedef unsigned long long ui64;
typedef long long i64;
bool cCheck(string s) {
	int c = 0;
	if (s[1] == 'C' || s[s.size()] == 'C') return false;
	for (size_t i = 2; i < s.size() - 1; i++)
	{
		if (s[i] == 'C') c++;
	}
	return c == 1;
}
bool acCheck(string s) {
	
	for (size_t i = 0; i < s.size(); i++)
	{
		if (s[i] == 'A' || s[i] == 'C') continue;
		if ('A' < s[i] && s[i] <= 'Z') return false;
	}
	return true;
}
void AcCepted() {
	string S;
	cin >> S;
	if (S[0] != 'A') {
		cout << "WA";
	}else if(!cCheck(S)){
		cout << "WA";
	}else if (!acCheck(S)) {
		cout << "WA";
	}
	else {
		cout << "AC";
	}
}
int main() {
	AcCepted();
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
void solve(){int cnt=0;
    int l,r,d;cin>>l>>r>>d;
    for(int i=l;i<=r;i++){
        if(i%d==0) cnt++;

    }
    cout<<cnt;
}
int32_t main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);cout.tie(NULL);	 
	int T=1;
	// cin>>T;
	while(T--){
		solve();
	}
	return 0;
}


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


int main() {

	int n;

	cin >> n;

	n = ((n % 100) % 10);

	if (n == 2) {cout << "hon" << endl;}
	if (n ==  4) { cout << "hon" << endl; }
	if (n ==  5) { cout << "hon" << endl; }
	if (n ==  7) { cout << "hon" << endl; }
	if (n ==  9) { cout << "hon" << endl; }
	if (n == 0) { cout << "pon" << endl; }
	if (n ==  6) { cout << "pon" << endl; }
	if (n ==  1) { cout << "pon" << endl; }
	if (n ==  8) { cout << "pon" << endl; }
	if (n == 3) { cout << "bon" << endl; }
	

	system("pause");
}

Measured memory_bytes: 3688
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
#define ll long long

const int mod = 1e9 + 7;
int dp[10005][105][2];

void mod_self(int& a, int b) {
	a += b;
	if (a >= mod)
		a -= mod;
	if (a < 0) 
		a += mod;
}

int main() {
	string num;
	int d, size;
	cin >> num >> d;
	size = num.size();
	dp[0][0][1] = 1;
	for (int i = 0; i < size; i++) {
		for (int j = 0; j < d; j++) {
			for (int l = 0; l < 10; l++) {
				int to = (j + l) % d;
				
				if (dp[i][j][1]) {
					if (l == num[i] - '0') {
						mod_self(dp[i + 1][to][1], dp[i][j][1]);
					} else if (l < num[i] - '0') {
						mod_self(dp[i + 1][to][0], dp[i][j][1]);
					}
				}
				
				if (dp[i][j][0]) {
					mod_self(dp[i + 1][to][0], dp[i][j][0]);
				}
			}
		}
	}
	cout << (dp[size][0][0] + dp[size][0][1] - 1 + mod) % mod << endl;
}

Measured memory_bytes: 11800
A,B = map(int,input().split())
 #最大公約数
def gcd(a,b):
  while b!=0:
    a,b=b,a%b
  return a
#最小公倍数
def lcm(a,b):
  return a*b//gcd(a,b)

print(lcm(A,B))
  

Measured memory_bytes: 2940
#include<stdio.h>
#include<stdlib.h>
#include<stdbool.h>
#include<string.h>
#include<math.h>
#include<ctype.h>
#define MOD 10000007
#define rep(i,n) for(ll i=0;i<n;i++)
#define revrep(i,n) for(ll i=n;i>0;i--)

typedef long long ll;

ll fac[100001], inv[100001];

ll mygcd(ll a, ll b) { if (b == 0) return a; return mygcd(b, a % b); }

ll mylcm(ll a, ll b) { return a / mygcd(a, b) * b; }

ll mymax(ll a, ll b) { return (a > b) ? a : b; }

ll mymin(ll a, ll b) { return (a < b) ? a : b; }

int myasc(const void* a, const void* b) { return *(ll*)a - *(ll*)b; }

int mydsc(const void* a, const void* b) { return *(ll*)b - *(ll*)a; }

ll mypow(ll a, ll b) {
	ll x;
	if (b == 0) return 1;
	else if (b % 2 == 1) return a * mypow(a, b - 1) % MOD;
	x = mypow(a, b / 2);
	return x * x % MOD;
}

ll mycomb(ll a, ll b) {
	if (a < b || a < 0 || b < 0)return 0;
	return fac[a] * inv[a - b] * inv[b] % MOD;
}

int main() {
	ll n, k;
	double p, dp[200001] = {};
	scanf("%lld%lld", &n,&k);
	rep(i, n) {
		scanf("%lf%", &p);
		dp[i + 1] = dp[i] + (p+1)/2;
	}
	double max = 0;
	rep(i, n - k + 1) max = (max>dp[i + k] - dp[i])?max:dp[i+k]-dp[i];
	printf("%f", max);

	return 0;
}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
#include <cctype>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
//template<typename key, typename val>
//using ordered_tree =
//  tree<key, val, std::less<>, rb_tree_tag, tree_order_statistics_node_update>;
using namespace std;
typedef long long int64;
typedef unsigned long long uint64;
typedef complex<double> comp;
const double pi = 3.14159265358979323846;
const int inf = (int)1e+9 + 2;
const int64 inf64 = (int64)1e+18 + 2;
const double dinf = 1e+20;
const int mod = 1'000'000'007;//*/998244353;
const int base = 2187;
const double eps = 1e-9;
const int N = 300'000;
const int LOGN = 19;

int n, m, k;

void solve(int) {
  cin >> n;
  char ok = 1;
  for (int i = 0; i < n; ++i) {
    int x;
    cin >> x;
    ok &= x % 3 == 0 || x % 5 == 0 || x % 2 != 0;
  }
  if (ok) {
    cout << "APPROVED\n";
  } else {
    cout << "DENIED\n";
  }
}

void precalc() {
}

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  precalc();
  int test = 1;
  //cin >> test;
  //auto start = chrono::high_resolution_clock::now();
  for (int i = 1; i <= test; ++i) {
    solve(i);
  }
  //cerr << chrono::duration_cast<chrono::milliseconds>(chrono::high_resolution_clock::now() - start).count() << '\n';
  return 0;
}



Measured memory_bytes: 256
#pragma GCC optimize(2,3,"Ofast")
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define db double
#define in inline
namespace fast_io
{
    char buf[1<<12],*p1=buf,*p2=buf,sr[1<<23],z[23],nc;int C=-1,Z=0,Bi=0,ny;
    in char gc() {return p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<12,stdin),p1==p2)?EOF:*p1++;}
    in int read()
    {
        int x=0;ny=1;while(nc=gc(),(nc<48||nc>57)&&nc!=EOF)if(nc==45)ny=-1;Bi=1;if(nc<0)return nc;
        x=nc-48;while(nc=gc(),47<nc&&nc<58&&nc!=EOF)x=(x<<3)+(x<<1)+(nc^48),Bi++;return x*ny;
    }
    in db gf() {int a=read(),y=ny,b=(nc!='.')?0:read();return (b?a+(db)b/pow(10,Bi)*y:a);}
    in int gs(char *s) {char c,*t=s;while(c=gc(),c<32);*s++=c;while(c=gc(),c>32)*s++=c;return s-t;}
    in void ot() {fwrite(sr,1,C+1,stdout);C=-1;}
    in void flush() {if(C>1<<22) ot();}
    template <typename T>
    in void write(T x,char t)
    {
        int y=0;if(x<0)y=1,x=-x;while(z[++Z]=x%10+48,x/=10);
        if(y)z[++Z]='-';while(sr[++C]=z[Z],--Z);sr[++C]=t;flush();
    }
    in void write(char *s) {int l=strlen(s);for(int i=0;i<l;i++)sr[++C]=*s++;sr[++C]='\n';flush();}
};
using namespace fast_io;
const int N=16,p=998244353;
int n,m[N],a[N][N],b[N][N],c[N];
int main()
{
	n=read();
	for(int i=1;i<=n;i++)
	{
		m[i]=read();
		for(int j=1;j<=m[i];j++) a[i][j]=read(),b[i][j]=read();
	}
	int S=(1<<n),ans=0;
	for(int s=0;s<=S;s++)
	{
		int res=0,op=1;
		for(int i=1;i<=n;i++) c[i]=bool(s&(1<<i-1)),res+=c[i];
		for(int i=1;i<=n;i++) for(int j=1;j<=m[i];j++)
		if(c[i]&&(b[i][j]!=c[a[i][j]])) op=0;
		if(op) ans=max(ans,res);
	}
	write(ans,'\n');
	return ot(),0;
}
//Author: disangan233
//In my dream's scene,I can see the everything that in Cyaegha.

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

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

    int N;
    cin >> N;
    string S, T;
    cin >> S >> T;
    for (int i = 0; i < N; i++) {
        cout << S[i] << T[i];
    }
    cout << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using vs=vector<string>;
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define range(i,a,n) for(int i=(a);i<(n);i++)

#define LINF    	((ll)1ll<<60)
#define INF     	((int)1<<30)
#define EPS     	(1e-9)
#define MOD     	(1000000007ll)
#define fcout(a)	cout<<setprecision(a)<<fixed
#define fs 			first
#define sc			second
#define PI			(3.1415926535897932384)

int dx[]={1,0,-1,0,1,-1,-1,1},dy[]={0,1,0,-1,1,1,-1,-1};
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s; a=0;} return os;}
template<class T> void chmax(T &a, const T &b){if(a<b)a=b;}
template<class T> void chmin(T &a, const T &b){if(a>b)a=b;}
void YN(bool b){cout<<(b?"YES":"NO")<<endl;}
void Yn(bool b){cout<<(b?"Yes":"No")<<endl;}
void yn(bool b){cout<<(b?"yes":"no")<<endl;}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll a,b,c;
	cin>>a>>b>>c;
	cout<<a*b/2<<endl;
}	


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

typedef long long ll;

int main(){
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    vector<int> a(n);
    for(int i=0;i<n;i++)cin >> a[i];

    int cou=0;
    for(int i=0;i<n;i++){
        for(int j=0;j<n-i-1;j++){
            if(a[j]>a[j+1]){
                swap(a[j],a[j+1]);
                cou++;
            }
        }
    }
    for(int i=0;i<n;i++)cout << a[i] << (i!=n-1?" ":"\n");
    cout << cou << endl;
}



Measured memory_bytes: 3216
#include<bits/stdc++.h>
#define INF 2147483647
#define SYOU(x) setprecision(x)
using namespace std;
long long i[300000];
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  long long a,b,c,d=0,e=0;
  string s,u;
  cin >>s;
  for(int n=0;n<s.size();n++){
    if(s[n]=='0') u.push_back('0');
    else{
      if(s[n]=='1') u.push_back('1');
      else{
	if(!u.empty())
	  u.erase(u.size()-1);
      }
    }
  }
  for(int n=0;n<u.size();n++) cout <<u[n];
  cout <<'\n';
  return (0);
}


Measured memory_bytes: 256
import java.io.PrintWriter
import java.util.*

val pw = PrintWriter(System.out)

val NUM_MAX = 200000
fun main(args: Array<String>) {
    val (n, k) = readListOfInt()
    val a = readListOfInt()
    
    val numList = (0..NUM_MAX).map{ 0 }.toMutableList()

    for(i in 0 until n) {
        numList[a[i]]++
    }
    
    val filteredNumList = numList.filter { it > 0 }.sorted()

    val cnt = filteredNumList.slice(0 until (filteredNumList.size-k)).sum()

    println(cnt)

    pw.flush()
}

fun inputList() = 
    readLine()!!.split(" ").map(String::toInt)

fun sum_digits(num_: Long): Long {
    var num = num_
    var rtn: Long = 0
    while(num != 0.toLong()) {
        val tmp = num % 10
        rtn += tmp
        num /= 10
    }
    return rtn
}

/****** Decrared Functions ******/

// IO
fun read() = readLine()!!
fun readInt() = read().toInt()
fun readLong() = read().toLong()
fun readDouble() = read().toDouble()
fun readListOfString() = read().split(" ")
fun readListOfInt() = readListOfString().map { it.toInt() }
fun readListOfLong() = readListOfString().map { it.toLong() }
fun readListOfDouble() = readListOfString().map { it.toDouble() }


fun println(value : Any) {
    pw.println(value)
}

fun gcd(a: Long, b: Long): Long = 
    if(b != 0L) a else gcd(b, a % b)

fun lcm(a: Long, b: Long) = 
    if(b==0L) a else gcd(b, a % b)


Measured memory_bytes: 84532
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
using namespace std;

int main(){
    int n;
    string s;
    cin >> n >> s;
    for(int i=0;i<s.size();i++){
        char x=(s.at(i)+n-'A')%26+'A';
        cout << x;
    }
    cout <<endl;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
long i,n,a,b,c;
cin>>n;
for(i=0;i<n;i++){
cin>>a>>b>>c;
a*=a;b*=b;c*=c;
if(a>b&&a>c&&a==b+c){
if(a==b+c)cout<<"YES"<<endl;else cout<<"NO"<<endl;
}else if(b>a&&b>c){
if(b==a+c)cout<<"YES"<<endl;else cout<<"NO"<<endl;
}else if(c>a&&c>b){
if(c==a+b)cout<<"YES"<<endl;else cout<<"NO"<<endl;
}else cout<<"NO"<<endl;
}
return 0;
}

Measured memory_bytes: 1156
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
const int MOD = 1e9+7;

int main(){
	
	int k;
	string s;
	cin >> k >> s;
	if(s.size()>k){
		for(int i=0; i<k; i++) cout << s.at(i);
		cout <<"..." << endl;
	}
	else cout << s << endl;
	
}



Measured memory_bytes: 3632
#include <iostream>
    #include <vector>
    #include <algorithm>
    #include <cmath>
     
    int main() {
        long long int n, b;
        std::cin >> n;
        std::vector<long long int> a(n);
     
        for (long long int i = 0; i < n; i++) {
            std::cin >> a[i];
            a[i] -= i;
        }
     
        std::sort(a.begin(), a.end());
        if (n % 2 == 0) b = a[n/2];
        else b = a[(n-1)/2];
     
        long long ret = 0;
     
        for (auto j : a) {
            ret += std::abs(j - b);
        }
     
        std::cout << ret << std::endl;
     
        return 0;
    }

Measured memory_bytes: 1792