akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

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

  int n, k;
  cin >> n >> k;
  long long sum = (2LL * k + n * 3 - 1) * 3 * n / 2;
  long long sumC = (2LL * k + n * 5 - 1) * n / 2;
  if (sumC * 2 < sum)
  {
    cout << -1 << endl;
    return 0;
  }

  int half = (n + 1) / 2;
  for (int i = 0; i < half; i++)
    cout << k + n - half + i << ' ' << k + n * 2 - 1 - i * 2 << ' ' << k + n * 3 - 1 - i << '\n';
  for (int i = 0; i < n - half; i++)
    cout << k + i << ' ' << k + n * 2 - 2 - i * 2 << ' ' << k + n * 3 - 1 - half - i << '\n';
}


Measured memory_bytes: 2304
def main():
    import sys
    input = sys.stdin.readline
    N, M = map(int, input().split())
    a = [0] * (1 + 10 ** 5)
    for _ in range(M):
        a[int(input())] = 1
    dp = [0] * (N + 1)
    dp[0] = 1
    if not a[1]:
        dp[1] = 1

    for i in range(2, N + 1):
        if not a[i]:
            dp[i] += dp[i-1] + dp[i-2]
            dp[i] %= 1000000007

    print(dp[N])

main()


Measured memory_bytes: 41692
#include<stdio.h>

int main() {

    int N, sum = 0, org;
    int n[10] = {};

    scanf("%d", &N);
    org = N;

    for (int i = 0; N != 0; i++) {
        n[i] = N % 10;
        N = N / 10;
    }

    for (int i = 0; n[i] != 0; i++) {
        sum += n[i];
    }

    if (org % sum == 0) {
        puts("Yes");
    } else {
        puts("No");
    }
    return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <iomanip>
#include <cassert>
using namespace std;

#define GET_ARG(a,b,c,F,...) F
#define REP3(i,s,e) for (i = s; i <= e; i++)
#define REP2(i,n) REP3 (i,0,(int)(n)-1)
#define REP(...) GET_ARG (__VA_ARGS__,REP3,REP2) (__VA_ARGS__)
#define RREP3(i,s,e) for (i = s; i >= e; i--)
#define RREP2(i,n) RREP3 (i,(int)(n)-1,0)
#define RREP(...) GET_ARG (__VA_ARGS__,RREP3,RREP2) (__VA_ARGS__)
#define DEBUG(x) cerr << #x ": " << x << endl

typedef long long ll;

int main(void) {
    int i, j, k, h, w, n;
    scanf("%d%d%d",&h,&w,&n);
    set<tuple<int,int,int>> pt;
    REP (i,n) {
        int a, b;
        scanf("%d%d",&a,&b);
        pt.insert(make_tuple(a,b,0));
        pt.insert(make_tuple(a+3,-b,0));
        REP (j,max(3,a),min(h,a+2)) REP (k,max(3,b),min(w,b+2)) {
            pt.insert(make_tuple(j,k,1));
        }
    }
    ll ans[10] {};
    set<pair<int,int>> st;
    for (auto t: pt) {
        int a = get<0>(t);
        int b = get<1>(t);;
        if (b < 0) st.erase(make_pair(-b,a-3));
        else if (get<2>(t) == 1) {
            auto p = st.lower_bound(make_pair(b-2,0));
            auto q = st.lower_bound(make_pair(b+1,0));
            int x;
            for (x = 0; p != q; p++,x++);
            ans[x]++;
        }
        else st.insert(make_pair(b,a));
    }
    ans[0] = (ll) (h-2) * (w-2);
    REP (i,1,9) ans[0] -= ans[i];
    REP (i,10) printf("%lld\n",ans[i]);
    return 0;
}


Measured memory_bytes: 68992
#include<stdio.h>
#include<string.h>

#define MAX 1010
#define max(a,b) ((a<b)?b:a)

char s[MAX], t[MAX];
int dp[MAX][MAX],path[MAX][MAX];

int LCS() {
  int n = strlen(s);
  int m = strlen(t);
  memset(dp,0,sizeof dp);
  int i,j,maxi=0;
  for(i=0;i<n;i++) {
    for(j=0;j<m;j++) {
      if( i ) dp[i][j] = max(dp[i][j],dp[i-1][j]);
      if( j ) dp[i][j] = max(dp[i][j],dp[i][j-1]);
      if( s[i] == t[j] ) {
	dp[i+1][j+1] = max(dp[i+1][j+1],dp[i][j]+1);
	maxi = max(maxi,dp[i+1][j+1]);
      }
    }
  }
  return maxi;
}

int main() {
  int n,i;
  scanf("%d",&n);
  for(i=0;i<n;i++) {
  scanf(" %s",&s[0]);
  scanf(" %s",&t[0]);
  printf("%d\n",LCS());
  }
  return 0;
}

Measured memory_bytes: 6540
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double ld;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const long long INF = 1LL << 60;
 
typedef pair<ll,ll> pairs;
vector<pairs> p;
bool pairCompare(const pair<double,ll>& firstElof, const pair<double,ll>& secondElof){
    return firstElof.first < secondElof.first;
}
#define MAX_N 1000100
bool x[MAX_N];
ll num[MAX_N];
ll fibl[MAX_N]={0};
 
ll fib(ll a){
    if (fibl[a]!=0)return fibl[a];
    if (a==0){
        return 0;
    }else if (a==1){
        return 1;
    }
    return fibl[a]=fib(a-1)+fib(a-2);
}
 
ll eratosthenes(ll n) {
    int p = 0;
    for (ll i=0; i<=n; ++i) x[i] = true;
    x[0] = x[1] = false;
    for(int i=2; i<=n; ++i) {
        if(x[i]) {
            p++;
            for(int j=2*i; j<=n; j+=i) x[j] = false;
        }
        
        num[i] = p;
    }
    return p;
}
 
ll gcd(ll a,ll b){
    if (a%b==0)return(b);
    else return(gcd(b,a%b));
}
 
ll keta(ll N){
    int tmp{};
    while( N > 0 ){
        tmp += ( N % 10 );
        N /= 10;
    }
    N = tmp;
    return N;
}

int main(){
    string s;
    cin>>s;
    
    if (s[0] == s[2])cout << "Yes" << endl;
    else cout << "No" << endl;
    
    return 0;
}



Measured memory_bytes: 256
// https://atcoder.jp/contests/abc085/tasks/abc085_c
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <map>
#include <stack>
#include <queue>
#include <iomanip>
#include <set>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;

int main()
{
    int N, Y;
    cin >> N >> Y;
    for (int x = 0; x <= N; ++x)
    {
        int rhs = Y - 1000 * N - 9000 * x;
        if (rhs < 0 || rhs % 4000 != 0) continue;
        int y = rhs / 4000;
        int z = N - y - x;
        if (z >= 0)
        {
            cout << x << " " << y << " " << z << endl;
            return 0;
        }
    }
    cout << -1 << " " << -1 << " " << -1 << endl;
    return 0;
}


Measured memory_bytes: 3584
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n)  for(long long i=0;i<(long long)(n);i++)
#define REP(i,k,n) for(long long i=k;i<(long long)(n);i++)
#define all(a) a.begin(),a.end()
#define eb emplace_back
#define pb push_back
typedef long long ll;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> PP;
typedef priority_queue<ll> PQ;
typedef priority_queue<ll,vector<ll>,greater<ll>> SMALLPQ;
using vi=vector<ll>;
using vvi=vector<vector<ll>>;
using vc=vector<char>;
using vvc=vector<vector<char>>;
ll inf=1000000007;
const int mod=1000000007;
void chmin(auto &a,auto b){if(b<a)a=b;}
void chmax(auto &a,auto b){if(a<b)a=b;}
int main(){
  int a,b;cin>>a>>b;
  cout<<max(0,a-b*2)<<endl;
}

