akhauriyash/Code-Regression huggingface dataset:
fun main(args: Array<String>) {
    val n = readLine()!!.toInt()
    val xs = readLine()!!.split(" ").map { it.toInt() }
    var min = Int.MAX_VALUE
    var count = 0
    for (i in 0 until n) {
        min = Math.min(min, xs[i])
        if (min >= xs[i]) count++
    }
    println(count)
}

Measured memory_bytes: 84844
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <climits>
#include <cassert>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <algorithm>
#include <numeric>
#include <complex>
#include <stack>
#include <queue>
#include <list>
#include <set>
#include <map>
#include <bitset>
#include <functional>
#include <iterator>

using namespace std;

#define dump(n) cout<<"# "<<#n<<'='<<(n)<<endl
#define repi(i,a,b) for(int i=int(a);i<int(b);i++)
#define peri(i,a,b) for(int i=int(b);i-->int(a);)
#define rep(i,n) repi(i,0,n)
#define per(i,n) peri(i,0,n)
#define iter(c) __typeof__((c).begin())
#define foreach(i,c) for(iter(c) i=(c).begin();i!=(c).end();++i)
#define all(c) (c).begin(),(c).end()
#define mp make_pair

typedef unsigned int uint;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<string> vs;
typedef pair<int,int> pii;

const int INFTY=1<<29;
const double EPS=1e-9;

template<typename T1,typename T2>
ostream& operator<<(ostream& os,const pair<T1,T2>& p){
	return os<<'('<<p.first<<','<<p.second<<')';
}
template<typename T>
ostream& operator<<(ostream& os,const vector<T>& a){
	os<<'[';
	rep(i,a.size()) os<<(i?" ":"")<<a[i];
	return os<<']';
}

int res;

void solve(vvi& g,int v,int len,vi& vis)
{
	vis[v]=1;
	res=max(res,++len);
	
	int n=g.size();
	rep(i,g[v].size()) if(!vis[g[v][i]])
		solve(g,g[v][i],len,vis);
	
	vis[v]=0;
}

int main()
{
	for(int n;scanf("%d",&n),n;){
		vvi g(100);
		rep(i,n){
			int s,d; scanf("%d%d",&s,&d); s--,d--;
			g[s].push_back(d);
			g[d].push_back(s);
		}
		
		res=0;
		rep(i,100){
			vi vis(100);
			solve(g,i,0,vis);
		}
		printf("%d\n",res);
	}
	
	return 0;
}

Measured memory_bytes: 1212
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define mp make_pair
#define pb push_back
#define ALL(A) A.begin(),A.end()
const long long mod=1000000007;
bool app[1000000]={};
//boolenもこの記述で0で初期化されるのね
int main(){
    int s,ans=0;
    cin>>s;
    while(app[s]!=true)
    {
        app[s]=true;
        if(s%2)
        s=3*s+1;
        else
        s/=2;
        ans++;
    }
    ans++;
    cout<<ans<<endl;
    return 0;
}

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

namespace abc126A
{
    class Program
    {
        static void Main(string[] args)
        {
            //string a = Console.ReadLine;
            int a = int.Parse(Console.ReadLine());
            //for (int i = 0; i < N; i++){}
            //int[] a = Console.ReadLine().Split().Select(int.Parse).ToArray();
            if(a == 0) { Console.WriteLine(1); }
            if (a == 1) { Console.WriteLine(0); }
        }
    }
}


Measured memory_bytes: 27508
#include <algorithm>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <tuple>
#include <vector>

using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define reps(i, f, n) for (int i = (f); i < (n); i++)
ll const INF = 1LL << 60;

int main() {
    int N, M;
    cin >> N >> M;
    
    int A[N][30];
    int K[N];

    for (int i = 0; i < N; i++) {
        cin >> K[i];
        rep(j, K[i]) cin >> A[i][j];
    }

    int cnt[M];
    for (int i = 0; i < M; i++)
        cnt[i] = 0;
    
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < K[i]; j++) {
            cnt[A[i][j]-1]++;
        }
    }

    int ans = 0;
    for (int i = 0; i < M; i++) {
        if (cnt[i] == N)
            ans++;
    }
    cout << ans << endl;

    return 0;
}

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

using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<vector<int>> vvi;
typedef vector<string> vs;
typedef unordered_set<int> si;
typedef pair<int, int> pp;
typedef vector<pp> vpp;

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
#define all(e) (e).begin(), (e).end()
#define pb push_back


template <typename T>
void printV(vector<T> A) {
    if (A.empty()) cerr << "EMTPY\n";
    else { 
        cerr << "[";
        for (int i = 0; i < A.size() -1 ; ++i) {
            cerr << A[i] << ", ";
        }
        if (A.size()) cerr << A.back() << "]\n";
    }
}


template <typename T>
void printVV(vector<vector<T>> A) {
    cerr << "[";
    for (auto v : A) {
        printV<T>(v);
    }
    cerr << "]";
}

template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
    cerr << name << ": " << arg1 << endl;
}

template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&& ...args) {
    const char* comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << ": " << arg1 << " |";
    __f(comma + 1, args...);
}

int main(int argc, char **argv) {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n; cin >> n;
    vpp arr(n);
    for (int i = 0; i < n; ++i) {
        int a, b; cin >> a >> b;
        arr[i] = {a,b};
    }
    sort(all(arr), [] (auto& p, auto& p1) {
        return p.second < p1.second;
    });

    ll time = 0;
    for (auto& p : arr) {
        if (p.first + time > p.second) {
            cout << "No\n";
            return 0;
        }
        time = p.first + time;
    }
    cout << "Yes\n";
    return 0;
}



Measured memory_bytes: 1792
m=["A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"]
N=int(input())
s=input()
ans=[]
for i in range(len(s)):
    index=m.index(s[i])
    if index+N>=26:
        ans.append(m[index+N-26])
    else:
        ans.append(m[index+N])
print(*ans, sep='')

Measured memory_bytes: 4852
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
#pragma GCC optimize(2)
#define int long long
#define MAXN 2000000
#define INF (1e13 + 7)
#define MANX MAXN

using namespace std;

inline int read()
{
	int x = 0, f = 1; char c = getchar();
	while (c > '9' || c < '0') { if (c == '-') f = -1; c = getchar(); }
	while (c >= '0' && c <= '9') { x = x * 10 + (c ^ 48); c = getchar(); }
	return f * x;
}

signed main()
{
	int x = read(), y = read();
	for (int i = 0; i <= 100; i++)
		for (int j = 0; j <= 100; j++)
			if (i + j == x && 2 * i + 4 * j == y)
			{
				cout << "Yes";
				return 0;
			}
	cout << "No";
	return 0;
}

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

