akhauriyash/Code-Regression huggingface dataset:
#pragma region
#include <bits/stdc++.h>
using namespace std;
inline void ci(void){
  return;
}
template <typename First, typename... Rest>
void ci(First& first, Rest&... rest){
  cin >> first;
  ci(rest...);
  return;
}
inline void co(void){
  cout << "\n";
  return;
}
template <typename First, typename... Rest>
void co(First first, Rest... rest){
  cout << first << " ";
  co(rest...);
  return;
}
#define ll long long
#define ld long double
#define st string
#define dl double
#define wh while
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define tp tuple
#define ft first
#define sc second
#define ve vector
#define tos to_string
#define len length
#define rt return 0
#define br break
#define con continue
#define lcm(n, m) (n * m / gcd(n, m))
#define np next_permutation
#define repi(i, m, n) for(int i=(int)(m);i<(int)(n);i++)
#define rep(i, n) repi(i, 0, n)
#define repill(i, m, n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define repll(i, n) repill(i, 0, n)
#define revi(i, m, n) for(int i=(int)(m);i>(int)(n);i--)
#define rev(i, n) revi(i, 0, n)
#define revill(i, m, n) for(ll i=(ll)(m);i>(ll)(n);i--)
#define revll(i, n) revill(i, 0, n)
#define sz(v) ((int)(v).size()) 
#define each(i, n) for(auto&& i: n)
#define all(n) (n.begin(), n.end())
#define sp(n) cout << fixed << setprecision(n)
#pragma endregion
// sqrt ルート, int 2*10^9, gcd　最大公約数 __builtin_popcount bitの個数