Measured memory_bytes: 256
#include<iostream>
using namespace std;
typedef long long lli;
typedef pair<int,lli> P;
#define MAX 100001
 
 
P par[MAX];
lli rank[MAX];
 
void init(int n=MAX){
  for(int i=0;i<n;i++){
    par[i]=P(i,0);
    rank[i]=0;
  }
}

P find(int x){
  if(par[x].first==x)return par[x];
  else {
    lli tmp=par[x].second;
    par[x]=find(par[x].first);
    par[x].second+=tmp;
    return par[x];
  }
}
 
void unite(int x,int y,lli z){
  P X=find(x),Y=find(y);
  x=X.first;
  y=Y.first;
  if(x==y)return;
  if(rank[x]<rank[y]){
    par[x].first = y;
    par[x].second = (z - X.second + Y.second);
  }else{
    par[y].first = x;
    par[y].second = -(z - X.second + Y.second);
    if(rank[x]==rank[y])rank[x]++;
  }
}
 
int N,M;
 
int main(){
  while(cin>>N>>M){
    if(N==0&&M==0)break;
    init();
    for(int i=0;i<M;i++){
      char ch;
      lli a,b,c;
      cin>>ch>>a>>b;
      if(ch=='?'){
	P A=find(a);
	P B=find(b);
	if(A.first!=B.first)cout<<"UNKNOWN"<<endl;
	else {
	  cout<< A.second - B.second <<endl;
	}
      }else{
	cin>>c;
	unite(a,b,c);
      }
    }
  }
  return 0;
}

Measured memory_bytes: 3512
#include<iostream>
#include<queue>
#include<map>
#include<set>
#include<vector>
#include<algorithm>

using namespace std;
const long long int MOD=1e9+7;

int main(){
  int n, cnt=0;
  vector<int> v;
  cin >> n;
  for(int i=0;i<n;i++){
    int tmp;cin >> tmp;
    v.push_back(tmp);
  }
  sort(v.begin(), v.end());
  int c=2;
  for(int i=0;i<n-2;i++){
    c = i+2;
    for(int j=i+1;j<n-1;j++){
      while(c<n && v[c]<v[i]+v[j])c++;
      cnt += max(0, c-j-1);
    }
  }
  cout << cnt << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define int long long
#define fi first
#define se second
#define pii pair<int,int>
#define mp make_pair

using namespace std;

const int N=1e5+5;
int n,m,k,p[N],sz[N];
vector<int>fr[N],block[N];

int Find(int x)
{
    if(x==p[x]) return x;
    return p[x]=Find(p[x]);
}

void Union(int u,int v)
{
    int a=Find(u);
    int b=Find(v);
    if(a==b) return ;
    p[a]=b;
    sz[b]+=sz[a];
}

main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cin>>n>>m>>k;
    for(int i=1;i<=n;i++)
    {
        p[i]=i;
        sz[i]=1;
    }
    while(m--)
    {
        int u,v;
        cin>>u>>v;
        fr[u].push_back(v);
        fr[v].push_back(u);
        Union(u,v);
    }
    while(k--)
    {
        int u,v;
        cin>>u>>v;
        block[u].push_back(v);
        block[v].push_back(u);
    }
    for(int i=1;i<=n;i++)
    {
        int res=sz[Find(i)]-1;
        res-=fr[i].size();
        for(auto&x:block[i]) if(Find(x)==Find(i)) res--;
        cout<<res<<' ';
    }
}


Measured memory_bytes: 15092
def max2(x,y):
    return x if x > y else y
N = int(input())
D = []
for i, a in enumerate(map(int, input().split())):
    D.append((a<<11) + i)
D.sort(reverse=True)
dp = [0]*(N+1)
for i, d in enumerate(D,start=1):
    x, a = d%(1<<11),d>>11
    for j in reversed(range(0, i+1)):
        dp[j] = max2((dp[j-1]+a*(x-(j-1)))*(j-1>=0), (dp[j]+a*(N-(i-j)-x))*(j<=i-1))
print(max(dp))

Measured memory_bytes: 68676
#ifdef MY_LOCAL
#define MY_NAMESPACE(ns) namespace ns {
#define MY_NAMESPACE_    }
#define MY_DEBUG(s)      s
#else
#define MY_NAMESPACE(ns) 
#define MY_NAMESPACE_    
#define MY_DEBUG(s)      
#endif

#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <string>
#include <tuple>
#include <unordered_map>
#include <utility>
#include <vector>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define EPS (1e-7)


MY_NAMESPACE(testbed)
vector<pll> prime_factorize(ll number)
{
	vector<pll> res;
	for (ll divisor = 2; divisor * divisor <= number; divisor++)
	{
		if (number % divisor != 0)
			continue;
		ll exponent = 0;
		while (number % divisor == 0)
		{
			number /= divisor;
			exponent++;
		}
		res.emplace_back(make_pair(divisor, exponent));
	}
	if (number != 1)
		res.emplace_back(make_pair(number, 1));
	return res;
}

int main()
{
	ll n;
	cin >> n;
	auto div_exps = prime_factorize(n);
	int res = 0;
	for (auto div_exp : div_exps)
	{
		ll exponent = div_exp.second;
		int i = 1;
		while (exponent > 0)
		{
			exponent -= i++;
			if (exponent >= 0)
				res++;
		}
	}
	cout << res << "\n";
	return 0;
}
MY_NAMESPACE_