#define eb emplace_back
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, a, b) for (int i = (int)(a); i >= (int)b; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)
#define rep(i, l, r) for (int i = (l); i <= (r); i++)
#define per(i, r, l) for (int i = (r); i >= (l); i--)
#define ms(x, y) memset(x, y, sizeof(x))
#define SZ(x) ((int)(x).size())

using namespace std;

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef double ld;

template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }

const int maxn = 2*(int)1e5+100;
int n, a[maxn];
map<int, int> cnt;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(10);
    cout << fixed;
#ifdef LOCAL_DEFINE
    freopen("input.txt", "r", stdin);
#endif

    cin >> n;
    i64 ans = 0;
    for1(i, n) {
        cin >> a[i];
        //cerr << i << ' ' << i-a[i] << ' ' << a[i]+i << endl;
        ans += cnt[i-a[i]];;
        ++cnt[a[i]+i];
    }
    cout << ans << '\n';


#ifdef LOCAL_DEFINE
    cerr << "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
    return 0;
}


Measured memory_bytes: 21416
import java.util.Scanner;

//What is the Number in my Mind ?
public class Main{

	char[][] t;
	int[] hit, blow;
	boolean[][] appear;
	int n, m;

	int[] temph, tempb;
	char[] s;
	
	boolean[] u;
	String ans;
	int c;
	
	void dfs(int k){
		if(c>1)return;
		if(k==n){
			boolean ok = true;
			for(int j=0;j<m;j++){
				if(temph[j]!=hit[j]||tempb[j]!=blow[j])ok = false;
			}
			if(!ok)return;
			c++;
			ans = new String(s);
			return;
		}
		for(int i=0;i<10;i++){
			if(u[i])continue;
			boolean ok = true;
			for(int j=0;j<m;j++){
				if(appear[j][i]){
					if(t[j][k]-'0'==i)temph[j]++;
					else tempb[j]++;
					if(hit[j]<temph[j]||blow[j]<tempb[j])ok = false;
				}
			}
			
			if(ok){
				u[i] = true;
				s[k] = (char)(i+'0');
				dfs(k+1);
				u[i] = false;
			}
			for(int j=0;j<m;j++){
				if(appear[j][i]){
					if(t[j][k]-'0'==i)temph[j]--;
					else tempb[j]--;
				}
			}
		}
	}
	
	void run(){
		Scanner sc = new Scanner(System.in);
		for(;;){
			n = sc.nextInt();
			m = sc.nextInt();
			if((n|m)==0)break;
			t = new char[m][n];
			hit = new int[m];
			blow = new int[m];
			appear = new boolean[m][10];
			for(int i=0;i<m;i++){
				t[i] = sc.next().toCharArray();
				for(char ch:t[i]){
					appear[i][ch-'0'] = true;
				}
				hit[i] = sc.nextInt();
				blow[i] = sc.nextInt();
			}
			temph = new int[m];
			tempb = new int[m];
			ans = "NO";
			c = 0;
			u = new boolean[10];
			s = new char[n];
			dfs(0);
			System.out.println(c>1?"NO":ans);
		}
	}
	
	public static void main(String[] args) {
		new Main().run();
	}
}

Measured memory_bytes: 12000
#include <bits/stdc++.h>
using ll = long long;
#define FOR(i, k, n) for(ll i = (k); i < (n); i++)
#define FORe(i, k, n) for(ll i = (k); i <= (n); i++)
#define FORr(i, k, n) for(ll i = (k)-1; i > (n); i--)
#define FORre(i, k, n) for(ll i = (k)-1; i >= (n); i--)
#define REP(i, n) FOR(i, 0, n)
#define REPr(i, n) FORre(i, n, 0)
#define ALL(x) (x).begin(), (x).end()
#define ALLr(x) (x).rbegin(), (x).rend()
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
using namespace std;

const int INF = 1001001001;

int main(void){
  ll n, x, m;
  cin >> n >> x >> m;
  vector<ll> a;
  map<ll, ll> mp;
  a.emplace_back(x);
  if(x == 0){
    cout << 0 << endl;
    return 0;
  }
  bool zero = false;
  ll count = 0;
  mp[x] = count++;
  while(1){
    ll b = a.back();
    ll c = b*b%m;
    a.emplace_back(c);
    if(c == 0){
      zero = true;
      break;
    }
    if(mp[c] != 0) break;
    mp[c] = count++;
  }

  if(!zero){
    ll sum = 0;
    ll k = a.size()-1;
    ll p = mp[a.back()];
    ll len = k-p;
    REP(i, len) sum += a[p+i];
    ll ans = (n-p)/len * sum;
    REP(i, (n-p)%len) ans += a[p+i];
    REP(i, p) ans += a[i];
    cout << ans << endl;
  }else{
  ll sum = 0;
  ll k = a.size()-1;
  REP(i, k) sum += a[i];
    cout << sum << endl;
  }
  return 0;
}

Measured memory_bytes: 6744
#include<bits/stdc++.h>
#define rep(i,m) for(long long i=0; i<m; i++)
#define per(i,m) for(long long i=m-1; i>=0; i--)
#define FOR(i,n,m) for(long long i=n; i<m; i++)
#define ROF(i,n,m) for(long long i=m-1; i>=n; i--)
#define SORT(v,n) do{sort(v,v+n);reverse(v,v+n);}while(0)
#define all(x) (x).begin(),(x).end()
#define EPS (1e-7)
#define INF (1e18)
#define PI (acos(-1))
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
using namespace std;
typedef long long ll;
const ll MOD = 1000000007;
typedef pair<ll, ll> LP;

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

ll POW2(ll x,ll n){
  if(n==0)return 1;
  if(n%2==0)return POW2(x*x,n/2);
  return x*POW2(x,n-1);
}

ll gcd(ll u, ll v) {
  ll r;
  while (0 != v) {
    r = u % v; u = v; v = r;
  }
  return u;
}

ll lcm(ll u, ll v) {
  return u*v/gcd(u,v);
}
 
ll KAI(ll m)
{
  if(m<0) return 0;
  if(m==0) return 1;
  return m*KAI(m-1)%MOD;
}
 
ll KAI2(ll m)
{
  if(m<0) return 0;
  if(m==0) return 1;
  return m*KAI2(m-1);
}

ll extGCD(ll a, ll b, ll &x, ll &y) {
    if (b == 0) {
        x = 1;
        y = 0;
        return a;
    }
    ll d = extGCD(b, a%b, y, x);
    y -= a / b * x;
    return d;
}
 
