akhauriyash/Code-Regression huggingface dataset:
[n,m,l]=map(int,input().split())
A=[[] for i in range(n)]
B=[[] for i in range(m)]
C=[[0 for i in range(l)] for j in range(n)]

for i in range(n):
    A[i]=list(map(int,input().split()))
for i in range(m):
    B[i]=list(map(int,input().split()))

for i in range(n):
    for j in range(l):
        for k in range(m):
            C[i][j]+=A[i][k]*B[k][j]
for i in range(n):
    for j in range(l):
        print(C[i][j],end='')
        if j<l-1:
            print(end=" ")
        else:
            print()


Measured memory_bytes: 6980
///Bismillahir Rahmanir Rahim
#include<bits/stdc++.h>

#define                           int                         long long
#define                           fi                          first
#define                           si                          second
#define                           mp                          make_pair
#define                           pb                          push_back
#define                           pi                          pair<int,int>
#define                           f(i,l,r)                    for(int i=l;i<=r;i++)
#define                           rf(i,r,l)                   for(int i=r;i>=l;i--)
#define                           done(i)                     cout<<"done = "<<i<<endl;
#define                           fast                        ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);




using namespace std;

const int inf=1e18;
const int mod=1e9+7;
const int M=100009;
inline int bigmod(int B,int P){int R=1;while(P>0){if(P&1){R=(R*B)%mod;}P>>=1;B=(B*B)%mod;}return R;}


 main()

{
    fast
    int n,m;
    cin>>n>>m;
    vector<int>vec;
    int two[67];
    two[0]=1;
    f(i,1,60)
    {
        two[i]=two[i-1]*2;
    }
    priority_queue<int>pq;
    f(i,1,n)
    {   int x;
        cin>>x;
        pq.push(x);
    }
    while(!pq.empty() && m)
    {
        int u=pq.top();
        pq.pop();
        u=u/2;
        m--;
        if(u!=0)pq.push(u);
    }
    int sum=0;
    while(!pq.empty())
    {
        int u=pq.top();
        pq.pop();
        sum+=u;
    }
    cout<<sum<<endl;
    return 0;

}













Measured memory_bytes: 1400
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using Graph = vector<vector<int>>;
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define rREP(i,a,n) for(int (i)=(n)-1; (i)>=(a);--(i))
#define all(x) (x).begin(),(x).end()
#define out(y,x,h,w) (y)<0||(x)<0||(y)>=(h)||(x)>=(w)
constexpr int INF = 1000000000;
constexpr ll mod = 1000000007;
constexpr double PI = 3.1415926535897932;