Measured memory_bytes: 3612
#include<iostream>
#include<vector>
#include<algorithm>
#include<cstring>
#include<cstdio>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<queue>
#include<set>
using namespace std;
typedef long long LL;
const int N=2e6;
int gi() {
	int w=0;bool q=1;char c=getchar();
	while ((c<'0'||c>'9') && c!='-') c=getchar();
	if (c=='-') q=0,c=getchar();
	while (c>='0'&&c <= '9') w=w*10+c-'0',c=getchar();
	return q? w:-w;
}
int s1[N],s2[N];
int L[N],R[N],st[N];
int main()
{
	int n=gi(),i,j,top=0,ans=0;char c;
	for (i=1;i<=n;s1[i++]=c-'a') while ((c=getchar())<'a');
	for (i=1;i<=n;s2[i++]=c-'a') while ((c=getchar())<'a');
	for (i=n;i&&s1[i]==s2[i];i--);if (!i) return puts("0"),0;
	for (i=j=n;i;L[j]=i--) {
		while (j&&s1[j]!=s2[i]) j--;
		if (!j) return puts("-1"),0;
		if (!R[j]) R[j]=i,st[++top]=j;
		j-=i==j;
	}
	reverse(st+1,st+1+top);
	for (i=j=1;i<=top;i++) {
		while (j<top&&st[j+1]-(j-i+1)<R[st[i]]) j++;
		ans=max(ans,j-i+1);
	}
	printf("%d\n",ans);
	return 0;
}


Measured memory_bytes: 28928
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
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)));
        int A = scan.nextInt();
        int B = scan.nextInt();
        int Q = scan.nextInt();
        long[] s = new long[A+1];
        for (int i = 0; i < A; i++) {
            s[i] = scan.nextLong();
        }
        s[A] = 10000000010L;
        long[] t = new long[B+1];
        for (int i = 0; i < B; i++) {
            t[i] = scan.nextLong();
        }
        t[B] = 10000000010L;
        for (int i = 0; i < Q; i++) {
            long start = scan.nextLong();
            long distance = Long.MAX_VALUE;
            distance = Math.min(distance, first_move(start, s, A, t, B));
            distance = Math.min(distance, first_move(start, t, B, s, A));
            System.out.println(distance);
        }
    }
    private long first_move(long start, long[] s, long A, long[] t, long B) {
        int result = Arrays.binarySearch(s, start);
        int index = 0 <= result ? result : ~result;
        long distance = Long.MAX_VALUE;
        for (int j = Math.max(index - 1, 0); j < Math.min(index + 1, A); j++) {
            distance = Math.min(distance, second_move(start, s, j, t, B));
        }
        return distance;
    }
    private long second_move(long start, long[] s, int position, long[] t, long N) {
        int result = Arrays.binarySearch(t, s[position]);
        int index = 0 <= result ? result : ~result;
        long distance = Long.MAX_VALUE;
        long from_start = Math.abs(start - s[position]);
        for (int i = Math.max(index - 1, 0); i < Math.min(index + 1, N); i++) {
            long temp = from_start + Math.abs(s[position]-t[i]);
            distance = Math.min(distance, temp);
        }
        return distance;
    }
}


Measured memory_bytes: 94140
#include<map>
#include<bits/stdc++.h>
#include<string>
#include<algorithm>
typedef long long int ll;
using namespace std;
#define MAXN 100001
#define X first
#define Y second
#define MOD 1000000007
#define fr(a,b,c) for(ll a=b;a<c;++a)
#define pb push_back
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

ll t,n,i,j;
int main()
{
    fastio;
    ll h,w;
    cin>>h>>w;
    //ll wall[1001][1001]={0};
    vector < vector <ll > > dp(h,vector <ll >(w));
    //ll dp[1001][1001]={0};
    char ch;
    fr(i,0,h){
        fr(j,0,w){
            cin>>ch;
            if(ch=='#'){
                dp[i][j]=-1;
            }
        }
    }ll a;
   /* fr(i,0,h){
        fr(j,0,w)
            cout<<dp[i][j]<<" ";
        cout<<endl;
    }
   */ fr(i,0,h){
        if(dp[i][0]==-1){
            a=i;i=h;
        }
        else
            dp[i][0]=1;
    }
    fr(i,a,h)
        dp[i][0]=0;
    //cout<<"dembele"<<endl;
    fr(j,1,w){
        if(dp[0][j]==-1){
            a=j;j=w;
        }
        else
            dp[0][j]=1;
    }
    fr(j,a,w)
        dp[0][j]=0;
    //cout<<"pepe"<<endl;
  /*  fr(i,0,h){
        fr(j,0,w)
            cout<<dp[i][j]<<" ";
        cout<<endl;
    }
   */ fr(i,1,h){
        fr(j,1,w){
            if(dp[i][j]!=-1)
                dp[i][j]=dp[i-1][j]+dp[i][j-1];
            else
                dp[i][j]=0;
            dp[i][j]=dp[i][j]%MOD;
            //cout<<dp[i][j]<<" ";
        }//cout<<endl;
    }
    cout<<dp[h-1][w-1]<<endl;
}


Measured memory_bytes: 8064
import sys

def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline

def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N] = [long(input_raw[0])]
    input_rawT = read_func().strip().split()
    input_rawA = read_func().strip().split()
    T = []
    A = []
    for i in range(N):
        T.append(long(input_rawT[i]))
        A.append(long(input_rawA[i]))
    count = 1
    h_T = [(0, 0) for i in range(N)]
    h_A = [(0, 0) for i in range(N)]
    h_T[0] = (T[0], T[0])
    h_A[N - 1] = (A[N - 1], A[N - 1])

    for i in range(1, N):
        j = N - 1 - i
        if T[i] == T[i - 1]:
            h_T[i] = (1, T[i])
        else:
            h_T[i] = (T[i], T[i])

        if A[j] == A[j + 1]:
            h_A[j] = (1, A[j])
        else:
            h_A[j] = (A[j], A[j])

    count = 1L
    for i in range(0, N):
        h1 = max(h_A[i][0], h_T[i][0])
        h2 = min(h_A[i][1], h_T[i][1])
        if h1 > h2:
            print 0
            exit()
        count = ((count * long(h2 - h1 + 1)) % long(1e9 + 7))

    print count




if __name__ == '__main__':
    main()


Measured memory_bytes: 41528
#include<stdio.h>
int main(void){
    int i;
    int j;
    int a,b;
    while(1){
        name:scanf("%d%d",&a,&b);
        if(a==0&&b==0){
            break;
        }
        else if(a==0||b==0){
            printf("\n");
            goto name;
        }
        for(i = 1;i <= a;i++){
            for(j = 1;j <= b;j++){
                printf("#");
            }printf("\n");
        }
        printf("\n");
    }
    return 0;
}

Measured memory_bytes: 572
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#include <cstdio>
#include <string>
#include <cmath>
#include <queue>
#include <tuple>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <random>
#include <set>
#include <stack>
#include <time.h>