inline ll mod(ll a, ll m) {
    return (a % m + m) % m;
}
 
ll modinv(ll a) {
    ll x, y;
    extGCD(a, MOD, x, y);
    return mod(x, MOD);
}
 
ll COM(ll m,ll n)
{
  if(m<n) return 0;
  if(n<0) return 0;
  if(n==0) return 1;
  if(m==n) return 1;
  return KAI(m)%MOD*modinv(KAI(n)%MOD*KAI(m-n)%MOD)%MOD;
}

ll COM2(ll m,ll n)
{
  if(m<n) return 0;
  if(n<0) return 0;
  if(n==0) return 1;
  if(m==n) return 1;
  return KAI2(m)/KAI2(n)/KAI2(m-n);
}

ll DEC(ll x,ll m,ll n)
{
  return x%POW(m,n+1)/POW(m,n);
}

ll keta(ll x,ll n)
{
  if(x==0)return 0;
  return keta(x/n,n)+1;
}

ll DIV(ll x,ll n)
{
  if(x==0)return 0;
  return x/n+DIV(x/n,n);
}

ll ORD(ll x,ll n)
{
  if(x==0)return INF;
  if(x%n!=0)return 0;
  return 1+ORD(x/n,n);
}

int main()
{
  ll n,m,a[200000],b[200000],c[200000],x=0,ans=0;
  cin >> n >> m;
  rep(i,n)cin >> a[i];
  rep(i,m)cin >> b[i] >> c[i];
  vector<pair<ll,ll>>p(n+m);
  rep(i,m){
    p[i]=make_pair(c[i],b[i]);
  }
  FOR(i,m,m+n){
    p[i]=make_pair(a[i-m],1);
  }
  sort(all(p));
  per(i,m+n){
    ans+=p[i].first*p[i].second;
    x+=p[i].second;
    if(x>n){
      ans-=(x-n)*p[i].first;
      break;
    }
  }
  printf("%lld",ans);
}

Measured memory_bytes: 8064
import sys
import math
from collections import deque

sys.setrecursionlimit(1000000)
MOD = 10 ** 9 + 7
input = lambda: sys.stdin.readline().strip()
NI = lambda: int(input())
NMI = lambda: map(int, input().split())
NLI = lambda: list(NMI())
SI = lambda: input()


def make_grid(h, w, num): return [[int(num)] * w for _ in range(h)]


def main():
    a, b, c, d = NMI()
    print(max(a*c, a*d, b*c, b*d))


if __name__ == "__main__":
    main()

Measured memory_bytes: 65112
/* abc_171_a */

#include<stdio.h>

int main()
{
  char moji;
  scanf("%c",&moji);
  if((moji>='a') && (moji<='z')){
    printf("a");
  } else if((moji>='A') && (moji<='Z')){
    printf("A");
  } 
  return 0;
}


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

int main(){
	cin.tie(0);
	cin.sync_with_stdio(false);
	ll R;
	cin>>R;
	cout<<2*M_PI*R<<endl;
}


Measured memory_bytes: 3724
N, K = map(int, input().split())
*p, = map(int, input().split())
Ep = [(x + 1) / 2 for x in p]
sums = [0 for _ in range(N - K + 1)]
sums[0] = sum(Ep[:K])
for i in range(N-K):
  sums[i+1] = sums[i]+Ep[i+K]-Ep[i]
print(max(sums))

Measured memory_bytes: 82056
#include<iostream>
using namespace std;
int main()
{
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  if(a + b > c + d)
    cout <<"Left";
  else if(a + b < c + d)
    cout <<"Right";
  else cout <<"Balanced";
  return 0;
}

Measured memory_bytes: 256
// author:  Harsh Nema
#include <bits/stdc++.h>
#define ll long long int
#define F first
#define S second
const ll mod = 1e9 + 7;
const ll INF = 10000000000000;
#define pb push_back
#define deb(x) cout << '>' << #x << ':' << x << endl;
#define fastio ios_base::sync_with_stdio(0); cin.tie(0);
using namespace std;
void solve(){
    ll n=0;
    string s;
    cin>>n>>s;
    ll r=0,g=0,b=0;
    for(ll i=0;i<n;++i){
        if(s[i]=='R') ++r;
        else if(s[i]=='G') ++g;
        else if(s[i]=='B') ++b;
    }
    ll ans=r*g*b;
    for(ll i=0;i<n-1;++i){
        for(ll j=i+1;j<n;++j){
            if(s[i]!=s[j]){
                ll ind=2*j-i;
                if(ind<n and s[i]!=s[ind] and s[j]!=s[ind]) --ans;
            }
        }
    }
    cout<<ans;
}
int main()
{
    fastio;
//    ll t=0;
//    cin>>t;
//    while(t--)
        solve();
    return 0;
}


Measured memory_bytes: 3660
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cerrno>
#include <clocale>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <limits>
#include <list>
#include <map>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <utility>
#include <vector>
#include <cwchar>
#include <cwctype>
using namespace std;
#define IO ios::sync_with_stdio(false), cin.tie(0), cout.tie(0)
const int inf = 0x3f3f3f3f;
typedef long long ll;
const int maxn = 3500;
const ll mod = 1e9 + 7;
char s[maxn],t[maxn];
int dp[maxn][maxn];
int main() {
    IO;
    cin>>s+1;
    cin>>t+1;
    int len=strlen(s+1),len1=strlen(t+1);
    for(int i=len;i>=1;i--) {
        for(int j=len1;j>=1;j--) {
            if(s[i]==t[j]) {
                dp[i][j]=dp[i+1][j+1]+1;
            }
            else {
                dp[i][j]=max(dp[i][j+1],dp[i+1][j]);
            }
        }
    }
    int l=1,r=1;
    while(l<=len&&r<=len1) {
        if(s[l]==t[r]) {
            cout<<s[l];
            l++,r++;
        }
        else if(dp[l][r]==dp[l+1][r]) {
            l++;
        }
        else r++;
    }
    puts("");
    
    return 0;
}


Measured memory_bytes: 44628
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip> 
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <functional>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <bitset>

using namespace std;

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

	long long n, m, i, j, k, ans, a, b, c, minn, maxx;
	cin >> n >> m;
	ans = n * m;
	if (n % 3 == 0) ans = 0;
	else ans = min(ans, m);
	if (m % 3 == 0) ans = 0;
	else ans = min(ans, n);
	for (i = 1; i < n; i++) {
		a = i * m;
		b = (n - i) * (m / 2);
		c = n * m - a - b;

		minn = min(a, min(b, c));
		maxx = max(a, max(b, c));
		ans = min(ans, maxx - minn);
	}
	for (i = 1; i < m; i++) {
		a = i * n;
		b = (m - i) * (n / 2);
		c = n * m - a - b;

		minn = min(a, min(b, c));
		maxx = max(a, max(b, c));
		ans = min(ans, maxx - minn);
	}
	cout << ans << "\n";


	return 0;
}


