akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<map>
#include<math.h>
#include<queue>
#include<deque>
#include<stack>
#include<cstdio>
#include<utility>
#include<set>
#include<list>
#include<cmath>
#include<stdio.h>
#include<string.h>
#include<iomanip>
using namespace std;
#define FOR(i, a, b) for (ll i = (a); i <= (b); i++)
#define REP(i, n) FOR(i, 0, n - 1)
#define NREP(i, n) FOR(i, 1, n)
using ll = long long;
using pii = pair<int, int>;
using piii = pair<pii, pii>;
const int dx[4] = { 0, -1, 1, 0 };
const int dy[4] = { -1, 0, 0, 1 };
const int INF = 1e9 + 7;
int gcd(int x, int y) {
	if (x < y)swap(x, y);
	if (y == 0)return x;
	return gcd(y, x%y);
}

template<class T1, class T2> void chmin(T1 &a, T2 b) { if (a>b)a = b; }

template<class T1, class T2> void chmax(T1 &a, T2 b) { if (a<b)a = b; }
template<class T>
void Add(T &a, const T &b, const T &mod = 1000000007) {
	int val = ((a % mod) + (b % mod)) % mod;
	if (val < 0) { val += mod; }
	a = val;
}
////////////////////////////////////////

int main() {
	ll N, M, a[100009][3], maxn = -(1LL << 60);
	cin >> N >> M;
	for (int i = 0; i < N; ++i) {
		for (int j = 0; j < 3; ++j) {
			cin >> a[i][j];
		}
	}
	for (int i = 0; i < 8; ++i) {
		vector<ll>vec;
		for (int j = 0; j < N; ++j) {
			ll S = 0;
			for (int k = 0; k <3; ++k) {
				if ((i / (1 << k)) % 2 == 0) {
					S += a[j][k];
				}
				else {
					S -= a[j][k];
				}
			}
			vec.push_back(S);
		}
		sort(vec.begin(),vec.end());
		reverse(vec.begin(),vec.end());
		ll ans = 0;
		for (int j = 0; j < M; ++j) {
			ans += vec[j];
		}
		maxn = max(maxn, ans);
	}
	cout << maxn << endl;
	return 0;
}


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