//#include <bits/stdc++.h>
#define maxs(x,y) x = max(x,y)
#define mins(x,y) x = min(x,y)
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repr(i, n) for (int i = (n) - 1; i >= 0; i--)
#define FOR(i,i0,n) for(int (i)=(i0);(i)<(n);(i)++)
#define FORR(i,i0,n) for(int (i)=(n)-1; (i)>=(i0);(i)--)
#define SORT(x) sort(x.begin(),x.end())
#define SORTR(x) sort(x.begin(),x.end(),greater<vector<int>>())
#define rn return
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define mt make_tuple

using namespace std;
using ll = long long;
typedef std::pair<int,int> pii;
typedef std::pair<int,double> pid;
typedef std::vector<int> vi;
typedef std::vector<pii> vii;

#define PI 3.14159265358979323846264338327950L
const int mod = 1000000007;



void solve(){
    int k;
    cin >> k;

    
    
    ll cur = 0;
    ll add = 7%k;
    
    int seen[1000001];
    int seen1[1000001];
    
    bool ok = true;
    int ans = 0;
    while(true){
        cur += add;
        cur %= k;
        add *= 10;
        add %= k;
        
        if (seen[cur] && seen1[add]){
            ok = false;
            break;
        }
        seen[cur] = 1;
        seen1[add] = 1;

        ans++;
        if (cur == 0) break;
    }
    
    
    if (ok) cout << ans;
    else cout << -1;
}


int main(){
    int T;
    //cin >> T;
    T = 1;
    while(T--){
        solve();
        cout << endl;
    }
}











Measured memory_bytes: 11384
#include<bits/stdc++.h>
using namespace std;
#define mod 998244353
int C[4005][4005],Pow[4005],k,n;
int solve(int x,int y,int z){
    int res=0;
    for(int i=0;i<=z&&i<=x;++i)
        if(y+i-1>=0)res=(res+1ll*Pow[i]*C[x][i]%mod*C[z+y-1][y+i-1]%mod)%mod;
    return res;
}
int main(){
	C[0][0]=1,Pow[0]=1;
	for(int i=1;i<=4000;++i){
		C[i][0]=1; 
		for(int j=1;j<=i;++j)C[i][j]=(C[i-1][j]+C[i-1][j-1])%mod;
		Pow[i]=Pow[i-1]*2%mod;
	}
	scanf("%d%d",&k,&n);
	for(int i=2;i<=2*k;++i){
		int cnt=min(i-1,k)-max(0,i-k-1);
		if(i&1)printf("%d\n",solve(cnt/2,k-cnt,n));
        else printf("%d\n",(solve((cnt-1)/2,k-cnt,n)+solve((cnt-1)/2,k-cnt,n-1))%mod);
	}
}

Measured memory_bytes: 61440
def solve():
    N = int(input())
    a_lst = [int(x) for x in input().split()]
    can = True
    for a in a_lst:
        if a%2 == 0:
            if a%3 == 0 or a%5 == 0:
                continue
            else:
                can = False
    return can
if __name__ == '__main__':
    print('APPROVED' if solve() == True else 'DENIED')


Measured memory_bytes: 2940
#include<bits/stdc++.h>
#define X first
#define Y second
using namespace std;
typedef long long ll;
const ll mod = 1e9+7, inf = 1e18;
ll n, cc, x, y, mn[200005], a[200005], b[200005], fac[200005], ans = 1;
vector<pair<ll, ll> > grp[400005];
priority_queue<pair<ll, ll> > pq;

ll calc (ll X, ll Y) {
	if(!Y) return 1;
	ll ret = calc(X, Y/2);
	ret = (ret * ret) % mod;
	if(Y&1) ret = (ret * X) % mod;
	return ret;
}

int main()
{
	scanf("%lld%lld%lld",&n,&x,&y);
	for(int i=1;i<=n;i++) {
		scanf("%lld%lld",&a[i],&b[i]);
		grp[a[i]].push_back({b[i], a[i]});
		cc = max(cc, a[i]);
	}
	for(int i=1;i<=cc;i++) {
		if(grp[i].empty()) continue;
		sort(grp[i].begin(), grp[i].end());
		mn[i] = grp[i][0].X;
		pq.push({-mn[i], i});
	}
	ll idx = pq.top().Y; pq.pop();
	while(!pq.empty()) {
		ll cur = pq.top().Y; pq.pop();
		if(grp[cur][0].X + grp[idx][0].X > y) break;
		while(grp[cur].size()) {
			grp[idx].push_back(grp[cur].back());
			grp[cur].pop_back();
		}
	}
	for(int i=1;i<=cc;i++) {
		if(grp[i].empty()) continue;
		sort(grp[i].begin(), grp[i].end());
		ll b1 = grp[i][0].X, i1 = grp[i][0].Y, b2 = inf;
		for(int j=1;j<grp[i].size();j++) {
			if(grp[i][j].Y != i1) {b2 = grp[i][j].X; break;}
		}
		vector<pair<ll, ll> > tmp;
		tmp.push_back(grp[i][0]);
		for(int j=1;j<grp[i].size();j++) {
			if((i1 == grp[i][j].Y ? b2 : b1) + grp[i][j].X > y && grp[i][j].X + mn[grp[i][j].Y] > x) {
				grp[++cc].push_back(grp[i][j]);
			}
			else tmp.push_back(grp[i][j]);
		}
		swap(grp[i], tmp);
	}
	fac[0] = 1;
	for(int i=1;i<=n;i++) fac[i] = fac[i-1] * i % mod;
	for(int i=1;i<=cc;i++) {
		if(grp[i].empty()) continue;
		for(int j=0;j<grp[i].size();j++) swap(grp[i][j].X, grp[i][j].Y);
		sort(grp[i].begin(), grp[i].end());
		ans = (ans * fac[grp[i].size()]) % mod;
		ll cur = 1;
		for(int j=1;j<grp[i].size();j++) {
			if(grp[i][j].X != grp[i][j-1].X) {
				ans = (ans * calc(fac[cur], mod-2)) % mod;
				cur = 1;
			}
			else cur++;
		}
		ans = (ans * calc(fac[cur], mod-2)) % mod;
	}
	printf("%lld\n",ans);
}