Measured memory_bytes: 256
//#include <bits/stdc++.h>
#include<iostream>
#include<stdio.h>
#include<bitset>
#include<algorithm>
#include<vector>
#include<list>
#include<queue>
#include<stack>
#include<string>
#include<string.h>
#include<cmath>
#include<utility>
#include<functional>
#include<map>
#include<set>


#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 LFOR(i, a, b) for( long long int i=(a);i<=(b);i++)
#define LRFOR(i, a, b) for(long long int i=(a);i>=(b);i--)
#define MOD 1000000007
#define INF 1000000000 //2000000000
#define LLINF 1000000000000000000 //9000000000000000000
#define PI 3.14159265358979

using namespace std;
typedef long long int ll;
typedef pair< long long int, long long  int> P;



int main(void) {
	
	while (1) {
		int t, n;
		int p, q;
		int dp[121][121] = {};//dp[60][60]=(0,0) not,bari,yes (x,y)
		int deep[121][121] = {};
		int count = 0;
		pair< int, int> now;
		queue< pair<int, int> > que;

		cin >> t >> n;
		if (t == 0) {
			break;
		}
		FOR(i, 1, n) {
			cin >> p >> q;
			dp[p + 60][q + 60] = 1;
		}
		cin >> p >> q;
		que.push(make_pair(p + 60, q + 60));
		dp[p + 60][q + 60] = 2;
		deep[p + 60][q + 60] = 0;

		while (!que.empty()) {
			now = que.front();
			que.pop();

			if (deep[now.first][now.second] >= t) {
				continue;
			}

			FOR(i, -1, 1) {
				FOR(j, -1, 1) {
					if ((i == 1 && j == -1)|| (i == 0 && j == 0) || (i == -1 && j == 1)) {
						continue;
					}

					if (dp[now.first + i][now.second+j] == 0) {
						if (deep[now.first + i][now.second+j] == 0) {
							dp[now.first + i][now.second + j] = 2;
							deep[now.first + i][now.second + j] = deep[now.first][now.second] + 1;
							que.push(make_pair(now.first + i, now.second + j));
						}
					}
				}
			}
			
		}
		FOR(i, 0, 120) {
			FOR(j, 0, 120) {
				if (dp[i][j] == 2) {
					count++;
				}
			}
		}
		cout << count << endl;
	}

	return 0;
}


Measured memory_bytes: 3280
//
// Created by sark2 on 19-10-2019.
//

#include "bits/stdc++.h"

#define pb push_back
using namespace std;
#define IOS cin.sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define cases int t;cin>>t;while(t--)
typedef long double ld;
typedef long long ll;
const int mod = 1e9 + 7;
const int nax = 3005;

int dp[nax][nax];
int n;

void add_self(int& a, int b);

int sub_mod(int a, int b){
    int ret = a-b;
    if(ret < 0)
        ret += mod;
    return ret;
}

int main() {
    IOS

    cin>>n;
    string s;
    cin>>s;

    dp[1][1] = 1;
    for(int l = 2; l <= n; l++){
        vector<int>pre(l+1);

        for(int i = 1; i <= l-1; ++i){
            pre[i] = (pre[i-1] + dp[l-1][i])%mod;
        }

        for(int b = 1; b <= l; b++){
            int L, R;
            if(s[l-2] == '<'){
                L = 1, R = b-1;
            }else{
                L = b, R = l-1;
            }

            if(L <= R){
                add_self(dp[l][b], sub_mod(pre[R], pre[L-1]));
            }








          /*  for(int a = 1; a <= l-1; ++a){
                int va = a;
                if(va >= b)
                    va++;
                assert(va != b);
                if((va < b) != (s[l - 2] == '<'))
                    continue;
                add_self(dp[l][b], dp[l-1][a]);

            }*/
        }
    }

    int ans = 0;
    for(int b = 1; b <= n; b++)
        add_self(ans, dp[n][b]);

    cout<<ans;



}

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


Measured memory_bytes: 34176
import sys
import math
import itertools
import collections
import heapq
import re
import numpy as np

rr = lambda: sys.stdin.readline().rstrip()
rs = lambda: sys.stdin.buffer.readline().split()
ri = lambda: int(sys.stdin.readline())
rm = lambda: map(int, sys.stdin.buffer.readline().split())
rl = lambda: list(map(int, sys.stdin.readline().split()))

n, k = rm()
li = rl()
li.sort()
li = li[:k]
print(sum(li))

Measured memory_bytes: 27248
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define FOR(i,a,b) for(int i=(a); i<(b); i++)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<int, pii> piii;

int main(){
    int n,q; cin >> n >> q;
    vector<pair<int, pii>> w;
    rep(i,n) {
        int s,t,x; cin >> s >> t >> x;
        s -= x; t -= x;
        w.push_back(piii(x, pii(s, t)));
    }
    sort(ALL(w));

    set<pii> se;
    rep(i,q) {
        int d; cin >> d;
        se.insert(pii(d,i));
    }

    vector<int> ans(q, -1);
    rep(i,n){
        int l = w[i].second.first;
        int r = w[i].second.second;
        int p = w[i].first;
        auto it = se.lower_bound(pii(l,-1));
        while(it != se.end()){
            if((it -> first) >= r) break;
            ans[it -> second] = p;
            se.erase(it++);
        }
    }
    
    rep(i,q) cout << ans[i] << endl;
}

Measured memory_bytes: 14320
/*
Wai u read my code xD
*/
#include <bits/stdc++.h>
#include <iomanip>
#define ll long long
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define vi vector <ll> 
#define qu queue <ll>
#define min_3(a,b,c) min(a,min(b,c))
#define max_3(a,b,c) max(a,max(b,c))
#define nout(ans) cout << (ans) << "\n"
#define sout(ans) cout << (ans) << " "
using namespace std;

bool compare(const pair<int, int>&i, const pair<int, int>&j)
{
    return i.second < j.second;
}