int main() {
  int D;
  ci(D);
  if(D == 25){
    co("Christmas");
  }
  else if(D == 24){
    co("Christmas Eve");
  }
  else if(D == 23){
    co("Christmas Eve Eve");
  }
  else{
    co("Christmas Eve Eve Eve");
  }
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <array>
#include <vector>
#include <cmath>
#include <algorithm>
#include <numeric>
#include <iterator>
#include <limits>
#include <set>

int main()
{
    int n{};
    std::cin >> n;
    std::vector<int> xs(n);
    for (int i = 0; i < n; i++) {
        std::cin >> xs[i];
    }
    long long min = std::numeric_limits<long long>::max();
    for (int i = 1; i < 100; i++) {
        long long tmp = 0;
        for (auto x : xs) {
            tmp += (x - i) * (x - i);
        }
        if (tmp < min) {
            min = tmp;
        }
    }
    std::cout << min << std::endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REP2(i, a, b) for(int i = a;i <= b;i++)
#define REPR(i, a, b) for(int i = a; i >= b; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define MOD 1000000007
#define PI 3.14159265358979323846
#define vi vector<int>
#define vll vector<ll>
#define vi2 vector<vector<int>>
#define eb emplace_back
#define fi first
#define se second
#define ALL(v) v.begin(), v.end()
#define sz(x) int(x.size())
using namespace std;
using P = pair<ll,ll>;
const int dx[]{0, 1, 0, -1, -1, -1, 1, 1}, dy[]{1, 0, -1, 0, -1, 1, -1, 1};
#define INT(name) int name;cin >> name;
#define VEC(type,name,n) vector<type> name(n);REP(i,n) cin >> name[i];

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

const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

int main()
{
  ll N;
  cin >> N;
  mint ten=10;
  mint nine=9;
  mint eight=8;
  cout << ten.pow(N)+eight.pow(N)-nine.pow(N)*2 << endl;
}


Measured memory_bytes: 3640
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<vector>

using namespace std;

int read()
{
	int x = 0, f = 1; char c = getchar();
	while(!isdigit(c)) { if(c == '-') f = 0; c = getchar(); }
	while(isdigit(c)) { x = (x << 3) + (x << 1) + (c ^ 48); c = getchar(); }
	return f ? x : -x;
}

typedef long long LL;
#define int long long
const int maxn = 1e5 + 10, maxm = maxn << 1;
int mod, to[maxm], nxt[maxm], head[maxn], e, f[maxn], g[maxn], ans[maxn], p[maxn];
vector<int> vec[maxn];

void add(int x, int y) 
{
	to[++e] = y; nxt[e] = head[x]; head[x] = e;
	to[++e] = x; nxt[e] = head[y]; head[y] = e;
}

void dfs(int u, int fa)
{
	f[u] = 1;
	int tot = 0;
	for(int i = head[u]; i; i = nxt[i])
	{
		int v = to[i];
		if(v == fa) continue;
		dfs(v, u);
		f[u] = (LL)f[u] * (f[v] + 1) % mod;
		p[v] = tot++; vec[u].push_back(f[v]);
	}
}

void dp(int u, int fa)
{
	vec[u].push_back(g[u]);
	for(int i = (int)vec[u].size() - 2; i >= 0; --i)
		vec[u][i] = (LL)(vec[u][i] + 1) * vec[u][i + 1] % mod;
	int now = 1; ans[u] = (LL)(g[u]) * f[u] % mod;
	for(int i = head[u]; i; i = nxt[i])
	{
		int v = to[i];
		if(v == fa) continue;
		g[v] = ((LL)now * vec[u][p[v] + 1] % mod + 1) % mod;
		dp(v, u);
		now = (LL)now * (f[v] + 1) % mod;
	}
}

main()
{
	int n = read(); mod = read();
	for(int i = 2; i <= n; ++i) add(read(), read());
	dfs(1, 0);
	g[1] = 1;
	dp(1, 0);
	for(int i = 1; i <= n; ++i) printf("%lld\n", ans[i]);

	return 0;
}

Measured memory_bytes: 19456
#include <iostream>
#include <numeric>
#include <vector>
#include <algorithm>
#include "math.h"

using namespace std;
int main(int argc, char const *argv[]) {
  int a, b, h;
  cin >> a >> b >> h;
  cout << (a+b) * h / 2 << endl;
  return 0;
}

Measured memory_bytes: 888
#line 1 "DPL_5_D.test.cpp"
#define PROBLEM "http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DPL_5_D"

#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
#define rep(i, n) for(ll i = 0;i < n;i++)
#define all(i) i.begin(), i.end()
template<class T, class U> bool cmax(T& a, U b) { if (a<b) {a = b; return true;} else return false; }
template<class T, class U> bool cmin(T& a, U b) { if (a>b) {a = b; return true;} else return false; }

#line 1 "../modint.cpp"
template <ll Mod>
struct ModInt {
  ll n;
  ModInt(const ll x = 0) : n(x) { while (n < 0) n += Mod; n %= Mod; }
  ModInt operator+(const ModInt r) const { return ModInt(*this) += r; }
  ModInt operator-(const ModInt r) const { return ModInt(*this) -= r; }
  ModInt operator*(const ModInt r) const { return ModInt(*this) *= r; }
  ModInt operator/(const ModInt r) const { return ModInt(*this) /= r; }
  ModInt &operator+=(const ModInt r) { n += r.n; if (n >= Mod) n -= Mod; return *this; }
  ModInt &operator-=(const ModInt r) { if (n < r.n) n += Mod; n -= r.n; return *this; }
  ModInt &operator*=(const ModInt r) { n = n * r.n % Mod; return *this; }
  ModInt &operator/=(const ModInt r) { return *this *= r.inv(); }
  ModInt pow(ll x) const { ModInt<Mod> ret(1), tmp(*this); while (x) { if (x&1) ret *= tmp; tmp *= tmp; x >>= 1; } return ret; }
  ModInt inv() const { return pow(Mod-2); }
  friend ostream& operator<<(ostream& os, const ModInt& obj) { return os << obj.n; }
  friend istream& operator>>(istream& is, ModInt& obj) { ll t; is >> t; obj = ModInt(t); return is; }
};
constexpr ll mod = 1000000007;
using mint = ModInt<mod>;
mint operator"" _mi(unsigned long long n) { return mint(n); }
#line 1 "../combination.cpp"
// T modint
template<class T>
struct Combination {
  vector<T> fact, inv_fact;
  Combination(ll n) : fact(n+1), inv_fact(n+1) {
    fact[0] = T(1);
    for (ll i = 1; i <= n; i++) fact[i] = fact[i-1] * static_cast<T>(i);
    inv_fact[n] = fact[n].inv();
    for (ll i = n; i > 0; i--) inv_fact[i-1] = inv_fact[i] * static_cast<T>(i);
  }

  T P(ll n, ll k) const {
    if (n < k or k < 0) return T(0);
    return fact[n] * inv_fact[n-k];
  }

  T C(ll n, ll k) const {
    if (n < k or k < 0) return T(0);
    return fact[n] * inv_fact[n-k] * inv_fact[k];
  }

  T H(ll n, ll k) const {
    if (n < 0 or k < 0) return T(0);
    if (n == 0 and k == 0) return T(1);
    return C(n+k-1, n-1);
  }
};
#line 16 "DPL_5_D.test.cpp"

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

  ll n, k;
  cin >> n >> k;
  Combination<mint> c(n+k);
  cout << c.H(k, n) << endl;
}



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

using namespace std;

/********** TEMPLATE STARTS HERE ***********/

#define IOS ios::sync_with_stdio(false), cin.tie(0);
#define all(v) v.begin(), v.end()
#define F first
#define S second
#define pb push_back
#define test int t; cin >> t; while(t--)
#define skip continue
#define stop break
#define sz(v) v.size()
#define endl '\n'
#define PI 3.1415926535897932384626433832795
#define EPS 1e-9
#define FR(i, a, b) for(int i = a; i <= b; i++)
#define gcd __gcd 
#define FR(i, l, r) for(int i = (l); i <= (r); i++)
#define debug(a) cout << #a << ": " << a << endl
#define debug1(a, l, r) FR(i, l, r) cout << a[i] << " "; cout << endl
	
	
typedef long long ll;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef vector <int> vi;
typedef vector <pii> vii;
typedef vector <pll> vll;

const int INF = 0x3f3f3f3f;
const int LINF = 0x3f3f3f3f3f3f3f3f;

template <typename T, typename U> inline void amin(T &x, U y) { if(y < x) x = y; }
template <typename T, typename U> inline void amax(T &x, U y) { if(x < y) x = y; }


/*********** TEMPLATE ENDS HERE *************/

int cnt[204];

main()
{
	int n;
	cin >> n;
	for(int i = 1; i <= 200; i++)
		for(int j = i; j <= 200; j += i)
			cnt[j]++;
	int ans = 0;
	for(int i = 1; i <= n; i += 2)
		if(cnt[i] == 8)
			ans++;
	cout << ans;
}


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

int main()
{  
  #ifndef ONLINE_JUDGE
	 freopen("input.txt", "r", stdin);
     freopen("output.txt", "w", stdout);

  #endif
   
    string s,t;

    cin>>s;
    cin>>t;
   

    long long ans=0;
    for(int i=0; i<s.length(); i++)
     { if(s[i]!=t[i]) ans++;
     }

     cout<<ans<<endl;




 }

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

using namespace std;

constexpr int N = 100000;
constexpr int MOD = 1000000007;

long long a[N + 1];
long long f[N + 1];

/* O(Log(min(a, b))) - Extended Euclidean Algorithm.
   Returns a solution to a * x + b * y = gcd(a, b).
   Returns |x| <= |a / gcd(a, b)|, |y| <= |b / gcd(a, b)| and gcd(a, b). */
long long extended_gcd(long long a, long long b, long long &x, long long &y) {
	long long x1, y1, gcd;

	if (a == 0) {
		x = 0;
		y = 1;
		return b;
	}
 
	gcd = extended_gcd(b % a, a, x1, y1);
	x = y1 - (b / a) * x1;
	y = x1;
 
	return gcd;
}

/* O(Log(M)) - Returns the modular multiplicative inverse of a mod m, if it exists.
Returns x that satisfies a * x = 1 (mod m) if a and m are coprime. Returns 0 otherwise. */
long long modular_inverse(long long a, long long m) {
	long long x, y;

	if (extended_gcd((a % m + m) % m, m, x, y) != 1) {
		return 0;
	}

	return (x % m + m) % m;
}

/* O(Log(M)) - This only works if k! * (n - k)! is coprime with m. */
long long nck(long long n, long long k, long long m) {
	long long num, den;

	// Trivial case.
	if (k < 0 or k > n) {
		return 0;
	}

	num = f[n];
	den = (f[k] * f[n - k]) % m;

	return (num * modular_inverse(den, m)) % m;
}

/* O(N). */
void nck_init(long long m) {
	f[0] = 1;

	for (long long i = 1; i <= N; i++) {
		f[i] = (f[i - 1] * i) % m;
	}
}

int main() {
	long long pos, neg;
	int n, k, i;

	nck_init(MOD);

	scanf("%d%d", &n, &k);

	for (i = 1; i <= n; i++) {
		scanf("%lld", a + i);
	}

	sort(a + 1, a + 1 + n);

	if (k == 1) {
		printf("0\n");
		return 0;
	}

	pos = neg = 0;
	
	for (i = 1; i <= n; i++) {
		pos = (pos + nck(i - 1, k - 1, MOD) * a[i]) % MOD;
		neg = (neg + nck(n - i, k - 1, MOD) * a[i]) % MOD;
	}

	printf("%lld\n", (pos - neg + MOD) % MOD);

	return 0;
}

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

int main(){
    int L,R,D;
    cin >> L >> R >> D;
    int ans = 0;
    for (int i = L; i <= R; i++){
        if (i % D == 0) ans++;
    }
    cout << ans << endl;
}



Measured memory_bytes: 3616
#include<bits/stdc++.h>
#define ll long long
#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define dump(a) (cerr << #a << "=" << (a) << endl)
#define DUMP(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }


using namespace std;

int main(){
    int N;
    cin >> N;
    int a[N];
    rep(i, N){
        cin >> a[i];
    }

    map<int, bool> m;
    map<int, bool>::iterator ite;
    rep(i, 8){
        m.insert(make_pair(i, false));
    }

    int c = 0;
    int ans = 0;
    rep(i, N) {
        if (a[i] >= 3200){
            c++;
        } else if (a[i]>= 1 && a[i] <= 399) {
            m[0] = true;
        } else if (a[i]>= 400 && a[i] <= 799) {
            m[1] = true;
        } else if (a[i] >= 800 && a[i] <= 1199) {
            m[2] = true;
        } else if (a[i] >= 1200 && a[i] <= 1599) {
            m[3] = true;
        }  else if (a[i] >= 1600 && a[i] <= 1999) {
            m[4] = true;
        } else if (a[i] >= 2000 && a[i] <= 2399) {
            m[5] = true;
        } else if (a[i] >= 2400 && a[i] <= 2799) {
            m[6] = true;
        } else if (a[i] >= 2800 && a[i] <= 3199) {
            m[7] = true;
        }
    }

    for(ite=m.begin(); ite != m.end(); ite++) {
        if(ite->second) ans++;
    }

    if ( c == N) {
        cout << 1;
    }  else {
        cout << ans;
    }


    cout << " " << ans + c << endl;


}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <numeric>
using namespace std;
typedef long long int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

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


int main() {
    int A, B, C;
    cin >> A >> B >> C;

    int ans = min(B / A, C);
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
/*input
4 3
1 2 6
3 4 5
2 3 7
*/
import java.util.Scanner;
import java.lang.*;
import java.util.Arrays;
import java.util.function.BinaryOperator;
import java.io.File;
import java.io.FileNotFoundException;
import java.util.*;


public class Main {
	private static final int N = (int)1e5 + 100;
	private static final long oo = (long) 1e18;
	public static class Pair {
		public int v;
		public long s;
		Pair(int v, long s) {
			this.v = v;
			this.s = s;
		}
	}

	private static long n, m, flag = 0;
	private static long[] a = new long[N];
	private static long[] step = new long[N];
	private static long[] res = new long[N];
	private static boolean[] visit = new boolean[N];

	public static ArrayList<ArrayList<Pair> > vi = new ArrayList< ArrayList <Pair> >();

	static void run() { System.out.print("0"); System.exit(0); }
	static void done() { System.out.print("1"); System.exit(0); }
	static boolean check(long x) {
		res[1] = x;
		for(int i = 1; i <= n; ++i) {
			if(step[i] % 2 == 0) {
				res[i] = a[i] + x;
			} else res[i] = a[i] - x;
			if(res[i] <= 0) return false;
		}
		for(int i = 1; i <= n; ++i) {
			for(Pair cur: vi.get(i))	{
				if(cur.s != (res[i] + res[cur.v])) return false;
			}
		}
		return true;
	}

	static void dfs(int u) {
		visit[u] = true;
		for(Pair cur: vi.get(u)) {
			if(!visit[cur.v]) {
				step[cur.v] = 1 - step[u];
				a[cur.v] = cur.s - a[u];
				dfs(cur.v);
			}
		}
	}

	public static void main(String[] args) {
		Scanner inp = new Scanner(System.in);

		n = inp.nextLong();
		m = inp.nextLong();
		
		for(int i = 1; i <= n + 1; ++i) {
			visit[i] = false;
			vi.add(new ArrayList<Pair>());
		}
		for(int i = 1; i <= m; ++i) {
			int u, v, s;
			u = inp.nextInt();
			v = inp.nextInt();
			s = inp.nextInt();
			vi.get(u).add(new Pair(v, s));
			vi.get(v).add(new Pair(u, s));
		} 
		step[1] = a[1] = 0;

		dfs(1);

		long minn = 1L, maxn = (long)1e9;

		//for(int i = 1; i <= n; ++i) System.out.println(a[i] + " " + step[i]);

		for(int i = 1; i <= n; ++i ) {
			for(Pair cur: vi.get(i)) {
				if(1 - step[i] == step[cur.v]) {
					if(a[cur.v] != cur.s - a[i]) run();
				} else {
					long tmp = cur.s - a[i];
					if(step[i] % 2 == 0) {
						if(check((tmp - a[cur.v]) / 2)) done();
						else run();
					} else {
						if(check((a[cur.v] - tmp) / 2)) done();
						else run();	
					}
				}
			}
			if(step[i] == 0) minn = Math.max(minn, 1 - a[i]);
			else maxn = Math.min(maxn, a[i] - 1);
		}
		
		System.out.print(Math.max(maxn - minn + 1, 0L));
	}
}

Measured memory_bytes: 126252
#include <bits/stdc++.h>
using namespace std;
template<class T> void chmin (T &a, T b) { if (a > b) a = b; }
constexpr long long INF = (1LL<<60);

int main() {
    int n, k;
    cin >> n >> k;
    vector<long long> a(n+1);
    for (int i = 0; i < n; i++) cin >> a[i+1];
    
    vector<vector<long long>> dp(n+1, vector<long long>(k+1, INF));
    dp[0][k] = 0;
    for (int i = 0; i <= n; i++) {
        for (int j = 0; j <= k; j++) if (dp[i][j] < INF) {
           for (int x = 1; i + x <= n and 0 <= j-x+1; x++) {
               chmin(dp[i+x][j-x+1], dp[i][j] + max(0LL, a[i+x]-a[i]));
           }
        }
    }
    
    long long ans = INF;
    for (int i = 0; i <= k; i++) {
        chmin(ans, dp[n-i][i]);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <cstdlib>
#include <list>
#include <map>
#include <vector>
#include <algorithm>
#include <cmath>
using namespace std;
 
int main(void)
{
    int N;
    cin >> N;

    cout << ((N>=30) ? "Yes" : "No");
    
    return 0;
}


Measured memory_bytes: 3136
#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstdio>
#include <string>
#include <vector>
#include <algorithm>
#include <complex>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <cassert>
#include <climits>
#include <queue>
#include <set>
#include <map>
#include <valarray>
#include <bitset>
#include <stack>
using namespace std;

#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
typedef long long ll;
typedef pair<int,int> pii;
const int INF = 1<<29;
const double PI = acos(-1);
const double EPS = 1e-8;

vector<string> lines;
vector<string> v;
string ans;

void solve(int &id, int indent, int now) {
  while(id<lines.size()) {
    int ind = 0;
    while(lines[id][ind] == ' ') ++ind;
    if (ind < indent) {
      return;
    }
    int t = lines[id].find(':');
    string a = lines[id].substr(ind,t-ind);
    string b = "";
    if (t+2<lines[id].size()) b = lines[id].substr(t+2);
    id++;
    if (a == v[now]) {
      if (now == v.size()-1) {
        ans = b;
      } else {
        solve(id, ind+1, now+1);
      }
    } else {
      // 違ったらそれより下位のものを飛ばす
      while(id<lines.size()) {
        int tmp = 0;
        while(lines[id][tmp] == ' ') ++tmp;
        if (tmp <= ind) {
          break;
        }
        id++;
      }
    }
  }
}

int main() {
  string in;
  cin >> in;
  FOR(it, in) if (*it == '.') *it = ' ';
  stringstream ss(in);
  string t;
  while(ss >> t) {
    v.push_back(t);
  }
  string line;
  getline(cin,line);
  while(getline(cin,line)) {
    lines.push_back(line);
  }
  int id = 0;
  ans = "*";
  solve(id, 0, 0);
  if (ans == "*") {
    puts("no such property");
  } else if (ans == "") {
    puts("object");
  } else {
    printf("string \"%s\"\n", ans.c_str());
  }
}

Measured memory_bytes: 1340
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<ctime>
#include<cctype>
#include<climits>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<memory>
#include<functional>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;

typedef vector<int> vi;
typedef vector<long long> vl;
typedef vector<double> vd;
typedef pair<int, int> pii;
typedef pair<long, long> pll;
typedef long long ll;

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

int main(){
	ios::sync_with_stdio(false);

	int n;
	scanf("%d", &n);

	double a[2], b[2], c[2], d[2];
	double e=0.00000001;


	while(n--){
		scanf("%lf %lf %lf %lf %lf %lf %lf %lf", &a[0], &a[1], &b[0], &b[1], &c[0], &c[1], &d[0], &d[1]);

		double l1, l2;
		bool p=false;

		if((fabs(a[0]-b[0])<e)&&(fabs(c[0]-d[0])<e)){
			p=true;
		}else if((fabs(a[0]-b[0])>e)&&(fabs(c[0]-d[0])>e)){
			l1=(b[1]-a[1])/(b[0]-a[0]);
			l2=(d[1]-c[1])/(d[0]-c[0]);

			if(fabs(l2-l1)<e)	p=true;
		}

		if(p){
			printf("YES\n");
		}else{
			printf("NO\n");
		}
	}

}

Measured memory_bytes: 1224
#include <bits/stdc++.h>
#include <math.h>
#define _GLIBCXX_DEBUG
using namespace std;
int main() {
  
  int N,A,B;
  cin>>N>>A>>B;
  
  int ans=0;
  
  
  for(int i=1;i<=N;i++){
    int num=0;
    int j=i;
    while(true){
      num+=j%10;
      j=j/10;
      if(j==0){
        break;
      }
    }
      if(num>=A&&num<=B){
        ans+=i;
      }
  }
  
  cout<<ans<<endl;
}

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

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

 vector<int> A(N),B(N),C(N);

 for(int i = 0; i < N; i++) {
   cin >> A.at(i);
 }

  for(int i = 0; i < N; i++) {
   cin >> B.at(i);
 }

  for(int i = 0; i < N; i++) {
   cin >> C.at(i);
 }

 sort(A.begin(),A.end());
 sort(C.begin(),C.end());

long long ans = 0;

  vector<int>::iterator posb;
 for(posb = B.begin();posb != B.end();posb++) {
  int b = *posb;
  vector<int>::iterator posa;
  vector<int>::iterator posc;
  posa = lower_bound(A.begin(),A.end(),b);
  posc = upper_bound(C.begin(),C.end(),b);
  long long disa = distance(A.begin(),posa);
  long long disc = N - distance(C.begin(),posc);
  ans += disa * disc;
 }


cout << ans << endl;

}


Measured memory_bytes: 1408
/*
━━━━━┒ギリギリ♂ eye！
┓┏┓┏┓┃キリキリ♂ mind！
┛┗┛┗┛┃＼○／
┓┏┓┏┓┃ /
┛┗┛┗┛┃ノ)
┓┏┓┏┓┃
┛┗┛┗┛┃
┓┏┓┏┓┃
┛┗┛┗┛┃
┓┏┓┏┓┃
┛┗┛┗┛┃
┓┏┓┏┓┃
┃┃┃┃┃┃
┻┻┻┻┻┻
*/
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <climits>
#include <complex>
#include <cassert>
#include <cstdio>
#include <bitset>
#include <vector>
#include <deque>
#include <queue>
#include <stack>
#include <ctime>
#include <set>
#include <map>
#include <cmath>
//#include <unordered_map>
using namespace std;
#define fr first
#define sc second
#define cl clear
#define BUG puts("here!!!")
#define W(a) while(a--)
#define pb(a) push_back(a)
#define Rint(a) scanf("%d", &a)
#define Rll(a) scanf("%I64d", &a)
#define Rs(a) scanf("%s", a)
#define Cin(a) cin >> a
#define FRead() freopen("in", "r", stdin)
#define FWrite() freopen("out", "w", stdout)
#define Rep(i, len) for(int i = 0; i < (len); i++)
#define For(i, a, len) for(int i = (a); i < (len); i++)
#define Cls(a) memset((a), 0, sizeof(a))
#define Clr(a, x) memset((a), (x), sizeof(a))
#define Full(a) memset((a), 0x7f7f7f, sizeof(a))
#define lrt rt << 1
#define rrt rt << 1 | 1
#define pi 3.14159265359
#define RT return
#define lowbit(x) x & (-x)
#define onenum(x) __builtin_popcount(x)
typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;
typedef pair<int, int> pii;
typedef pair<string, int> psi;
typedef pair<LL, LL> pll;
typedef map<string, int> msi;
typedef vector<int> vi;
typedef vector<LL> vl;
typedef vector<vl> vvl;
typedef vector<bool> vb;

const int maxn = 55;
const int maxm = 2550;
LL ret;
LL n, a;
LL x[maxn];
LL dp[maxn][maxn][maxm];

int main() {
	// FRead();
	while(cin >> n >> a) {
		Cls(dp); dp[0][0][0] = 1; ret = 0;
		Rep(i, n) cin >> x[i];
		For(i, 1, n+1) {
			Rep(j, i+1) {
				Rep(k, 2501) {
					dp[i][j][k] += dp[i-1][j][k];
					if(j >= 1 && k >= x[i-1]) {
						dp[i][j][k] += dp[i-1][j-1][k-x[i-1]];
					}
				}
			}
		}
		For(i, 1, n+1) ret += dp[n][i][a*i];
		cout << ret << endl;
	}
	RT 0;
}


Measured memory_bytes: 60544
#include <bits/stdc++.h>
using namespace std;
int n;
long long int k;
int bit_count[64][2];
int bit_num = 0;
long long int a;
long long int temp, temp_k;
long long int now_k = 0;
long long int ans = 0;
int main()
{
    cin >> n >> k;
    //ビット数数える
    temp_k = k;
    while (temp_k)
    {
        bit_num++;
        temp_k /= 2;
    }
    for (int i = 0; i < n; i++)
    {
        cin >> a;
        //それぞれのビット見て配列に入れる．
        for (int i = 0; i < 64; i++)
        {
            bit_count[i][a & 1]++;
            a /= 2;
        }
    }

    for (int i = bit_num - 1; i >= 0; i--)
    {
        temp = 1;
        for (int j = 0; j < i; j++)
            temp *= 2;
        if (temp + now_k <= k && bit_count[i][0] >= bit_count[i][1])
        {

            ans += temp * bit_count[i][0];
            now_k += temp;
        }
        else
        {
            ans += temp * bit_count[i][1];
        }
    }
    for (int i = bit_num; i < 64; i++)
    {
        temp = 1;
        for (int j = 0; j < i; j++)
            temp *= 2;
        ans += temp * bit_count[i][1];
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <cstdio>
#include <vector>
#include <map>
#include <unordered_map>
#include <set>
#include <unordered_set>
#include <stack>
#include <queue>
#include <algorithm>
#include <string.h>
#include <string>
#include <math.h>
#include <iomanip>
using namespace std;

#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
#define pb push_back

typedef pair<int, int> pii;
typedef long long ll;
typedef unsigned long long ull;

const int mod = (int)1e9 + 7;
const int mod2 = 998244353;

ll exp(ll taban, ll us, ll md) {
    ll carpan = taban % md;
	if(carpan == 0) return 0;
    ll temp = us;
    ll res = 1;
    while(temp){
        if(temp % 2) res = (res*carpan) % md;
        temp /= 2;
        carpan = (carpan*carpan) % md;
    }
    return res;
}
 
ll ebob(ll a, ll b){
    if(!a)return b;
    return ebob(b%a, a);
}

ll ekok(ll a, ll b){
    return (a*b)/ebob(a, b);
}

ll mul(ll a, ll b, ll md){
	return a*b % md;
}

vector<ll> fact;
vector<ll> inv_fact;
void fact_init(int n){
	fact.resize(n+5);
	inv_fact.resize(n+5);
	fact[0] = inv_fact[0] = 1;
	for(int i = 1; i <= n; i++){
		fact[i] = (fact[i-1] * i) % mod;
		inv_fact[i] = exp(fact[i], mod-2, mod);
	}
}

ll komb(ll a, ll b){
	if(a < b) return 0;
	return fact[a] * (inv_fact[a-b] * inv_fact[b] % mod) % mod;
}


const int N = 2e5+5;

int main(){
	ios::sync_with_stdio(false); cin.tie(NULL);
	string s, t; cin>>s>>t;
	int n = s.size(), m = t.size();
	
	if(n < m){
		cout<<"UNRESTORABLE\n";
		return 0;
	}
	int target = -1;
	set<string> st;
	for(int i = n-m; i >= 0; i--){
		bool check = true;
		for(int j = i; j < i+m; j++){
			if(s[j] == '?' || (s[j] == t[j - i])){
			}else check = false;
		}
		if(check){
			string tmp;
			for(int j = 0; j < i; j++){
				tmp += (s[j] == '?' ? 'a' : s[j]);
			}
			tmp += t;
			for(int j = i+m; j < n; j++){
				tmp += (s[j] == '?' ? 'a' : s[j]);
			}
			st.insert(tmp);
		}
	}
	if(st.empty()){
		cout<<"UNRESTORABLE\n";
		return 0;
	}
	cout<<*st.begin()<<"\n";
}

Measured memory_bytes: 256
#include <stdio.h>

const int pow[4] = {1, 9, 81, 729};

int combination(int n, int k)
{
	if (n < k) return 0;
	else if (k == 0 || n == k) return 1;
	
	int i, x;
	for (i = n, x = 1; i >= n - k + 1; i--) x *= i;
	for (i = 2; i <= k; i++) x /= i;
	return x;
}

long long recursion(char N[], int l, int K)
{
	if (K == 0) return 1;
	else if (l == 0) return 0;
	else if (N[0] == '0') return recursion(&(N[1]), l - 1, K);
	else return recursion(&(N[1]), l - 1, K - 1) + combination(l - 1, K - 1) * pow[K-1] * (N[0] - '1') + combination(l - 1, K) * pow[K];
}

int main()
{
	int l, K;
	char N[102];
	scanf("%s", N);
	scanf("%d", &K);
	for (l = 0; N[l] != 0; l++);
	printf("%lld\n", recursion(N, l, K));
	fflush(stdout);
	return 0;
}

Measured memory_bytes: 1728
#pragma GCC optimize ("O3")
#pragma GCC target ("sse4")
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp> 
#include <ext/pb_ds/assoc_container.hpp> 
using namespace std; 
using namespace __gnu_pbds;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
 
template <class T> using ordered_set = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;
typedef tree<int, null_type, less_equal<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_mset;
 
#define FOR(i,a,b) for(int i = a; i < b; i++)
#define F0R(i,a) for(int i = 0; i < a; i++)
#define F0Rd(i,a) for (int i = a - 1; i >=0 ; i--)
#define FORd(i,a,b) for (int i = b - 1; i >= a; i--)
#define pb push_back
#define all(x) x.begin(), x.end()
#define sz(x) int((x).size())
#define newl '\n'
 
#define FAST ios::sync_with_stdio(0); cin.tie(0);
#define print(x) cout << x << newl;
#define finish(x) return cout << x << "\n", 0;
#define bug(x) cerr << ">>> " << #x << " = " << x << "\n";
#define _ << " " << 
 
const int MXN = 2e5 + 5;
const ll MOD = 998244353;
const ll INF = 1e9 + 7;


int N;

int main(){ FAST
    //ifstream cin("/Users/konwoo/input.txt");
    //ofstream cout("/Users/konwoo/output.txt");

    cin >> N;
    if (N % 10 == 3) finish("bon");
    if (N % 10 == 0 || N % 10 == 1 || N% 10 == 6 || N% 10 == 8) finish("pon");
    finish("hon");

    

 
 
 
    return 0;
}


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

#define ris   return *this
#define tmplt template<class T
#define dbgo  debug& operator<<
tmplt > struct rge { T b, e; };
tmplt > rge<T> range(T i, T j) { return rge<T>{i, j}; }
struct debug {
#ifdef LOCAL
~debug(){cerr<<endl;}
tmplt > dbgo(T x){cerr<<boolalpha<<x;ris;}
tmplt, class C > dbgo(pair<T, C> x){ris<<"("<<x.first<<", "<<x.second<<")";}
tmplt > dbgo(rge<T> x){*this<<"[";for(auto it=x.b;it!=x.e;it++){*this<<", "+2*(it==x.b)<<*it;}ris<<"]";}
tmplt > dbgo(vector<T> x){ris<<range(x.begin(),x.end());}
#else
tmplt > dbgo(const T&){ris;}
#endif
};
#define nav(...) << "[ " << #__VA_ARGS__ ": " << (__VA_ARGS__) << " ] "
using ll = long long;

#define forn(i, n) for(int i = 0; i < int(n); i++)
#define ford(i, n) for(int i = n-1; i >= 0; i--) 

template<typename T> 
void min_self(T& a, T b) { 
    a = min(a, b); 
}
template<typename T>
void max_self(T& a, T b) { 
    a = max(a, b); 
}


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

    int h1, m1, h2, m2, k;
    cin >> h1 >> m1 >> h2 >> m2 >> k;
    int total_awake = (h2-h1)*60 + (m2 - m1);
    cout << total_awake - k << '\n';
}   













// Spend more time thinking, it won't hurt

// Read statement carefully
// Solve on paper first!
// Make your infinity big enough
// Overflows (long long)

// Author: blondie


Measured memory_bytes: 3600
#include <bits/stdc++.h>
#define enl printf("\n")
#define case(t) printf("Case #%d: ", (t))
#define ni(n) scanf("%d", &(n))
#define nl(n) scanf("%I64d", &(n))
#define nai(a, n) for (int i = 0; i < (n); i++) ni(a[i])
#define nal(a, n) for (int i = 0; i < (n); i++) nl(a[i])
#define pri(n) printf("%d\n", (n))
#define prl(n) printf("%I64d\n", (n))
#define pii pair<int, int>
#define vii vector<pii>
#define vi vector<int>
#define pb push_back
#define mp make_pair
#define fi first
#define se second
typedef long long ll;
const double pi = acos(-1);
const int MOD = 1e9 + 7;
const int INF = 1e9 + 7;
const int MAXN = 1e6 + 5;
const double eps = 1e-9;
using namespace std;
int a[MAXN], dp[MAXN], ind[MAXN];

int main()
{
    int n;
    ni(n);
    nai(a, n);
    for (int i = 0; i < n; i++)
        ind[a[i]] = i;
    int ans = 0;
    for (int i = 0; i < n; i++)
    {
        dp[a[i]] = 1;
        if (a[i] == 1)
            dp[1] = 1;
        else if (ind[a[i] - 1] < ind[a[i]])
            dp[a[i]] = max(dp[a[i]], dp[a[i] - 1] + 1);
        ans = max(ans, dp[a[i]]);
    }
    pri(n - ans);
    return 0;
}


Measured memory_bytes: 9216
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define mp make_pair
#define Fast_IO ios::sync_with_stdio(false);
#define fir first
#define sec second
#define mod 998244353
#define INF 0x3fffffff
#define ll long long
inline int read()
{
	char ch=getchar(); int nega=1; while(!isdigit(ch)) {if(ch=='-') nega=-1; ch=getchar();}
	int ans=0; while(isdigit(ch)) {ans=ans*10+ch-48;ch=getchar();}
	if(nega==-1) return -ans;
	return ans;
}
typedef pair<int,int> pii;
int add(int x,int y){return x+y>=mod?x+y-mod:x+y;}
int sub(int x,int y){return x-y<0?x-y+mod:x-y;}
int mul(int x,int y){return 1LL*x*y%mod;}
#define N 20005
char s[N],t[N];
int a[N],b[N],ta[N],tb[N];
int c1,c2,n;
signed main()
{
	cin>>n;
	scanf("%s%s",s+1,t+1);
	if(s[1]=='1') ta[++c1]=0;
	for(int i=1;i<n;i++) if(s[i]!=s[i+1]) ta[++c1]=i;
	if(s[n]=='1') ta[++c1]=n;
	if(t[1]=='1') tb[++c2]=0;
	for(int i=1;i<n;i++) if(t[i]!=t[i+1]) tb[++c2]=i;
	if(t[n]=='1') tb[++c2]=n;
	for(int i=1;i<=c1;i++) a[i+c2]=ta[i];
	for(int i=c1+c2+1;i<=c1+c2+c2;i++) a[i]=n;
	// for(int i=1;i<=c1+c2+c2;i++) printf("%d ",a[i]); cout<<"\n";
	int ans=1e9;
	for(int i=0;i<=c2+c1;i+=2)
	{
		for(int j=1;j<=i;j++) b[j]=0;
		for(int j=1;j<=c2;j++) b[i+j]=tb[j];
		for(int j=i+c2+1;j<=c1+c2+c2;j++) b[j]=n;
		int R=0;
		// for(int i=1;i<=c1+c2+c2;i++) printf("%d ",b[i]); cout<<"\n";
		for(int j=1;j<=c1+c2+c2;j++) R+=abs(a[j]-b[j]);
		if(R<ans) ans=R;
	}
	cout<<ans<<endl;
	return 0;
}



Measured memory_bytes: 512
/*
   THE DARK NIGHT RISES
I LOVE YOU 72 AND WILL FOREVER DO SO
Patience, Persistence, Perseverance, Passion, Purpose
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;
const int N = 2e5 + 20 ;
#define F first
#define S second
# define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define pb push_back
#define mk make_pair
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define rep(i,a,b) for(ll i=a;i<b;i++)
typedef pair<int, int> ii;
typedef vector<int> vi;
typedef vector<ii> vii;
typedef vector<vi> vvi;
typedef vector<vii> vvii;
#define sz(x)       (int)x.size()
const long long int mod=1e9 + 7;
const long double EPS=1e-12;
#define mem( a, val ) memset(a, val, sizeof( a ) )
#define deci( x ) cout<<fixed<<setprecision( x );
#define bitcount( x ) __builtin_popcountll( x )
 
const int dx[8] = {-1, -1, -1, 0, 1, 1, 1, 0};
const int dy[8] = {-1, 0, 1, 1, 1, 0, -1, -1};
 
void solve()
{
    ll n , a, b ;
    cin >> n >> a >> b ;
    cout << ((n/(a+b))*(a) + min(a , n%(a+b)));
    
}
int main()
{
    fast;
    ll t;
    t=1;
    //cin>>t;
    while(t--)
    {
        solve();
    }
 
    return 0;
}
// Patience, Persistence, Perseverance, Passion, Purpose
// I LOVE YOU 72 AND WILL FOREVER DO SO.

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

int main(){
  int N,A,B;
  cin >> N>> A;
  B=N % 500; //BはNを500で割ったときのあまり
  if(B <= A){
    cout << "Yes" << endl;
  }
  else {
    cout << "No" <<endl;
  }
}
    

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define rep(i,n) for(int i=0;i<n;++i)
typedef long long ll;
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}

int main(){
   int n,k;
   cin >> n >> k;
   int cnt=0;
   rep(i,n){
      int h;
      cin >> h;
      if(h>=k) cnt++;
   }


   cout <<cnt<< endl;
   return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
using namespace std;
using ll = long long;

const int N = 100;
const int W = (int)1e5;
ll dp[W+1];

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

	int n, mw;
	cin >> n >> mw;
	for (int i = 0; i < n; ++i) {
		int w, v;
		cin >> w >> v;
		for (int j = mw - w; j >= 0; --j) {
			dp[j + w] = max(dp[j + w], dp[j] + v);
		}
	}
	ll res = 0;
	for (int j = 0; j <= mw; ++j) res = max(res, dp[j]);
	cout << res << '\n';
}


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

#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for(int64 i = 0;i < (n);i++)
#define FOR(i, a, b) for(int64 i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

const double eps = 1e-10;

template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;}
template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;}

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value!=0>::type
fill_v(U &u,const V... v){u=U(v...);}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value==0>::type
fill_v(U &u,const V... v){
  for(auto &e:u) fill_v<T>(e,v...);
}

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

int main(void) {
  vector<PLL> sol;
  PLL prin;
  PLL st;
  int64 H, W;
  cin >> H >> W;
  vector<string> f(H);
  REP(i, H) {
    cin >> f[i];
    REP(j, W) {
      if (f[i][j] == '@') prin = PLL(i, j);
      if (f[i][j] == '%') st = PLL(i, j);
      if (f[i][j] == '$') sol.push_back(PLL(i, j));
    }
  }
  using T = pair<int64, PLL>;
  priority_queue<T, vector<T>, greater<T>> pq;
  auto d = make_v<int64>(H, W);
  fill_v<int64>(d, INF_LL);
  d[st.fs][st.sc] = 0;
  pq.push(T(0, st));
  auto in = [&](int64 y, int64 x) { return 0<=y&&y<H&&0<=x&&x<W&&f[y][x]!='#'; };

  while (pq.size()) {
    int64 dd, x, y;
    PLL a;
    tie(dd, a) = pq.top(); pq.pop();
    tie(y, x) = a;
    if (d[y][x] < dd) continue;
    REP(i, 4) {
      int64 yy = y + dy[i], xx = x + dx[i];
      if (!in(yy, xx)) continue;
      if (d[yy][xx] > dd+1) {
        d[yy][xx] = dd+1;
        pq.push(T(dd+1, PLL(yy, xx)));
      }
    }
  }
  int64 res = d[prin.fs][prin.sc];
  bool ok = 1;
  REP(i, sol.size()) {
    if (d[sol[i].fs][sol[i].sc] <= res) ok = 0;
  }
  cout << (ok ? "Yes" : "No") << endl;
}


Measured memory_bytes: 4020
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h> // uint64_t

#define NUM_MAX 100000
#define BUF_SIZE (NUM_MAX*7+50)

int get_int(void) {
  int num;
#ifdef BUF_SIZE
  char line[BUF_SIZE];
  if(!fgets(line, BUF_SIZE, stdin)) return 0;
  sscanf(line, "%d", &num);
#else
#error
#endif
  return num;
}

// <arr[0]> <arr[1]> .. <arr[size-1]>
int fget_array(int *arr, int size) {
#ifdef BUF_SIZE
    char line[BUF_SIZE];
    char *tmpbuf = line;
    int i;
    if(!fgets(line, BUF_SIZE, stdin)) return -1;
    for(i = 0; i < size; i++) {
        char *tmp = strtok(tmpbuf, " ");
        arr[i] = strtol(tmp, NULL, 10);
        tmpbuf = NULL;
    }
#else
#error
#endif
    return 0;
}

#define min(a,b) ((a) > (b) ? (b) : (a))

int main(void) {
    int num = get_int();
    static int arr[NUM_MAX+1];
    static int dp[NUM_MAX+1];
    memset(dp, 0x3f, sizeof(int)*(NUM_MAX+1));
    fget_array(&arr[1], num);
    int i;
    dp[1] = 0;
    dp[2] = dp[1] + abs(arr[2] - arr[1]);
    for(i = 3; i <= num; i++) {
        dp[i] = min(dp[i], dp[i-1] + abs(arr[i]-arr[i-1]));
        dp[i] = min(dp[i], dp[i-2] + abs(arr[i]-arr[i-2]));
    }
    printf("%d\n", dp[num]);
    return 0;
}

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

const int ms = 1e2+9, inf = 0x3f3f3f3f;
int dp[ms][100009], w_v[ms][2];
int n, w;


int solve(int pos, int left_value){
  if(left_value == 0)
    return 0;
  if(pos >=n or left_value < 0)
    return inf;

  int &ans = dp[pos][left_value];
  if(~ans)
    return ans;

  ans = solve(pos+1, left_value);

  ans = min(ans, solve(pos + 1, left_value - w_v[pos][1]) + w_v[pos][0]);


  return ans;
}

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

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

  memset(dp, -1, sizeof dp);

  int ans = 0;
  for(int i = 0; i <=1e5; i++){ 
    int mini_w = solve(0, i);

    if(mini_w <= w)
      ans = i;
    
  }

  cout<<ans;


}

Measured memory_bytes: 42880
import sys
import itertools
sys.setrecursionlimit(1000000000)
from heapq import heapify,heappop,heappush,heappushpop

import collections

s = list(input())
s.sort()
ans = ""
for i in range(len(s)):
    ans += s[i]
if ans == "abc":
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3316
#include<bits/stdc++.h>
#define I64 "%I64d"
#define RAN(v)v.begin(),v.end()
#define pb push_back
#define lb lower_bound
#define ub upper_bound
using namespace std;
typedef long long ll;
template<class T>
inline void upd1(T&a,T b){a>b?a=b:0;}
template<class T>
inline void upd2(T&a,T b){a<b?a=b:0;}
struct ano{
	operator ll(){
		ll x=0,y=0,c=getchar();
		while(c<48)
			y=c==45,c=getchar();
		while(c>47)
			x=x*10+c-48,c=getchar();
		return y?-x:x;
	}
}buf;
const int N=1e5+5;
int c[N],w[N];
int main(){
	int n=buf,k=buf;
	ll a=0;
	for(int i=0;i<n;++i){
		c[i]=buf,w[i]=buf;
		if((c[i]&k)==c[i])a+=w[i];
	}
	for(int j=0;j<30;++j)
		if(~k>>j&1)k|=1<<j;
		else{
			ll s=0;
			for(int i=0;i<n;++i)
				if((c[i]&(k^1<<j))==c[i])s+=w[i];
			upd2(a,s);
		}
	printf("%lld\n",a);
}

Measured memory_bytes: 1024
#include <stdio.h>
#include <stdlib.h>//random,NULL
#include <string.h>
#include <time.h>
#include <unistd.h>//sleep()
#include <math.h>
#include <stdbool.h>

#define rep(i,n) for(int i=0; i<((int)n); i++)
#define REP(i,n) for(int i=0; i<=((int)n); i++)
#define srep(i,a,n) for(int i=a; i<((int)n); i++)
#define SREP(i,a,n) for(int i=a; i<=((int)n); i++)
#define rrep(i,n) for(int i=n-1; i>=0; i--)
#define RREP(i,n) for(int i=n; i>=0; i--)
#define INF 1000000000


int main(){
  char buf[1024];
  char buf2[100010];
  int N,Q;

  fgets(buf,sizeof(buf),stdin);
  sscanf(buf, "%d %d", &N, &Q);

  char *S=(char *)malloc(sizeof(char)*N);
  fgets(buf2,sizeof(buf2),stdin);
  sscanf(buf2, "%s", S);

  int *l=(int *)malloc(sizeof(int)*Q);
  int *r=(int *)malloc(sizeof(int)*Q);
  rep(i,Q){
    fgets(buf,sizeof(buf),stdin);
    sscanf(buf, "%d %d", &l[i], &r[i]);
    l[i]--;
    r[i]--;
  }

  int *point=(int *)malloc(sizeof(int)*N);
  int count=0;
  int number=0;
  while(number<N){
    if(number<N-1 && (S[number]=='A' && S[number+1]=='C')){
      point[number]=count+1;
      point[number+1]=count+2;
      count=count+2;
      number=number+2;
    }
    else{
      point[number]=count;
      number++;
    }
  }

  // rep(i,N){
  //   printf("%d\n", point[i]);
  // }

  rep(i,Q){
    int first, second;
    if(point[l[i]]%2!=0){
      first=point[l[i]]-1;
    }
    else{
      first=point[l[i]];
    }

    if(point[r[i]]%2!=0){
      second=point[r[i]]-1;
    }
    else{
      second=point[r[i]];
    }
    printf("%d\n", (second-first)/2);
  }

  return 0;

}


Measured memory_bytes: 2176
#include <iostream>
#include <vector>
#include <boost/multiprecision/cpp_int.hpp>
#define rep0(i, n) for(int i=0; i<(int)(n);i++)
typedef int64_t lint;
using namespace std;

int main(){
    lint n, k;
    cin >> n >> k;
    vector<lint> a(n);
    rep0(i, n){
        cin >> a[i];
    }
    lint kk = k * (k - 1) / 2;
    boost::multiprecision::cpp_int ans = 0;
    for (int i = 0; i < n; ++i) {
        lint left = 0;
        lint right = 0;
        for (int j = 0; j < n; ++j) {
            if(a[i] > a[j]){
                if(i > j)left ++ ;
                if(i < j)right ++ ;
            }
        }
        rep0(j,left)
        {
            ans += kk;
        }
        //ans += kk * left;

        rep0(j,right)
        {
            ans += kk;
            ans += k;
        }
        ans %= 1000000007;
    }
    cout << ans << endl;
}

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

int main() {
  using LL = long long;
  struct Point {LL x, y;};

  LL N;
  cin >> N;
  vector<Point> P(N);
  for(auto& p: P) cin >> p.x >> p.y;

  auto parity = abs(P[0].x+P[0].y)&1;
  for(const auto& p: P) if((abs(p.x+p.y)&1) != parity) {
    cout << -1 << endl;
    exit(0);
  }

  auto m = 31ll;
  vector<LL> d;
  for(auto i=m-1; 0<=i; --i) d.emplace_back(1ll<<i);
  if(!parity) d.emplace_back(1ll), ++m;

  cout << m << endl;
  for(auto i: d) cout << (i==d.front() ? "" : " ") << i;
  cout << endl;
  for(const auto& p: P) {
    auto x = p.x;
    auto y = p.y;
    for(auto i: d) {
      if(abs(x)<abs(y)) {
        if(y<0) {y += i; cout << "D";}
        else    {y -= i; cout << "U";}
      } else {
        if(x<0) {x += i; cout << "L";}
        else    {x -= i; cout << "R";}
      }
    }
    cout << endl;
  }
}


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

class D
{
	static void Main()
	{
		var h = Console.ReadLine().Split().Select(int.Parse).ToArray();
		var k = h[1];
		var s = Console.ReadLine();

		var g = new List<int>();
		var tc = '1';
		var tn = 0;
		foreach (var c in s)
		{
			if (c != tc)
			{
				g.Add(tn);
				tc = c;
				tn = 0;
			}
			tn++;
		}
		g.Add(tn);
		if (tc == '0') g.Add(0);

		int M = g.Take(2 * k + 1).Sum(), t = M;
		for (int l = 0, r = 2 * k + 2; r < g.Count; l += 2, r += 2)
			M = Math.Max(M, t += g[r] + g[r - 1] - g[l + 1] - g[l]);
		Console.WriteLine(M);
	}
}


Measured memory_bytes: 14048
package main

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

const debug = true

var sc = bufio.NewScanner(os.Stdin)

/*-----------Main-----------*/

func main() {
	a := readS()
	b := readS()

	num, _ := strconv.Atoi(a + b)

	x := 0
	for x*x <= num {
		if x*x == num {
			fmt.Println("Yes")
			return
		}
		x++
	}
	fmt.Println("No")
}

/*-----------Utilities-----------*/

func init() {
	if debug {
		testFile, err := os.Open("./test/sample-3.in")
		if err == nil {
			sc = bufio.NewScanner(testFile)
		}

	}
	const maxBuf = 200100
	var buf []byte = make([]byte, maxBuf)
	sc.Split(bufio.ScanWords)
	sc.Buffer(buf, maxBuf)
}

func readS() string {
	sc.Scan()
	return sc.Text()
}

func readI() int {
	sc.Scan()
	r, _ := strconv.Atoi(sc.Text())
	return r
}

func readF() float64 {
	sc.Scan()
	r, _ := strconv.ParseFloat(sc.Text(), 64)
	return r
}


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

#define pb push_back
#define mp make_pair
#define F first
#define S second
#define FOR(i, a, b) for(int i = a; i < b; i++)
#define sizeOf(A) (sizeof(A))/(sizeof(A[0]))
#define odd(x) ((x) % (2))
#define fastio ios_base::sync_with_stdio(false), cin.tie(0);
#define fileio freopen("template.in", "r", stdin), freopen("template.out", "w", stdout);
typedef long long ll;
const ll MOD = 1e9 + 7;

int main() {
    fastio;
    //fileio;

    int l, r, d;
    cin >> l >> r>> d;
    int count = 0;
    FOR(i, l, r+1) {
        if (i % d == 0) {
            count++;
        }
    }
    cout << count << "\n";
    return 0;
}


Measured memory_bytes: 3636