template<class T>inline bool chmin(T& a, T b) {
	if (a > b) {
		a = b;
		return true;
	}
	return false;
}
template<class T>inline bool chmax(T& a, T b) {
	if (a < b) {
		a = b;
		return true;
	}
	return false;
}
inline void init() {
	cin.tie(nullptr); cout.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

int main() {
	init();

	int N; cin >> N;
	unordered_map<int, int>mp;
	rep(i, N) {
		int a; cin >> a;
		mp[a]++;
	}
	cout << (mp.size() == N ? "YES" : "NO") << "\n";

	return 0;
}

Measured memory_bytes: 8520
n, w = map(int, input().split())

dp = [0]*(w+1)

for _ in range(n):
  wei, v = map(int, input().split())
  dp_1 = dp[:]
  for j in range(w + 1):
    if j - wei >= 0:
      dp[j] = dp_1[j-wei] + v if (dp_1[j-wei] + v) > dp_1[j] else dp[j]
  
print(dp[w])


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

#define ll long long int

int main() {
	// your code goes here
	
	ll n;
	cin>>n;
	ll x=0;
	ll y=0;
	ll arr[n];
	for(ll i=0;i<n;i++){
		cin>>arr[i];
		if(arr[i]%6==0 || arr[i]%10==0){
			x++;
		}
		if(arr[i]%2==0){
			y++;
		}
	}
	if(x==y){cout<<"APPROVED";
	}else{cout<<"DENIED";}
	return 0;
}

Measured memory_bytes: 256
//long long -> ll
//http://web.mit.edu/~ecprice/acm/acm08/notebook.html#file12
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
#include<bits/stdc++.h>
typedef long long ll;
#define x first
#define y second
#define all(aaa) (aaa).begin(),(aaa).end()
#define REP(i,sss,eee) for(long long i=sss;i<=eee;++i)
#define pb push_back
#define pii pair<long long,long long>
#define vi vector<long long>
#define speed ios_base::sync_with_stdio(0);cin.tie(0);
#define N 1000000007
using namespace __gnu_pbds;
using namespace std;
template <class T>
T MAX(T a, T b){return ((a>b)?a:b);}
template <class T>
T MIN(T a, T b){return ((a<b)?a:b);}
template <class T>
T MOD(T a){return ((a>=0)?a:(-1*a));}
template <class T>
void SWAP(T &a,T &b){T temp=a;a=b;b=temp;}

typedef tree<
long long,
null_type,
less<long long>,
rb_tree_tag,
tree_order_statistics_node_update>
ordered_set;

long long ex(long long a, long long b){
	if(b==0||a==1){return 1;}
	if(a==0||b==1){return a;}
	long long tmp=ex(a,(b/2));
	if(b%2){return ((((tmp*tmp)%N)*a)%N);}
	else{return ((tmp*tmp)%N);}
}
long long inv(long long k){
	if(k==1){return 1;}
	else{return ex(k,N-2);}
}
/*****************default********************/
long long mod;
std::vector<std::vector<long long>> g;
std::vector<long long> ways;
std::vector<long long> fin,topo,parval,par;
long long dfs(long long num,long long fpar)
{
	std::vector<long long> vec;
	ways[num]=1;
	for(auto it:g[num])
	{
		if(it==fpar){continue;}
		else
		{
			par[it]=num;
			dfs(it,num);
			ways[num]=((ways[num]*(1+ways[it]))%mod);
			vec.pb(((1+ways[it])%mod));
		}
	}
	vector<long long> pre,suff;
	long long pro=1;
	for(auto it:vec)
	{
		pro=((pro*it)%mod);
		pre.pb(pro);
	}
	pro=1;
	long long sz=vec.size();
	for(long long i=sz-1;i>=0;--i)
	{
		pro=((pro*vec[i])%mod);
		suff.pb(pro);
	}
	long long ct=0;
	reverse(suff.begin(),suff.end());
	for(auto it:g[num])
	{
		if(it==fpar){
			continue;
		}
		else
		{
			long long ans=1;
			if(ct!=0){ans=((ans*pre[ct-1])%mod);}
			if(ct!=sz-1){ans=((ans*suff[ct+1])%mod);}
			parval[it]=ans;
			++ct;
		}
	}
	topo.pb(num);
	return ways[num];
}
long long solve()
{
	long long n;cin>>n>>mod;
	g.resize(n);ways.resize(n,1);fin.resize(n,1);parval.resize(n,0);par.resize(n);
	REP(i,0,n-2)
	{
		long long a,b;
		cin>>a>>b;--a;--b;
		g[a].pb(b);g[b].pb(a);
	}
	dfs(0,-1);fin[0]=ways[0];
	//for(auto it:parval){cout<<it<<" ";}cout<<"\n";
	reverse(topo.begin(),topo.end());
	std::vector<long long> factor(n,1);
	for(auto it:topo)
	{
		if(it==0){continue;}
		long long p=par[it];
		ll mt=(((parval[it]*factor[p])%mod+1)%mod);
		//cout<<it<<" "<<p<<" "<<parval[it]<<" "<<ways[it]<<" "<<mt<<"\n";
		factor[it]=((factor[it]*mt)%mod);
		fin[it]=((ways[it]*mt)%mod);
	}
	for(auto it:fin){cout<<it<<"\n";}
}
signed main(){
	//speed
	long long tt=1;
	//cin>>tt;
	while(tt--)
	{
		solve();
	}
	return 0;
}

Measured memory_bytes: 24120
#include <bits/stdc++.h>
#define int long long 
using namespace std;
signed main(){
	long long k;
	cin>>k;
	long long f=k%50;
	long long cnt=(k)/50;
	cnt+=49;
	cout<<"50"<<endl;
	for(int i=1;i<=50;i++){
		if(i<=(50-f)){
			cout<<cnt-f<<" ";
		} else {
			cout<<cnt+51-f<<" ";
		}
	}
	puts("");
	return 0;
}


Measured memory_bytes: 256
def section_sum(a, b):
    return acc[b] - acc[a]


def minimize(s1, s2, s3):
    lsum = float("inf")
    for i in range(s1, s2):
        if abs(section_sum(0, i) - section_sum(i, s2)) < lsum:
            q = section_sum(0, i)
            r = section_sum(i, s2)
            s1 = i
            lsum = abs(q - r)
        else:
            break

    rsum = float("inf")
    for i in range(s3, len(a)):
        if abs(section_sum(s2, i) - section_sum(i, len(a))) < rsum:
            s = section_sum(s2, i)
            t = section_sum(i, len(a))
            s3 = i
            rsum = abs(s - t)
        else:
            break

    cut = [q, r, s, t]
    return abs(min(cut) - max(cut)), s1, s2, s3


n = int(input())
a = list(map(int, input().split()))

acc = [0]
for x in a:
    acc.append(acc[-1] + x)

s1, s2, s3 = 1, 2, 3
ans = float("inf")
for s2 in range(2, len(a) - 1):
    x, s1, s2, s3 = minimize(s1, s2, s3)
    ans = min(ans, x)

print(ans)


Measured memory_bytes: 25672
#include <stdio.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>

using namespace std;

int main(){
	int N, M;
	cin >> N >> M;
	int sum = 0;
	for(int i = 0; i < M; i++){
      	int a;
      	cin >> a;
    	sum += a;
    }
  	int ans;
  	ans = N - sum;
  	if(ans < 0) ans = -1;
	cout << ans << endl; 

}

Measured memory_bytes: 3636
import collections
import heapq
n = int(raw_input())
ais = [0] + map(int, raw_input().split()) 
res = [0 for __ in range(n +1)]
used = set([])
for u in range(n, 0, -1):
	c = u*2
	cumul = 0
	for jj in range(u, n+1, u):
		cumul += res[jj]
	
	if ais[u] != (cumul % 2): 
		res[u] = 1
		used.add(u)
s = sum(res)
print s
if s:
	for x in used: print x,
	print

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

#ifdef _DEBUG
inline void dump() { cerr << endl; }
template <typename Head> void dump(Head &&head) {
  cerr << head;
  dump();
}
template <typename Head, typename... Tail>
void dump(Head &&head, Tail &&... tail) {
  cerr << head << ", ";
  dump(forward<Tail>(tail)...);
}
#define debug(...)                                                             \
  do {                                                                         \
    cerr << __LINE__ << ":\t" << #__VA_ARGS__ << " = ";                        \
    dump(__VA_ARGS__);                                                         \
  } while (false)
#else
#define dump(...)
#define debug(...)
#endif

template <typename T> struct edge {
  int src, to;
  T cost;
  edge(int to, T cost) : src(-1), to(to), cost(cost) {}
  edge(int src, int to, T cost) : src(src), to(to), cost(cost) {}
  edge &operator=(const int &x) {
    to = x;
    return *this;
  }
  operator int() const { return to; }
};
template <typename T> using Edges = vector<edge<T>>;
template <typename T> using WeightedGraph = vector<Edges<T>>;
using UnWeightedGraph = vector<vector<int>>;
template <typename T> using Matrix = vector<vector<T>>;

/////////////////////////////////////////////////////////////////////

const ll inf = 1LL << 60;
const ll mod = 1000000007;

struct mint {
  ll x;
  mint(ll 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 { return mint(*this) += a; }
  mint operator-(const mint a) const { return mint(*this) -= a; }
  mint operator*(const mint a) const { return mint(*this) *= a; }
  mint pow(ll t) const {
    if (!t)
      return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1)
      a *= *this;
    return a;
  }
  mint inv() const { return pow(mod - 2); }
  mint &operator/=(const mint a) { return (*this) *= a.inv(); }
  mint operator/(const mint a) const { return mint(*this) /= a; }
  bool operator==(const mint a) const { return x == a.x; }
  bool operator!=(const mint a) const { return x != a.x; }
  friend ostream &operator<<(ostream &os, const mint &p) { return os << p.x; }
  friend istream &operator>>(istream &is, mint &a) {
    ll t;
    is >> t;
    a = mint(t);
    return (is);
  }
};

int main() {
  ll n; cin >> n;
  vector<ll> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  mint ans = 0;
  mint sum = 0;
  rep(i, n) sum += a[i];

  rep(i, n) {
    sum -= a[i];
    ans += sum * a[i];
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 4752
import qualified Data.ByteString.Lazy.Char8 as B
import Data.ByteString.Lazy.Char8 (ByteString)
import Control.Monad.Trans.State.Strict
import Control.Applicative
import Data.Char

main :: IO ()
main = B.interact $ output . solve . input

output :: Int -> ByteString
output = B.pack . show

solve :: [Int] -> Int
solve = sum . map pred

input :: ByteString -> [Int]
input = maybe (error "parse error") fst . runStateT (parseInt *> many parseInt)

parseInt :: StateT ByteString Maybe Int
parseInt = StateT $ B.readInt . B.dropWhile isSpace


Measured memory_bytes: 1148
#include<bits/stdc++.h>
using namespace std;
#define ll long long
char s[40500];
int main()
{
	int n;
	scanf("%d",&n);
	scanf("%s",s);
	ll sum=0,r=0,g=0,b=0;
	for(int i=0;i<n;i++)
	{
		if(s[i]=='B')
			b++;
		else if(s[i]=='G')
			g++;
		else
			r++;
	}
	ll r1=0,g1=0,b1=0;
	for(int i=0;i<n-1;i++)
	{
		if(s[i]=='R')
		{
			r1++;
			r--;
			sum+=g1*b;
			sum+=b1*g;
			for(int j=0;j<i;j++)
			{
				if(s[j]!=s[i]&&s[i-j+i]!=s[j]&&s[i-j+i]!=s[i]&&(i-j+i)<n)
				{
					sum--;
				}
			}
			
		}
		else if(s[i]=='B')
		{
			b1++;
			b--;
			sum+=g1*r;
			sum+=r1*g;
			for(int j=0;j<i;j++)
			{
				if(s[j]!=s[i]&&s[i-j+i]!=s[j]&&s[i-j+i]!=s[i]&&(i-j+i)<n)
				{
					sum--;
				}
			}
		}
		else
		{
			g1++;
			g--;
			sum+=b1*r;
			sum+=r1*b;
			for(int j=0;j<i;j++)
			{
				if(s[j]!=s[i]&&s[i-j+i]!=s[j]&&s[i-j+i]!=s[i]&&(i-j+i)<n)
				{
					sum--;
				}
			}
			
		}
	}

	cout<<sum<<endl;
	return 0;
} 

Measured memory_bytes: 3688
n,c,k = map(int,input().split())
t = [int(input()) for i in range(n)]

t.sort()
key = t[0]+k
len_t = 0
ans1 = 0
for i in range(n):
    if t[i] <= key and len_t < c:
        len_t += 1
    else:
        ans1 += 1
        key = t[i]+k
        len_t = 1
ans1 += 1
print(ans1)

Measured memory_bytes: 7484
#include<bits/stdc++.h>
#define ll long long
#define ull unsigned ll
#define FOR(i, a, b) for(ll i = a; i < b; i++)
#define all(x) (x).begin(), (x).end()
#define MOD1 1000000007
#define MOD2 998244353
#define IOS std::ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define pb push_back
#define print(a) for(auto x : a)    cout<<x<<" "; cout<<"\n";
using namespace std;

void OFFLINE(){ 
    #ifndef ONLINE_JUDGE 
        freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); 
    #endif
}
ll GCD(ll a, ll b){ int gcd = b != 0 ? a : GCD(b, a % b); return gcd;}

int main(){

    IOS;

    int a, b, k;
    cin >> k >> a >> b;
    int ans = 0;
    int flag = 0;
    for(int i = 1; ans < b; i++ )
    {
        ans = k * i;
        if(ans >= a && ans <= b)
        {
            cout<<"OK\n";
            flag = 1;
            break;
        }
    }
    if(!flag)
        cout<<"NG\n";

    return 0;
}

Measured memory_bytes: 3648
#!/usr/bin/env python3
import sys
import bisect


def solve(N: int, K: int, x: "List[int]"):
    zi = bisect.bisect_left(x,0)

    s = max(0,zi-K)
    e = min(N-K,zi+K-1)

    res = float("inf")
    for i in range(s,e+1):
        x1 = x[i]
        x2 = x[i+K-1]
        if x2 < 0:
            res = min(res,abs(x1))
        elif x1 > 0:
            res = min(res,x2)
        else:
            res = min(res,abs(x1*2)+abs(x2))
            res = min(res,abs(x1)+abs(x2*2))
    print(res)
    return


# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    x = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, K, x)

if __name__ == '__main__':
    main()


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

bool prime(int n) {
    if (n % 2 == 0)  return 0;
    int lim = sqrt(n);
    for (int i = 3; i <= lim; i+= 2) {
        if (n%i == 0) {
            return 0;
        }
    }
    return 1;
}

void solve () {
    int n;
    cin >> n;
    if (n == 2) {
        cout << 2;
        return;
    }
    n += (n % 2 == 0);
    while (1) {
        if (prime(n)) {
            cout << n;
            return;
        }
        n+=2;
    }
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    solve();
    return 0;
}


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

#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>

// isDebug?
#ifndef ONLINE_JUDGE
#define _DEBUG
#endif

// Function Macros:
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rrep(i, n) for(int i = (n)-1; i >= 0; i--)
#define all(v) (v).begin(), (v).end()
#define setpre(n) cout << fixed << setprecision(n)

// -* https://xn--kst.jp/blog/2019/08/29/cpp-comp/ *- Thx :)
// debug methods
// usage: debug(x,y);
#define CHOOSE(a) CHOOSE2 a
#define CHOOSE2(a0, a1, a2, a3, a4, x, ...) x
#define debug_1(x1) cout << #x1 << ": " << x1 << endl
#define debug_2(x1, x2) cout << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << endl
#define debug_3(x1, x2, x3) cout << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << ", " #x3 << ": " << x3 << endl
#define debug_4(x1, x2, x3, x4) cout << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << ", " #x3 << ": " << x3 << ", " #x4 << ": " << x4 << endl
#define debug_5(x1, x2, x3, x4, x5) cout << #x1 << ": " << x1 << ", " #x2 << ": " << x2 << ", " #x3 << ": " << x3 << ", " #x4 << ": " << x4 << ", " #x5 << ": " << x5 << endl
#ifdef _DEBUG
#define debug(...)                                                        \
    cout << __FILE__ << ": " << __LINE__ << ": " << __func__ << " -> ";   \
    CHOOSE((__VA_ARGS__, debug_5, debug_4, debug_3, debug_2, debug_1, ~)) \
    (__VA_ARGS__)
#else
#define debug(...)
#endif

// namespace / type / class / struct Definitions:
using namespace std;
namespace mp = boost::multiprecision;

using ll = long long;
using ull = unsigned long long;
// 任意長整数型
using Bint = mp::cpp_int;
// 仮数部が1024ビットの浮動小数点数型
using Real = mp::number<mp::cpp_dec_float<1024>>;

// Constants:
const int INF = (1ll << 30) - 1;  // approx 1.07e9
const ll INFLL = 1ll << 60;       // approx 1.15e18
const int MOD = 1e9 + 7;          // 998244353
const long double EPS = 1.0e-14;
const int FACN = 510000;

// Global Variables:
// ll fac[FACN], finv[FACN], inv[FACN];

// Prototype Declarations:
int gcd(int, int);
int lcm(int, int);
template <class T>
inline bool chmin(T&, T);
template <class T>
inline bool chmax(T&, T);

// ================ Main Loop ================
int main() {
    /* Code */
    ll a;
    Real b;
    cin >> a >> b;
    cout << (ll)(a * b) << endl;
    return 0;
}
// ===========================================

// Functions:
// 最大公約数O (log(max(a, b)))
int gcd(int a, int b) {
    return b ? gcd(b, a % b) : a;
}
// 最小公倍数 O(log(max(a, b)))
int lcm(int a, int b) {
    return a * b / gcd(a, b);
}

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

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


Measured memory_bytes: 3816
#include "bits/stdc++.h"

#define REP(i, n, N) for(int i=(n); i<(N); i++)
#define RREP(i, n, N) for(int i=(N-1); i>=n; i--)
#define CK(n, a, b) ((a)<=(n)&&(n)<(b))
#define ALL(v) (v).begin(),(v).end()
#define MCP(a, b) memcpy(b,a,sizeof(b))
#define p(s) cout<<(s)<<endl
#define p2(a, b) cout<<(a)<<" "<<(b)<<endl
#define v2(T) vector<vector<T>>
typedef long long ll;
using namespace std;
const ll mod = 1e9 + 7;
const ll inf = 1e18;

int N, M;
int cnt[50];
int ans;
int main() {
	cin >> N >> M;
	REP(i, 0, N){
		int K;
		cin>>K;
		REP(j,0,K){
			int a;
			cin>>a;
			cnt[a]++;
		}
	}
	REP(i,1,M+1){
		if(cnt[i] == N){
			ans++;
		}
	}
	p(ans);

	return 0;
}


Measured memory_bytes: 256
n=gets.to_i
bs=gets.split.map(&:to_i)

as=[]
(0..(n-3)).each do |i|
  if bs[i]<=bs[i+1]
    as.push(bs[i])
  else
    as.push(bs[i+1])
  end
end

as.push(bs[0])
as.push(bs[-1])

p as.inject(:+)


Measured memory_bytes: 1788
X = int(input())
if 400 <= X <= 599:
    print(8)
elif 600 <= X <= 799:
    print(7)
elif 800 <= X <= 999:
    print(6)
elif 1000 <= X <= 1199:
    print(5)
elif 1200 <= X <= 1399:
    print(4)
elif 1400 <= X <= 1599:
    print(3)
elif 1600 <= X <= 1799:
    print(2)
elif 1800 <= X <= 1999:
    print(1)


Measured memory_bytes: 9176
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner kb = new Scanner(System.in);
		int s = kb.nextInt();
		System.out.println((int) (s + Math.pow(s, 2) + Math.pow(s, 3)));
		kb.close();
	}

}