void solve()
{
    int n; cin >> n;
    int p[n]; for (int i = 0; i < n; i++) cin >> p[i];
    int q[n]; for (int i = 0; i < n; i++) cin >> q[i];
    int pn = -1, qn = -1;
    int a[n]; int cnt = 0;
    for (int i = 1; i<=n; i++) a[i-1] = i;
    do{
        cnt++;
        bool pnb = true;
        for (int i = 0; i < n; i++)
        {
            if (a[i]!=p[i])
            {
                pnb = false; break;
            }
        }
        if (pnb) pn = cnt;
        
        bool qnb = true;
        for (int i = 0; i < n; i++)
        {
            if (a[i]!=q[i])
            {
                qnb = false; break;
            }
        }
        if (qnb) qn = cnt;
        if (pn!=-1 && qn!=-1) break;
    } while (next_permutation(a,a+n));
    nout(abs(pn-qn));
}

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

Measured memory_bytes: 256
//q5.cpp
//Sat Aug  8 09:48:45 2020

#include <iostream>
#include <string>
#include <queue>
#include <map>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <math.h>
#include <set>
#define INTINF 2147483647
#define LLINF 9223372036854775807
#define MOD 1000000007
#define rep(i,n) for (int i=0;i<(n);++i)

using namespace std;
using ll=long long;
typedef pair<int,int> P;

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

	int ans = INTINF;
	rep(i,max(x,y)*2+1){
		int cost = 2*c*i;
		if (x-i>0){
			cost += (x-i)*a;
		}
		if (y-i>0){
			cost += (y-i)*b;
		}
		ans = min(ans,cost);
	}

	cout << ans << endl;

//	printf("%.4f\n",ans);
}

Measured memory_bytes: 3584
from collections import deque

h,w=map(int,input().split())
l=[list(input()) for i in range(h)]
visited=[[float('inf')]*w for i in range(h)]
def bfs():
  que =deque()
  visited[0][0]=0
  que.append([0,0])
  while que:
    p=que.popleft()
    if p[1]==w-1 and p[0]==h-1:
      break
    for dx,dy in ([0,1],[0,-1],[1,0],[-1,0]):
      ny=p[1]+dy
      nx=p[0]+dx
      if nx>=0 and ny>=0 and nx<h and ny<w and visited[nx][ny]==float('inf') and l[nx][ny]!='#':
        visited[nx][ny]=visited[p[0]][p[1]]+1
        que.append([nx,ny])

  return visited[h-1][w-1]


suml=0
for i in range(h):
  suml+=l[i].count('#')
  
if bfs()==float('inf'):
  print(-1)
else:
  print(h*w-suml-bfs()-1)

Measured memory_bytes: 3316
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <numeric>
#include <cmath>

using namespace std;

typedef long long int ll;

#define all(x) x.begin(),x.end()

const ll mod = 1e9+7;
const ll INF = 1e9;
const ll MAXN = 1e9;

int main()
{
	int n;
	cin >> n;
	int left = 0,right=n;
	string l_n,r_n;
	cout << 0 << endl;
	cin >> l_n;
	if(l_n=="Vacant") return 0;
	for(int i = 1; i <20; i++){
		int mid = (left+right)/2;
		cout << mid << endl;
		string s;
		cin >> s;
		if(s=="Vacant") return 0;
		int res = mid-left+1;
		// if(right==0) res = n-left + 1;
		// cout << left << " " << right << " " <<res << endl;
		if((res)%2==0){
			if(s == l_n){
				right = mid;
				r_n = s;
			}else{
				left = mid;
				r_n = l_n;
				l_n = s;
			}
		}else{
			if(s == l_n){
				left = mid;
				r_n = l_n;
				l_n = s;
			}else{
				right = mid;
				r_n = s;
			}
		}
	}

	return 0;
}

Measured memory_bytes: 852
#include<iostream>
using namespace std;
int main(){
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    int left=a+b;
    int right=c+d;
    if(left>right)
    {
        cout<<"Left\n";
    }
    else
    if(left<right){
        cout<<"Right\n";
    }
    else
    {
        cout<<"Balanced\n";
    }
}

Measured memory_bytes: 3628
#include<iostream>
#include<cstdio>
#include<string>
#include<vector>
#include<list>
#include<algorithm>
#include<set>
#include<map>
#include<stack>
#include<queue>

using namespace std;

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

#define PRINT(str) printf(#str "\n")
#define yOUT PRINT(Yes)
#define nOUT PRINT(No)
#define YOUT PRINT(YES)
#define NOUT PRINT(NO)
 
#define pb(a) push_back(a)
#define all(x) (x).begin(),(x).end()

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


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int n;
char a[101],b[101];
int main()
{
	cin>>n;
	for(int i=0;i<n;++i)
	cin>>a[i];
	for(int i=0;i<n;++i)
	cin>>b[i];
	for(int i=0;i<n;++i)
	{
	    cout<<a[i];
	    cout<<b[i];
	}
	return 0;
}

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

#define rep(i, n) for(int i = 0; i < (n); ++i)
typedef long long ll;

using namespace std;

int main()
{
  int n;
  cin >> n;
  vector<int> d(100, 0);
  int x;
  rep(i, n)
  {
    cin >> x;
    d[x-1] = 1;
  }
  int ans = accumulate(d.begin(), d.end(), 0);
  cout << ans << endl;

  return 0;
}


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

const long long tentonine = pow(10,9);

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

	long long curPow{1};
	for(int i{1}; i<=N; i++){
		curPow = i * curPow % (tentonine+7);
	}
	
	cout << curPow << "\n";

	




}


Measured memory_bytes: 256
# B - Sum of Three Integers
def main():
    k, s = map(int, input().split())
    cnt = 0

    for i in range(k+1):
        for j in range(k+1):
            z = s-i-j
            if 0 <= z <= k:
                cnt += 1
    else:
        print(cnt)



if __name__ ==  "__main__":
    main()

Measured memory_bytes: 8992
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pll pair<ll,ll>
#define pq priority_queue
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define lb(c,x) distance(c.begin(),lower_bound(all(c),x))
#define ub(c,x) distance(c.begin(),upper_bound(all(c),x))

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

const ll INF=1e18;
const ll mod=1e9+7;

int main(){
    string s;
    cin >> s;
    ll ans=0;
    rep(i,6){
        if(s[i]=='1') ans++;
    }
    cout << ans << endl;
    return 0;
}


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

using namespace std;

int main()


{
    int n,cnt=0,i;
    cin>>n;
    int a[n+1];
    for(i=1;i<n+1;i++) cin>>a[i];
    int min=a[1];
    for(i=1;i<n+1;i++)
    {
        if(a[i]<=min) 
        {
            min=a[i];
            cnt++;
        }
    }
    cout<<cnt<<endl;




}

Measured memory_bytes: 1024
#include<stdio.h>