Measured memory_bytes: 35440
#include <bits/stdc++.h>
#define endl '\n'
#define int long long
#define lint long long
#define pii pair<int, int>
#define FOR(i, a, b) for(int i = (a); i < (b); ++i)
#define FORR(i, a, b) for(int i = (a); i > (b); --i)
#define REP(i, n) FOR(i, 0, n)
#define SZ(v) ((int)v.size())
#define ZERO(a) memset(a, 0, sizeof(a))
#define MINUS(a) memset(a, 0xff, sizeof(a))
#define FINF(a) memset(a, 0x3f, sizeof(a))
#define POW(n) (1LL << (n))
#define POPCNT(n) (__builtin_popcount(n))
#define IN(i, a, b) ((a) <= (i) && (i) <= (b))
using namespace std;
template <typename T> inline bool CHMIN(T& a,T b) { if(a > b) { a = b; return 1; } return 0; }
template <typename T> inline bool CHMAX(T& a,T b) { if(a < b) { a = b; return 1; } return 0; }
template <typename T> inline void SORT(T& a) { sort(begin(a), end(a)); }
template <typename T> inline void REV(T& a) { reverse(begin(a), end(a)); }
template <typename T> inline void UNI(T& a) { sort(a.begin(), a.end()); a.erase(unique(a.begin(), a.end()), a.end()); }
template <typename S, typename T> inline T LB(S& v, T a) { return *lower_bound(begin(v), end(v), a); }
template <typename S, typename T> inline int LBP(S& v, T a) { return lower_bound(begin(v), end(v), a) - begin(v); }
template <typename S, typename T> inline T UB(S& v, T a) { return *upper_bound(begin(v), end(v), a); }
template <typename S, typename T> inline int UBP(S& v, T a) { return upper_bound(begin(v), end(v), a) - begin(v); }
template <typename S, typename T> ostream& operator << (ostream& os, const pair<S, T>& p) { os << p.first << " " << p.second; return os; }
template <typename S, typename T> istream& operator >> (istream& is, pair<S, T>& p) { is >> p.first >> p.second; return is; }
template <typename T> ostream& operator << (ostream& os, const vector<T>& v) { for (int i = 0; i < v.size(); ++i) { if (i) os << " "; os << v[i]; } return os; }
template <typename T> istream& operator >> (istream& is, vector<T>& v) { for(T& in : v) is >> in; return is; }
template <typename T = int> vector<T> make_v(size_t a) { return vector<T>(a); }
template <typename T, typename... Ts> auto make_v(size_t a, Ts... ts) { return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...)); }
template <typename T, typename V> typename enable_if<is_class<T>::value == 0>::type fill_v(T &t, const V &v) { t = v; }
template <typename T, typename V> typename enable_if<is_class<T>::value != 0>::type fill_v(T &t, const V &v) { for(auto &e : t) fill_v(e, v); }
const lint MOD = 1000000007;
const lint INF = 0x3f3f3f3f3f3f3f3f;
const double PI = 3.14159265358979323846;
const double EPS = 1e-10;

int N, H, W;

void _main() {
    cin >> N >> H >> W;
    int ans = 0;
    REP (i, N) {
        int A, B;
        cin >> A >> B;
        ans += (A >= H && B >= W);
    }
    cout << ans << endl;
}

signed main(signed argc, char **argv) {
    if (argc > 1) {
        if (strchr(argv[1], 'i')) freopen("input.txt", "r", stdin);
        if (strchr(argv[1], 'o')) freopen("output.txt", "w", stdout);
    }
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout << fixed << setprecision(10);
    _main();
    return 0;
}

Measured memory_bytes: 256
//#include "pch.h"
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <limits.h>
#include <string>
#include <deque>
#include <cmath>
#include <bitset>
#include <complex>
#include <functional>
#include <time.h>
#include <stdio.h>
#include <tuple>

typedef long long ll;
typedef std::pair<int, int> Pii;
typedef std::pair<long long, long long> Pll;
typedef std::pair<double, double> Pdd;

#define rip(i, n, s) for (int i = (s);i < (int)( n ); i++)
#define mapa make_pair
#define all(a) a.begin(), a.end()
#define MM << " " <<

template<typename T>
using MaxHeap = std::priority_queue<T>;
template<typename T>
using MinHeap = std::priority_queue<T, std::vector<T>, std::greater<T>>;

template<typename T>
inline bool chmax(T &a, T b){
	if(a<b){
		a = b;
		return true;
	}
	return false;
}
template<typename T>
inline bool chmin(T &a, T b){
	if(a>b){
		a = b;
		return true;
	}
	return false;
}
template<typename T>
std::vector<T> vec(int len, T elem) {return std::vector<T>(len, elem);}
template<typename T>
void vdeb(std::vector<T> &da) {
	for (int i = 0;i < da.size();i++) {
		if (i == da.size() - 1) std::cout << da[i] <<std:: endl;
		else std::cout << da[i] << ' ';
	}
}
template<typename T>
void vdeb(std::vector<std::vector<T>> &da) {
	for (int i = 0;i < da.size();i++) vdeb(da[i]);
	std::cout << std::endl;
}

using namespace std;

int main(){
	ll n,m;
	cin >> n >> m;
	vector<ll> da(n);
	rip(i,n,0) cin >> da[i];
	sort(all(da));
	ll sm = 0, la = LLONG_MAX/2;
	while(la - sm >  1){
		ll mi = (sm + la)/2;
		ll cnt  = 0;
		rip(i,n,0) cnt += da.end() - lower_bound(da.begin(), da.end(), mi - da[i]);
		if(cnt >= m) sm = mi;
		else la = mi;
	}
	//cout << sm << endl;
	ll cnt = 0, ans = 0;
	vector<ll> su(n+1);
	rip(i,n,0) su[i+1] = su[i] + da[n-i-1];
	rip(i,n,0){
		int now = da.end() - lower_bound(da.begin(), da.end(), sm - da[i]);
		cnt += now;
		ans += (ll)now*da[i] + su[now];
		//cout << now << endl;
	}
	ans -= sm * (cnt-m);
	//vdeb(da);
	cout << ans << endl;
}

Measured memory_bytes: 1792
import sys

H, W = [int(_) for _ in input().split()]
s = ["" for _ in range(H)]
for i in range(H):
    s[i] = input()
A = [[0, 0]]
d = [[] for _ in range(H)]
for i in range(0, H):
    for j in range(0, W):
        d[i].append(float('inf'))
d[0][0] = 0
while [H-1,W-1] not in A:
    
    if len(A) == 0:
        print(-1)
        sys.exit()


    res = float('inf')
    t_i = 0
    t_j = 0
    for i in range(len(A)):
        if d[A[i][0]][A[i][1]] < res:
            res = d[A[i][0]][A[i][1]]
            t_i = A[i][0]
            t_j = A[i][1]
    


    A.remove([t_i,t_j])

    if t_i - 1 >= 0 and s[t_i-1][t_j] == '.':
        if d[t_i-1][t_j] == float('inf'):
            A.append([t_i-1,t_j])
            d[t_i-1][t_j] = res + 1
        elif d[t_i-1][t_j] > res + 1:
            d[t_i-1][t_j] = res + 1



    if t_i + 1 <= H-1 and s[t_i+1][t_j] == '.':
        if d[t_i+1][t_j] == float('inf'):
            A.append([t_i+1,t_j])
            d[t_i+1][t_j] = res + 1
        elif d[t_i+1][t_j] > res + 1:
            d[t_i+1][t_j] = res + 1

   

    if t_j - 1 >= 0 and s[t_i][t_j-1] == '.':
        if d[t_i][t_j-1] == float('inf'):
            A.append([t_i,t_j-1])
            d[t_i][t_j-1] = res + 1
        elif d[t_i][t_j-1] > res + 1:
            d[t_i][t_j-1] = res + 1



    if t_j + 1 <= W-1 and s[t_i][t_j+1] == '.':
        if d[t_i][t_j+1] == float('inf'):
            A.append([t_i,t_j+1])
            d[t_i][t_j+1] = res + 1
        elif d[t_i][t_j+1] > res + 1:
            d[t_i][t_j+1] = res + 1