Measured memory_bytes: 27116
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <fstream>
#include <functional>
#include <bitset>
#define chmin(a, b) ((a)=min((a), (b)))
#define chmax(a, b) ((a)=max((a), (b)))
#define fs first
#define sc second
#define eb emplace_back
using namespace std;

typedef long long ll;
typedef pair<int, int> P;
typedef tuple<int, int, int> T;

const ll MOD=1e9+7;
const ll INF=1e18;
const double pi=acos(-1);
const double eps=1e-10;

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

int main(){
    while(1){
        int n, m; cin>>n>>m;
        if(n == 0) return 0;
        vector<int> c(m), x(n);
        for(int i=0; i<m; i++) cin>>c[i];
        for(int i=0; i<n; i++) cin>>x[i];

        vector<vector<int>> dp(n+10, vector<int>(300, 1e9));
        dp[0][128] = 0;

        for(int i=0; i<n; i++){
            for(int j=0; j<=255; j++){
                for(int k=0; k<m; k++){
                    if(256 <= j + c[k]){
                        dp[i+1][255] = min(dp[i+1][255], dp[i][j] + (x[i] - 255) * (x[i] - 255));
                    }
                    else if(j + c[k] < 0){
                        dp[i+1][0] = min(dp[i+1][0], dp[i][j] + x[i] * x[i]);
                    }
                    else{
                        dp[i+1][j+c[k]] = min(dp[i+1][j+c[k]], dp[i][j] + (x[i] - (j + c[k])) * (x[i] - (j + c[k])));
                    }
                }
            }
        }

        int ans=1e9;
        for(int i=0; i<=255; i++){
            chmin(ans, dp[n][i]);
        }

        cout << ans << endl;
    }
}