long long int compare(const void *a,const void *b){
	long long int *pa=(long long int*)a;
	long long int *pb=(long long int*)b;
	long long int num1=*pa;
	long long int num2=*pb;
	return num1-num2;
}
int main(){
	int a,b,i;
	scanf("%d %d",&a,&b);
	long long int guai[a];
	for(i=0;i<a;i++){
	scanf("%lld",&guai[i]);		
	}
	qsort(guai,a,sizeof(long long int),compare);
	long long int result=0;
	for(i=0;i<a-b;i++){
		result+=guai[i]; 
	}
	printf("%lld",result);
	return 0;
}

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

constexpr int kMod = 1'000'000'000 + 7;

int fpow(int a, int n) {
    int res = 1;
    while (n > 0) {
        if (n & 1) res = 1LL * res * a % kMod;
        a = 1LL * a * a % kMod;
        n >>= 1;
    }
    return res;
}

int main() {
    int b, w; scanf("%d%d", &b, &w);
    vector<int> fc(b + w + 1, 1), iv(b + w + 1, 1);
    for (int i = 1; i <= b + w; ++i) {
        fc[i] = 1LL * fc[i - 1] * i % kMod;
        iv[i] = fpow(fc[i], kMod - 2);
    }
    const int kHalf = fpow(2, kMod - 2);
    bool sw = false;
    if (b > w) {
        swap(b, w);
        sw = true;
    }

    auto Choose = [&](int n, int k) {
        if (n < k || k < 0) return 0LL;
        return 1LL * fc[n] * iv[k] % kMod * iv[n - k] % kMod;
    };

    vector<int> ans(b + w + 1), pw(b + w + 1, 1);
    for (int i = 1; i <= b + w; ++i) pw[i] = 1LL * pw[i - 1] * kHalf % kMod;
    for (int i = 1; i <= b; ++i) ans[i] = kHalf;
    vector<int> dp1(b + w + 1), dp2(b + w + 1);
    for (int i = b + 1; i <= w; ++i) {
        dp1[i] = (dp1[i - 1] + 1LL * Choose(i - 2, b - 1) * pw[i - 1] % kMod) % kMod;
        ans[i] = 1LL * kHalf * (kMod + 1 - dp1[i]) % kMod;
    }
    for (int i = w + 1; i <= b + w; ++i) {
        dp1[i] = (dp1[i - 1] + 1LL * Choose(i - 2, b - 1) * pw[i - 1] % kMod) % kMod;
        dp2[i] = (dp2[i - 1] + 1LL * Choose(i - 2, w - 1) * pw[i - 1] % kMod) % kMod;
        ans[i] = (1LL * kHalf * (kMod + 1 - dp1[i] + kMod - dp2[i]) % kMod + dp2[i]) % kMod;
    }
    for (int i = 1; i <= b + w; ++i) {
        if (sw) printf("%d\n", (kMod + 1 - ans[i]) % kMod);
        else printf("%d\n", ans[i]);
    }
    return 0;
}


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

int main() {
	int n,sum=0,sim=0;
	cin>>n;
	vector<int>vec(n);
	for(int i=0;i<n;i++){
		int a;
		cin>>a;
		vec.at(i)=a;
	}
	
	for(int i=0;i<n;i++){
		if(vec.at(i)%2==1){
			sum++;
		}
		else if(vec.at(i)%4==0){
			sim++;
		}
	}
	if(sum+sim!=n||n%2==0){
	    if(sum<=sim){
		cout<<"Yes"<<endl;
	    }
	    else{
		cout<<"No"<<endl;
	    }
	}
	else{
		if(sum<=sim+1){
			cout<<"Yes"<<endl;
		}
		else{
			cout<<"No"<<endl;
		}
	}
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define LL long long
#define db double
using namespace std;
 
const int MAXN = 200200;
const int MAXE = 400400;
const int INF = 0x3f3f3f3f;
 
template<typename T> inline void CheckMax(T &A, T B) {
	A < B ? A = B : A;
}
 
template<typename T> inline void CheckMin(T &A, T B) {
	A > B ? A = B : A;
}
 
template <typename T> inline void read(T &x) {
    int c = getchar();
    bool f = false;
    for (x = 0; !isdigit(c); c = getchar()) {
        if (c == '-') {
            f = true;
        }
    }
    for (; isdigit(c); c = getchar()) {
        x = x * 10 + c - '0';
    }
    if (f) {
        x = -x;
    }
}
 
LL n;
long long k;
typedef pair<int, int> pii;
typedef pair<pii, int> ppi;
#define X first
#define Y second
 
LL num[100], len[100], add[100], ans;
 
int Find(LL x) {
	for(int i = 50; i >= 0; i--) {
		if(x >= len[i]) return i;
	}
	return -1;
}
 
signed main() {
	read(n), read(k);
	num[0] = len[0] = 1;
	for(int i = 1; i <= 50; i++) num[i] = num[i - 1] * 2 + 1;
	for(int i = 1; i <= 50; i++) len[i] = len[i - 1] * 2 + 3;
	if(k == len[n]) {
		cout << num[n] << endl;
		return 0;
	}
	long long l = 1, m = n - 1;
	while(l < k) {
		if(l == k) break;
		for(LL i = m; i >= 0; i--) {
			if(k >= len[i] + l) {
				ans += num[i];
				l += len[i];
				m = i;
				break;
			}
			l++;
			if(l == k) break;
		}
		if(l == k) break;
		ans++, l++;
		if(l == k) break;
	}
	cout << ans << endl;
	return 0;
}

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

using namespace std;

typedef unsigned long long ull;
typedef long long ll;

int main()
{
    ios_base::sync_with_stdio(false);cin.tie(NULL);
    int n;cin>>n;
    ull arr[n+1];
    arr[0]=2;
    arr[1]=1;
    for (int i=2;i<=n;i++){
        arr[i]=arr[i-1]+arr[i-2];
    }cout<<arr[n];
    return 0;
}


Measured memory_bytes: 256
def inpf() a=gets.chomp.split(" ").map(&:to_f)end

def inps() a=gets.chomp.split(" ")end

def copy(a) Marshal.load(Marshal.dump(a)) end

def kaijo(n,r = 10**9+7)(n < 2)? 1 : (2..n).inject{|memo,u|memo=(memo*u)%r} end

def na(n,d=0) Array.new(n,d)end

def na2(n,m,d=0) Array.new(n){Array.new(m,d)}end

def na3(n,m,l,d=0) Array.new(n){Array.new(m){Array.new(l,d)}}end

def inp() a=gets.chomp.split(" ").map(&:to_i)end

def r_up(a, b) (a+b-1)/b end

def r_sort(a) a.sort{|a,b|b<=>a} end

p inp.sort[0,2].inject(:+)

Measured memory_bytes: 1788
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
#define ALL(A) A.begin(), A.end()

using namespace std;

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

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	ll N, M; cin >> N >> M;
	vector<ll> A(N+1,0LL);
	for (int i = 1; i <= (int)N; ++i){
		cin >> A[i];
	} // end for
	for (int i = 1; i <= (int)N; ++i){
		A[i] += A[i-1];
	} //  end for

	map<int,int> cnt; cnt.clear();
	for (int i = 0; i <= (int)N; ++i){
		++cnt[(int)(A[i] % M)];
	} // end for

	ll res = 0LL;
	map<int,int>::iterator it = cnt.begin();
	for (; it != cnt.end(); ++it){
		int c = (*it).second;
		res += (ll)c * ((ll)c - 1LL) / 2LL;
	} // end for

	cout << res << endl;
	
	return 0;
}

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

