akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using static kyoupuro.Input;
using static kyoupuro.MyMath;

namespace kyoupuro {

    class MainClass {

        public static void Main() {
            var S = Line();

            Console.WriteLine(S.Where((_, n) => n % 2 == 0).ToArray());
        }
    }

    class MyMath {
        static long Gcd(long a, long b) {
            return b == 0 ? a : Gcd(b, a % b);
        }
    }

    class Input {
        static IEnumerator<string> enumerator = new string[] { }.AsEnumerable().GetEnumerator();

        public static string Line() {
            return Console.ReadLine();
        }

        public static int NextInt() {
            while (!enumerator.MoveNext()) {
                enumerator = StrArr().AsEnumerable().GetEnumerator();
            }
            return int.Parse(enumerator.Current);
        }

        public static long NextLong() {
            while (!enumerator.MoveNext()) {
                enumerator = StrArr().AsEnumerable().GetEnumerator();
            }
            return long.Parse(enumerator.Current);
        }

        public static string[] StrArr() {
            return Line().Split(' ');
        }

        public static List<int> IntList() {
            return StrArr().Select(int.Parse).ToList();
        }

        public static List<long> LongList() {
            return StrArr().Select(long.Parse).ToList();
        }

        public static void Skip(int line = 1) {
            enumerator.Reset();
            for (int i = 0; i < line; i++) Console.ReadLine();
        }

        public static void Reset() {
            enumerator.Reset();
        }
    }
}

Measured memory_bytes: 13792
#include<bits/stdc++.h>
using namespace std;
int sum[12834];
int main()
{
int a,b;
cin>>a>>b;
sum[1]=300000;
sum[2]=200000;
sum[3]=100000;
if(a>=4&&b>=4)
cout<<0;
else if(a==1&&b==1)
cout<<1000000;
else
cout<<sum[a]+sum[b];
}


Measured memory_bytes: 256
N, M = map(int, input().split())
H_lis = list(map(int, input().split()))

del_set = set([])
for i in range(M):
    l, r = map(int, input().split())
    l -= 1
    r -= 1
    if H_lis[l] > H_lis[r]:
        del_set.add(r)
    elif H_lis[l] < H_lis[r]:
        del_set.add(l)
    else:
        del_set.add(r)
        del_set.add(l)

print(N - len(del_set))

Measured memory_bytes: 19940
#include <iostream>
#include <stdio.h>
#include <string.h>
#include <map>
//#include <bits/stdc++.h>
using namespace std;
/*inline int read(){
    int s=0,w=1;
    char ch=getchar();
    while(ch<'0'||ch>'9'){if(ch=='-')w=-1;ch=getchar();}
    while(ch>='0'&&ch<='9') s=s*10+ch-'0',ch=getchar();
    return s*w;
}*/
typedef long long ll;
const int inf=0x3f3f3f3f;
map<ll,ll>mp;
ll a[200000+5];
ll p[40];
int main()
{
    int n,ans=0,f;
    while(cin>>n)
    {
        ans=0;
        for(int i=1;i<=n;i++)
        {
            cin>>a[i];
            f=1;
            for(int j=i;j>=1;j--)
                if(a[j]>a[i])
                {
                    f=0;
                    break;
                }
            if(f==1)
                ans++;
        }
       cout<<ans<<endl;
    }

    return 0;
}

Measured memory_bytes: 256
def calc(n, m):
    if n == 1:
        if m == 1:
            return 1
        if m == 2:
            return 0
        if m >= 3:
            return m - 2
    elif n == 2:
        return 0
    else:
        if m == 1:
            return n - 2
        elif m == 2:
            return 0
        else:
            return (n - 2) * (m - 2)


def main():
    N, M = list(map(int, input().split()))
    print(calc(N, M))


if __name__ == '__main__':
    main()


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

int main(void) {
	int H, W, num = 0;
	cin >> H >> W;
	vector<string> a(H);
	for (int i = 0; i < H; i++) cin >> a[i];

	for (int i = 0; i < H + 2; i++) {
		string s;
		if (i == 0 || i == H + 1) {
			for (int j = 0; j < W + 2; j++) {
				s = s + '#';
			}
		}
		else {
			s = '#' + a[i - 1] + '#';
		}
		cout << s << endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<n;++i)
#include<string>
#include<vector>
using namespace std;
typedef long long 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; }
//max=({});
//条件式が真ならwhileの中身を回し続ける
//printf("%d\n", ans);

//pairの入力
//vector<pair<ll, ll>>work(n);
//rep(i, n) {
//	ll a, b;
//	cin >> a >> b;
//	work[i] = make_pair(a, b);
//for(auto p:mp)(mapの探索)
//printf("%.10f\n",なんちゃら)

int g[15][15];
const int INF = 1001001001;
const int dx[4] = { -1,0,1,0 };
const int dy[4] = { 0,-1,0,1 };

//最大公約数
ll gcd(ll x, ll y) {
	return y ? gcd(y, x % y) : x;
}

ll lcm(ll x, ll y) {
	if (x == 0 || y == 0)return 0;
	return (x / gcd(x, y) * y);
}

//素因数分解
vector<pair<ll, int>>factorize(ll n) {
	vector<pair<ll, int>>res;
	for (ll i = 2;i * i <= n;++i) {
		if (n % i)continue;
		res.emplace_back(i, 0);
		while (n % i == 0) {
			n /= i;
			res.back().second++;
		}
	}
	if (n != 1)res.emplace_back(n, 1);
	return res;
}

int bingo[3][3];
bool flag[3][3];
int cnt[2][105];
int h, w;
int choco[1010][1010];
int s[11][11];

int main() {
	ll n, m;
	ll INF = 1e9 + 7;
	ll ans = 0;
	cin >> n >> m;
	if (n > m + 1 || m > n + 1)cout << 0 << endl;
	else {
		ll res1 = 1, res2 = 1;
		if (n == m) {
			while (n > 0) {
				res1 *= n;
				res1 %= INF;
				n--;
			}
			ans = res1 * res1 % INF;
			ans = ans * 2 % INF;
		}
		else {
			while (n > 0) {
				res1 *= n;
				res1 %= INF;
				n--;
			}
			while (m > 0) {
				res2 *= m;
				res2 %= INF;
				m--;
			}
			ans = res1 * res2 % INF;
		}
		cout << ans << endl;
	}
	return 0;
}


Measured memory_bytes: 256
import sys