Measured memory_bytes: 27140
#include <iostream>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
using namespace std;

int main(){
  int N, min=9999999, max=-9999999;
  long sum=0;
  cin >> N;
  for(int i=0;i<N;i++){
    int t;
    cin >> t;
    if(min > t){
      min = t;
    }
    if(max < t){
      max = t;
    }
    sum += t;
  }

  cout << min << " " << max << " " << sum << endl;
  return 0;
}

Measured memory_bytes: 1168
#include<iostream>
#include <cstdlib>
#include<algorithm>
using namespace std;

int main(){
	int N;
	cin>>N;
	int a[N];
	for(int i=0;i<N;i++){
		cin>>a[i];
	}
	int alice=0,bob=0;
	sort(a,a+N);
	int c=1;
	for(int i=N;i>0;i--){
		if(c%2==1){
			alice+=a[i-1];
		}else{
			bob+=a[i-1];
		}
		c++;
	}
	cout<<abs(alice-bob)<<endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <memory>
#include <complex>
#include <numeric>
#include <cstdio>
#include <iomanip>
#include <random>

#define REP(i,m,n) for(int i=int(m);i<int(n);i++)
#define RREP(i,m,n) for(int i=int(n)-1;i>=int(m);--i)
#define EACH(i,c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
//#define int long long

#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR 
#endif
using namespace std;

using UI = unsigned int;
using UL = unsigned long;
using LL = long long;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VVLL = vector<VLL>;
using VS = vector<string>;
using PII = pair<int,int>;
using VP = vector<PII>;
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; }

long long power(long long x, long long n) {
    if (n == 0) return 1;
    if (n % 2 == 0) return power(x * x, n/2);
    else return x * power(x, n-1);
}

bool solve(LL b, LL x, LL a) {
    return power(a,5) - power(b,5) <= x;
}