ans = d[H-1][W-1]

c = 0
for i in range(H):
    for j in range(W):
        if s[i][j] == '.':
            c += 1

print(c-ans-1)

Measured memory_bytes: 3192
#include <iostream>
#include <complex>
#include <sstream>
#include <string>
#include <algorithm>
#include <deque>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <vector>
#include <set>
#include <limits>
#include <cstdio>
#include <cctype>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
using namespace std;
#define REP(i, j) for(int i = 0; i < (int)(j); ++i)
#define FOR(i, j, k) for(int i = (int)(j); i < (int)(k); ++i)
#define SORT(v) sort((v).begin(), (v).end())
#define REVERSE(v) reverse((v).begin(), (v).end())
typedef complex<double> P;

int main() {
  int N;
  while(cin >>N){
    vector<int> v(N);
    REP(i, N) cin >>v[i];
    SORT(v);
    FOR(i, 1, N) v[i] += v[i - 1];
    int ans = 0;
    REP(i, N) ans += v[i];
    cout <<ans <<endl;
  }
  return 0;
}

Measured memory_bytes: 1216
#include <stdio.h>

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

  int S=0;
  int s;
  for(int j=0;j<n;j++)
{for(int k=j+1;k<n;k++)
  {s=d[j]*d[k];
  S=S+s;
}
}
  printf("%d",S);
  return 0;
  
}

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

int cost(int start, int end, vector <int> &h) {
	return abs(h[start] - h[end]);
}

int minCost(int n, vector <int> &h, vector <int> &dp) {

	// base case
	if (n == 0) {
		return dp[0] = 0;
	}
	// memoized value
	if (dp[n] != INT_MAX) {
		return dp[n];
	}
	// recurrence relation
	dp[n] = INT_MAX;
	for (int backStep = 1; backStep <= 2; backStep ++) {
		if (n - backStep >= 0) {
			dp[n] = min(dp[n], minCost(n - backStep, h, dp) + cost(n - backStep, n, h));
		}
	}
	return dp[n];
}

int main () {

	int n, height;
	cin >> n;

	vector <int> h, dp;
	for (int i = 0; i < n; i ++) {
		cin >> height;
		h.push_back(height);
	}

	dp.resize(n, INT_MAX);
	cout << minCost(n - 1, h, dp);
}

Measured memory_bytes: 8952
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<string>
#include<cstring>
#include<climits>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#include<set>
#include<stack>
#include<queue>
#include<deque>
#include<tuple>
#include<list>
#include<unordered_map>
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vii vector<int>
#define vll vector<ll>
#define lb lower_bound
#define pb push_back
#define mp make_pair
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep2(i,a,b) for(ll i=a;i<b;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define all(x) x.begin(),x.end()
#define INF (1 << 30) - 1
#define LLINF (1LL << 61) - 1
// #define int ll
using namespace std;
const int MOD = 1000000007;
const int MAX = 510000;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    ll a;
    string s;
    cin>>a>>s;
    if(a>=3200) cout<<s<<endl;
    else cout<<"red"<<endl;

    return 0;
}

Measured memory_bytes: 256
// 有點不耐煩會破壞偉大的計劃

#include <bits/stdc++.h>

#define append push_back

using namespace std;
using ll = long long;

const int N = 1e5 + 3;
const int M = 1e6 + 7;
const long long MOD = 1e9 + 7;
const long long INF = 1e18 + 9;
const int SM = 1e3 + 5;
const int logN = 22, BL = 400;
const double EPS = 1e-9, PI = acos(-1);
const int dx[] = {1, 0, 0, -1, -1, 1, -1, 1};
const int dy[] = {0, 1, -1, 0, -1, 1, 1, -1};

void debug() {
	cerr << "\n";
}
template<typename Type1, typename... Type2>
void debug(Type1 a, Type2... b) {
    cerr << a << " ";
    debug(b...);
}

int main() {
//    freopen(".in", "r", stdin);
//    freopen(".out", "w", stdout);
    ios_base::sync_with_stdio(false);
    cin.tie(0), cout.tie(0);

    string a, b; cin >> a >> b;

    a += b;

    long long n = stoll(a);

    for(long long i = 1; i <= 200000; i++){
        if(i * i == n){
            cout << "Yes";
            return 0;
        }
    }

    cout << "No";

    return 0;
}


Measured memory_bytes: 3628
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<string>
using namespace std;
int main()
{
  int n,m,c;
  int b[20],a[20][20];
  cin>>n>>m>>c;
  for(int i=0;i<m;i++) cin>>b[i];
  for(int i=0;i<n;i++)
  for(int j=0;j<m;j++) cin>>a[i][j];

  int cnt=0;
  for(int i=0;i<n;i++)
  {
    int tmp=0;
    for(int j=0;j<m;j++) tmp+=b[j]*a[i][j];
    tmp+=c;
    if(tmp>0) cnt++;
  }

  cout<<cnt<<endl;
}

Measured memory_bytes: 256
import numpy as np

n, t = map(int, input().split())
ab = [list(map(int, input().split())) for _ in range(n)]

ab.sort()

dp = np.zeros(t, dtype=np.int64)

ans = 0
for a, b in ab:
    ans = max(ans, dp[-a:].max() + b)
    np.maximum(dp[a:], dp[:-a] + b, out=dp[a:])


print(ans)


Measured memory_bytes: 14276
import scala.io.StdIn.readLine
import scala.collection.immutable.BitSet

object Main {

  def sum(n:Int, s:Int, b:BitSet):Int = {
    if(n==1) {
      if(s >= 0 && s<=9 && (b.isEmpty || s > b.max)) 1 else 0
    } else {
      var j = 0
      for(i <- 0 to 9 ){
        if(s>=i && (b.isEmpty || i > b.max))
          j += sum(n-1,s-i,b+i)
      }
      j
    }
  }

  def getSum(sb:StringBuilder):Unit = {
    val r = readLine.split(" ").map(_.toInt)

    if(r(0)==0 && r(1)==0)  print(sb.result)
    else {
      println(sum(r(0),r(1),BitSet.empty))
      getSum(sb)
    }
  }

  def main(args:Array[String]) = getSum(new StringBuilder)
}