n = int(input())
links = [set() for _ in [0] * n]
for line in sys.stdin:
    u, v, w = map(int, line.split())
    u -= 1
    v -= 1
    links[u].add((v, w))
    links[v].add((u, w))
ans = [-1] * n
q = [(0, 0, -1)]
while q:
    v, d, p = q.pop()
    if d % 2 == 0:
        ans[v] = 0
    else:
        ans[v] = 1
    for u, w in links[v]:
        if u == p:
            continue
        q.append((u, d + w, v))
print('\n'.join(map(str, ans)))


Measured memory_bytes: 57088
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define ff first
#define ss second
#define pb push_back
#define ios                           \
    std::ios::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
#define fill(x, v) memset(x, v, sizeof(x))
const ll mod = 1000000007;
const double pi = 3.14159265359; // PI
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
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...);
}
/*
std::cout << std::setprecision(9) << f << '\n';//3.141590000;
map<char,int>::reverse_iterator rit;
for(rit = mp.rbegin(); rit!=mp.rend(); rit++)
*/
int power(int x, unsigned int y, int p)
{
    int res = 1;

    x = x % p;

    while (y > 0)
    {
        if (y & 1)
            res = (res * x) % p;

        y = y >> 1;
        x = (x * x) % p;
    }
    return res;
}
// string parser
vector<int> parse(string s)
{
    stringstream ss(s);
    int x;
    vector<int> v;
    while (ss >> x)
    {
        v.pb(x);
    }
    return v;
}
//-----------------------------

int main()
{
    ios;
    ll x;
    cin >> x;
    ll i = 1;
    ll y = 100;
    if (y >= x)
    {
        cout << 0 << endl;
        return 0;
    }
    for (i = 1;; i++)
    {
        y = (y + y / 100);
        if (y >= x)
            break;
    }
    cout << i << endl;
}


Measured memory_bytes: 3652
#include <iostream>
#include <math.h>
#include <string>
#include <string.h> 
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <cassert>
using namespace std;
#define MAX 200000
#define rep(i, n) for(int i = 0;i < n;i++)
#define OUT(n) printf("%d\n",n);
#define IN2(n,k) scanf("%d%d",&n,&k);