long long meguru_bin(LL x, LL a) {
    long long ok = 1<<12;
    long long ng = -(1<<12);

    while (abs(ok - ng) > 1) {
        long long mid = ng + (ok - ng) / 2;
        if (solve(mid, x, a)) ok = mid;
        else ng = mid;
    }

    return ok;
}

void solve() {
    LL x;
    cin >> x;
    REP(i,0,(1<<12)+1) {
        LL b = meguru_bin(x,i);
        LL a = i;
        if (power(a,5) - power(b,5) == x) {
            cout << a << " " << b << endl;
            return;
        }
    }
}

signed main() {
    solve();
    
    return 0;
}

Measured memory_bytes: 3636
import math
A, B, H, M = map(int,input().split())
#時針:0.5°/min
#分針:6.0°/min
print(math.sqrt(A ** 2 + B ** 2 - 2 * A * B * math.cos(5.5 * (H * 60 + M) * math.pi / 180 )))

Measured memory_bytes: 9472
#include <iostream>
using namespace std;
int main(){
	int n;
	while(1){
		cin>>n;
		if(n==0) break;
		for(int i=1;i<=n; i++){
			int pj,pm,pe;
			cin>>pm>>pe>>pj;
			if(pj==100||pm==100||pe==100){
				cout<<"A"<<endl;
			}else if((pm+pe)/2>=90){
				cout<<"A"<<endl;
			}else if((pj+pm+pe)/3>=80){
				cout<<"A"<<endl;
			}else if((pj+pm+pe)/3>=70){
				cout<<"B"<<endl;
			}else if((pj+pm+pe)/3>=50&&pm>=80||pe>=80){
				cout<<"B"<<endl;
			}else{
				cout<<"C"<<endl;
			}
		} 
	} 
}

Measured memory_bytes: 1156
// Created by Nandu Vinodan
#include <bits/stdc++.h>

#define db1(x) cout<<#x<<"="<<x<<'\n'
#define db2(x,y) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<'\n'
#define db3(x,y,z) cout<<#x<<"="<<x<<","<<#y<<"="<<y<<","<<#z<<"="<<z<<'\n'
#define rep(i,a,n) for(int i=a;i<=(n);++i)
#define repD(i,a,n) for(int i=a;i>=(n);--i)
#define pb(a) push_back(a)
#define eb(a) emplace_back(a)
#define vi vector<int>
#define pi pair<int, int>
#define INF INT_MAX
#define _INF INT_MIN
#define TC 0

using namespace std;
using ll = long long;

void testcase() {
    int a, b;
    cin >> a >> b;

    rep (i, 1, 1000) {
    	if (floor((double)i * 0.08)==a && floor((double)i*0.1)==b) {
    		cout << i << "\n";
    		return;
    	}
    }

    cout << "-1\n";
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    if (TC)
        cin>>t;
    while(t--) {
        testcase();
    }
    return 0;
}

Measured memory_bytes: 256
n  = int(input())
h = [0]+list(map(int,input().split()))
dp = [0]*(n+1)
dp[1]= 0
dp[2]= abs(h[2]-h[1])
for i in range(3,n+1):
	    dp[i]= min(dp[i-1]+abs(h[i]-h[i-1]),dp[i-2]+abs(h[i]-h[i-2]))
print(dp[n])
	    
	    

Measured memory_bytes: 52208
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,b) for(int i=a;i<b;i++)

int H, W;
string C[10];
int dx[4] = { 0, 1, 0, -1 };
int dy[4] = { -1, 0, 1, 0 };
string ds = "URDL";

string dfs(int cnt, int x, int y, int dir)
{
	if (cnt == 0) return "";

	rep(i, 0, 4) if((dir - i + 4) % 4 != 2)
	{
		int xx = x, yy = y;
		int tx = -1, ty = -1;

		while ((0 <= xx && xx < W) && (0 <= yy && yy < H))
		{
			if (C[yy][xx] == 'o')
			{
				tx = xx;
				ty = yy;
				break;
			}

			xx += dx[i];
			yy += dy[i];
		}

		if (tx < 0) continue;

		C[ty][tx] = 'x';

		string ret = dfs(cnt - 1, tx, ty, i);
		if (ret != "CANT") return ds[i] + ret;
		C[ty][tx] = 'o';
	}

	return "CANT";
}

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

	while (cin >> H >> W)
	{
		rep(y, 0, H) cin >> C[y];

		int N = 0;
		rep(y, 0, H) rep(x, 0, W) if (C[y][x] == 'o') N++;
		rep(y, 0, H) rep(x, 0, W) if (C[y][x] != 'o' && C[y][x] != '.')
		{
			switch (C[y][x])
			{
			case 'U': cout << dfs(N, x, y, 0) << endl; break;
			case 'R': cout << dfs(N, x, y, 1) << endl; break;
			case 'D': cout << dfs(N, x, y, 2) << endl; break;
			case 'L': cout << dfs(N, x, y, 3) << endl; break;
			}
		}
	}
}

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

#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define st first
#define nd second
#define endl '\n' //toggle off for interactive problems
#define what_is(x) cerr << #x << " is " << x << endl;
#define what_is_v(x) cerr << #x << " is "; for(auto&e: (x)) cerr << e << ' '; cerr << '\n'; //vector, set
#define what_is_a(x, n) cerr << #x << " is "; for(int i=0;i<n;i++) cerr << x[i] << ' '; cerr <<  '\n'; //n first element of array
#define cerr_pair(x) '{' << x.st << ", " << x.nd << '}'
#define pwhat_is(x) cerr << #x << " is " << cerr_pair(x) << endl;
#define pwhat_is_v(x) cerr << #x << " is "; for(auto&e: (x)) cerr << cerr_pair(e) << ' '; cerr << '\n'; //vector, set
#define pwhat_is_a(x, n) cerr << #x << " is "; for(int i=0;i<n;i++) cerr << cerr_pair(x[i]) << ' '; cerr <<  '\n'; //n first element of array
// #define int long long
// #define pow mypow

typedef pair<int,int> pii;
const int N = 1e5+5;
const int INF = 1e9+5;
const int MOD = 1e9+7;

string s;
map<string, int> m;
int32_t main()
{
	IOS
	// freopen("input.txt", "r", stdin);
	m["RRR"] = 3;
	m["RRS"] = 2;
	m["RSR"] = 1;
	m["RSS"] = 1;
	m["SRR"] = 2;
	m["SRS"] = 1;
	m["SSR"] = 1;
	m["SSS"] = 0;
	cin >> s;
	cout << m[s] << endl;
	return 0;
}