int main(void)
{
    ll h, w;
    cin >> h >> w;
    ll area = h * w;
    if (h == 1 || w == 1) cout << 1 << endl;
    else if (area % 2 == 0) cout << area / 2 << endl;
    else cout << area / 2 + 1 << endl;
}


Measured memory_bytes: 256
n = gets.to_i
list = []
n.times do |i|
  s, p = gets.split
  list[i] = { index: (i + 1), name: s, score: p.to_i }
end

list.sort_by! { |l| [l[:name], -(l[:score])] }
list.each do |l|
  puts l[:index]
end


Measured memory_bytes: 1788
#pragma GCC optimize("O3")
#include<bits/stdc++.h>
#define rc(x) return cout<<x<<endl,0
#define pb push_back
#define in insert
#define er erase
#define fr first
#define sc second
typedef long long ll;
const long long llinf=LLONG_MAX;
const int inf=INT_MAX;
const int nmax=1e5+5;
const int mod=1e9+7;
using namespace std;
int n,m,k,i,j;
int main() 
{
	//freopen("sol.in","r",stdin);
	//freopen("sol.out","w",stdout);
	ios_base::sync_with_stdio(false);cin.tie(0);cerr.tie(0);cout.tie(0);
	cin>>n>>m>>k;
	if(k%n==0 || k%m==0)rc("Yes");
	for(i=1;i<=m;i++)for(j=1;j<=n;j++)if(i*n+j*m-2*i*j==k)rc("Yes");
	rc("No");
}  

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

int main() {
  int H, W, A, B;
  cin >> H >> W >> A >> B;
  for (int i = 1; i <= H; i++){
    for (int j = 1; j <= W; j++){
      if (j <= A && i <= B) cout << 1;
      if (j > A && i <= B) cout << 0;
      if (j <= A && i > B) cout << 0;
      if (j > A && i > B) cout << 1;
    }
    cout << endl;
  }
}

Measured memory_bytes: 3612
#include<stdio.h>
#include<math.h>
int sosuuhannbetu(int);

int main(){
    int Ntw,Atw,a,i,count=0;
    scanf("%d",&Ntw);
    for(i=0;i<Ntw;i++){
        scanf("%d",&Atw);
        a=sosuuhannbetu(Atw);
        if(a==1)count++;
    }
    printf("%d\n",count);
    return 0;
}

int sosuuhannbetu(int x){
    if(x==2)return 1;
    if(x<2||x%2==0)return 0;
    int i=3;
    while(i<=sqrt(x)){
        if(x%i==0)return 0;
        i=i+2;
    }
    return 1;
}


Measured memory_bytes: 2144
#include<bits/stdc++.h>
using namespace std;
int a, b, c, d;

int main(){
	cin >> a >> b >> c >> d;	
	while(a>0 && b >0){
		c = c - b;
		if(c<=0){
			break;
		}
		a = a - d;
	}
	
	if(a>c){
		cout << "Yes" << endl;
	}else{
		cout << "No" << endl;	
	}


	return 0;
}

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

int main() {
    int N,result=0;
    cin >> N;

    int a[N+1];

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

    for (int i=1; i<=N ;i++) {
        if ((a[i] % 2 == 1) && (i % 2 == 1)){
            result++;
        }
    }


    cout << result << endl;

    return 0;
}


Measured memory_bytes: 3616
#include <bits/stdc++.h>
#define int long long int
using namespace std;
template<typename T,typename U> using P=pair<T,U>;
template<typename T> using V=vector<T>;
template<typename T>bool chmax(T&a,T b){if(a<b){a=b;return true;}return false;}
template<typename T>bool chmin(T&a,T b){if(a>b){a=b;return true;}return false;}

template<typename T>auto&operator<<(ostream&s,const vector<T>&v){s<<"[";bool a=1;for(auto e:v){s<<(a?"":" ")<<e;a=0;}s<<"]";return s;}
template<typename T,typename U>auto&operator<<(ostream&s,const pair<T,U>&p){s<<"("<<p.first<<","<<p.second<<")";return s;}
template<typename T>auto&operator<<(ostream&s,const set<T>&st){s<<"{";bool a=1;for(auto e:st){s<<(a?"":" ")<<e;a=0;}s<<"}";return s;}
template<typename T,typename U>auto&operator<<(ostream&s,const map<T,U>&m){s<<"{";bool a=1;for(auto e:m){s<<(a?"":" ")<<e.first<<":"<<e.second;a=0;}s<<"}";return s;}
#define DUMP(x)  cerr<<#x<<" = "<<(x)<<endl;

struct edge { int to, cost; };

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

signed main()
{
   int n; cin >> n;
   map<int,int> cnt;
   for (int i = 0; i < n; i++) {
      int a; cin >> a;
      cnt[a]++;
   }

   V<V<V<double>>> dp(n+1, V<V<double>>(n+1, V<double>(n+1)));
   for (int c = 0; c <= n; c++) {
      for (int b = 0; b <= n; b++) {
         for (int a = 0; a <= n; a++) {
            if (a == 0 && b == 0 && c == 0) continue;
            if (a + b + c > n) continue;
            dp[a][b][c] = (
               (a == 0 ? 0. : dp[a-1][b][c]) * a +
               (b == 0 ? 0. : dp[a+1][b-1][c]) * b +
               (c == 0 ? 0. : dp[a][b+1][c-1]) * c + n) / (a + b + c);
         }
      }
   }
   printf("%.9lf\n", dp[cnt[1]][cnt[2]][cnt[3]]);

   return 0;
}


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