Measured memory_bytes: 57400
#include<bits/stdc++.h>
using namespace std;
int main(){
  char a,b;
  cin>>a>>b;
  if(a==b){
    cout<<'='<<endl;
  }
  else if(a>b){
    cout<<'>'<<endl;
  }
  else{
    cout<<'<'<<endl;
  }
}

Measured memory_bytes: 256
#include <algorithm>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for(int(i) = 0; (i) < (n); (i)++)
#define FOR(i, m, n) for(int(i) = (m); (i) < (n); (i)++)
#define All(v) (v).begin(), (v).end()
#define pb push_back
#define MP(a, b) make_pair((a), (b))
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int INF = 1 << 30;
const ll LINF = 1LL << 60;
const int MOD = 1e9 + 7;

int main() {
    int N;
    cin >> N;
    vector<int> A(N);
    rep(i, N) {
        cin >> A[i];
        A[i]--;
    }
    vector<bool> ok(N);
    int res = 0;
    rep(i, N) {
        if(!ok[i]) {
            if(A[A[i]] == i) {
                ok[i] = true;
                ok[A[i]] = true;
                res++;
            }
        }
    }
    cout << res << endl;
    return 0;
}

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

#define TSUBO 3.305785

int main()
{
	double a, b;
	cin>>a>>b;
	cout<<setprecision(6);
	cout<<setiosflags(ios::fixed);
	cout<<a*b/TSUBO<<endl;
}

Measured memory_bytes: 1284
#include <bits/stdc++.h>
#include <iostream>
#include <iomanip>
#include <ios> 
#include <vector>
#include <string>
#include <algorithm>
//#include <functional>
#include <queue>
//#include <stack>
//#include <set>
#include <cmath>
//#include <bitset>
#include <map>
using namespace std;
typedef long long ll;

int main() {
  int N,M;
  cin >> N >> M;
  int L[M],R[M];
  for(int i=0; i<M; i++){
    cin >> L[i] >> R[i];
  }

  int lb=0;
  int rb=N+1;
  for(int i=0; i<M; i++){
    lb = max(lb, L[i]);
    rb = min(rb, R[i]);
  }
  if(rb -lb + 1 > 0){
    cout << rb -lb +1 << endl;

  }
  else {
    cout << 0 << endl;
  }

  /*  int lb=0;
  int rb=N+1;

  while(rb -lb >1){
    int mid = (rb+lb)/2;
    for(int i=0; i<M; i++){
      if(mid < L[i]){
	lb = mid;
	break;
      }
      else if (i==M-1){
	rb = mid;
      }
    }
  }
   
  int lb_2=0;
  int rb_2=N+1;

  while(rb_2 -lb_2 >1){
    int mid = (rb_2+lb_2)/2;
    for(int i=0; i<M; i++){
      if(mid > R[i]){
	rb_2 = mid;
	break;
      }
      else if (i==M-1){
	lb_2 = mid;
      }
    }   
  }
  cout << rb_2 -rb << endl;
  return 0;*/

}


Measured memory_bytes: 1024
from collections import defaultdict, Counter
from itertools import product, groupby, count, permutations, combinations
from math import pi, sqrt
from collections import deque
from bisect import bisect, bisect_left, bisect_right
from string import ascii_lowercase
from functools import lru_cache
import sys
sys.setrecursionlimit(10000)
INF = float("inf")
YES, Yes, yes, NO, No, no = "YES", "Yes", "yes", "NO", "No", "no"
dy4, dx4 = [0, 1, 0, -1], [1, 0, -1, 0]
dy8, dx8 = [0, -1, 0, 1, 1, -1, -1, 1], [1, 0, -1, 0, 1, 1, -1, -1]


def inside(y, x, H, W):
    return 0 <= y < H and 0 <= x < W


def ceil(a, b):
    return (a + b - 1) // b


# 初項s, 交差dのn個の数列の和
def sum_of_arithmetic_progression(s, d, n):
    return n * (2 * s + (n - 1) * d) // 2


# aとbの最大公約数
def gcd(a, b):
    if b == 0:
        return a
    return gcd(b, a % b)


# aとbの最小公倍数
def lcm(a, b):
    g = gcd(a, b)
    return a / g * b


def main():
    N = int(input())
    S = input()

    total_b = S.count("#")
    total_w = S.count(".")
    ans = min(total_b, total_w)
    b, w = 0, 0
    for i in range(N):
        left_b = b
        right_w = total_w - w
        ans = min(ans, left_b + right_w)

        if S[i] == "#":
            b += 1
        else:
            w += 1

    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 4388
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#define ll long long
using namespace std;
int main() {
	int n;
	cin >> n;
	vector<int>h(n+1);
	vector<int>dp(n+1,1000000000);
	for (int i = 0; i < n; i++) {
		cin >> h[i];
	}
	dp[0] = 0;
	//dp[1] = abs(h[0]-h[1]);
	for (int i = 0; i < n-1; i++) {
		dp[i + 1] = min(dp[i] + abs(h[i] - h[i + 1]),dp[i+1]);
		dp[i + 2] = min(dp[i] + abs(h[i] - h[i + 2]), dp[i + 2]);
	}
	
	cout << dp[n - 1] << endl;
}

Measured memory_bytes: 1024
// https://qiita.com/drken/items/fd4e5e3630d0f5859067
package main

import (
	"fmt"
)

func main() {
	var N int
	fmt.Scan(&N)
	T := make([]int, N)
	X := make([]int, N)
	Y := make([]int, N)
	for i := 0; i < N; i++ {
		fmt.Scan(&T[i], &X[i], &Y[i])
	}

	possible := func(T []int, X []int, Y []int) bool {
		judge := func(T int, N int) bool {
			if (T - N) >= 0 {
				T -= N
			} else {
				return false
			}
			if T%2 != 0 {
				return false
			}
			return true
		}

		preT := 0
		preX := 0
		preY := 0
		for i := 0; i < N; i++ {
			t := T[i] - preT
			x := X[i] - preX
			y := Y[i] - preY
			if !judge(t, x+y) {
				return false
			}
			preT = t
			preX = x
			preY = y
		}
		return true
	}
	if possible(T, X, Y) {
		fmt.Println("Yes")
	} else {
		fmt.Println("No")
	}
}


Measured memory_bytes: 5504
#ifdef __GNUG__
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG // ArrayOutofBounds
#else
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#endif
#define rep(i, N) for (int i = 0; i < N; i++) //制御変数iを用いてN回転
using namespace std;
using ll = long long;
//0:上 1:左 2:下 3:右
const int di[] = { -1, 0, 1, 0};
const int dj[] = { 0, -1, 0, 1};

const int mod = 1e9 + 7;