int main(){
    int n,m,a[50]={},b,c;
    IN2(n,m);
    rep(i,m){
        IN2(b,c);
        a[b-1]++,a[c-1]++;
    }
    rep(i,n){
        OUT(a[i]);
    }
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#define fo(i,a,b) for(int i=a;i<=b;i++)
#define fd(i,a,b) for(int i=a;i>=b;i--)
int n,p[310000],l,r,lv,rv;
int main(){
	scanf("%d",&n);
	fo(i,1,n) scanf("%d",&p[i]);
	for(l=1;l<=n;l++)
		if (p[l]!=l){
			r=l;
			while (r<=n){
//				if (p[r+1]!=r+1){
//					printf("No\n");
//					return 1;
//				}
				if (r+1>n||p[r+1]!=r+1) break;	//if (p[r+1]!=r+1) break;
				if (r+2>n||p[r+2]==r+2) break;//if (p[r+2]==r+2) break;
				r+=2;
			}
			fo(i,l,r) if (p[i]<l||p[i]>r){
				printf("No\n");
				return 0;
			}
			lv=0;
			rv=0;
			fo(i,l,r){
				if (p[i]<i){
					if (p[i]<lv){
						printf("No\n");
						return 0;						
					}
					lv=p[i];
				}
				if (p[i]>i){
					if (p[i]<rv){
						printf("No\n");
						return 0;							
					}
					rv=p[i];
				}
			}
			l=r;//l=r+2;
		}
	printf("Yes\n");
	return 0;
} 

Measured memory_bytes: 1408
/* 

*/
// #pragma GCC optimize("Ofast")
// #pragma GCC target("avx,avx2,fma")
#include <iostream>
#include <iomanip>
#include <sstream>
#include <fstream>
#include <string>
#include <cstring>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <queue>
#include <stack>
#include <deque>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <utility>
#include <bitset>
 
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
 
#define LSOne(S) (S & (-S))
#define EPS 1e-9
 
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
typedef pair<int, int> pi;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<double, double> pd;
typedef tree<pi, null_type, less<pi>, rb_tree_tag, tree_order_statistics_node_update> ordered_multiset;

const int MAXN = 2e5+5;
int h[MAXN], a[MAXN];
ll segtree[4*MAXN];
int n;

void Update(int curr, int left, int right, int idx, ll val)
{
    if(left == right)
    {
        segtree[curr] = max(segtree[curr], val);
        return;
    }
    int mid = left + (right-left) / 2;
    if(idx <= mid) Update(curr*2, left, mid, idx, val);
    else Update(curr*2+1, mid+1, right, idx, val);
    segtree[curr] = max(segtree[curr*2], segtree[curr*2+1]);
}

ll Query(int curr, int left, int right, int qleft, int qright)
{
    if(qleft > right || qright < left) return 0;
    if(left >= qleft && right <= qright) return segtree[curr];
    int mid = left + (right-left) / 2;
    ll ansLeft = Query(curr*2, left, mid, qleft, qright);
    ll ansRight = Query(curr*2+1, mid+1, right, qleft, qright);
    return max(ansLeft, ansRight);
}

int main()
{
    std::ios::sync_with_stdio(false);
    cin.tie(0); // BEFORE SUBMIT DON'T FORGET TO UNCOMMENT THIS
    cin >> n;
    for(int i = 0; i < n; ++i)
    {
        cin >> h[i];
    }
    for(int i = 0; i < n; ++i)
    {
        cin >> a[i];
    }

    ll ans = 0;
    for(int i = 0; i < n; ++i)
    {
        ll prev = Query(1, 0, n-1, 1, h[i]-1);
        ans = max(ans, prev+a[i]);
        Update(1, 0, n-1, h[i], prev+a[i]);
    }
    cout << ans << "\n";
    return 0; 
}

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

int main() {
    int n, k;
    string s;
    cin >> n >> s >> k;

    for (int i = 0; i < n; i++) {
        if (s[i] != s[k-1]) s[i] = '*';
    }
    cout << s << endl;

}

Measured memory_bytes: 3584
#include <stdio.h>

int main() {
  int a, b, k, i;
  
  scanf("%d%d%d", &a, &b, &k);
  
  for(i=1; i <= k; i++) {
    if(i % 2) {
      if(a % 2 != 0) a--;
      b += a / 2;
      a /= 2;
    }
    else {
      if(b % 2 != 0) b--;
      a += b / 2;
      b /= 2;
    }
  }
  
  printf("%d %d\n", a, b);
  return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<vector>
#include<queue>
#include<stack>
#include<string>
#include<cmath>
#include<algorithm>
#include<bitset>
#include<map>
#include<unordered_map>
#include<functional>
#include<set>
#include<numeric>

#pragma region
using namespace std;
#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); i++)
#define rep(i,n) FOR(i,0LL,n)
#define RFOR(i,r,n) for(ll i=(ll)(n-1);i>=r;i--)
#define rrep(i,n) RFOR(i,0LL,n)
#define all(x) x.begin(),x.end()
#define rall(x) x.rbegin(),x.rend()
#define COUNT(a,y,x) upper_bound(all(a), y) - lower_bound(all(a), x)
#define UNIQUE(a) sort(all(a)); a.erase(unique(all(a)), a.end())
#define SUM(a) accumulate(all(a),0LL)
#define pb push_back
#define endl '\n'
typedef long long int ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef pair<ll, ll> pll;
typedef vector<pll> vpll;
typedef vector<string> vs;
typedef map<ll, ll> MAP;
const ll inf = 2222222222222222222LL;
const ll mod = 1000000007LL;

ll n = 0, m = 0, ans = 0, cnt = 0, tmp = 0, ma = -inf, mi = inf;
string s;
bool ok = true, flag = false;
ll dx[9] = { 0,1,-1,0,0,1,1,-1,-1 }, dy[9] = { 0,0,0,1,-1,1,-1,1,-1 };
#pragma endregion
#define MAX 222222

void dfs(ll cur, ll used) {
  if (cur > n) return;
  else if (used == 7) ans++;
  dfs(cur * 10 + 3, used | 1);
  dfs(cur * 10 + 5, used | 2);
  dfs(cur * 10 + 7, used | 4);
}


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


  cin >> n;
  dfs(0, 0);
  cout << ans << endl;



  return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1e9+7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i = (m); i <= (n); i++)
#define zep(i,m,n) for(ll i = (m); i < (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define printa(x,m,n) for(int i = (m); i <= n; i++){cout << (x[i]) << " ";} cout<<endl;

struct ModInt {
    long long v;
    //static long long MOD;
    
    ModInt (long long v=0) : v((v % MOD + MOD) % MOD) {}

    ModInt& operator += (const ModInt a) {v += a.v; v %= MOD; return *this;}
    ModInt& operator *= (const ModInt a) {v *= a.v; v %= MOD; return *this;}

    ModInt operator + (const ModInt a) const {return ModInt(*this) += a;}
    ModInt operator * (const ModInt a) const {return ModInt(*this) *= a;}

    //ostream
};

ll n;
ModInt dp[1000008][3], lazy[1000008];

int main(){
    cin.tie(0); ios::sync_with_stdio(false);
    
    cin >> n;
    dp[0][0] = 1;

    ModInt comp = 0;
    rep(i, 1, n){
        lazy[i] += lazy[i-1];
        dp[i][0] += lazy[i];
        dp[i][0] += dp[i-1][0];
        dp[i][1] += lazy[i];
        dp[i][1] += dp[i-1][0];
        dp[i][2] += dp[i-1][1]*ModInt(n-1);
        dp[i][2] += dp[i-1][2];

        if(i+2 <= n){
            lazy[i+2] += dp[i-1][1];
        }

        if(i < n){
            comp += dp[i-1][1]*ModInt(i);
        }
        else{
            comp += dp[i-1][1]*ModInt(i-1);
        }
    }

    print((dp[n][0]+dp[n][1]*ModInt(n-1)+dp[n][2]*ModInt(n-1)+comp).v)
    return 0;
}

Measured memory_bytes: 31616
N,M=map(int,input().split())
H=list(map(int,input().split()))
l=[]

for i in range(M):
    l.append(list(map(int,input().split())))
    
ll=[0]*N

for j in l:
    if H[j[0]-1]-H[j[1]-1]>0:
        ll[j[1]-1]+=1
    elif H[j[0]-1]-H[j[1]-1]<0:    
        ll[j[0]-1]+=1
    else:
        ll[j[0]-1]+=1
        ll[j[1]-1]+=1
ans=0
for x in ll:
    if x==0:
        ans+=1

print(ans)

Measured memory_bytes: 32020
#include <stdio.h>
int main()
{
	int a[200000], c,x, n, m = 0;
		scanf("%d", &n);
	while (m<n)
	{
		scanf("%d", &a[m]);
			m++;
		}
	if (m % 2 == 1)
	{
		for (c = m-1; c >= 0; c -= 2)
		{
			printf("%d ", a[c]);
		}
		for (c = 1; c < m-2; c += 2)
		{
			printf("%d ", a[c]);
		}
		if(m!=1)
		printf("%d\n", a[c]);
	}
	else
	{
		for (c = m-1; c >= 1; c -= 2)
		{
			printf("%d ", a[c]);
		}
		for (c = 0; c < m-2; c += 2)
		{
			printf("%d ", a[c]);
		}
		printf("%d\n", a[c]);
	}
	return 0;
}

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

const int INF = 1 << 25;

int main()
{
	double max_ = -1, min_ = INF;
	double r;
	while(cin >> r){
		max_ = max(max_,r);
		min_ = min(min_,r);
	}
	
	cout << max_ - min_ << endl;
}

Measured memory_bytes: 1280
#include "bits/stdc++.h"
#pragma GCC optimize "03"
using namespace std;

#define int long long int
#define pb push_back
#define pii pair<int,int>
#define fi first
#define se second
#define rep(i,a,b) for (int i = a; i < b; ++i)
#define dbg(x) { cerr<<"> "<<#x<<": "<<x<< endl; }
#define dbg2(x,y) { cerr<<"> "<<#x<<": "<<x<<" , "<<#y<<": "<<y<<endl; }
#define dbg3(x,y,z) { cerr<<"> "<<#x<<": "<<x<<" , "<<#y<<": "<<y<<" , "<<#z<<": "<<z<<endl; }
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#ifndef LOCAL
#define endl '\n'
#endif
const int inf = INT_MAX;
const double eps = 0.0000001;
const double PI = acos(-1.0);
const int MOD = 1e9+7;
const int N  = 1e5+5;

int a[105], dp[105][N], prefix[105][N];

signed main(){
    #ifdef LOCAL
        freopen("input.txt", "r", stdin);
        //freopen("output.txt", "w", stdout);
    #endif  
    IOS;

    int n, k;
    cin >> n >> k;
    for (int i = 1; i <= n; i++)
    	cin >> a[i];
    dp[0][0] = 1;
	for (int i = 0; i <= k; i++)
	{
		prefix[0][i] = 1;
	}
	for (int i = 1; i <= n; i++) {
		for (int j = 0; j <= k; j++) {
			dp[i][j] = (prefix[i-1][j] - (j-a[i]-1 >=0 ? prefix[i-1][j-a[i]-1] : 0) + MOD)%MOD;
			prefix[i][j] = (dp[i][j] + (j ? prefix[i][j-1] : 0)) % MOD;
		}
	}
	cout << dp[n][k];
    return 0;
}

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

int main(){
    string a,b,c;
    cin >> a >> b >> c;
    if(a[a.length()-1]==b[0]&&b[b.length()-1]==c[0]){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <cmath>
#include <iostream>
#include <iomanip>
#define REP(i, a, b) for (auto i = (a); i < (b); ++i)
using namespace std;

using ll = long long;

const double pi = acos(-1);

signed main() {
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);

	double a, b, x, h; cin >> a >> b >> x;
	h = x / (a * a);
	double tant;
	if (2 * x < a * a * b)
		tant = 2 * x / (a * b * b);
	else tant = (a * a * a) / (2 * (a * a * b - x));
	double t = 90.0 - atan(tant) * 180 / pi;
	cout << setprecision(10) << fixed << t;
}

Measured memory_bytes: 512
package main

import (
	"bufio"
	"fmt"
	"math"
	"strconv"
	"strings"
)

func main() {

	var S string
	var w int
	fmt.Scan(&S)
	fmt.Scan(&w)

	r := ""

	rs := []rune(S)
	for i := 0; i < len(rs); i++ {
		if rs[i] == 0 {
			break
		}

		if i%w == 0 {
			r = fmt.Sprintf("%s%c", r, rs[i])
		}
	}

	fmt.Printf("%s\n", r)
}

func ScanIntN(r *bufio.Reader, ints []int) {

	line, e := r.ReadString('\n')
	strs := strings.Split(line, " ")
	for i, str := range strs {
		trimed := strings.TrimSpace(str)
		ints[i], e = strconv.Atoi(trimed)
		if e != nil {
			panic(e)
		}
	}
}

func min(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton min() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Min(float64(res), float64(nums[i])))
	}
	return res
}