int main() {
    long long s=0;
    cin >> s;

    int x=(1000000000-(s%1000000000))%1000000000;
    int y=(s+x)/1000000000;

    cout << "0 0 1000000000 1 " << x << " " << y << endl;
}

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


int main(){
    string s;
    cin >> s;
    
    sort(s.begin(),s.end());
    if(s.at(0) == s.at(1) && s.at(2) == s.at(3) && s.at(0) != s.at(2)){
        cout << "Yes" << endl;
    }
    else{
        cout << "No" << endl;
    }
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
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; }

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int h, w;
	cin >> h >> w;
	vector<vector<char>> c(h+2, vector<char>(w+2, '.'));
	for(int i = 1; i <= h; i++){
		for(int j = 1; j <= w; j++){
			cin >> c[i][j];
		}
	}
	for(int i = 1; i <= h; i++){
		for(int j = 1; j <= w; j++){
			if(c[i][j] == '#'){
				bool ok = false;
				if(c[i+1][j] == '#') ok = true;
				if(c[i-1][j] == '#') ok = true;
				if(c[i][j+1] == '#') ok = true;
				if(c[i][j-1] == '#') ok = true;
				if(!ok){
					cout << "No" << endl;
					return 0;
				}
			}
		}
	}
	cout << "Yes" << endl;
	return 0;
}


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

using namespace std;

#define rep(i,n) for(int i=0;i<(n);i++)
#define repa(i,a,n) for(int i=(a);i<(n);i++)
#define rrep(i,n) for(int i=n;i>=0;i--)
#define rrepa(i,a,n) for(int i=n;i>=(a);i--)
#define all(a) (a).begin(),(a).end()
#define MOD 1000000007
#define cmax(a,b) a=max(a,b)
#define cmin(a,b) a=min(a,b)
#define vc vector

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<int,int> pi;

int main(){

    int n;
    cin>>n;

    vvi num(10,vi(10,0));

    int x10=1,b,e;
    repa(i,1,n+1){
        b=i/x10;
        e=i%10;
        num[b][e]++;
        if(i+1==10*x10)x10*=10;
    }

    ll ans=0;

    repa(i,1,10){
        repa(j,1,10){
            if(num[i][j])cerr<<i<<","<<j<<" "<<num[i][j]<<"\n";
            ans+=num[i][j]*num[j][i];
        }
    }

    cout<<ans<<"\n";

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define for1(n) for(i=1; i<=(n); i++)
#define N 10000
bool isPrime[N];

vector<ll> prime;

void seive()
{
    ll i,j,t=1,val;
    memset(isPrime,true,sizeof(isPrime));
    isPrime[0]=isPrime[1]=false;
    for(i=4;i<=N;i+=2) isPrime[i]=false;
    for(i=3;i*i<=N;i+=2)
        if(isPrime[i])
            for(j=i*i;j<=N;j+=2*i )
                isPrime[j]=false;
    for(i=2;i<=N;i++)
        if(isPrime[i])
            prime.push_back(i);
}

ll primefactorization(ll n)
{
    ll c=1,i,j,cc;
    for(i=0;prime[i]*prime[i]<=n;i++)
    {
        if(n%prime[i]==0)
        {
            cc=1;
            while(n%prime[i]==0)
            {
                n/=prime[i];cc++;
            }
            c*=cc;
        }
    }
    if(n>1) c*=2;
    return c;
}

int main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    ll _,i,j,n,a,b,e,k,u,t,x=1,m,y,q,f=1,c=0,d=0,l,p,z,o,r,g;
    string ss,s;
    seive();
    cin>>n;
    for1(n-1)
    {
        x=n-i;
        p=primefactorization(x);
        c+=p;
    }
    cout<<c<<endl;
}



Measured memory_bytes: 3712
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Security.Cryptography.X509Certificates;
using System.Text.RegularExpressions;
using Console = System.Console;

namespace Atcoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var l = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            if (l[0] + l[1] + l[2] >= 22)
            {
                Console.WriteLine("bust");
            }
            else
            {
                Console.WriteLine("win");
            }
        }
    }
}

Measured memory_bytes: 13268
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int> pi;
#define f first
#define s second
#define FAST ios_base::sync_with_stdio(0); cin.tie(0);
#define all(x) x.begin(),x.end()
typedef pair<int,pi> pp;
#define p(x,y,z) pp(x,pi(y,z))
const int maxn = 55;
const int maxv = 2500;

struct edge {
	int v, cost, t;
};

int dp[maxn][maxv];
int n,m,silver;
bool visited[maxn];
int co = 0;

pi shop[maxn];

vector <edge> adjlist[maxn];

int32_t main() {
	FAST
	cin >> n >> m >> silver;
	silver = min(silver, maxv-1);
	for (int i =0;i<m;i++) {
		int a,b,cost,t; cin >> a >> b >> cost >> t;
		adjlist[a].push_back({b,cost,t});
		adjlist[b].push_back({a,cost,t});
	}
	
	for (int i =1;i<=n;i++) {
		cin >> shop[i].f >> shop[i].s;
	}
	
	memset(dp,-1,sizeof dp);
	priority_queue <pp,vector<pp>,greater<pp>> pq;
	pq.push(p(0,1,silver));
	dp[1][silver] = 0;
	
	while (!pq.empty()) {
		pp cur = pq.top(); pq.pop();
		int curt = cur.f, x = cur.s.f, s = cur.s.s;
		if (curt > dp[x][s]) continue;
		if (!visited[x]) {
			visited[x] = 1;
			co++;
		}
		if (co == n) break;
		//cout << x << " " << s << " " << curt << "\n";
		
		int newsilver = min(s + shop[x].f,maxv-5);
		int newt = curt + shop[x].s;
		if (dp[x][newsilver] == -1 or dp[x][newsilver] > newt) {
			dp[x][newsilver] = newt;
			pq.push(p(newt,x,newsilver));
		}
		
		for (auto curr: adjlist[x]) {
			int ss = s - curr.cost;
			if (ss < 0) continue;
			int tt = curt + curr.t, v = curr.v;
			
			if (dp[v][ss] == -1 or dp[v][ss] > tt) {
				dp[v][ss] = tt;
				pq.push(p(tt,v,ss));
			}
			
		}
	}
	
	//cout << "ENDED\n";
	
	for (int i =2;i<=n;i++) {
		int ans = LLONG_MAX/2;
		for (int j =0; j < maxv; j++) {
			if (dp[i][j] == -1) continue;
			ans = min(ans,dp[i][j]);
		}
		cout << ans << "\n";
	}
	
}




Measured memory_bytes: 7428