int main() {
    int N;
    cin >> N;
    ll total = 1, each = 1, inter = 1;
    rep(i, N) {
        /* あらゆる数列 */
        total *= 10;
        total %= mod;
        /* 0がない数列 or 9がない数列 */
        each *= 9;
        each %= mod;
        /* 0も9もない数列 */
        inter *= 8;
        inter %= mod;
    }
    each = (each * 2) % mod;
    ll ans = total + mod;
    ans = (ans - each) % mod;
    ans = (ans + inter) % mod;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3624
#include <stdio.h>

int main(void){
    
    int d,n,x;
    scanf("%d %d",&d,&n);
    x=n;
    
    if(n==100)
        x++;
    for(int i=0; i<d; i++){
        x*=100;
    }
    printf("%d",x);
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
using namespace std; 
typedef long long int ll;
 
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll k, x;
    cin >> k >> x;
    if(k * 500 >= x)
    {
        cout << "Yes" << endl;
    }
    else
    {
        cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 256
N = int(input())
count = 0
ans = 0
for i in range(N):
    a = int(input())
    if a:
        count += a
    else:
        ans += count // 2
        count = 0
ans += count // 2
print(ans)

# https://www.youtube.com/watch?v=yjrzxk7JC68


Measured memory_bytes: 3060
def sinsu(M,k):
    L=0
    MM=M
    while(True):
        L+=MM%k
        MM=MM//k
        if MM==0:
            break
    return L
N=int(input())
ans=N
for i in range(N+1):
    a=i
    b=N-i
    tmp=sinsu(a,6)+sinsu(b,9)
    if ans>tmp:
        ans=tmp
print(ans)


Measured memory_bytes: 3060
import java.util.Scanner;

class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
//        System.out.println("Please input a.");
        int a = sc.nextInt();
//        System.out.println("Please input b.");
        int b = sc.nextInt();
        if((a<-1000 || 1000<a) || (b<-1000 || 1000<b)){
            System.exit(-1);
        }else if(a<b){
            System.out.println("a < b");
        }else if(a>b){
            System.out.println("a > b");
        }else{
            System.out.println("a == b");
        }
    }
}

Measured memory_bytes: 26232
# ABC121 D-XOR World

A, B = map(int, input().split())

def XOR(x):
    if (x+1) % 2 == 0:
        if ((x+1) // 2) % 2 == 0:
            return 0
        else:
            return 1
    else:
        if ((x+1) // 2) % 2 == 0:
            return 0 ^ (x)
        else:
            return 1 ^ (x)
        
print(XOR(A-1) ^ XOR(B))

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

#define debug(n) cerr << #n << ':' << n << endl;

using namespace std;

using  ll = long long;

template<class T,class U>
using umap = unordered_map<T,U>;

template<class T>
using uset = unordered_set<T>;

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

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


int main(){
  int n; cin >> n;
  vector<double>a(n);
  for(auto&&e:a){
    cin >> e;
  }

  sort(a.begin(), a.end());
  double ans = a[0];
  for(int i = 1; i < n; ++i){
    ans = (ans+a[i])/2;
  }

  cout << fixed << setprecision(10) << ans << endl;
    

  return 0;
}


Measured memory_bytes: 256
//I am so vegetable
//#define _LOCAL_
#pragma GCC optimize(2)
#include <bits/stdc++.h>
#define FIO ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define PB push_back
#define IN insert
#define ER erase
#define CT count
#define EP empty
#define _for(i,a,b) for(int i = (a);i<(b);++i)
#define _rfor(i,a,b) for(int i = (a);i>(b);--i)
#define _sfor(p,st) for(auto &p:st)
using namespace std;
typedef long long ll;
const int INF = 0x3f3f3f3f;
const ll N = 2e3 + 5;
const int MOD = 998244353;
const double eps = 1e-6;
const double pi = acos(-1);
int gcd(int a, int b) { return b == 0 ? a : gcd(b, a % b); }
ll qpow(ll x, ll y) { ll ans = 1; for (; y > 0; y >>= 1) { if (y & 1)ans *= x; x *= x; }return ans; }
int a[N];
int main() {
	FIO;
	int n;cin>>n;
	int x,y;cin>>x>>y;
	_for(i,1,n){
		_for(j,i+1,n+1){
			int len = min(j-i,abs(i-x)+abs(y-j)+1);
			++a[len];
		}
	}
	_for(i,1,n){
		cout<<a[i]<<'\n';
	}
	return 0;
}

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

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

#define rep(i,cc,n) for(int i=cc;i<n;++i)
#define lrep(i,cc,n) for(long long i=cc;i<n;++i)
#define sqrep(i,cc,n) for(long long i=cc;i*i<=n;++i)
#define rrep(i,cc,n) for(long i=cc;i>n;--i)
#define pii pair<int, int>
#define pll pair<long long, long long>
 
using ll = long long;

const vector<int> dx = {1, 0, -1, 0};
const vector<int> dy = {0, 1, 0, -1};
const double PI = 3.1415926535;
const ll inf = 1001001001;
const ll e9  = 1000000000;
const ll mod = 1000000007;

int main(){
    string s;
    cin >> s;
    int n = s.size();
    vector<vector<ll>>dp(n,vector<ll>(13));
    vector<ll>rem({1, 10, 9, 12, 3, 4});
    reverse(s.begin(),s.end());
    if(s[0]=='?'){
        rep(i, 0, 10){
            dp[0][i] = 1;
        }
    }else{
        int r = s[0] - '0';
        dp[0][r] = 1;
    }
    rep(i, 1, n){
        if(s[i] == '?'){
            rep(j, 0, 10){
                rep(k, 0, 13){
                    int p = j*rem[i%6]%13;
                    p = (p+k)%13;
                    dp[i][p] += dp[i-1][k];
                    dp[i][p] %= mod;
                }
            }
        }else{
            int q = s[i]-'0';
            int p = q*rem[i%6]%13;
            rep(j, 0, 13){
                dp[i][(p+j)%13] += dp[i-1][j];
                dp[i][(p+j)%13] %= mod;
            }
        }
    }
    cout << dp[n-1][5] << endl;
}

Measured memory_bytes: 16716
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
    ll n;
    cin >> n;
    vector<ll> a(n);
    ll i,j,k;
    for(i=0;i<n-1;i++){
        ll b;
        cin >> b;
        a.at(b-1)++;
    }
    for(i=0;i<n;i++){
        cout << a.at(i) << endl;
    }
    return 0;
}

Measured memory_bytes: 4844
#include <stdio.h>

int main(void){
  int tmp, cup[3] = {1, 0, 0};
  char a, b;

  while(scanf(" %c,%c", &a, &b) != EOF){
    tmp = cup[a-'A'];
    cup[a-'A'] = cup[b-'A'];
    cup[b-'A'] = tmp;
  }
  if(cup[0] == 1){
    printf("A\n");
  }else if(cup[1] == 1){
    printf("B\n");
  }else{
    printf("C\n");
  }
  return 0;
}

Measured memory_bytes: 524