func max(nums ...int) int {
	if len(nums) == 0 {
		panic("funciton max() requires at least one argument.")
	}
	res := nums[0]
	for i := 0; i < len(nums); i++ {
		res = int(math.Max(float64(res), float64(nums[i])))
	}
	return res
}

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


Measured memory_bytes: 1152
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int D=0,T=0,S=0;
  cin >> D >> T >> S;
  
  if(D>T*S){
    cout << "No" << endl;
  }
  else{
    cout << "Yes" << endl;
  }

}

Measured memory_bytes: 3592
// Author: Mohammad Faisal
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n; 
    cin >> n;
    int * table = new int[n+1];

    for(int i=0;i<n+1;i++)
        table[i] = i;

    for(int i=0;i<n+1;i++)
    {
        int j=6;
        while(i-j >= 0)
        {
            table[i] = table[i-j] + 1;
            j*=6;
        }
         j=9;
        while(i-j >= 0)
        {
            table[i] = min(table[i],table[i-j]+1);
            j*=9;
        }
    }
    cout<< table[n]<<endl;
    return 0;
}

Measured memory_bytes: 640
package main

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

func main() {
	scanInit()

	n := nextInt()
	h := make([]int, n)

	for i := 0; i < n; i++ {
		h[i] = nextInt()
	}
	cnt := 1
	maxh := h[0]
	for i := 1; i < n; i++ {
		if h[i] < maxh {
			continue
		}
		cnt++
		maxh = h[i]
	}

	fmt.Println(cnt)

}

// ---- readfunc
var sc = bufio.NewScanner(os.Stdin)

func scanInit() {
	const cap = 200 * 1024 // default=64*1024
	var buf = make([]byte, cap)
	sc.Buffer(buf, cap)
	sc.Split(bufio.ScanWords)
	return
}
func nextInt() int {
	sc.Scan()
	i, _ := strconv.Atoi(sc.Text())
	return i
}
func nextStr() string {
	sc.Scan()
	return sc.Text()
}


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

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

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

  while(n>1000){
    n -= 1000;
  }
  cout << 1000-n;
}

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

#define int long long

// ???????????£??????????????????
struct warshall_floyd {
    int d[1000][1000];
    int V;
    warshall_floyd(int V) : V(V) {
        for(int i=0; i<V; ++i) {
            for(int j=0; j<V; ++j) {
                if(i==j) d[i][j] = 0;
                else d[i][j] = 1e+18;
            }
        }
    }
    void add_edge(int s, int t, int c) {
        d[s][t] = c;
    }
    void run() {
        for(int k=0; k<V; ++k) {
            for(int i=0; i<V; ++i) {
                for(int j=0; j<V; ++j) {
                    if(d[i][k]==1e+18||d[k][j]==1e+18) continue;
                    d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
                }
            }
        }
    }
    bool has_negative_cycle() {
        for(int i=0; i<V; ++i) {
            if(d[i][i]<0) return true;
        }
        return false;
    }
};

signed main() {
    int V, E;
    cin >> V >> E;
    warshall_floyd wf(V);
    for(int i=0; i<E; ++i) {
        int s, t, c;
        cin >> s >> t >> c;
        wf.add_edge(s, t, c);
    }
    wf.run();
    if(wf.has_negative_cycle()) {
        cout << "NEGATIVE CYCLE" << endl;
        return 0;
    }
    for(int i=0; i<V; ++i) {
        for(int j=0; j<V; ++j) {
            if(j!=0) cout << " ";
            if(wf.d[i][j] == 1e+18) cout << "INF";
            else cout << wf.d[i][j];
        }
        cout << endl;
    }
    return 0;
}

Measured memory_bytes: 3576
#include <iostream>
#include <string>
#include <vector>

int main(){
    std::string s;
    std::cin >> s;
    std::vector<char> a;
    for(int i = 0; i < s.size(); i++){
        if(s[i] == '1' || s[i] == '0'){
            a.push_back(s[i]);
        }
        else if(!(a.empty())){
            a.pop_back();
        }
    }
    for(int i = 0; i < a.size(); i++){
        std::cout << a[i];
    }
    return 0;
}