int main()
{
    int N;
    cin >> N;

    int P;
    vector<int> Q(N + 1, 0);
    for (int i = 0; i < N; i++)
    {
        cin >> P;
        Q[P] = i;
    }

    int current = 0;
    int ans = N - 1;
    for (int i = 1; i <= N; i++)
    {
        if (Q[i] > Q[i - 1])
        {
            current++;
            ans = min(ans, N - current);
        }
        else
        {
            current = 1;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 1024
n,L=list(map(int,input().split()))
l=[]
for i in range(1,n+1):
    l.append(L+i-1)
m=abs(l[0])
t=l[0]
for i in range(1,len(l)):
    if abs(l[i])<m:
        m=abs(l[i])
        t=l[i]

print(sum(l)-t)

Measured memory_bytes: 3064
#include <iostream>
#define rep(i,a,b) for(int i=a; i< (int)(b); ++i)
#define ALL(x) (x).begin(),(x).end()
#define rALL(x) (x).rbegin(),(x).rend()
typedef long double ld;
using ll=long long;
using namespace std;
const auto mod=1e9+7;


int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int n; cin >> n;
  string ans="No";
  while(n>0){
  	int k = n%10;
  	if(k==7) ans="Yes";
  	n/=10;
  }
  cout << ans << endl;
 }

Measured memory_bytes: 3652
#include <bits/stdc++.h>
using namespace std;
int main(){
    long long int n;
    cin>>n;
    long long int h[n],total[n];
    for(int i=0;i<n;i++)
    cin>>h[i];
    total[0]=0;
    if(h[0]<h[1])
    total[1]=h[1]-h[0];
    else
    total[1]=h[0]-h[1];
    for(int i=2;i<n;i++){
        long long int x,a,b;
        x=h[i]-h[i-2];
        if(x<0)
        x=-1*x;
        a=total[i-2]+x;
        x=h[i]-h[i-1];
        if(x<0)
        x=-1*x;
        b=total[i-1]+x;
        if(a<b)
        total[i]=a;
        else
        total[i]=b;
    }
    cout<<total[n-1];
    return 0;
}

Measured memory_bytes: 1792
#include<iostream>

using namespace std;

int main(){
    int w, h, x, y, r;
    cin >> w >> h >> x >> y >> r;
    if(0 <= x - r && x + r <= w && 0 <= y - r && y + r <= h) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 3112
package main

import "fmt"

func main() {
	var N, SN int64
	fmt.Scan(&N)
	n := N
	for {
		SN += n % 10
		n /= 10
		if n == 0 {
			break
		}
	}
	if N%SN == 0 {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


Measured memory_bytes: 512
def gcd(x,y):
  if y==0:
    return x
  return gcd(y, x%y)
def lcm(x,y):
  return x*y//gcd(x,y)
n,m=map(int,input().split())
ans=lcm(n,m)
s=list(input())
t=list(input())
p=n//gcd(n,m)
q=m//gcd(n,m)
flag=True
if p>=q:
  for i in range(0,m,q):
    if s[(p*i)//q]!=t[i]:
      flag=False
      break
else:
  for i in range(0,n,p):
    if s[i]!=t[(q*i)//p]:
      flag=False
      break
if flag:
  print(ans)
else:
  print(-1)

Measured memory_bytes: 4624
n = int(input())
if(n>555):
  if(n<=666):
    x = 666
  elif(n<=777):
    x = 777
  elif(n<=888):
    x = 888
  else:
    x = 999
else:
  if(n>444):
    x = 555
  elif(n>333):
    x = 444
  elif(n>222):
    x = 333
  elif(n>111):
    x = 222
  else:
    x = 111
print(x)
    

Measured memory_bytes: 3060
($n,$k)=glob<>;
foreach(1..$n){
    $c=<>;
    push (@h,$c);
}

@h = sort {$a<=>$b} @h;
$d[0]=0;
for(my$i=1;$i<$n;$i++){
    $d[$i]=$h[$i]-$h[$i-1]+$d[$i-1];
}
$min=1<<32;
for(my$i=0;$i<$n-$k+1;$i++){
    $dt=$d[$i+$k-1]-$d[$i];
    $min=($min<$dt)?$min:$dt;
}
print $min;


Measured memory_bytes: 15728
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0;i<static_cast<int>(n);++i)
#define per(i, n) for(int i=static_cast<int>(n)-1;i>=0;--i)
#define eee(a) (cerr<<(#a)<<": "<<(a)<<'\n');
#define ppp(a) (cout<<(a)<<'\n'); 
#define cop(a) for(auto x:(a)){cerr<<(x)<<'\n';}
using ll = long long;
constexpr int dx[4]={1,0,-1,0};
constexpr int dy[4]={0,1,0,-1};
constexpr ll MOD = 1e9+7;
constexpr ll Mod = 998244353;
constexpr int INF = 1e9;
constexpr ll LINF = 1e18;
constexpr double phi = (1+sqrt(5))/2;
constexpr double pi = 3.14159265358979323846264338327950288;
inline ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
inline ll lcm(ll a,ll b){return a/gcd(a,b)*b;}
inline ll inverse(ll n,ll m=MOD){ll a=n,b=m,x=1,y=0;while(b){ll t=a/b;a-=t*b;swap(a,b);x-=t*y;swap(x,y);}return (a%m+m)%m;}
inline void Yes(){puts("Yes");}
inline void No(){puts("No");}
inline void Judge(bool b){b?Yes():No();}
inline void YES(){puts("YES");}
inline void NO(){puts("NO");}
inline void JUDGE(bool b){b?YES():NO();}
inline ll powmod(ll b, ll e, ll m=MOD){ll r=1;while(e>0){if(e&1)r=(r%m)*(b%m)%m;b=(b%m)*(b%m)%m;e>>=1;}return r;}
inline double distance(ll x1, ll y1, ll x2, ll y2){return sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));}
inline double d2r(double d){return d*pi/180;}
inline double r2d(double r){return r*180/pi;}
template<class T>inline bool chmax(T &a, const T &b){if(a<b){a=b;return 1;}return 0;}
template<class T>inline bool chmin(T &a, const T &b){if(b<a){a=b;return 1;}return 0;}
template<typename T1,typename T2>ostream& operator<<(ostream& s,const pair<T1, T2>& p){return s <<"("<<p.first<<", "<<p.second<<")";}
template<typename T> ostream& operator<<(ostream& s,const vector<T>& v){s<<'[';for(size_t i=0;i<v.size();++i){s<<v[i];if(i<v.size()-1)s<<", ";}s<<']';return s;}

int main(){
    cin.tie(0); ios::sync_with_stdio(0); cout<<fixed<<setprecision(15);
    
    int n, k;
    cin >> n >> k;
    vector<ll> a(n);
    rep(i, n) cin >> a[i];
    
    ll ans = LINF;
    for(int b = 0; b < 1<<n; ++b){
        ll H = a[0];
        int cnt = 1;
        ll tmp = 0;
        for(int i = 1; i < n; ++i){
            if(chmax(H, a[i])){
                ++cnt;
            }else{
                if(1<<i & b){
                    tmp += H+1-a[i];
                    ++H;
                    ++cnt;
                }
            }
        }
        if(cnt >= k) chmin(ans, tmp);
    }
    cout << ans << '\n';
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <deque>
#include <cctype>
#include <cstdio>
#include <math.h>
using namespace std;
int main(){
    long long x;
    cin >> x;
    vector<long long> t(10000000);
    long long total=0;
    long long ans=0;
    for(long long i=0;i<10000000;i++){
        total+=i;
        t[i]=total;
         if(t[i]>=x){
            ans = i;
            break;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 78336
import java.util.*;
import java.io.*;
import java.awt.geom.*;
import java.math.*;

public class Main {

	static final Scanner in = new Scanner(System.in);
	static final PrintWriter out = new PrintWriter(System.out,false);
	static boolean debug = false;

	static void solve() {
		String s = in.next();
		int n = s.length();
		for (int i=0; i<n-1; i++) {
			if (s.charAt(i) == s.charAt(i+1)) {
				out.println((i+1)+" "+(i+2));
				return;
			}
		}
		for (int i=0; i<n-3; i++) {
			if (s.charAt(i) == s.charAt(i+2)) {
				out.println((i+1)+" "+(i+3));
				return;
			}
		}
		out.println("-1 -1");
	}

	public static void main(String[] args) {
		debug = args.length > 0;
		long start = System.nanoTime();

		solve();
		out.flush();

		long end = System.nanoTime();
		dump((end - start) / 1000000 + " ms");
		in.close();
		out.close();
	}

	static void dump(Object... o) { if (debug) System.err.println(Arrays.deepToString(o)); }
}

Measured memory_bytes: 13012
#include<bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(ll i=num, i##_len=(n); i<i##_len; ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
const ll LLINF = 1LL<<60;
const int INTINF = 1<<30;
const int MOD = 1000000007;

void add(long long &a, long long b) {
  a += b;
  if (a >= MOD) a -= MOD;
}

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


int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int N, C; cin >> N >> C;
    vector<vector<int> > D(C, vector<int>(C, 0));
    for (int i = 0; i < C; ++i) for (int j = 0; j < C; ++j) cin >> D[i][j];
    vector<vector<int> > fi(N, vector<int>(N, 0));
    for (int i = 0; i < N; ++i) for (int j = 0; j < N; ++j) cin >> fi[i][j], --fi[i][j];

    // 前処理
    vector<vector<int> > cost(3, vector<int>(C, 0));
    for (int c = 0; c < C; ++c) {
        for (int i = 0; i < N; ++i) {
            for (int j = 0; j < N; ++j) {
                cost[(i+j)%3][c] += D[fi[i][j]][c];
            }
        }
    }

    int ans = 1 << 30;
    int c[3];
    for (c[0] = 0; c[0] < C; ++c[0]) {
        for (c[1] = 0; c[1] < C; ++c[1]) {
            if (c[1] == c[0]) continue;
            for (c[2] = 0; c[2] < C; ++c[2]) {
                if (c[2] == c[0] || c[2] == c[1]) continue;
                int tmp = 0;
                for (int it = 0; it < 3; ++it) tmp += cost[it][c[it]];
                ans = min(ans, tmp);
            }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 1280
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

template<typename T> void drop(const T &x){cout<<x<<endl;exit(0);}

//INSERT ABOVE HERE
signed main(){
  int a,b,c;
  cin>>a>>b>>c;
  if(a==b&&b==c) drop("No");
  if(a==b||b==c||c==a) drop("Yes");
  drop("No");
  return 0;
}


Measured memory_bytes: 256
// Package main provides
//
// File:  main.go
// Author: ymiyamoto
//
// Created on Sat Jul 20 23:34:16 2019
//
package main

import (
	"fmt"
	"sort"
)

func main() {
	var n int
	fmt.Scan(&n)

	arr := make([]int, n)
	for i := range arr {
		fmt.Scan(&arr[i])
	}

	dp := []int{1 << 60}
	for _, a := range arr {
		last := dp[len(dp)-1]
		if last >= a {
			dp = append(dp, a)
		} else {
			i := sort.Search(len(dp), func(i int) bool {
				return a > dp[i]
			})
			dp[i] = a
		}
	}
	fmt.Println(len(dp) - 1)
}


Measured memory_bytes: 6912
#include <bits/stdc++.h>
using namespace std;
#define FIN ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef map<int, int> mii;
typedef map<ll, ll> mll;
typedef set<ii> sii;
typedef set<int> si;
typedef priority_queue<int> pqi;
typedef priority_queue<ii> pqii;

const int INF = 1000000010;
const ll MOD = 1000000007;

int main() {FIN
	
	ll x, k, d, n;
	cin >> x >> k >> d;
	n = abs(x) / d;
	if (k > n)
		cout << ((k-n)&1 ? abs(abs(x)-(n+1)*d) : abs(abs(x)-n*d)) << "\n";
	else
		cout << abs(x) - (k*d) << "\n";
	
	return 0;
}


Measured memory_bytes: 3648
#include <bits/stdc++.h>
using namespace std;
int main(void){

string S;
cin >> S;

if(S == "SUN")
  cout << 7;
else if (S == "MON")
  cout << 6;
else if (S == "TUE")
  cout << 5;
else if (S == "WED")
  cout << 4;
else if (S == "THU")
  cout << 3;
else if (S == "FRI")
  cout << 2;
else if (S == "SAT")
  cout << 1;
  
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
const int INF=1e9,MOD=1e9+7,ohara=1e6+10;
const ll LINF=1e18;
using namespace std;

#define rep(i,n) for(int (i)=0;(i)<(int)(n);(i)++)
#define rrep(i,a,b) for(int i=(a);i<(b);i++)
#define rrrep(i,a,b) for(int i=(a);i>=(b);i--)
#define all(v) (v).begin(), (v).end()
#define Size(n) (n).size()
#define Cout(x) cout<<(x)<<endl
#define doublecout(a) cout<<fixed<<setprecision(15)<<a<<endl;
#define Cerr(x) cerr<<(x)<<endl
#define fi first
#define se second
#define P pair<ll,ll> 
#define m_p make_pair
#define V vector<ll> 

ll n,cnt,ans,a[10],b[10],c[10][10],d,tmp,tmpp,m,h,w,x,y,sum,pos,k;
ld doua;
int dy[]={1,0,-1,0};
int dx[]={0,1,0,-1};
//int dy[]={-1,0,1,-1,1,-1,0,1};
//int dx[]={-1,-1,-1,0,0,1,1,1};
string alph("abcdefghijklmnopqrstuvwxyz"),s;
bool fl;
struct edge{int to,cost;};

//-------------------------↓↓↓↓↓↓------------------------

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

    rep(i,3)rep(j,3)cin>>c[i][j];
    rep(a1,101){
        rep(a2,101){
            rep(a3,101){
                ll b1,b2,b3;
                b1=c[0][0]-a1;
                b2=c[0][1]-a1;
                b3=c[0][2]-a1;
                a[0]=a1;a[1]=a2;a[2]=a3;
                b[0]=b1;b[1]=b2;b[2]=b3;
                int ok=1;
                rep(i,3){
                    rep(j,3){
                        if(a[i]+b[j]!=c[i][j]){
                            ok=0;
                            break;
                        }
                    }
                }
                if(ok){
                    Cout("Yes");
                    return 0;
                }
            }
        }
    }
    Cout("No");
    return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;

namespace A
{
    class Program
    {
        static void Main(string[] args)
        {
            var S = Io.Read();
            var T = Io.Read();

            var count = 0;
            for (var i = 0; i < 3; i++)
            {
                if (S[i] == T[i])
                {
                    count++;
                }
            }

            Console.WriteLine(count);
        }
    }

    class Io
    {
        public static string Read()
        {
            return Console.ReadLine();
        }

        public static IEnumerable<string> ReadRepeat(int count)
        {
            return Enumerable.Range(0, count).Select(_ => Read());
        }

        public static T Read<T>()
        {
            return (T)Convert.ChangeType(Read(), typeof(T));
        }

        public static IEnumerable<T> ReadRepeat<T>(int count)
        {
            return Enumerable.Range(0, count).Select(_ => Read<T>());
        }

        public static string[] ReadSplit(char devide = ' ')
        {
            return Read().Split(devide);
        }

        public static T[] ReadSplit<T>(char devide = ' ')
        {
            return ReadSplit(devide)
                .Select(s => (T)Convert.ChangeType(s, typeof(T)))
                .ToArray();
        }

        public static IEnumerable<T[]> ReadSplitRepeat<T>(int count, char devide = ' ')
        {
            return Enumerable.Range(0, count).Select(_ => ReadSplit<T>(devide));
        }
    }
}


Measured memory_bytes: 11092
#include <bits/stdc++.h>
#include <cmath>
#include <iostream>
#include <numeric>
#define ll long long
using namespace std;
int main() {
  int N;
  string S;
  cin>>N>>S;
  for(int i=0;i<S.size();i++){
    for(int j=0;j<N;j++){
      S[i]++;
      if(S[i]=='[') S[i]='A';
    }
  }
  cout<<S<<endl;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
"""
http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=0526
TLE
"""
import sys
from sys import stdin
from heapq import heappush, heappop
from collections import namedtuple
input = stdin.readline


def warshall_floyd(d, V):
    for k in range(V):
        for i in range(V):
            for j in range(V):
                new_cost = d[i][k] + d[k][j]
                if new_cost < d[i][j]:
                    d[i][j] = new_cost


def main1(args):
    while True:
        n, k = map(int, input().split())
        if n == 0 and k == 0:
            break

        d = [[float('inf')] * (n+1) for _ in range(n+1)]
        #for i in range(n+1):
        #    d[i][i] = 0

        updated = False
        for _ in range(k):
            data = [int(x) for x in input().split()]
            if data[0] == 0:
                if updated:
                    warshall_floyd(d, n+1)
                    updated = False
                f, t = data[1], data[2]
                if d[f][t] == float('inf'):
                    print(-1)
                else:
                    print(d[f][t])
            else:
                f, t, c = data[1], data[2], data[3]
                if c < d[f][t]:
                    d[f][t] = c
                    updated = True
                if c < d[t][f]:
                    d[t][f] = c
                    updated = True


edge = namedtuple('edge', ['t', 'c'])
def dijkstra(s, G):
    pq = []
    d = [float('inf')] * len(G)
    d[s] = 0
    heappush(pq, (0, s))

    while pq:
        c, v = heappop(pq)
        if d[v] < c:
            continue

        for e in G[v]:          #  ?????????v?????£??\??????????????±????????¨?????????????????°?????§?????????????????´??°
            if d[e.t] > d[v] + e.c: #  ???????????§??\??£?????????????????????????????????v????????±????????????????????????????????????????????°???????????????????????´??°
                d[e.t] = d[v] + e.c
                heappush(pq, (d[e.t], e.t)) #  python???heapq??????????°???????????????????pop?????????????????????????????§???-1??????????????????
    return d


def main(args):
    while True:
        n, k = map(int, input().split())
        if n == 0 and k == 0:
            break

        d = [[] for _ in range(n+1)]
        costs = [[float('inf')]*(n+1) for _ in range(n+1)]
        updated = False
        for _ in range(k):
            data = [int(x) for x in input().split()]
            if data[0] == 0:
                f, t = data[1], data[2]
                if updated:
                    costs[f] = dijkstra(f, d)
                if costs[f][t] == float('inf'):
                    print(-1)
                else:
                    print(costs[f][t])
            else:
                f, t, c = data[1], data[2], data[3]
                d[f].append(edge(t, c))
                d[t].append(edge(f, c))
                updated = True



if __name__ == '__main__':
    main(sys.argv[1:])
    

Measured memory_bytes: 9016
#include <iostream>
#include <map>
#include <string>
#include <iterator>

using namespace std;

int main() 
{
  map<char,int> L;
  string S;
  cin >> S;
  for(char s : S) {L[s]++;}
  
  if(L.size() == 2)
  {
    map<char,int> :: iterator i = L.begin();
    if((*i).second == 2){cout << "Yes";}
    else {cout << "No";}
  }
  else { cout << "No";}
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstdio>
#include <iomanip>
#include <fstream>
#include <cassert>
#include <cstring>
#include <numeric>
#include <ctime>
#include <complex>
#include <bitset>
#include <random>
#include <climits>

using namespace std;

typedef long long ll;
typedef long double ld;

#define int ll
#define double ld
#define loop(i, n) for(int i = 0; i < (int)n; ++i)
#define loop1(i, n) for(int i = 1; i <= (int)n; ++i)
#define F first
#define S second
#define pb push_back
#define pi pair <int, int>
#define all(x) begin(x), end(x)
#define ti tuple <int, int, int>
#define Point Vect
#define no {cout << 0; return;}
#define mkp make_pair
#define mkt make_tuple
#define cerr if(0) cerr

void solve() {
    int n;
    cin >> n;
    bool ok = 1;
    loop(i, n) {
        int x; cin >> x;
        if (x % 2 == 0 && (x % 3 && x % 5))
            ok = 0;
    }
    cout << (ok ? "APPROVED" : "DENIED");
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    //int t; cin >> t; loop(i, t)
    solve();
    return 0;
}

Measured memory_bytes: 3620
N=gets.to_i
h=gets.split.map(&:to_i)
mh = Array.new(N,h[0])
(N-1).times do |i| 
    mh[i+1]=[mh[i],h[i+1]].max
end
ans = 1
(N-1).times do |i|
    ans += 1 if mh[i]<=h[i+1]
end
puts ans

Measured memory_bytes: 1788
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>

using flt = double;
const flt eps = 1e-12, inf = 1e18, PI = acos(-1.0);
template<typename T>
inline T sqr(T x) {return x * x;}
inline flt cmp(flt a, flt b, flt e = eps) {
  return fabs(a - b) >= e + fabs(a) * e ? a - b : 0;
}
inline int sgn(flt x, flt e = eps) {return x < -e ? -1 : (x > e);}
inline flt fix(flt x, flt e = eps) {return cmp(x, 0, e);}

struct point {
  flt x, y;
  point(flt x = 0, flt y = 0): x(x), y(y) {}
  bool operator < (const point &rhs) const {
    return cmp(x, rhs.x) < 0 || (cmp(x, rhs.x) == 0 && cmp(y, rhs.y) < 0);
  }
  bool operator == (const point &rhs) const {
    return cmp(x, rhs.x) == 0 && cmp(y, rhs.y) == 0;
  }
  point operator + (const point &rhs) const {
    return point(x + rhs.x, y + rhs.y);
  }
  point operator - (const point &rhs) const {
    return point(x - rhs.x, y - rhs.y);
  }
  point operator * (const flt k) const {
    return point(x * k, y * k);
  }
  point operator / (const flt k) const {
    return point(x / k, y / k);
  }
  point operator ~ () const {// counter clockwise rotate 90 degree
    return point(-y, x);
  }
  flt dot(const point &rhs) const {
    return x * rhs.x + y * rhs.y;
  }
  flt det(const point &rhs) const {
    return x * rhs.y - y * rhs.x;
  }
  flt norm2() const {
    return x * x + y * y;
  }
  flt norm() const {
    return hypot(x, y);
  }
  point rot(flt a) const {// counter clockwise rotate A rad
    return point(x * cos(a) - y * sin(a), x * sin(a) + y * cos(a));
  }
  point rot(flt cosa, flt sina) const {// counter clockwise rotate using cos/sin
    return point(x * cosa - y * sina, x * sina + y * cosa);
  }
  point trunc(flt a = 1.0) const {
    return (*this) * (a / this->norm());
  }
};

point reflect(const point &A, const point &B, const point &O) {
  point AB = B - A;
  return (A + AB * (AB.dot(O - A) / AB.norm2())) * 2 - O;
}

int main() {
  point A, B;
  scanf("%lf%lf%lf%lf", &A.x, &A.y, &B.x, &B.y);
  int q;
  scanf("%d", &q);
  for (int i = 0; i < q; ++i) {
    point O;
    scanf("%lf%lf", &O.x, &O.y);
    O = reflect(A, B, O);
    printf("%.10f %.10f\n", O.x, O.y);
  }
  return 0;
}

Measured memory_bytes: 2756
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll INF = 1LL<<60;
#define all(x) (x).begin(),(x).end()
#define REP(i,n) for(int i=0; i<(n);++i)
#define FOR(i,k,n) for(int i=(k);i<(n);++i)


const int MAX = 1000005;
const ll MOD = 1000000007;

ll fac[MAX], finv[MAX], inv[MAX];

void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main(){
    int H, W, A, B; cin >> H >> W >> A >> B;
    COMinit();
    ll ans = 0;
    // 下にH-A-1回、右にB+i(0<=i<W-B)回移動する
    // その後一つ下のマスに移動し、それから先ほど右に移動した回数iに応じて
    // 下にA-1回、右にW-B-1-i回移動する
    REP(i,W-B){
        ll tmp = COM(H-A-1+B+i,H-A-1);
        tmp *= COM(A-1+W-B-1-i,A-1);
        tmp %= MOD;
        ans = (ans + tmp) % MOD;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 23680
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Main main = new Main();
        main.solve();
    }
    public void solve() {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        long a = scan.nextInt();
        long ans = a + a * a + a * a * a;
        System.out.println(ans);
    }
}


Measured memory_bytes: 35808
#include <cstdio>
int main(){
	int H,W;
	while(1){
		scanf("%d %d",&H,&W);
		if(!W&&!H){break;}
		for(int i=0;i<H;i++){
			for(int j=0;j<W;j++){
				if(!(i%2-j%2)){putchar('#');}
				else{putchar('.');}
			}
			putchar('\n');
		}
		putchar('\n');
	}
}

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

int main(){
    int h,w,cnt,l,el,c,ec,k;
    cin>>h>>w;
    char m[h+1][w+1];
    for(int i = 0;i<h;++i){
        if(i == 0){
            getchar();
        }
        cin.getline(m[i],100);
    }
    for(int i = 0;i<h;++i){
        
        for(int j = 0;j<w;++j){
            if(m[i][j] == '#'){
                continue;
            }
            cnt = 0;
            l = i-1;
            el = i+1;
            c = j-1;
            ec = j+1;
            if(i == 0){
                l = i;
            }
            if(i == h-1){
                el = h-1;
            }
            if(j == 0){
                c = j;
            }
            if(j == w-1){
                ec = j;
            }
            for(;l<=el;++l){
                for(k = c;k<=ec;++k){
                    if(l == i && k == j){
                        continue;
                    }
                    if(m[l][k] == '#'){
                        cnt++;
                    }
                }
            }
            m[i][j] = cnt+'0';
        }
    }
    for(int i = 0;i<h;++i){
        for(int j = 0;j<w;++j){
            cout<<m[i][j];
        }
        cout<<endl;
    }

    return 0;
}

Measured memory_bytes: 3616
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <vector>
#include <string>
#include <sstream>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <typeinfo>
#include <math.h>
#include <iomanip>
#include <limits>

using namespace std;
using ll = long long;
const ll res = 1000000007;

int main() {
	string s;
	cin >> s;
	if (s[2] == s[3] and s[4] == s[5])
		cout << "Yes" << endl;
	else
		cout << "No" << endl;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>
int main(void){
  int N,M;
  int *p;
  scanf("%d %d",&N,&M);
  p=calloc(M+1,sizeof(int));
  int i;
  for(i=1; i<=M; i++){
   	scanf("%d",&p[i]);
    N-=p[i];
  }
  if(N<0)
    printf("-1");
  else
    printf("%d",N);
  return 0;
}


Measured memory_bytes: 1744
////////////////////////// Author
////////////////////////// Nasim Hossain Rabbi
////////////////////////// JU-CSE28
////////////////////////// CF - imnasim3.1415
////////////////////////// UVA - imnasim3.1415
////////////////////////// Mail - imnasim3.1415@gmail.com
#include<bits/stdc++.h>
using namespace std;
#define E end()
#define B begin()
#define sz size()
#define EM empty()
#define clr clear()
#define sqr(a) (a*a)
#define mk make_pair
#define pb push_back
string en="\n";
string t="hello";
string Y="YES\n";
string N="NO\n";
#define rep(i,n) for(i=0;i<n;i++)
#define Rep(i,n) for(i=1;i<=n;i++)
#define per(i,n) for(i=n-1;i>=0;i--)
#define peR(i,n) for(i=n;i>0;i--)
#define mem(a,b) memset(a,b,sizeof(a))
#define all(cont) cont.begin(),cont.end()
#define fast ios_base::sync_with_stdio(false); cin.tie(NULL);cout.tie(NULL)
#define pi 3.1415926535897932384626433832795
#define vi vector<int>
#define vl vector<long long>
#define vs vector<string>
#define vp(vi,x) cin>>x; vi.pb(x);
#define srch(a,x) binary_search(all(a),x)
#define LB(a,x) (lower_bound(all(a),x)-a.B)
#define UB(a,x) (upper_bound(all(a),x)-a.B)
typedef long long LL;
typedef unsigned long long ULL;
bool isprm(LL a){for(LL i=2;i*i<=a;i++){if(a%i==0)return false;}return true;}
bool isVowel(char ch){ ch=toupper(ch); if(ch=='A'||ch=='U'||ch=='I'||ch=='O'||ch=='E') return true; return false;}
int toInt(string s){int sm;stringstream ss(s);ss>>sm;return sm;}
template<typename T>inline T gcd(T a,T b){if(a<0)return gcd(-a,b);if(b<0)return gcd(a,-b);return (b==0)?a:gcd(b,a%b);}
template<typename T>inline T lcm(T a,T b) {if(a<0)return lcm(-a,b);if(b<0)return lcm(a,-b);return a*(b/gcd(a,b));}
int main()
{
//    fast;
    LL i,j,k,n,m,l,s=0,x,y,tc=1,c=0;
    string a,b;
    while(cin>>a)
    {
        if(a.compare("Sunny")==0) cout<<"Cloudy"<<en;
        else if(a.compare("Rainy")==0) cout<<"Sunny"<<en;
        else  cout<<"Rainy"<<en;

    }
}



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

#include <stdio.h>

#define rep(i, n) for (int i = 0; i < (n); i++)
#define pb push_back
#define vec vector
#define ref(a) &(a)

typedef long long ll;

using namespace std;

int check(ll p, vec<int> w, int n, int k) {
  int c = 0;
  for (int i = 0; i < k; i++) {
    ll s = 0;
    while (s + w[c] <= p) {
      s += w[c];
      c++;
      if (c == n) return c;
    }
  }
  return c;
}

int main() {
  int n, k; cin >> n >> k;
  vec<int> w;
  rep(i, n) {
    int x; cin >> x;
    w.pb(x);
  }

  ll ma = 100000 * 10000, mi = 0;
  while (ma - mi > 1) {
    ll mid = (ma + mi) / 2;
    int v = check(mid, w, n, k);
    if (v < n)
      mi = mid;
    else
      ma = mid;
  }
  cout << ma << endl;
}


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

#define pb push_back
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define REP(i,n) for(int _n=n, i=0;i<_n;++i)
#define FOR(i,a,b) for(int i=(a),_b=(b);i<=_b;++i)
#define FORD(i,a,b) for(int i=(a),_b=(b);i>=_b;--i)
#define trav(a, x) for (auto& a : x)
using ull = uint64_t;
using ll = int64_t;
using PII = pair<int, int>;
using VI = vector<int>;
#define INF (1ll<<60)

string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string((string) s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B> string to_string(pair<A, B> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; }
template <typename A> string to_string(A v) {
bool first = true; string res = "{";
for (const auto &x : v) { if (!first) { res += ", "; } first = false; res += to_string(x); }
res += "}"; return res; }
void debug_out() { cerr << endl; }
template <typename Head, typename... Tail> void debug_out(Head H, Tail... T) {
  cerr << " " << to_string(H); debug_out(T...); }
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)


int main() {
    ios::sync_with_stdio(false), cin.tie(0);
    int N, K;
    cin >> N >> K;
    vector<pair<ll, ll>> V(N);
    REP(i, N) {
        int x, y;
        cin >> x >> y;
        V[i] = {x, y};
    }
    sort(all(V));
    ll ans = LLONG_MAX;
    REP(i, N - 1) {
        FOR(j, i + 1, N - 1) {
            vector<ll> A;
            FOR(k, i, j) {
                A.pb(V[k].second);
            }
            sort(all(A));
            REP(k, SZ(A) - 1) {
                FOR(l, k + 1, SZ(A) - 1) {
                    if (l - k + 1 < K) continue;
                    ll area = (V[j].first - V[i].first) * (A[l] - A[k]);
                    ans = min(area, ans);
                }
            }
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdlib>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <functional>
using namespace std;

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

char table[410][410];
int cover[410][410];
int h, w;

long long int white = 0;
long long int black = 0;

void dfs(int x, int y){
    cover[x][y] = 1;
    if(table[x][y] == '.'){
        white++;
    }else{
        black++;
    }

    for(int i = 0; i < 4; i++){
        if(x+dx[i] < 0 || y+dy[i] < 0 || h <= x+dx[i] || w <= y+dy[i]){
            continue;
        }
        if(table[x+dx[i]][y+dy[i]] == ((table[x][y] == '#')?'.':'#') && cover[x+dx[i]][y+dy[i]] == 0){
            dfs(x+dx[i], y+dy[i]);
        }
    }
}

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

    long long int result = 0;

    for(int i = 0; i < h; i++){
        for(int j = 0; j < w; j++){
            if(table[i][j] == '#') {
                dfs(i, j);
                result += white*black;
                white = 0;
                black = 0;
            }
        }
    }

    cout << result << endl;
    return 0;
}


Measured memory_bytes: 6016
import java.util.*

//

fun main() {
    abc167c()
}

fun abc167c() {
    val (n, m, x) = readLine()!!.split(" ").map { it.toInt() }
    val books = mutableListOf<Book>()
    val sc = Scanner(System.`in`)
    for (i in 0 until n) {
        val c = sc.nextInt()
        val e = mutableListOf<Int>()
        for (j in 0 until m) {
            e.add(sc.nextInt())
        }
        books.add(Book(c, e))
    }
    val cost = 1000000
    val pattern = mutableListOf<Book>()
    val emptyBook = Book(0, List<Int>(m) { 0 })
    generatePattern(books, pattern, emptyBook, 0, x)
    if (pattern.isEmpty()) {
        println("-1")
    } else {
        val min = pattern.minBy { it.cost }
        println(min!!.cost)
    }
}

private fun generatePattern(data: List<Book>, result: MutableList<Book>, current: Book,
    num: Int, x: Int) {
    if (num == data.size) {
        val ng = current.experience.filter { it < x }
        if (ng.isEmpty()) {
            result.add(current)
        }
    } else {
        generatePattern(data, result, current, num + 1, x)
        val t = data[num]
        val e = current.experience.mapIndexed { index, i -> t.experience[index] + i }
        generatePattern(data, result, Book(t.cost + current.cost, e), num + 1, x)
    }
}

data class Book(
    val cost: Int,
    val experience: List<Int>
)

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

int main() {
  int N, M;
  cin >> N >> M;
  if(M/10 == 0) N *= 10;
  else {
    if(M/100 == 0) N *= 100;
    else N *= 1000;
  }
  int L = N + M;
  bool ans = false;
  for(int i=1;i<2000;i++) {
    if(L == i * i) {
      ans = true;
      break;
    }
  }
  if(ans) cout << "Yes" << endl;
  else cout << "No" << endl;
}

Measured memory_bytes: 256
import math
a, b, c, d =map(int, input().split())
ans1 = math.ceil(a / d)
#青木君の攻撃回数
ans2 = math.ceil(c / b)
#高橋君の攻撃回数
if ans2 <= ans1:
    print("Yes")
else:
    print("No")


Measured memory_bytes: 9184
#include <iostream>
#include <iomanip>
typedef long long ll;
using namespace std;
const ll INF = 1e9;
const ll MOD = 1e9 + 7;
#define repi(i, n, init) for (ll i = init; i < (n); i++)

int main()
{
    int n, k;
    cin >> n >> k;
    if (k % 2)
    {
        ll x = n / k;
        cout << x * x * x << endl;
    }
    else
    {
        ll x = n / k, y = (n + k / 2) / k;
        cout << x * x * x + y * y * y << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define dl double
#define mp make_pair
#define pb push_back
using namespace std;

//***********************************************************************

// hash struct for unordered_map
struct hash_pair { 
    template <class T1, class T2> 
    size_t operator()(const pair<T1, T2>& p) const
    { 
        auto hash1 = hash<T1>{}(p.first); 
        auto hash2 = hash<T2>{}(p.second); 
        return hash1 ^ hash2; 
    } 
};

int MAXNUM = 5e3+5;
vector <int>vis(MAXNUM);
vector<int> pr;
void sieve() {
	pr.push_back(2);
	for(ll i=3;i<MAXNUM;i+=2) if(!vis[i]) {
		pr.push_back(i);
		for(ll j=i*i;j<MAXNUM;j+=2*i) vis[j]=true;
	}
}
//************************************************************************

void solve()
{
    ll n,k;
    cin >> n >>k;
    vector<ll> v(n);
    for(int i=0;i<n;i++)
    cin >> v[i];
    sort(v.begin(),v.end());
    ll ans=0;
    for(int i=0;i<k;i++)
    ans+=v[i];
    cout << ans << endl;
}


int main()
{ 
	ios_base::sync_with_stdio(false); 
    cin.tie(NULL);
	ll t;
	//cin >> t;
	t=1;
	while(t--)
	{
		solve();
	}

	return 0;
}

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

ALL = 1 << N
S = [0]*ALL
MOD = 10**9 + 7
S[ALL-1] = 1
for k in range(N, 0, -1):
    I = [i for i in range(N) if A[k-1][i]]
    v = (1 << k) - 1
    while v < ALL:
        w = S[v] % MOD
        for i in I:
            if v & (1 << i):
                S[v ^ (1 << i)] += w
        x = v & -v; y = v + x
        v = ((v & ~y) // x >> 1) | y
print(S[0] % MOD)

Measured memory_bytes: 57836
#include <iostream>
#include <queue>
#define ll long long
using namespace std;

priority_queue<ll> pq;

int main() {
	int N, M;
	cin >> N >> M;
	for(int i=0; i<N; ++i){
	    ll a;
	    cin >> a;
	    pq.push(a);
	}
	for(int i=0; i<M; ++i){
	    ll now=pq.top();
	    pq.pop();
	    pq.push(now/2);
	}
	ll ans=0;
	for(int i=0; i<N; ++i){
	    ans += pq.top();
	    pq.pop();
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 1400
#include<bits/stdc++.h>
using namespace std;
const int N=10010;
char s[N],ans[N];
int n,k;
int check(int l){
	for (int i=0;i<n;i++){
		if (s[i+l]!=ans[i]){
			return s[i+l]<ans[i];
		}
	}
	return 0;
}
void cov(int l){
	for (int i=0;i<n;i++)
		ans[i]=s[i+l];
}
int main(){
	cin>>n>>k;
	scanf("%s",s);
	for (int i=n;i<2*n;i++)s[i]=s[2*n-1-i];
	cov(0);
	for (int i=1;i<n;i++)
		if (check(i))cov(i);
	int cnt=0,cnt1=0;
	for (int i=0;i<n;i++){
		if (ans[i]!=ans[0])break;
		else cnt++;
	}cnt1=cnt;
	while (k>1&&cnt<n)k--,cnt<<=1;
	cnt=min(cnt,n);
	for (int i=1;i<=cnt;i++)
		putchar(ans[0]);
	for (int i=0;i<n-cnt;i++)
		putchar(ans[i+cnt1]);
	cout<<endl;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>
#include<string.h>

int main(void) {
	int a, b, c, k, i;
	int ans = 0;
	scanf("%d%d%d%d", &a, &b, &c, &k);
	for (i = 1; i <= k; i++) {
		if (a > 0) {
			ans = ans + 1;
			a = a - 1;
		}
		else if (b > 0) {
			b = b - 1;
		}
		else if (c > 0) {
			ans = ans - 1;
			c = c - 1;
		}
	}
	printf("%d", ans);
	return 0;
}

Measured memory_bytes: 1736
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
using namespace std;
typedef long long LL;

LL n,A,B,ans = 0;
LL x[500005] = {0};
 
int main(){
	cin >> n >> A >> B;
	cin >> x[1];
	for(LL i = 2;i <= n;i ++){
		cin >> x[i];
		ans += min((x[i] - x[i - 1]) * A,B);
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
 
using namespace std;
typedef long long ll;
typedef vector<int> VI;
ll mm=1000000000;ll MM=mm+7;
#define rep(i, n) for(int i=0;i<n;i++)
#define PI 3.141592653589793

int main(){
 int a,b,c;
 cin >> a >> b >> c;
 int n=a*100+b*10+c;
 if(n%4==0)cout <<"YES" <<endl;
 else cout << "NO" << endl;
}

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

using lint = long long int;
using pint = pair<int, int>;
using plint = pair<lint, lint>;
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((lint)(x).size())
#define POW2(n) (1LL << (n))
#define FOR(i, begin, end) for (int i = (begin), i##_end_ = (end); i < i##_end_; i++)
#define IFOR(i, begin, end) for (int i = (end)-1, i##_begin_ = (begin); i >= i##_begin_; i--)
#define REP(i, n) FOR(i, 0, n)
#define IREP(i, n) IFOR(i, 0, n)

int main()
{
    int D;
    cin >> D;
    vector<int> c(26);
    vector<vector<int>> s(D, vector<int>(26));
    vector<vector<pint>> ss(D, vector<pint>(26));
    REP(i, 26)
    cin >> c[i];
    REP(i, D)
    REP(j, 26){
        cin >> s[i][j];
        ss[i][j].first = s[i][j];
        ss[i][j].second = j;
    }
    REP(i,D)sort(ALL(ss[i]),greater<pint>());
    lint sat = 0;
    vector<int> las(26, -1), con(D);

    vector<int> t(D);
    //REP(i, D)cin >> t[i];
    REP(i,D){
        //t[i] = ss[i][0].second + 1;
        //cout << t[i] << "\n";
    }

    REP(i, D)
    {
        cout << (i)%26 + 1 << "\n";
    }

    /*

    REP(i, D)
    {
        int tt = t[i] - 1;
        con[i] = tt;
        las[tt] = i;
        sat += s[i][tt];
        REP(j, 26)
        sat -= c[j] * (i - las[j]);
    }
    cout << sat << "\n";
    REP(i, m)
    {
        int d, q;

        t[d - 1] = q;
        lint sat2 = 0;
        vector<int> las2(26, -1);
        REP(i, D)
        {
            int tt = t[i] - 1;
            con[i] = tt;
            las2[tt] = i;
            sat2 += s[i][tt];
            REP(j, 26)
            sat2 -= c[j] * (i - las2[j]);
        }
        cout << sat2 << "\n";
    }
    */
    return 0;
}

Measured memory_bytes: 3772
import java.util.*;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        double[] x = new double[N];
        String[] u = new String[N];
        double sum = 0;
        for(int i = 0; i < N; i++){
            x[i] = sc.nextDouble();
            u[i] = sc.next();
        }
        for(int i = 0; i < N; i++){
            if(u[i].equals("BTC")){
                sum += x[i]*380000;
            } else {
                sum += x[i];
            }
        }        
        System.out.println(sum);
    }
}

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

typedef long long ll;
#define vec vector<int>
#define vecll vector<ll>
#define vpair vector<pair<int, int>>
#define vpairll vector<pair<ll, ll>>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define rep(i,n)   for(int i=(int)0; i<(int)n; i++)
#define llrep(i,n)   for(ll i=(ll)0; i<(ll)n; i++)
#define REP(i,m,n) for(int i=(int)m; i<(int)n; i++)
#define all(var)     (var).begin(), (var).end()
#define prt(var)     cout << var << endl
#define prt_dbl(i,var) cout<<fixed<<setprecision(i)<<var<<endl;

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

int main(){
  ll N,M,ans;
  cin>>N>>M;
  if(N==1&&M==1){
    ans = 1;
  }else if(N==1){
    ans = M-2;
  }else if(M==1){
    ans = N-2;
  }else{
    ans =(N-2)*(M-2);
  }

  cout<<ans<<endl;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
    double PI = 3.14159265359;
    double A, B, H, M;
    cin >> A >> B >> H >> M;
    double degA = (60 * H + M) / (12.0 * 60) * 2.0 * PI;
    double degB = M / 60.0 * 2.0 * PI;
    double deg;
    if (degA > degB)
    {
        deg = degA - degB;
    }
    else
    {
        deg = degB - degA;
    }
    if (deg > PI)
    {
        deg = 2.0 * PI - deg;
    }
    double tmp = A * A + B * B - 2.0 * A * B * cos(deg);
    cout << setprecision(15) << fixed << pow(tmp, 0.5) << endl;
}

Measured memory_bytes: 4312
a = input()

b = a.count('N')
c = a.count('S')
d = a.count('W')
e = a.count('E')

if (b != 0 and c== 0) or (b == 0 and c != 0):
    print('No')
elif (d != 0 and e== 0) or (d == 0 and e != 0):
    print('No')
else:
    print('Yes')

Measured memory_bytes: 3064
/////////////////////////////////////////////template 1
#include <bits/stdc++.h>
#define MOD 1000000007
//for(int i=0; i<n; ++i)
using namespace std;
#define all(c) c.begin(), c.end()
#define watch(x) cout << (#x) << " is " << (x) << endl
#define ll long long

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n;
    cin >> n;
    vector<int[3]> h(n), dp(n);
    for (int i = 0; i < n; ++i)
        for (int j = 0; j < 3; ++j)
            cin >> h[i][j];

    dp[0][0] = h[0][0];
    dp[0][1] = h[0][1];
    dp[0][2] = h[0][2];

    for (int i = 1; i < n; ++i)
    {
        dp[i][0] = h[i][0] + max(dp[i - 1][1], dp[i - 1][2]);
        dp[i][1] = h[i][1] + max(dp[i - 1][0], dp[i - 1][2]);
        dp[i][2] = h[i][2] + max(dp[i - 1][0], dp[i - 1][1]);
    }
    cout << max(dp[n - 1][0], max(dp[n - 1][1], dp[n - 1][2])) << endl;
    return 0;
}

Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
using ll = long long;
using ld = long double;
#define rep2(i, s, n) for (ll i = (s); i < (ll)(n); i++)
#define rep3(i, n) for (ll i = 1; i < (ll)(n+1); i++)
#define rep4(i, s, n) for (ll i = (s); i < (ll)(n+1); i++)
#define repr(i,n) for (ll i = (n-1); i>=0;i--)
#define repr3(i,n) for(ll i = (n);i>0;i--)
#define stlen(s) ll s.size()-1
#define all(v) v.begin(), v.end()
#define cout(n) cout<<std::fixed<<std::setprecision(n)
using Graph = vector<vector<int>>;
#define INF1  INT_MAX;
#define INF2  LLONG_MAX;
#define PI  3.14159265358979323846;



int main() {
int N,Q;
cin>>N>>Q;
string S;
cin>>S;
int A[N+1];
A[0]=0;
rep3(i,N){
    if((S[i]=='C')&&(S[i-1]=='A')){
        A[i]=A[i-1]+1;
    }
    else{
        A[i]=A[i-1];
    }
}
int ans[Q];
rep(i,Q){
    int l,r;
    cin>>l>>r;
    ans[i]=A[r-1]-A[l-1];

}
rep(i,Q){
    cout<<ans[i]<<endl;
}
return 0;
}



Measured memory_bytes: 1792
#include <iostream>
using namespace std;
 
int n, height,ask,counter;
 
int main() {
    counter = 0;
    cin >> n >> height;
    for(int i = 0; i < n; i++){
      cin >> ask;
      if(ask >= height){
        counter++;
      }
    }
    cout << counter;

}

Measured memory_bytes: 256
/**
*    author:  Dooloper
*    created: 11.07.2020 20:58:45
**/

#include <bits/stdc++.h>

#define rep(i,n) for(int i = 0; i < (n); i++)
using namespace std;
using P = pair<int,int>;
using ll = long long;

const int mod = 1000000007;
class mint {
    long long x;
public:
    mint(long long x=0) : x((x%mod+mod)%mod) {}
    mint operator-() const {
      return mint(-x);
    }
    mint& operator+=(const mint& a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator-=(const mint& a) {
        if ((x += mod-a.x) >= mod) x -= mod;
        return *this;
    }
    mint& operator*=(const  mint& a) {
        (x *= a.x) %= mod;
        return *this;
    }
    mint operator+(const mint& a) const {
        mint res(*this);
        return res+=a;
    }
    mint operator-(const mint& a) const {
        mint res(*this);
        return res-=a;
    }
    mint operator*(const mint& a) const {
        mint res(*this);
        return res*=a;
    }
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t>>1);
        a *= a;
        return a;
    }
    // for prime mod
    mint inv() const {
        return pow(mod-2);
    }
    mint& operator/=(const mint& a) {
        return (*this) *= a.inv();
    }
    mint operator/(const mint& a) const {
        mint res(*this);
        return res/=a;
    }

    friend ostream& operator<<(ostream& os, const mint& m){
        os << m.x;
        return os;
    }
};

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int n;
  cin >> n;
  int ans = 0;
  vector<int> a(n);
  rep(i,n){
    cin >> a[i];
    if((i+1)%2 == 1 and a[i] % 2 == 1) ans++;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3648
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <tuple>
using namespace std;

typedef long long ll;

int N, W;
int w[102];
ll v[102];
ll dp[102][100002];

int main() {
  while (cin >> N >> W) {
    for (int i = 0; i < N; i++) {
      cin >> w[i] >> v[i];
    }
    for (int i = 0; i <= N; i++) {
      for (int j = 0; j <= W; j++) {
        dp[i][j] = -1;
      }
    }
    dp[0][0] = 0;

    for (int i = 0; i < N; i++) {
      for (int j = 0; j <= W; j++) {
        if (dp[i][j] == -1) continue;
        dp[i + 1][j] = max(dp[i + 1][j], dp[i][j]);

        int nj = j + w[i];
        ll nv = dp[i][j] + v[i];

        if (nj > W) continue;

        dp[i + 1][nj] = max(dp[i + 1][nj], nv);
      }
    }

    ll ans = 0;
    for (int j = 0; j <= W; j++) {
      ans = max(ans, dp[N][j]);
    }
    cout << ans << endl;
  }
}


Measured memory_bytes: 79104