Measured memory_bytes: 3644
#include <bits/stdc++.h>
using namespace std;
const int maxn=3e5+5;
typedef long long ll;
const int mod=1e9+7;
ll n;int cnt[65];
void via(ll x){
	int p=0;
	while(x){
		if(x%2)
		cnt[p]++;
		x>>=1;p++;
	}
}
ll C(ll x){
	return x*(x-1)/2;
}
int main(){
	cin>>n;ll sum=0;
	for(int i=1;i<=n;i++){
		ll x;cin>>x;
		via(x);sum+=x;sum%=mod;
	}
	ll tmp=0;
	for(int i=0;i<=64;i++){
		tmp+=C(cnt[i])%mod*(((ll)1<<(i+1))%mod)%mod;
		tmp%=mod;
	}
	
	ll ans=((n-1)*sum%mod-tmp+mod)%mod;
	cout<<ans<<endl;
	return 0;
}


Measured memory_bytes: 384
/* 
	Author: ankrypt
*/


#include <bits/stdc++.h>

using namespace std;

#define MOD 1000000007
#define ll long long int
#define u64 unsigned long long int

ll N;

int main() {
	scanf("%lld", &N);
	ll cnt1 = 9;
	ll cnt2 = 999 - 99;
	ll cnt3 = 99999 - 9999;
	
	if(N <= 9) {
		printf("%lld\n", N);
	}
	else if(N >= 10 && N <= 99) {
		printf("9\n");
	}
	else if(N <= 999) {
		printf("%lld\n", cnt1 + (N - 99));
	}
	else if(N >= 1000 && N <= 9999) {
		printf("%lld\n", cnt1 + cnt2);
	}
	else if(N <= 99999) {
		printf("%lld\n", cnt1 + cnt2 + (N - 9999));
	}
	else if(N <= 100000) {
		printf("%lld\n", cnt1 + cnt2 + cnt3);
	}
	return 0;
}
/*
	Powered by Buggy Plugin
*/


Measured memory_bytes: 256
#include <iostream>

using namespace std;

typedef long long int ll;

const int MAX_N = 50;


int main () {
    int n;
    int D[MAX_N];
    ll ans = 0;

    cin >> n;

    for (int i = 0; i < n; i++) {
        cin >> D[i];
    }

    for (int i = 0; i < n - 1; i++) {
        for (int j = i + 1; j < n; j++) {
            ans += D[i] * D[j];
        }
    }

    cout << ans << endl;
}


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

int main()
{
	int a, b, sum = 0;
	cin >> a >> b;

	for (int i = 0; i < 2; ++i) {
		if (a > b) {
			sum += a;
			--a;
		}
		else {
			sum += b;
			--b;
		}
	}
	cout << sum << endl;

	return 0;
}

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

using namespace std;

typedef long long ll;
typedef pair<int,int> P;

int c[100][100];//0??????
int h,w;

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

void bfs(int i,int j){
    queue<P> q;
    q.push(P(i,j));
    c[i][j]=0;
    while(!q.empty()){
        int x=q.front().first,y=q.front().second;
        q.pop();
        for(int i=0;i<8;i++){
            int nx=x+dx[i],ny=y+dy[i];
            if(0<=nx&&nx<h&&0<=ny&&ny<w&&c[nx][ny]==1){
                q.push(P(nx,ny));
                c[nx][ny]=0;
            }
        }
    }
}

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

  while(true){
      cin>>w>>h;
      if(w==0&&h==0) break;
      for(int i=0;i<h;i++)for(int j=0;j<w;j++){
          cin>>c[i][j];
      }
      int res=0;
      for(int i=0;i<h;i++)for(int j=0;j<w;j++){
          if(c[i][j]==1){
              bfs(i,j);
              res++;
          }
      }
      cout<<res<<endl;
  }
}

Measured memory_bytes: 3072
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;

struct Dice {
  int face[6];
  Dice() {}
  int& operator [] (int i) { return face[i]; }
  bool operator == (const Dice& other) {
    for (int i = 0; i < 6; i++) if (face[i] != other.face[i]) return false;
    return true;
  }
  bool operator != (const Dice& other) {
    return !(*this == other);
  }
  void roll(int a, int b, int c, int d) {
    int tmp = face[a];
    face[a] = face[b];
    face[b] = face[c];
    face[c] = face[d];
    face[d] = tmp;
  }
  void roll(char c) {
    switch (c) {
      case 'N' : roll(0, 1, 5, 4); break;
      case 'S' : roll(0, 4, 5, 1); break;
      case 'E' : roll(0, 3, 5, 2); break;
      case 'W' : roll(0, 2, 5, 3); break;
      case 'R' : roll(1, 2, 4, 3); break;
      case 'L' : roll(1, 3, 4, 2); break;
    }
  }
  bool identical(Dice other) {
    for (int i = 0; i < 6; i++) {
      other.roll(i & 1 ? 'E' : 'N');
      for (int j = 0; j < 4; j++) {
        other.roll('R');
        if (*this == other) return true;
      }
    }
    return false;
  }
};

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(10);
  
  Dice D[2];
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < 6; j++) {
      cin >> D[i][j];
    }
  }
  cout << (D[0].identical(D[1]) ? "Yes" : "No") << endl;

  return 0;
}


Measured memory_bytes: 3224
using System;
using System.Text;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();

            string res = "Yes";
            
            for (var i = 0; i < s.Length; i++)
            {
                if (i % 2 == 0)
                {
                    //奇数
                    if (s[i].Equals('L')) res = "No";
                }
                else
                {
                    //偶数
                    if (s[i].Equals('R')) res = "No";
                }
            }
            
            Console.WriteLine(res);
            
            return;
            
        }
    }
}

Measured memory_bytes: 11092
A, B, C = map(int, input().split())
five = 0
seven = 0
if A == 5:
  five += 1
if A == 7:
  seven += 1

if B == 5:
  five += 1
if B == 7:
  seven += 1

if C == 5:
  five += 1
if C == 7:
  seven += 1
  
if five == 2 and seven == 1:
  print("YES")
else:
  print("NO")

Measured memory_bytes: 3064
use std::io::Read;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();

    let answer = solve(&buf);

    println!("{}", answer);
}

fn solve(input: &str) -> String {
    let mut iterator = input.split_whitespace();

    let a: usize = iterator.next().unwrap().parse().unwrap();
    let b: usize = iterator.next().unwrap().parse().unwrap();

    return if b * 2 >= a {
        "0".to_string()
    } else {
        format!("{}", a - b * 2)
    }
}


Measured memory_bytes: 4352
/*
[agc010] D - Decrementing
*/

#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, int> pli;
typedef pair<ll, ll> pll;
#define ALL(c) (c).begin(), (c).end()

const int MAX_N = 1e5;

int N;
int A[MAX_N];