Measured memory_bytes: 256
N, K = map(int, input().split())
import itertools
A=[]
B=[]
i=0
m=0
for _ in range(2*K):
    a = [int(x) for x in input().split()]
    if i%2!=0:
        A.append(a)
    i=i+1
#A = list(map(list, set(map(tuple, A))))
B=(list(itertools.chain.from_iterable(A)))
print(N-len(set(B)))


Measured memory_bytes: 9232
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
using namespace std;

ll MOD = 1000000007;

class Combination {
    //a^p%mod
    ll powmod(ll a, ll p) {
        ll ans = 1LL;
        ll mul = a;
        // p >>=1 <-> p=(p >> 1)
        for (; p > 0; p >>= 1, mul = (mul * mul) % mod) {
            if ((p & 1) == 1) ans = (ans * mul) % mod;
        }

        return ans;
    }
public:
    int N;
    ll mod;
    vector<ll> fact;
    vector<ll> revFact;

    Combination(int n, ll m) : N(n), mod(m), fact(n+1), revFact(n+1) {
        fact[0] = 1;
        for (int i = 1; i <= N; i++) {
            fact[i] = fact[i-1] * i;
            fact[i] %= mod;
        }

        // Fermat's little theorem
        revFact[N] = powmod(fact[N], mod - 2);

        for (int i = N-1; i >= 0; i--) {
            revFact[i] = revFact[i+1] * (i+1);
            revFact[i] %= mod;
        }
    }

    ll get(int a, int b) {
        if (a < 0 || b < 0) return 0;
        if (b > a) return 0;
        return (((fact[a] * revFact[b]) % mod) * revFact[a-b]) % mod;
    }
};
//==========================================================
int main(){
  ll N, K;
  cin >> N >> K;

  Combination cm = Combination(10000, MOD);

  for(int i = 1; i <= K; i++){
    ll ans;
    //青の作り方
    ll bl = cm.get(K - 1, i - 1);
    //赤の作り方
    ll b = N - K - i + 1;
    ll re;
    if(b < 0){
      re = 0;
    } else{
      re = cm.get(b + i, b);
    }

    //cout << bl << " " <<  re << endl;
    cout << (bl * re) % MOD << endl;
  }

  return 0;

}


Measured memory_bytes: 384
def dfs(s):
    a = []
    if int(s) > N:
        return []

    if all (s.count(c) > 0 for c in '753'):
        a.append(int(s))

    for i in '753':
        p = dfs(s+i)
        for j in p:
            a.append(j)

    return a


N = int(input())

print(len(dfs('0')))

Measured memory_bytes: 4316
package main

import (
	"fmt"
	"strings"
)

func main() {
	var sx, sy, tx, ty int
	var ans string
	fmt.Scan(&sx, &sy, &tx, &ty)
	dx := tx - sx
	dy := ty - sy
	// 1回目
	ans += strings.Repeat("R", dx)
	ans += strings.Repeat("U", dy)
	ans += strings.Repeat("L", dx)
	ans += strings.Repeat("D", dy)
	// 2回目
	ans += "D" + strings.Repeat("R", dx+1) + strings.Repeat("U", dy+1) + "L"
	ans += "U" + strings.Repeat("L", dx+1) + strings.Repeat("D", dy+1) + "R"
	fmt.Println(ans)
}


Measured memory_bytes: 768
#include <iostream>

using namespace std;

int main()
{
    int c;
    int cnt = 0;
    while (cin >> c)
    {
        if ((1 <= c) && (c <= 10000))
        {
            if (++cnt <= 10000)
            {
                cout << "Case " << cnt << ": " << c << endl;
            }
            else
            {
                return (0);
            }
        }
        else if (c == 0)
        {
            return (0);
        }
    }
}

Measured memory_bytes: 2984
#include<stdio.h>
#include<string.h>
int main()
{
	char a[200005];
	scanf("%s", a);
	long long int n = strlen(a);
	long long int i;
	long long int ans = 1;
	ans += n * (n - 1) / 2;
	long long int c[30];
	for (i = 0; i < 30; i++)
		c[i] = 0;
	for (i = 0; i < n; i++)
		c[a[i] - 'a']++;
	for (i = 0; i < 30; i++)
		ans -= c[i] * (c[i] - 1) / 2;
	printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 384
#include<iostream>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<utility>
#include<algorithm>
#include<cstdio>
#include<iomanip>
#include<queue>
#include<stack>

#define ll int64_t
#define Rep(i, n) for (ll i = 0; i < n; i++)

using namespace std;

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

    ll N, C;
    cin >> N >> C;
    vector<vector<pair<ll, ll>>> video(30);
    Rep (i, N) {
        ll s, t, c;
        cin >> s >> t >> c;
        c--;
        video[c].push_back(make_pair(s, t));
    }

    vector<ll> time(1e5+10, 0);
    Rep (i, 30) {
        sort(video[i].begin(), video[i].end());
        set<ll> start, finish;
        for (auto e : video[i]) {
            if (finish.count(e.first)) {
                finish.erase(e.first);
            } else {
                start.insert(e.first);
            }
            finish.insert(e.second);
        }
        for (auto e : start) {
            time[e-1]++;
        }
        for (auto e : finish) {
            time[e]--;
        }
    }

    Rep (i, 1e5+9) {
        time[i+1] += time[i];
    }

    ll ans = 0;
    Rep (i, 1e5+10) {
        ans = max(ans, time[i]);
    }

    cout << ans << endl;
}

Measured memory_bytes: 3584
package main

import "fmt"

func main(){
	var N int;
	
	fmt.Scan(&N);
	A := make([]int64, N+1);
	B := make([]int64, N);

	var kill, amari int64

	for i := 0 ; i < N+1 ; i++ {
		fmt.Scan(&A[i]);
	}
	for i := 0 ; i < N ; i++ {
		fmt.Scan(&B[i]);
	}

	for i := 0 ; i < N ; i++{
		if A[i] < B[i] {
			amari = B[i]-A[i];
			kill += A[i];
		}else {
			kill += B[i]
			amari = 0;
		}
		if A[i+1] < amari {
			kill += A[i+1]
			A[i+1] = 0;
		}else{
			kill += amari
			A[i+1] -= amari;
		}
		amari = 0;
	//	fmt.Println("a=",kill);
	}
	fmt.Println(kill);
}

Measured memory_bytes: 5504
n, m = map(int, input().split())
way_list = [ [] for _ in range(n)]
ans = [0] * n

for _ in range(m):
    a, b = map(int, input().split())
    way_list[a-1].append(b-1)
    way_list[b-1].append(a-1)

marked = {0}
que = [0]
for q in que:
    for i in way_list[q]:
        if i in marked:
            continue
        que.append(i)
        marked.add(i)
        ans[i] = q+1
        
if ans.count(0) > 1:
    print("No")
else:
    print("Yes")
    for i in ans[1:]:
        print(i)

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

int main() {
    string s;
    getline(cin,s);
    int len = s.length();
    bool find_C = false;
    int CC = 0;
    bool find_F = false;
    int FF = 0;
    for(int i = 0; i < len; i++) {
        if(s[i] == 'C') {
            find_C = true;
            CC = i;
        }
        if(s[i] == 'F') {
            find_F = true;
            FF = i;
        }
    }
    if(find_C == true && find_F == true && CC < FF) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
    return 0;
}


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

YES = "yes"  # type: str
NO = "no"  # type: str


def solve(S: str):
    s = set()
    for i in S:
        if i in s:
            print(NO)
            return
        s.add(i)
    print(YES)
    return


# Generated by 1.1.7.1 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()
    S = next(tokens)  # type: str
    solve(S)

if __name__ == '__main__':
    main()


Measured memory_bytes: 61912
n = int(input())
a = list(map(int,input().split()))

#6,10の倍数になれば良い

count = 0
ok_count = 0
for i in range(len(a)):
    if a[i]%2  == 0:
        count += 1
        if a[i]%3 == 0 or a[i]%5 == 0 or a[i]%3 == 0 and a[i]%5 == 0:
            ok_count += 1
if count == ok_count:
    print('APPROVED')
else:
    print('DENIED')

Measured memory_bytes: 3064
#include <iostream>
#include <cstdio>
#include <cmath>
using namespace std;
const int MAXN = 2e5+5;
int a[MAXN];
int n ,k;

bool Find(int x) {
    int cnt = 0;
    for(int i = 1; i <= n; i++) {
        cnt += (a[i]-1)/x;
    }
    return cnt <= k;
}


int main() {
    int l = 1, r = 0;
    scanf("%d%d", &n, &k);
    for(int i = 1; i <= n; i++) {
        scanf("%d", &a[i]);
        r = max(r,a[i]);
    }
    while(l <= r) {
        int mid = (l+r)/2;
        if(Find(mid))
            r = mid - 1;
        else
            l = mid + 1;
    }
    printf("%d\n", l);
    return 0;
}



Measured memory_bytes: 4572
#include <iostream>
#include <string>
#include <cstdlib>
#include <climits>
#include <cmath>
#include <vector>
#include <algorithm>
#include <utility>

#include <cstring>

using namespace std;

#define FOR(var,start,end) for(int var=start; var<end; var++)
#define REP(var,cnt) FOR(var,0,cnt)

bool DP[2][17000];

int main(void) {
	
	string S;
	cin >> S;
	
	int X, Y;
	cin >> X >> Y;
	
	
	vector<int> list[2]; //tate, yoko
	int isYoko = 1;
	int accum = 0;
	
	for( char& c : S ) {
		if ( c == 'F' ) {
			accum ++;
		} else {
			list[ isYoko ].push_back( accum );
			accum = 0;
			isYoko = (isYoko+1)%2;
		}
	}
	list[ isYoko ].push_back( accum );
	
	const int SAB = 8500;
	
	DP[0][0 + SAB] = true;
	DP[1][0 + SAB] = true;
	
	REP(bb, 2) {
		
		for (int ppos=0; ppos < list[bb].size(); ppos++) {
		//for ( int x : list[bb] ) {
		
			int x = list[bb][ppos];
			
			bool temp[17000];
			REP(i,17000) { temp[i] = false; }
			
			REP(i, 17000) {
				if ( DP[bb][i] == true ) {
				//	cout << bb << " " << i << " is true " << x << endl;
					if ( bb == 1 && ppos == 0 ) {
						temp[i + x] = true;
					} else {
						temp[i - x] = true;
						temp[i + x] = true;
					}
				}
			}
			
			memcpy(DP[bb], temp, sizeof(bool)*17000);
			
			/*
			cout << bb << " " << x << " ";
			for(int ps=SAB-10; ps<SAB+10; ps++) {
				if ( ps ==SAB ) { cout<<"*"; }
				cout << DP[bb][ps] ? '+' : '.';
			}
			cout << endl;
			*/
		}
	}
	
	
	if ( DP[0][Y+SAB] && DP[1][X+SAB] ) {
		cout << "Yes" << endl;
	} else {
		cout << "No" << endl;
	}
}


Measured memory_bytes: 384
#include<stdio.h>
#include<stdlib.h>
//#include<math.h>

int main(void){
     
     int i,j;
     int A,B,C;
    // int A[100002];
     int sum = 0;
     int max;

     scanf("%d %d %d",&A, &B, &C);

    max = A;
    if(B > max) max = B;
    if(C > max) max = C;

    sum = (max - A) + (max -B) + (max -C);

    if(sum % 2 ==0){
        printf("%d \n",sum /2);
    }else{
        printf("%d\n", (sum + 3) / 2);
    }
   
  
}

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

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rrep(i, n) for(int i = ((int)(n)-1); i >= 0; i--)
#define all(x) (x).begin(),(x).end()

using namespace std;
using ll = long long;

typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> P;
 
const int INF = 1e9;
//const ll INF = 1e18;
const double EPS = 1e-10;
const int MOD = 1e9+7;
const double PI = acos(-1.0);

int main()
{
	int n,m;
	cin >> n >> m;
	char a[n][n],b[m][m];
	rep(i,n) rep(j,n) cin >> a[i][j];
	rep(i,m) rep(j,m) cin >> b[i][j];
	for(int i = 0; i <= n-m; i++){
		for(int j = 0; j <= n-m; j++){
			int flag = 1;
			for(int k = 0; k < m; k++){
				for(int l = 0; l < m; l++){
					if(a[i+k][j+l] != b[k][l]) flag = 0;
				}
			}
			if(flag){
				cout << "Yes" << endl;
				return 0;
			}
		}
	}
	cout << "No" << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
  int d;
  cin>>d;
  if(d==25){
    cout<<"Christmas";
  }
  else if(d==24){
    cout<<"Christmas Eve";
  }
  else if(d==23){
    cout<<"Christmas Eve Eve";
  }
  else cout<<"Christmas Eve Eve Eve";
}

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