int gcd(ll a, ll b) {
    while (b > 0) {
        swap(b, a %= b);
    }
    return a;
}

bool solve() {
    int cnt_od = 0, od_i = -1;
    for (int i = 0; i < N; i++) {
        if (A[i] % 2 == 1) {
            cnt_od++;
            od_i = i;
        }
    }
    if ((N - cnt_od) % 2 == 1) {
        return true;
    }
    if (cnt_od != 1 || A[od_i] == 1) {
        return false;
    }

    A[od_i]--;
    int g = A[0];
    for (int i = 1; i < N; i++) {
        g = gcd(g, A[i]);
    }
    for (int i = 0; i < N; i++) {
        A[i] /= g;
    }
    return !solve();
}

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

    cout << (solve() ? "First" : "Second") << endl;

    return 0;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
 
#define FAST ios_base::sync_with_stdio(0); cin.tie(); cout.tie();
 
#define MAXX 10005
 
#define PI 3.14159265358979323846264338327950
 
#define F first
#define S second
 
#define ll 	 long long int
 
#define mod  1000000007



int main()
{
	FAST;
	ll n;
	cin >> n;
	if(n % 4 == 0 || n % 7 == 0){
		cout << "Yes";
		return 0;
	}
	ll a = n;
	while(a > 0){
		a -= 4;
		if(a % 7 == 0){
			cout << "Yes";
			return 0;
		}
	}
	while(n > 0){
		n -= 7;
		if(a % 4 == 0){
			cout << "Yes";
			return 0;
		}
	}
	cout << "No";
	return 0;
}

Measured memory_bytes: 3608
#include <stdio.h>

int main()
{
    int n;
    int i;
    int x;
    int block=1;
    int count=0;
    scanf("%d",&n);

    int num[n];

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

    for(i=0;i<n;i++)
    {
        if(num[i]==block) block++;
        else count++;
    }

    if(block==1) 
    {
        printf("%d\n",-1); 
        return 0;
    }


    printf("%d\n",count);
    return 0;
}

Measured memory_bytes: 896
#include<iostream>
using namespace std;
int a,b,c;
int main(void){
  string s;
  cin>>s;
  for(int i(0);i<3;i++){
    if(s[i]=='a')a++;
    if(s[i]=='b')b++;
    if(s[i]=='c')c++;
  }
  if(a==1 && b==1 && c==1){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
  return 0;
}

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

#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define endl '\n'

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

const ll INF = 2e18;
const int MOD = 1e9 + 7;
const int MAXN = 5e5 + 5;

double A, B, H, M;

int main() {
	ios::sync_with_stdio(0); cin.tie(0);
	cin >> A >> B >> H >> M;
	double ang = abs((H*60+M)/(12*60)*atan(-1)*8 - (M/60)*atan(-1) * 8);
	if(A < B) swap(A, B);
	double a = (double)B * sin(ang);
	double b = (double)A - (double)B * cos(ang);
	double len = sqrt(a*a + b*b);
	printf("%.12lf", len);
}

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

// Q: What is the runtime of this
// solution?


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

    // Start from every stone
    // and use previous computed
    // to compute min.
    
    dp[0] = 0;
    for(int i = 0; i < n; i++) {
        for (int j = i + 1; j < n, j <= i + 2; j++) {
            // the min cost at jth stone
            dp[j] = min(dp[j], dp[i]+abs(height[j]-height[i])); 
        }
    }

    printf("%d", dp[n-1]);

    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define FORR(i, m, n) for (int i = m; i >= n; i--)
#define ALL(x) (x).begin(), (x).end()
const long long INF = 1e15;
const long long MOD = 1e9 + 7;
using namespace std;
typedef long long ll;

ll dp[100010];
int main() {
  ll n, m;
  cin >> n >> m;
  dp[0] = 1;
  dp[1] = 1;
  vector<bool> safe(n, true);
  REP(i, m) {
    ll a;
    cin >> a;
    safe[a] = false;
  }
  FOR(i, 2, n + 1) {
    if (safe[i - 2]) dp[i] += dp[i - 2];
    if (safe[i - 1]) dp[i] += dp[i - 1];
    dp[i] %= MOD;
  }
  cout << dp[n] << endl;
  return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < n; ++i)
#define ALL(a) a.begin(), a.end()
ll dx[4] = { 0, 1, 0, -1 };
ll dy[4] = { 1, 0, -1, 0 };
const ll INF = 1e14;
const ll MOD = 1e9 + 7;


int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    string s;
  	cin >> s;
  	if (s == "Rainy") {
      puts("Sunny");
    } else if ( s == "Sunny") {
      puts("Cloudy");
    } else {
      puts("Rainy");
    }
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
int main(){
    int x,y;
    while(1){
        scanf("%d %d",&x,&y);
        if(x==0 && y==0)break;
        if(x<y){
            printf("%d %d\n",x,y);
        }else{
            printf("%d %d\n",y,x);
        }
    }
    return 0;
}

Measured memory_bytes: 1740
//rennsyuu03.c
#include <stdio.h>

int main(void)

{
	int i,s1,s2,zen,go;
	int hito[10];
	int kei[10];
	char kurasu[10][16];
	while(1)
	{
		for(i=1;i<=9;i++)
		{
		//printf("クラス名を入力してください。");
		scanf("%s",kurasu[i]);
		//printf("午前の入場者数は?");
		scanf("%d",&s1);
		if((s1<0)||(s1>400))
		{
			break;
		}
		//printf("午後の入場者数は?");
		scanf("%d",&s2);
		if((s2<0)||(s2>400))
		{
			break;
		}
		
		hito[i]=s1+s2;
		
		zen=s1*200;
		go=s2*300;
		kei[i]=zen+go;
		}
		
		for(i=1;i<=9;i++)
		{
		printf("%s %d %d\n",kurasu[i],hito[i],kei[i]);
		//	printf("%sクラスの入場者総数は%dで収入は%dです。\n",kurasu[i],hito[i],kei[i]);
		}
		break;
	}
	return 0;
}
		

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

using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
constexpr ll TEN(int n) { return (n==0) ? 1 : 10*TEN(n-1); }
template<class T> using V = vector<T>;
template<class T> using VV = V<V<T>>;

template<class T> ostream& operator<<(ostream& os, const V<T> &v) {
    cout << "[";
    for (auto p: v) cout << p << ", ";
    cout << "]";
    return os;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << setprecision(20) << fixed;
    int n, m;
    cin >> n >> m;
    string s;
    cin >> s;
    V<int> d(n);
    for (int i = 0; i < n; i++) d[i] = s[i] - 'A';

    VV<int> g(n);
    V<array<int, 2>> c(n);
    for (int i = 0; i < m; i++) {
        int u, v;
        cin >> u >> v; u--; v--;
        g[u].push_back(v);
        g[v].push_back(u);
        c[u][d[v]]++;
        c[v][d[u]]++;
    }

    queue<int> q;
    for (int i = 0; i < n; i++) {
        if (c[i][0] == 0 || c[i][1] == 0) q.push(i);
    }

    V<bool> used(n);
    int uc = 0;
    while (q.size()) {
        int p = q.front(); q.pop();
        if (used[p]) continue;
        used[p] = true;
        uc++;
        int x = d[p];
        for (int v: g[p]) {
            c[v][x]--;
            if (c[v][x] == 0) q.push(v);
        }
    }
    cout << (uc == n ? "No" : "Yes") << endl;
    return 0;
}


Measured memory_bytes: 13008
from collections import deque, defaultdict

N = int(input())

e = defaultdict(list)
for i in range(N-1):
    a, b, c = map(int, input().split())
    e[a].append((b, c))
    e[b].append((a, c))


Q, K = map(int, input().split())

visits = [False]*(N+1)
costs = defaultdict(int)
q = deque()
q.append((K, 0))
visits[K] = True
while q:
    u, c1 = q.popleft()
    for v, c2 in e[u]:
        if not visits[v]:
            costs[(K, v)] = c1+c2
            visits[v] = True
            q.append((v, c1+c2))

for i in range(Q):
    x, y = map(int, input().split())
    print(costs[(K, x)]+costs[(K, y)])


Measured memory_bytes: 135312
//给dalao递茶.png
#include <bits/stdc++.h>

#define vector std::vector
#define string std::string
#define cin std::cin
#define cout std::cout
#define endl '\n'
#define inf 0x3f3f3f3f
#define sumover
#define maxn 100001
#define max(A, B) (A) > (B) ? (A) : (B)
#define min(A, B) (A) < (B) ? (A) : (B)
#define middle(A, B) ((A) + (B))/2
#define range(K, A, B) for(int K(A);K<(B);++K)
typedef unsigned long long ULL;
typedef long long LL;
int n, t;
long long wait[maxn];
long long jian[maxn];
long long _time[maxn];

int main() {
    memset(wait, 0, sizeof(wait));
    memset(_time, 0, sizeof(_time));
    memset(jian, 0, sizeof(jian));
    scanf("%d %d", &n, &t);
    for (int i = 0; i < n; i++) {
        scanf("%lld", &_time[i]);
        if (!i) {
            jian[i] = _time[i];
        }
        if (i) {
            wait[i] = wait[i - 1] + _time[i - 1];
            jian[i] = max(jian[i - 1], _time[i]);
        }
    }
    for (int i = 0; i < n; i++) {
        if ((t - wait[i]) <= 0)
            cout << "1" << endl;
        else {
            long long int x = ((t - wait[i]) / jian[i]) + 1;
            if ((t - wait[i]) % jian[i] >= _time[i])
                x++;
            cout << x << endl;
        }
    }
}


//给dalao递茶.png
#ifndef sumover
5 1000000000
1
1
1
1
1

3 20
5
7
3

5 1000000000
5553
2186
3472
2605
1790

180083
180083
180082
180082
180082
#endif //sumover



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

using namespace std;

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

    vector<int> v(n);
    for (int i = 0; i < n; ++i)
        cin >> v[i];

    bool flag = true;
    for (int i = n - 1; i >= 0; --i) {
        if (v[i - 1] <= v[i]) {
            continue;
        } else if (v[i - 1] - 1 == v[i]) {
            --v[i - 1];
        } else {
            flag = false;
            break;
        }
    }

    if (flag)
        cout << "Yes\n";
    else
        cout << "No\n";
}


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