#define mp make_pair
#define fst first
#define snd second
#define forn(i,n) for (int i = 0; i < int(n); i++)
#define forn1(i,n) for (int i = 1; i <= int(n); i++)
#define popcnt __builtin_popcount
#define ffs __builtin_ffs

using namespace std;

using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pli = pair<ll,int>;
using pil = pair<int,ll>;
using pll = pair<ll,ll>;
template <typename T> using vec = vector<T>;
using vi = vec<int>;
using vl = vec<ll>;
template <typename T> using que = queue<T>;
template <typename T> using deq = deque<T>;

template <typename T> T id(T b) {return b;};
template <class It> bool all(It f,It l){return std::all_of(f,l,id<bool>);}
template <class It> bool any(It f,It l){return std::any_of(f,l,id<bool>);}
template <typename T> void chmax(T &x, T y) {if (x < y) x = y;}
template <typename T> void chmin(T &x, T y) {if (x > y) x = y;}
void fastio() { ios_base::sync_with_stdio(false); cin.tie(nullptr); }
constexpr ll TEN(int n) { if (n == 0) return 1LL; else return 10LL*TEN(n-1); }

int main()
{
  fastio();

  int a,b; cin >> a >> b;
  if (a < 10 && b < 10)
    cout << a*b << endl;
  else
    cout << -1 << endl;

  return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <vector>

const int MAXN = 1e5 + 5;

int lenS, lenT;
long long int cur;
char s[MAXN], t[MAXN];
std::vector<int> place[26];

int search(int key, int position) {
    int left = 0, right = place[position].size() - 1, tmpAns = -1;
    while (left <= right) {
        int mid = (left + right) >> 1;
        if (place[position][mid] > key) {
            right = mid - 1;
            tmpAns = mid;
        }
        else
            left = mid + 1;
    }
    return tmpAns;
}

int main() {
    scanf("%s%s", s + 1, t + 1);
    lenS = strlen(s + 1);
    lenT = strlen(t + 1);
    for (int i = 1; i <= lenS; ++i) {
        place[s[i] - 'a'].push_back(i);
    }
    for (int i = 1; i <= lenT; ++i) {
        int tmp = t[i] - 'a';
        int k = search((cur % lenS == 0) ? lenS : cur % lenS, tmp);
        if (place[tmp].empty()) {
            printf("-1");
            return 0;
        }
        if (k == -1) {
            if (cur % lenS == 0)
                cur += place[tmp][0];
            else
                cur = cur + lenS - (cur % lenS - place[tmp][0]);
        }
        else
            cur += (place[tmp][k] - cur % lenS);
    }
    printf("%lld", cur);
    return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <cstring>
#include <stdlib.h>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <math.h>
#include <string>
#include <map>
#include <cstdlib>
using namespace std;

typedef long long ll;

int main()
{
    int N,M;
    cin >> N >> M;
    cout << pow(2,M)*(M*1900+(N-M)*100) << endl;

    return 0;
}

Measured memory_bytes: 256
def solve(row, col, l, H, W):
	K = 0
	for x, r in enumerate(row):
		if r == 1:
			for y in range(W):
				if l[x][y] == '#':
					K += 1
					if col[y] == 1:
						K -= 1
	for y, c in enumerate(col):
		if c == 1:
			for x in range(H):
				if l[x][y] == '#':
					K += 1
	return K

H, W, K  = map(int, input().split(" "))
l = []
num_black = 0
for i in range(H):
	l2 = list(input())
	num_black += sum([1 if x == '#' else 0 for x in l2])
	l.append(l2)


answer = 0
for i in range(2 ** (H + W)):
	binary = bin(i)[2:]
	t = [0] * ((H + W) - len(binary)) + [int(x) for x in binary]
	rows = t[:H]
	cols = t[H:]
	k = solve(rows, cols, l, H, W)
	if num_black - k == K:
		answer += 1

print(answer)


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

int main(){
  int A,B,X;
  cin >> A >> B >> X;
  if(A>X){
    cout << "NO" << endl;
  }else if(A+B<X){
    cout << "NO" << endl;
  }else {
    cout << "YES" << endl;
  }
}


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

using namespace std;

bool compare(pair<int, double> a, pair<int, double> b) {
    return a.second < b.second;
}

int main() {
    int n, t, a;

    cin >> n >> t >> a;

    int idx = 0;
    vector<pair<int, double>> dst;
    for (int i = 0; i < n; ++i) {
        double h;
        cin >> h;
        h *= .006;
        h = t - h;
        double d = (a > h ? a - h : h - a);
        dst.push_back(make_pair(i, d));
    }
    sort(dst.begin(), dst.end(), compare);
    cout << dst[0].first + 1 << endl;
}

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

using namespace std;
#define f first
#define s second
//#define int long long
#define st string
#define int long long
#define dear_crush int32_t main()
#define bari_ja return 0
#define forn(i, n) for (int i = 0; i < n; i++)
#define INF 1e9+5

dear_crush
{
/*
string str;

cin >> str;

	bool flag = true;

for(int i=1; i<str.size(); i++){

	if (str[i-1]!=str[i]) {
		flag = false;
	}
}

if (flag==false) {

	std::cout << "YES" << '\n';
}

else
std::cout << "NO" << '\n';

*/

int n, a, b;

std::cin>>a>>b;

int c = b/.1;


int d;

for(int i=c; i<c+10; i++){

 d = .08*i;
 
	if(d==a){
		std::cout << i << '\n';
		bari_ja;
	}
}

std::cout << "-1" << '\n';

bari_ja;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define SORT(x) sort(x.begin(),x.end())
#define ALL(x) x.begin(),x.end()
#define rep(i, n) for(int i = 0; i < n; i++)
#define reps(i, m, n) for(int i = m; i < n; i++)
#define repr(i, m, n) for(int i = m; i >= n; i--)
#define INF (1e9)
#define PI (acos(-1))
#define MOD 1000000007
using namespace std;
typedef long long ll;

void Main(){

  int K,S;

  cin>>K>>S;

  ll ct=0;

  rep(i,K+1){
    rep(j,K+1){
      ct+=(i+j <= S and i+j>=S-K);
    }
  }

  cout << ct <<"\n";

}
//-----------------------------------
int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  Main();
}
//-----------------------------------


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

int main()
{
	int a, b;
	cin >> a >> b;
	
	if(a > b)
	cout << "a > b" <<endl;
	else if(a < b)
	cout << "a < b" << endl;
	else
	cout << "a == b" << endl;
	
	return 0;
}

Measured memory_bytes: 1156
#include <cstdio>
#include <iostream>
#include <cassert>
#include <string>
#include <algorithm>
#include <cstring>
#include <utility>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <deque>
#include <unordered_map>
using namespace std;
typedef long long LL;
typedef pair<int, int> pii;
typedef pair<LL, LL> pll;
const int MAXN = 87;
int maze[MAXN][MAXN];
bool visit[MAXN][MAXN];
int stepx[4] = {-1, 1, 0, 0};
int stepy[4] = {0, 0, -1, 1};
char s[MAXN];

int bfs(int x, int y, int H, int W) {
    memset(visit, 0, sizeof(visit));
    int lv = 0;
    queue<pii> qu;
    qu.push(make_pair(x, y));
    visit[x][y] = 1;
    while (!qu.empty()) {
        queue<pii> nqu;
        while (!qu.empty()) {
            auto tmp = qu.front();
            qu.pop();
            int curx = tmp.first, cury = tmp.second;
            for (int i = 0; i < 4; i++) {
                int nx = stepx[i] + curx, ny = stepy[i] + cury;
                if (nx < 0 || ny < 0 || nx == H || ny == W) continue;
                if (!maze[nx][ny]) continue;
                if (visit[nx][ny]) continue;
                visit[nx][ny] = 1;
                nqu.push(make_pair(nx, ny));
            }
        }
        qu = nqu;
        lv++;
    }
    return lv - 1;
}

int main() {
    int H, W;
    scanf("%d %d", &H, &W);
    for (int i = 0; i < H; i++) {
        scanf("%s", s);
        for (int j = 0; j < W; j++)
            if (s[j] == '.')
               maze[i][j] = 1;
    }
    int ans = 0;
    for (int i = 0; i < H; i++)
        for (int j = 0; j < W; j++) {
            if (!maze[i][j]) continue;
            ans = max(ans, bfs(i, j, H, W));
        }
    printf("%d\n", ans);

    return 0;
}


Measured memory_bytes: 256
n,k=map(int,input().split())
t=sorted(map(int,input().split()))
dp=[-float('inf')]*(k+1)
dp[:t[0]]=[0]*t[0]
for i in range(k):
    for j in range(n):
        if i+t[j]<k+1:
            dp[i+t[j]]=max(dp[i+t[j]],(dp[i]+1)%2)
print(['Second','First'][dp[-1]%2])

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

int main() {
  int k;
  double c = 0, n;
  cin >> n >> k;
  cout << fixed << setprecision(12);
  for(int i = 1; i <= n; i++) {
    double p = 1 / n, pp = i;
    while(1) {
      if(pp < k) {
        p /= 2.0;
        pp *= 2;
      } else {
        c += p;
        break;
      }
    }
  }
  cout << c;
}

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

int main() {
    int ans = 0;
    int N, K;
    cin >> N >> K;
    vector<int> h(N);
    for(size_t i = 0; i < N; i++) {
        cin >> h[i];
    }
    sort(h.begin(), h.end());
    auto it = lower_bound(h.begin(), h.end(), K);
    ans = h.end() - it;

    cout << ans << endl;
}

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


int main() {

  string str;
  cin >> str;
  int n = (str.length() - 1) / 2;
  string s = str.substr(0, n);

  bool flag = true;
  for(int i = 0; i < s.length(); i++){
    if(s[i] != s[s.length() - i - 1]){
      flag = false;
      break;
    }
  }
  if (flag){
    for(int i = 0; i < str.length(); i++){
      if(str[i] != str[str.length() - i - 1]){
        flag = false;
        break;
      }
   }
  }
  if(flag)  cout << "Yes" << endl;
  else cout << "No" << endl;
  
}

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

#define ll long long int
#define ld long double
#define DEFAULT_MIN 10000000
#define DEFAULT_MAX -10000000
#define PRECISION 15
using namespace std;

ll lcm(ll n1, ll n2);
ll gcd(ll n1, ll n2);

int main(){
    int n;
    cin >> n;
    ll num[n];
    for(int i=0; i<n; i++){
        cin >> num[i];
    }
    ll ans = 1;
    for(int i=0; i<n; i++){
        if(ans < num[i]){
            ans = lcm(num[i], ans);
        }
        else{
            ans = lcm(ans, num[i]);
        }
    }
    cout << ans << endl;
    return 0;
}

ll lcm(ll n1, ll n2){
    return n1 / gcd(n1, n2) * n2;
}

ll gcd(ll n1, ll n2){
    if(n1 % n2 == 0){
        return n2;
    }
    else{
        return gcd(n2, n1%n2);
    }
}


Measured memory_bytes: 3624
#include <iostream>

using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    string s;
    cin >> s;
    int ans = 0;
    if (s == "SUN") {
        ans = 6;
    } else if (s == "MON") {
        ans = 5;
    } else if (s == "TUE") {
        ans = 4;
    } else if (s == "WED") {
        ans = 3;
    } else if (s == "THU") {
        ans = 2;
    } else if (s == "FRI") {
        ans = 1;
    } else if (s == "SAT") {
        ans = 0;
    }
    cout << ans + 1 << "\n";
}


Measured memory_bytes: 256
import java.io.IOException;
import java.util.Scanner;
public class Main {

	public static void main(String[] args) throws IOException {
		// TODO ?????????????????????????????????????????????
     Scanner sc = new Scanner(System.in);
     int a = sc.nextInt();
     int b = sc.nextInt();
     int c = sc.nextInt();
     if(a<b && b<c){System.out.println("Yes");}
     else{System.out.println("No");}
	}
}

Measured memory_bytes: 26412
import java.io.IOException;
import java.io.InputStream;
import java.util.*;

public class Main {
	static final long MOD = 1000000007;
	public static void main(String[] args) {	
		FastScanner sc = new FastScanner();
		int N = sc.nextInt();
		int M = sc.nextInt();
		int[] A = new int[N];
		for(int i = 0; i < N; i++) {
			A[i] = sc.nextInt();
		}
		for(int i = 0; i < M; i++) {
			for(int j = 0; j < N; j++) {
				if(j == N-1) {
					continue;
				}
				else {
					if(A[j] % (i+1) > A[j+1] % (i+1)) {
						int tmp = A[j];
						A[j] = A[j+1];
						A[j+1] = tmp;
					}
				}
			}
		}
		for(int i = 0; i < N; i++) {
			System.out.println(A[i]);
		}
	}
	
}

class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    private void skipUnprintable() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++;}
    public boolean hasNext() { skipUnprintable(); return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
    	return (int)nextLong();
    }
}

Measured memory_bytes: 24440