int main() {
	int n, u, k, v;
	cin >> n;
	vector<vector<int>> a(n);
	for (int i = 0; i < n; ++i) {
		cin >> u >> k;
		for (int j = 0; j < k; ++j) {
			cin >> v;
			a[u - 1].push_back(v - 1);
		}
	}
	queue<int> b;
	b.push(0);
	vector<int> ans(n, -1);
	ans[0] = 0;
	while (!b.empty()) {
		for (int& i : a[b.front()]) {
			if (-1 == ans[i]) {
				ans[i] = 1 + ans[b.front()];
				b.push(i);
			}
		}
		b.pop();
	}
	for (int i = 0; i < n; ++i) cout << 1 + i << ' ' << ans[i] << endl;
}


Measured memory_bytes: 3168
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = s; i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << endl;
#define CFYN(n) cout << ( (n) ? "YES":"NO") << endl;
#define out(n) cout << (n) << endl;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;

int main(void)
{
    IOS
    int n, ch;
    cin >> n >> ch;
    vector<vector<pii>> p(ch);
    REP(i,n) {
        int s, t, c;
        cin >> s >> t >> c;
        c--;
        p[c].push_back({s,t});
    }
    REP(i,ch) sort(ALL(p[i]));
    vector<deque<pii>> p2(ch);
    priority_queue<pii,vector<pii>, greater<pii>> standby;
    priority_queue<int,vector<int>, greater<int>> record;
    REP(i,ch) {
        REP(j,p[i].size()) {
            if (j != 0 && p2[i].back().second == p[i][j].first) {
                p2[i].back().second = p[i][j].second;
            } else p2[i].push_back(p[i][j]);
        }
        if (p2[i].size() != 0) standby.push({p[i][0].first,i});
    }

    size_t ans = 0;
    while(!standby.empty()) {
        //cerr << standby.top().first << endl;
        if (record.empty() || standby.top().first <= record.top()) {
            //cerr << "s" << endl;
            pii pi = standby.top(); standby.pop();
            record.push(p2[pi.second][0].second);
            p2[pi.second].pop_front();
            if (p2[pi.second].size() != 0) standby.push({p2[pi.second][0].first,pi.second});
            //cerr << standby.top().first << endl;
        } else {
            //cerr << "r" << endl;
            record.pop();
        }
        ans = max(ans,record.size());
    }

    cout << ans << endl;

    return 0;
}

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

int main() {
  int r, D,x2k;
  cin>>r>>D>>x2k;
  for(int i = 0; i < 10; i++)
  {
    cout<<(r*x2k)-D<<endl;
    x2k = (r*x2k)-D;
  }
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()

int main() {
  string s;
  cin >> s;
  if (s[0] == 'S') {
    cout << "Cloudy" << endl;
  } else if (s[0] == 'C') {
    cout << "Rainy" << endl;
  } else {
    cout << "Sunny" << endl;
  }
}

Measured memory_bytes: 256