akhauriyash/Code-Regression huggingface dataset:
// Standard I/O
#include <iostream>
#include <sstream>
#include <cstdio>
// Standard Library
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <cmath>
// Template Class
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
// Container Control
#include <algorithm>

using namespace std;

#define rep( i, n ) for( int i = 0; i < n; ++i )
#define irep( i, n ) for( int i = n-1; i >= 0; --i )
#define reep( i, s, n ) for ( int i = s; i < n; ++i )
#define ireep( i, n, s ) for ( int i = n-1; i >= s; --i )
#define foreach(itr, x) for( typeof(x.begin()) itr = x.begin(); itr != x.end(); ++itr)

#define mp make_pair
#define mt make_tuple
#define pb push_back
#define eb emplace_back
#define all( v ) v.begin(), v.end()
#define fs first
#define sc second
#define vc vector

// for visualizer.html
double SCALE = 1.0;
double OFFSET_X = 0.0;
double OFFSET_Y = 0.0;
#define LINE(x,y,a,b) cerr << "line(" << SCALE*(x) + OFFSET_X << ","	\
	<< SCALE*(y) + OFFSET_Y << ","										\
	<< SCALE*(a) + OFFSET_X << ","										\
	<< SCALE*(b) + OFFSET_Y << ")" << endl;
#define CIRCLE(x,y,r) cerr << "circle(" << SCALE*(x) + OFFSET_X << ","	\
	<< SCALE*(y) + OFFSET_Y << ","										\
	<< SCALE*(r) << ")" << endl;

typedef long long ll;
typedef complex<double> Point;

typedef pair<int, int> pii;
typedef pair<int, pii> ipii;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector< vector<int> > vii;
typedef vector< vector<double> > vdd;

typedef vector<int>::iterator vi_itr;

const int IINF = 1 << 28;
const double INF = 1e30;
const double EPS = 1e-10;
const double PI = acos(-1.0);

// Direction : L U R D
const int dx[] = { -1, 0, 1, 0};
const int dy[] = { 0, -1, 0, 1 };

int main()
{
	int h, w;
	
	cin >> h >> w;
	string ans = "";
	rep(i, h) rep(j, w){
		string str;
		cin >> str;
		if( str == "snuke" ){
			char a = 'A' + j;
			ans = a + to_string(i+1);
		}
	}

	cout << ans << endl;
}


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

#define rep(i, n) REP(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define MSG(a) cout << #a << " " << a << endl;
#define REP(i, x, n) for (int i = x; i < n; i++)
#define OP(m) cout << m << endl
typedef long long ll;
typedef unsigned long long ull;

int main()
{
    int t, h, s;
    while (cin >> t >> h >> s)
    {
        if (t == -1 && h == -1 && s == -1)
            break;

        int n = 7200 - (t * 3600 + h * 60 + s);
        int f = 3 * n;

        printf("%02d:%02d:%02d\n", n / 3600, n % 3600 / 60, n % 60);
        printf("%02d:%02d:%02d\n", f / 3600, f % 3600 / 60, f % 60);
    }
    return 0;
}


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

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


Measured memory_bytes: 3136
#include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
#define ll long long
#define rep(i,n) for(int i = 0; i < int(n); i++)
#define vi vector<int>
using namespace std;
const int INF = 1001001001;
const int MOD = 1e9+7;
const int dx[] = {-1, 0, 1, 0};
const int dy[] = {0, 1, 0, -1};
template<class T> inline bool chmax(T &a, const T &b){ if(a<b) { a=b; return 1; } return 0; }
template<class T> inline bool chmin(T &a, const T &b){ if(b<a) { a=b; return 1; } return 0; }

ll num(string x){
  ll res = 0;
  rep(i,x.size()){
    res *= 10;
    res += x[i]-'0';
  }
  return res;
}

int main(){
  cin.tie(0), ios::sync_with_stdio(false);
  string s; cin >> s;
  int n = s.size();
  ll ans = 0;
  rep(bit,1<<(n-1)){
    vector<string> split;
    int p = 0;
    rep(i,n-1){
      if(bit>>i & 1){
        split.push_back(s.substr(p,i-p+1));
        p = i+1;
      }
    }
    split.push_back(s.substr(p,n));
    for(auto x : split) ans += num(x);
  }
  cout << ans;
  cout << "\n";
  return 0;
}


Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
using graph = vector<vector<int>>;

vector<int> strongly_connected_component(const graph& G) {
	int n = G.size(), idx = 0, k = 0, s = 0;
	vector<int> ord(n, -1), stk(n), low(n), onS(n), cmp(n);
	function<void(int)> dfs = [&](int v) {
		ord[v] = low[v] = idx++;
		stk[s++] = v;
		onS[v] = true;
		for (int w : G[v]) {
			if (ord[w] == -1) dfs(w);
			if (!onS[w]) continue;
			low[v] = min(low[v], low[w]);
		}
		if (low[v] == ord[v]) {
			while (true) {
				int w = stk[--s];
				onS[w] = false; cmp[w] = k;
				if (w == v) break;
			}
			++k;
		}
	};
	for (int v = 0; v < n; ++v) {
		if (ord[v] == -1) dfs(v);
	}
	return cmp;
}

int main()
{
	ios::sync_with_stdio(false), cin.tie(0);
	int n, m;
	cin >> n >> m;
	graph G(n);
	for (int i = 0; i < m; i++) {
		int s, t;
		cin >> s >> t;
		G[s].push_back(t);
	}
	auto scc = strongly_connected_component(G);
	int q;
	cin >> q;
	while (q--) {
		int u, v;
		cin >> u >> v;
		puts(scc[u] == scc[v] ? "1" : "0");
	}
	return 0;
}



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

#define forn(i, n) for (int i = 0; i < int(n); ++i)
#define for1(i, n) for (int i = 1; i <= int(n); ++i)
#define fore(i, l, r) for (int i = int(l); i <= int(r); ++i)
#define ford(i, n) for (int i = int(n)-1; i >= 0; --i)
#define pb push_back
#define eb emplace_back
#define ms(a, x) memset(a, x, sizeof(a))
#define F first
#define S second
#define endl '\n'
#define all(x) (x).begin(),(x).end()
#define de(x) cout<<#x<<" = "<<(x)<<endl
#define de2(x,y) cout<<#x<<" = "<<(x) <<' '<< #y<<" = "<<y<<endl;

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
const int INF = 0x3f3f3f3f;
mt19937 gen(chrono::high_resolution_clock::now().time_since_epoch().count());
ll nxt(){ll x;cin>>x;return x;}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
	int h,w,k;
	cin>>h>>w>>k;
	vector<string> a(h);
	for(auto& it:a) cin>>it;
	int ans=INF;
	forn(par,1<<(h-1)){
		int sz=1+__builtin_popcount(par);
		vector<int> cnt(sz);
		int tmp=__builtin_popcount(par);
		int last=0;
		forn(i,w){
			int now=0;
			forn(j,h){
				if(a[j][i]=='1') cnt[now]++;
				if(par>>j&1) now++;
			}
			if(*max_element(all(cnt))>k){
				if(i==last){
					tmp=INF;
					break;
				}
				tmp++;
				cnt=vector<int>(sz);
				last=i;
				i--;
			}
		}
		ans=min(ans,tmp);
	}
	cout<<ans;
    return 0;
}



Measured memory_bytes: 384
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        if (a <= 5) {
            System.out.println(0);
        } else if (a >= 6 && a <= 12) {
            System.out.println(b / 2);
        } else {
            System.out.println(b);
        }
    }
}

Measured memory_bytes: 25044
from heapq import heappush, heappop
from bisect import bisect_left, bisect_right
from collections import deque, defaultdict
from itertools import combinations, permutations, combinations_with_replacement
from itertools import accumulate
from math import ceil, sqrt, pi

MOD = 10 ** 9 + 7
INF = 10 ** 18

S = input()
T = input()

print("Yes" if S + T[-1] == T else "No")

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

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

Measured memory_bytes: 3628
import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.InputStreamReader;
import java.io.OutputStreamWriter;
import java.util.*;

public class Main {

    private static final class FastInput {
        private final BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        private StringTokenizer st;

        private int nextInt() throws Exception {
            return Integer.parseInt(nextWord());
        }

        private long nextLong() throws Exception {
            return Long.parseLong(nextWord());
        }

        private String nextWord() throws Exception {
            if (st == null || !st.hasMoreElements()) st = new StringTokenizer(br.readLine(), " ");
            return st.nextToken();
        }

        private long[] lineToIntArr(int len) throws Exception {
            long[] arr = new long[len];
            for (int i = 0; i < arr.length; i++) arr[i] = nextLong();
            return arr;
        }
    }

    public static void main(String[] args) throws Exception {
        FastInput in = new FastInput();
        int n = in.nextInt();
        long[] stones = in.lineToIntArr(n);
        long[] dp = new long[n + 1];
        dp[0] = 0;
        dp[1] = Math.abs(stones[1] - stones[0]);
        for (int i = 2; i < stones.length; i++) {
            dp[i] = Math.min(dp[i - 1] + Math.abs(stones[i] - stones[i - 1]), dp[i - 2] + Math.abs(stones[i] - stones[i - 2]));
        }
        BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(System.out));
        bw.write(String.valueOf(dp[n - 1]));
        bw.flush();
    }
}


Measured memory_bytes: 34136
#include <cassert>
#include <cstdio>
#include <cmath>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>

const int MOD = 1000000007, INF = 1111111111;
using namespace std;
using lint = long long;

template <class T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
	for (int i = 0; i < (int)vec.size(); i++) {
		os << vec[i] << (i + 1 == vec.size() ? "" : " ");
	}
	return os;
}

#ifdef _DEBUG
template <class Head>
void dump(const char* str, Head &&h) { cerr << str << " = " << h << "\n"; };
template <class Head, class... Tail>
void dump(const char* str, Head &&h, Tail &&... t) {
	while (*str != ',') cerr << *str++; cerr << " = " << h << "\n";
	dump(str + 1, t...);
}
#define DMP(...) dump(#__VA_ARGS__, __VA_ARGS__)
#else 
#define DMP(...) ((void)0)
#endif

template<class T = lint>
struct Edge {
	int to;
	T cost;
	Edge() {}
	Edge(int to, T cost = 1) : to(to), cost(cost) {}
	bool operator>(const Edge &r) const { return this->cost > r.cost; }
};

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	int N, M;
	cin >> N >> M;

	int u, v, len;
	vector<vector<Edge<int>>> edges(N);
	for (int i = 0; i < M; i++) {
		cin >> u >> v;
		u--, v--;
		edges[u].emplace_back(v);
		edges[v].emplace_back(u);
	}

	bool flag = false;
	for (const auto &e1 : edges[0]) {
		for (const auto &e2 : edges[e1.to]) {
			if (e2.to == N - 1) flag = true;
		}
	}

	if (flag) cout << "POSSIBLE" << "\n";
	else cout << "IMPOSSIBLE" << "\n";

	return 0;
}

Measured memory_bytes: 12776
import java.util.Arrays;
import java.util.Scanner;

//Traffic Analysis
public class Main{

	void run(){
		Scanner sc = new Scanner(System.in);
		while(true){
			int n = sc.nextInt();
			int m = sc.nextInt();
			if((n|m)==0)break;
			int[] a = new int[n+m+1];
			for(int i=1;i<=n+m;i++)a[i]=sc.nextInt();
			Arrays.sort(a);
			int max = 0;
			for(int i=1;i<=n+m;i++)max = Math.max(max, a[i]-a[i-1]);
			System.out.println(max);
		}
	}
	
	public static void main(String[] args) {
		new Main().run();
	}
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#define f first
#define s second
#define pb push_back
#define pii pair<int, int>
#define endl '\n'
#define vi vector<int>
#define vvi vector<vi>
#define pii pair<int, int>
#define vpii vector<pii>
typedef long long ll;
typedef long double ld;
using namespace std;
template<class T> using minheap = priority_queue<T, vector<T>, greater<T>>;

const int N = 3e5 + 10;
int a[N];
int cnt[N];
int ans[N];
int n;

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

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

  multiset<int> z;
  for (int i = 1; i <= n; i++) {
    if (cnt[i]) z.insert(cnt[i]);
  }

  for (int i = n; i >= 1; i--) {
    if (z.size() < i) {
      ans[i] = 0;
    } else {
      ans[i] = *z.begin();
    }
    if (z.size() == i && i > 1) {
      int v = *z.begin();
      z.erase(z.find(v));
      while (v--) {
        int u = *z.begin();
        z.erase(z.find(u));
        ++u;
        z.insert(u);
      }
    }
  }

  for (int i = 1; i <= n; i++) {
    cout << ans[i] << endl;
  }
  return 0;
}

Measured memory_bytes: 17792
N, qms = map(int, input().split())

raw_proc = [input() for i in range(N)]
queue = [{} for i in range(N+1)]
for i in range(N):
    name, time = raw_proc[i].split()
    time = int(time)
    queue[i] = {"name": name, "time": time}

def enque(tail, p):
    queue[tail] = p
    tail = (tail+1) % (N+1)
    return tail

def deque(head):
    proc = queue[head]
    head = (head+1) % (N+1)
    return proc, head


if __name__ == '__main__':
    head = 0
    tail = N
    total_time = 0
    while head != tail:
        p, head = deque(head)
        t = min(qms, p["time"])
        p["time"] = p["time"] - t
        total_time += t
        if p["time"] > 0:
            tail = enque(tail, p)
        else:
            print("{} {}".format(p["name"], total_time))


Measured memory_bytes: 24316
#include <cassert>
#include <functional>
#include <utility>
#include <vector>

template <typename T, class Container = std::vector<T>,
	class Compare = std::less<typename Container::value_type>>
	class IntervalHeap {

	public:
		using container_type = Container;
		using value_compare = Compare;
		using value_type = typename container_type::value_type;
		using reference = typename container_type::reference;
		using const_reference = typename container_type::const_reference;
		using size_type = typename container_type::size_type;

	protected:
		container_type c;
		value_compare comp;

	private:
		static constexpr size_type z = ~static_cast<size_type>(1);
		bool normalize(const size_type x, const size_type y) {
			if (!comp(c[y], c[x]))
				return false;
			std::swap(c[x], c[y]);
			return true;
		}
		void build() {
			const size_type s = size() + 1;
			if (s & 1) {
				normalize(s & z, s);
				buildmin(s >> 1);
				buildmax(s >> 1);
				return;
			}
			if (s == 2)
				return;
			if (normalize(s, s >> 1 | 1))
				buildmax(s >> 2);
			buildmin(s >> 1);
		}
		void buildmin(size_type i) {
			while (i > 1 && normalize(i & z, i << 1))
				i >>= 1;
		}
		void buildmax(size_type i) {
			while (i > 1 && normalize(i << 1 | 1, i | 1))
				i >>= 1;
		}

	public:
		explicit IntervalHeap(const value_compare &x = Compare()) : c(2), comp(x) {}
		bool empty() const { return c.size() == 2; }
		size_type size() const { return c.size() - 2; }
		const_reference min() const {
			assert(!empty());
			return c[2];
		}
		const_reference max() const {
			assert(!empty());
			return size() == 1 ? c[2] : c[3];
		}
		void push(const value_type &x) {
			c.push_back(x);
			build();
		}
		void push(value_type &&x) {
			c.push_back(std::move(x));
			build();
		}
		template <class... Args> void emplace(Args &&... args) {
			c.emplace_back(std::forward<Args>(args)...);
			build();
		}
		void pop_min() {
			assert(!empty());
			const size_type s = size() + 1;
			std::swap(c[2], c[s]);
			c.pop_back();
			size_type i = 4;
			while (i < s) {
				if ((i | 2) < s && !comp(c[i], c[i | 2]))
					i |= 2;
				if (!normalize(i >> 1 & z, i))
					break;
				if ((i | 1) < s)
					normalize(i, i | 1);
				i <<= 1;
			}
		}
		void pop_max() {
			assert(!empty());
			const size_type s = size() + 1;
			if (s == 2)
				return pop_min();
			std::swap(c[3], c[s]);
			c.pop_back();
			size_type i = 5;
			while (i < s) {
				if ((i | 2) < s && !comp(c[i | 2], c[i]))
					i |= 2;
				if (!normalize(i, i >> 1 | 1))
					break;
				normalize(i & z, i);
				i = (i & z) << 1 | 1;
			}
		}
};


#include<iostream>
#include<string>
#include<vector>

int main() {
	IntervalHeap<int,std::vector<int>,std::greater<int>> Q;
	std::string s;
	int k;
	std::cin >> s;
	while (s[2] != 'd') {
		if (s[0] == 'i') {
			std::cin >> k;
			Q.push(k);
		}
		else {
			std::cout << Q.min() << std::endl;
			Q.pop_min();
		}
		std::cin >> s;
	}
	return 0;
}


Measured memory_bytes: 6980
#include <stdio.h>
#include <stdlib.h>

int main(void){
  int a, b, c;

  if(scanf("%d%d", &a, &b) == -1) {
    fprintf(stderr, "error: ill-formed fraction.\n");
    exit(1);
  }
  
  c = (double)(b - 1) / (double)(a - 1) + 0.99999;
 
  printf("%d", c);
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
const auto start_time = std::chrono::high_resolution_clock::now();
void timecalculater(){
    #ifndef ONLINE_JUDGE
    auto end_time = std::chrono::high_resolution_clock::now();
    std::chrono::duration<double> diff = end_time-start_time;
    cerr<<"Time Taken : "<<diff.count()<<"\n";
    #endif
}
void __print(int x) {cout << x;}
void __print(long x) {cout << x;}
void __print(long long x) {cout << x;}
void __print(unsigned x) {cout << x;}
void __print(unsigned long x) {cout << x;}
void __print(unsigned long long x) {cout << x;}
void __print(float x) {cout << x;}
void __print(double x) {cout << x;}
void __print(long double x) {cout << x;}
void __print(char x) {cout << '\'' << x << '\'';}
void __print(const char *x) {cout << '\"' << x << '\"';}
void __print(const string &x) {cout << '\"' << x << '\"';}
void __print(bool x) {cout << (x ? "true" : "false");}
template<typename T, typename V>
void __print(const pair<T, V> &x) {cout << '{'; __print(x.first); cout << ','; __print(x.second); cout << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cout << '{'; for (auto &i: x) cout << (f++ ? "," : ""), __print(i); cout << "}";}
void _print() {cout << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cout << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cout << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif
#define rep(i, n) for(ll i = 0; i < (n); ++i)
#define repA(i, a, n) for(int  i = a; i <= (n); ++i)
#define all(x) x.begin(), x.end()
#define sz(x) (int) (x).size()
#define fill(a) memset(a, 0, sizeof(a))
#define fst first
#define snd second
#define mp make_pair
#define pb push_back
#define endl '\n'
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<long long, long long> pll;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long long int> vll;
typedef vector<pii> vii;
int main() {
  
    cin.sync_with_stdio(0); cin.tie(0);
    cin.exceptions(cin.failbit);
    int T=1;
    // cin>>T;
    while(T--){
        int m,n;cin>>n>>m;
        int a[n];rep(i,n)cin>>a[i];
        string ans="Yes";
        int s=0;
        rep(i,n)s=s+a[i];
        int y=s/(4*m);
        if(s%(4*m)==0)y--;
        int cnt=0;
        rep(i,n){
            if(a[i]>y)cnt++;
        }
        if(cnt<m)ans="No";
        cout<<ans;
    }   
    timecalculater();
    return 0;   
}   

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <set>
#include <queue>
#include <stack>
#include <tuple>
#include <cmath>
#include <iomanip>
#include <map>
#include <cstring> //memset(dp,0,sizeof(dp))
#include <functional>
#include <cctype>
#include <locale>
#define ll long long
#define rep(i,n) for(int i=0;i<(n);i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define fi first
#define se second
#define pb push_back
#define ALL(a) (a).begin(),(a).end()
using namespace std;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
typedef pair<int,int> P;
typedef pair<long long,long long> Pll;
#define fout(num) cout << fixed << setprecision(20) << (num) << endl
//s[i]=tolower(s[i]); islower(s[i]); cout << tolower(s[i])はバグ
//vector<vector<ll>> dp(n,vector<ll>(n))


signed main(){
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    int n; cin >> n;
    string s; cin >> s;
    bool dp[n][1000][3];
    rep(i,n)rep(j,1000)rep(k,3)dp[i][j][k]=0;
    rep(i,n){
        int x=s[i]-'0';
        if(i==0) dp[0][x][0]=1;
        else{
            dp[i][x][0]=1;
            rep(j,1000){
                rep(k,3) if(dp[i-1][j][k]) dp[i][j][k]=1;
                rep(k,2){
                    if(dp[i-1][j][k]){
                        int z=10*j+x;
                        if(z<1000) dp[i][z][k+1]=1;
                    }
                }
            }
        }
    }
    int ans=0;
    rep(i,1000)if(dp[n-1][i][2]){ans++;}
    cout<<ans<<endl;
}


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

int main()
{
string s,t;
  vector<int>v;
  cin>>s>>t;
  int sl=s.size(),tl=t.size();
  for(int i=0;i<=sl-tl;i++)
  { int cnt=0; 
    for(int j=0;j<tl;j++)
    if(s[i+j]!=t[j]) cnt++;
   
   v.push_back(cnt);
  }
  sort(v.begin(),v.end());
  cout<<v[0];
}

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

#define REP(i, n) for(decltype(n) i = 0; i < (n); i++)
#define REP2(i, x, n) for(decltype(x) i = (x); i < (n); i++)
#define REP3(i, x, n) for(decltype(x) i = (x); i <= (n); i++)
#define RREP(i, n) for (decltype(n) i = (n) - 1;i >= 0; i--)

#define ALL(a) (a).begin(),(a).end()
#define SORT(c) sort((c).begin(),(c).end())
#define DESCSORT(c) sort(c.begin(), c.end(), greater<int>())

#define LL long long int
#define LD long double

#define INF 1000000000
#define PI 3.14159265358979323846

#define _CRT_SECURE_NO_WARNINGS

using namespace std;

// N, E, S, W
const int dx[4] = { -1, 0,  1,  0 };
const int dy[4] = { 0, 1,  0, -1 };

typedef pair<int, int> pii;
typedef pair<LL, LL> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<LL> vll;
//==============================================
int ans = 0;

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

	string s;
	cin >> s;

	for (int i = 0; i + 1 < s.size(); i++) {
		if (s[i] == s[i + 1]) {
			cout << i + 1 << " " << i + 2 << "\n";
			return 0;
		}
	}

	for (int i = 0; i + 2 < s.size(); i++) {
		if (s[i] == s[i + 2]) {
			cout << i + 1 << " " << i + 3 << "\n";
			return 0;
		}
	}

	cout << "-1 -1" << "\n";
	return 0;
}

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

using ll = long long;

#define dump(x) cerr << #x << "=" << x << endl
#define dump2(x, y) cerr << #x << "=" << x << "," << #y << "=" << y << endl
#define dump3(x, y, z)                                                     \
  cerr << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z \
       << endl
#define check(s) cerr << s << endl

#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 all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define unique(v) v.erase(unique(v.begin(), v.end()), v.end());

vector<int> dx = {0, 1, 0, -1};
vector<int> dy = {1, 0, -1, 0};

const ll LINF = 2e18;
const int INF = 1e9;

ll f(ll X) {
  if (X == 0) return 0;
  ll pc = __builtin_popcountll(X);
  return f(X % pc) + 1;
}

void solve(ll N, std::string X) {
  ll pc = 0;  // x's popcount
  rep(i, N) if (X.at(i) == '1') pc++;

  vector<ll> ans(N);

  rep(b, 2) {  // b=0: 変更する桁が0の場合、 b=1: 反転する桁が1の場合
    ll npc = b == 0 ? pc + 1 : pc - 1;
    if (npc <= 0) continue;
    ll r0 = 0;  // X (mod Popcount(X) +- 1)
    rep(i, N) {
      r0 = (r0 * 2) % npc;
      if (X.at(i) == '1') r0++;
    }

    ll k = 1;  // 2^i
    repr(i, N - 1) {
      if (X.at(i) - '0' == b) {  // 反転対象の桁の場合
        ll r = r0;               // (X + 2^k) (mod Popcount(X) +- 1)
        if (b == 0) {
          r = (r + k) % npc;
        } else {
          r = (r - k + npc) % npc;
        }
        ans.at(i) = f(r) + 1;
      }
      k = (k * 2) % npc;
    }
  }
  rep(i, N) { cout << ans.at(i) << endl; }
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll N;
  cin >> N;
  string X;
  cin >> X;

  solve(N, X);
  return 0;
}


Measured memory_bytes: 5136
#include <bits/stdc++.h>
using namespace std;
#define endl 		'\n'
#define pb 			push_back
#define mp 			make_pair
#define F 			first
#define S 			second
#define ll 			long long
#define ld 			long double
#define read(x)		cin >> x
#define read2(x,y)	cin >> x >> y
#define read3(x,y,z)	cin >> x >> y >> z
#define print(x)	cout << x << endl
#define print2(x,y)	cout << x << ", " << y << endl
#define print3(x,y,z)	cout << x << ", " << y << ", " << z << endl
#define pii 		pair<int, int>
#define mii			map<int, int>
#define vi 			vector<int>
#define vd 			vector<double>
#define vll 		vector<ll>
#define vld 		vector<ld>
#define vpii 		vector<pii>
#define all(arr) 	arr.begin(), arr.end()
#define TC()		int tc;	read(tc); while(tc--)
const int mod = 1e9 + 7;
const int _mod = 998244353;
const int INF = 1000000000;
const ll INF64 = (ll)1E18;
const int N = 5*(1<<17); 	// 17 : 1e5, 20 : 1e6

vi graph[N];
bool visited[N];
vi order;

void dfs(int u) {
	for(int v : graph[u]) {
		if(!visited[v]) {
			visited[v] = true;
			dfs(v);
		}
	}
	order.pb(u);
}

int main() {
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);

	int n, m;
	read2(n, m);
	while(m--) {
		int u, v;
		read2(u, v);
		graph[u].pb(v);
	}

	// toposort
	for(int i = 1; i <= n; i++) {
		if(!visited[i]) {
			visited[i] = true;
			dfs(i);
		}
	}

	reverse(all(order));
	vi dist(n+1, -INF);
	for(int u : order) {
		dist[u] = max(0, dist[u]);
		for(int v : graph[u]) {
			dist[v] = max(dist[v], dist[u] + 1);
		}
	}
	cout << *(max_element(all(dist)));
	return 0;
}

Measured memory_bytes: 21752
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>

#define MAXN 3005

using namespace std;

int dp[MAXN][MAXN];

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

    string s1, s2;
    cin >> s1 >> s2;
    int n = s1.size(), m = s2.size();
    for(int i = 1; i <= n; i++) {
        for(int j = 1; j <= m; j++) {
            if(s1[i - 1] == s2[j - 1]) {
                dp[i][j] = 1 + dp[i - 1][j - 1];
            }
            else {
                dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]);
            }
        }
    }
    int idx = dp[n][m];
    char res[idx + 1];
    res[idx] = '\0';
    int i = n, j = m;
    while(i > 0 && j > 0) {
        if(s1[i - 1] == s2[j - 1]) {
            res[--idx] = s1[i - 1];
            i--;
            j--;
        }
        else if(dp[i - 1][j] > dp[i][j - 1]) {
            i--;
        }
        else {
            j--;
        }
    }
    cout << string(res) << '\n';

    return 0;
}

Measured memory_bytes: 38776
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <functional>
#include <sstream>
#include <string>
#include <utility>
#include <map>
#include <memory>
#include <set>
#include <vector>
#include <deque>
#include <list>
#include <stack>
#include <queue>

using namespace std;

class PriorityQueue
{
public:
  vector<int> q;
  int solve();
  int insert( int x );
  int extractMax();
  int maxHeapify( int i );
};

int PriorityQueue::solve()
{
  string com;
  int a;

  q.push_back( 0 );

  while ( ( cin >> com ) && com !=  "end" )
    {
      if ( com == "insert" )
        {
          cin >> a;
          insert( a );
        }
      else
        {
          cout << extractMax() << endl;
        }
    }
    
  return 0;
}

int PriorityQueue::insert( int x )
{
  q.push_back( x );
  maxHeapify( q.size() - 1 );
  return 0;
}

int PriorityQueue::extractMax()
{
  int ret = q[1];
  q[1] = -1;

  int p = 1;
  int l = p * 2;
  int r = l + 1;

  while ( l < (int)q.size() )
    {
      if ( r < (int)q.size() )
        {
          if ( q[l] > q[r] )
            {
              swap( q[p], q[l]);
              p = l;
            }
          else
            {
              swap( q[p], q[r] );
              p = r;
            }
          l = p * 2;
          r = l + 1;
        }
      else
        {
          swap( q[p], q[l] );
          p = l;
          l = p * 2;
          r = l + 1;
        }
    }
  return ret;
}

int PriorityQueue::maxHeapify( int i )
{
  int p = i / 2;

  while ( p > 0 && q[p] < q[i] )
    {
      swap( q[p], q[i] );
      i = p;
      p = i / 2;
    }
  
  return 0;
}

int main()
{
  PriorityQueue pq;

  pq.solve();

  return 0;
}

Measured memory_bytes: 11232
#include<bits/stdc++.h>
#define int long long int
#define boost ios_base::sync_with_stdio(false)
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repp(i,a,b) for(int i=a;i<=b;i++)
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
using namespace std;
#define test int t; cin>>t; while(t--)
signed main()
{
    int n; cin>>n;
    int dp[n+1][3]={0},arr[n+1][3];
    repp(i,1,n)
    {
        rep(j,0,3)cin>>arr[i][j];
    }
    dp[1][0]=arr[0][0]; dp[1][1]=arr[0][1]; dp[1][2]=arr[1][2];
    repp(i,1,n)
    {
        rep(j,0,3)
        {
            dp[i][j]=arr[i][j]+max(dp[i-1][(j+1)%3],dp[i-1][(j+2)%3]);
        }
    }
    cout<<max(dp[n][0],max(dp[n][1],dp[n][2]));
}


Measured memory_bytes: 4992
import java.util.*;

public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int m = Integer.parseInt(sc.next());
        sc.close();

        // 主処理
        int result = 48 - m;

        // 出力
        System.out.println(result);
    }
}


Measured memory_bytes: 21716
//                                                              ۡمِ ٱللهِ ٱلرَّحۡمَـٰنِ ٱلرَّحِيمِ‎
//created by --------> Aslan Nesipbay;

#include<bits/stdc++.h>

#define F first
#define S second

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef stringstream SS;
typedef pair< ll, ll > pll;

const ll N = 10e5 + 5;
const ll NN = 105;
const double pi = 3.14159;
const ll MAX = 2e5 + 123;
const ll MOD = 1e9 + 7;
const ll INF = 1000000000000000000;
const ll pw = 31;

void speed()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
}

ll n, k, a[N];

void hajime()
{
    cin >> n >> k;
    vector <ll> dp (n + 1, INF);
    for (ll i = 1; i <= n; i ++) cin >> a[i];
    dp[1] = 0;
    for (ll i = 2; i <= min (n, k); i ++)
    {
        for (ll j = 1; j < i; j ++)
        {
            dp[i] = min (abs (a[j] - a[i]) + dp[j], dp[i]);
        }
    }
    for (ll i = min(n, k + 1); i <= n; i ++)
    {
        for (ll j = i - min (n, k); j < i; j ++)
        {
            dp[i] = min (abs (a[j] - a[i]) + dp[j], dp[i]);
        }
    }
    cout << dp[n];
}

int main()
{
    ll miyagi = 1;
    //scanf ("%I64d", &miyagi);
    speed();
    //cin >> miyagi;
    for (ll i = 1; i <= miyagi; i ++)
    {
        //cout << "Case " << i << ": ";
        hajime();
    }
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
#include <cstdlib>
#include <cmath>
#include <algorithm>
using namespace std;
using ll = long long;
using P = pair<int,int>;
using Graph= vector<vector<int>>; 
#define rep(i,n) for(ll i=0;i<n;i++) 
#define rep2(i,n,m) for(ll i=n;i<=m;i++)
#define rep3(i,n,m) for(ll i=n;i>=m;i--)
#define pb push_back
#define eb emplace_back
#define ppb pop_back
const ll INF=1e18 ;
inline void chmax(ll& a,ll b){a=max(a,b);}
inline void chmin(ll& a,ll b){a=min(a,b);}
int main(){
  int a,b ;
  cin>> a>> b ;
 if(a%2==1&&b%2==1)
 cout<<"Odd"<<endl ;
 else
  
  cout<<"Even" <<endl ;
  return 0;
  }

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

int main(){

    int n,k;
    cin >> n >> k;
    int l[n];
    for(int i = 0;i<n;i++) cin >> l[i];

    sort(l,l+n);
    int ans=0;
    bool flag = true;
    int i = n-1;
    while(flag){
        ans += l[i];
        
        i--;
        k--;
        if(k == 0){
            flag = false;
        }
    }

    cout << ans << endl;
    return 0;
}

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

using namespace std;

#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)((x).size()))

typedef pair<int, int> PII;
typedef vector<int> VI;
typedef long long int64;
typedef unsigned int uint;
typedef unsigned long long uint64;

#define gi(x) ((x) = F())
#define gii(x, y) (gi(x), gi(y))
#define giii(x, y, z) (gii(x, y), gi(z))

int F()
{
	char ch;
	int x, a;
	while (ch = getchar(), (ch < '0' || ch > '9') && ch != '-');
	if (ch == '-') ch = getchar(), a = -1;
	else a = 1;
	x = ch - '0';
	while (ch = getchar(), ch >= '0' && ch <= '9')
		x = (x << 1) + (x << 3) + ch - '0';
	return a * x;
}

int a[100010];

int n, l;

int main()
{
	gii(n, l);
	for (int i = 1; i <= n; ++i) gi(a[i]);
	int j = 1;
	for (int i = 2; i < n; ++i)
		if (a[i] + a[i + 1] > a[j] + a[j + 1])
			j = i;
	if (a[j] + a[j + 1] < l)
	{
		puts("Impossible");
		return 0;
	}
	puts("Possible");
	for (int i = 1; i < j; ++i)
		printf("%d\n", i);
	for (int i = n - 1; i >= j; --i)
		printf("%d\n", i);
	return 0;
}



Measured memory_bytes: 1152
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define FORR(i, m, n) for (int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define ll long long
#define ull unsigned long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

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

int main()
{
    int n, tmp=0, cnt=0;
    cin >> n;

    int h[n];
    REP(i, n){
        cin >> h[i];
        if(tmp <= h[i]){
            cnt++;
            tmp = h[i];
        }
    }
    cout << cnt << endl;
}


Measured memory_bytes: 256
#include <stdio.h>

using namespace std;

int main(){
	int a,b;
	double a_d,b_d;
	scanf("%d %d",&a,&b);
	a_d = static_cast<double>(a);
	b_d = static_cast<double>(b);
	printf("%d %d %.5f\n",a/b,a%b,a_d/b_d);
}



Measured memory_bytes: 2704
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
from pprint import pprint
from copy import deepcopy
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor
from operator import mul
from functools import reduce
from pprint import pprint


sys.setrecursionlimit(2147483647)
INF = 10 ** 13
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007

n, h = LI()
A = []
B = []
for _ in range(n):
    a, b = LI()
    A += [a]
    B += [b]

max_a = max(A)
power_sort = sorted(B + [max_a], reverse=True)
for i in range(n + 1):
    h -= power_sort[i]
    if h <= 0:
        print(i + 1)
        exit()
    elif power_sort[i] == max_a:
         print(h // max_a + bool(h % max_a) + i + 1)
         exit()




Measured memory_bytes: 54492
#include <algorithm>
#include <iostream>
#include <functional>
#include <map>
#include <set>
#include <string>
#include <vector>


using namespace std;

using hint32 = int32_t;
using hint64 = int64_t;
using huint32 = uint32_t;
using huint64 = uint64_t;
using hint = hint32;
using huint = huint32;


#define hrep( i, n )		for( hint i = 0; i < ( hint )( n ); ++i )
#define hrepr( i, n )		for( hint i = ( hint )( n ); i >= 0; --i)
#define hfor( i, a, n )		for( hint i = ( hint )( a ); i < ( hint )( n ); ++i )
#define hforr( i, a, n )	for( hint i = ( hint )( n ); i >= ( hint )( a ); --i)


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


#define dump(x)			std::cout << #x << " = " << x << "\n";
#define hout(x)			std::cout << x << "\n";
#define hout2(x,y)		std::cout << x << "," << y << "\n";
#define hout3(x,y,z)	std::cout << x << "," << y << "," << z << "\n";

#define ini	std::cin.tie(0);std::ios::sync_with_stdio(false)



int main()
{
	ini;

	hint a, b;

	cin >> a >> b;

	int res = max(a + b, a-b);
	hout( max(res, a*b));
	
	return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(){
  int n,k;
  cin >> n >> k;
  string s;
  cin >> s;
  int sum=0;
  for(int i=1;i<n;i++){
    if(s[i]==s[i-1])sum++;
  }
  cout << min(sum+2*k,n-1) << endl;
  return 0;
}


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

int N, K, V[50];
// (左/右)からi個とってj個戻すときのスコアが(left/right)[i][j]
int left_[51][51], right_[51][51];


int main(){
    cin >> N >> K;
    for(int i = 0; i < N; i++){
        cin >> V[i];
    }
    for(int i = 0; i <= N; i++){
        for(int j = 0; j <= i; j++){
            int score = 0;
            priority_queue<int> q;
            for(int k = 0; k < i; k++){
                score += V[k];
                q.push(-V[k]);
            }
            for(int k = 0; k < j; k++){
                score -= -(q.top());
                q.pop();
            }
            left_[i][j] = score;
        }
    }
    for(int i = 0; i <= N; i++){
        for(int j = 0; j <= i; j++){
            int score = 0;
            priority_queue<int> q;
            for(int k = 0; k < i; k++){
                score += V[N - 1 - k];
                q.push(-V[N - 1 - k]);
            }
            for(int k = 0; k < j; k++){
                score -= -(q.top());
                q.pop();
            }
            right_[i][j] = score;
        }
    }
    int ans = 0;
    for(int i = 0; i <= N; i++){
        for(int j = 0; j <= i; j++){
            for(int k = 0; k + i <= N; k++){
                for(int l = 0; l <= k; l++){
                    if(i + j + k + l <= K){
                        ans = max(ans, left_[i][j] + right_[k][l]);
                    }
                }
            }
        }
    }

    cout << ans << endl;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int sum(int x) {
	int s = 0;
	while ( x ) {
		s += x%10;
		x /= 10;
	}
	return s;
}
int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int n, a, b, ans = 0;
	cin >> n >> a >> b;
	for ( int i=1; i<=n; ++i ) {
		int tmp = sum(i);
		if ( a <= tmp && tmp <= b )	ans += i;
	}
	cout << ans << '\n';
	return 0;
}

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

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

    string s;
    cin >> s;
    if (s.back() == 's') {
        cout << s + "es" << endl;
    } else {
        cout << s + "s" << endl;
    }

    return 0;
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--)
#define IREP(i, n) IFOR(i,0,n)
#define SORT(a) sort(a.begin(), a.end())
#define REVERSE(a) reverse(a.begin(), a.end())
#define int long long
#define INF 1000000000000000
using namespace std;

typedef vector<int> vec;
typedef vector<vec> mat;
typedef pair<int, int> Pii;

template<typename T>
void readvec(vector<T> &a);
void readindex(vector<int> &a);

class BIT
{
public:
    vector<int> bit;
    int M;

    BIT(int M):
        bit(vector<int>(M+1, 0)), M(M) {}

    int sum(int i) {
        if (!i) return 0;
        return bit[i] + sum(i-(i&-i));
    }

    void add(int i, int x) {
        if (i > M) return;
        bit[i] += x;
        add(i+(i&-i), x);
    }
};

//medianがx以上となる組み合わせ数
int num(vec &a, int x){
    int N = a.size();
    BIT bit(2 * N + 1);
    int tmp = N + 1, ans = 0;
    bit.add(tmp,1);
    REP(i, N){
        if(a[i] >= x){
            tmp++;
        }else{
            tmp--;
        }
        ans += bit.sum(tmp); 
        bit.add(tmp, 1);
    }
    return ans;
}

signed main(){

    int N; cin >> N;
    vec a(N); readvec(a);

    vec b = a;
    SORT(b);
    vec vals(0);
    int tmp = -1;
    REP(i, b.size()){
        if(b[i] != tmp){
            tmp = b[i];
            vals.push_back(tmp);
        }
    }

    if(vals.size() == 1){
        cout << vals[0];
        return 0;
    }
    int total = N * (N + 1) / 2;
    //num(a, vals[i]) >= (total+1) / 2となるvals[i]の下限を知りたい
    int i1 = 0, i2 = vals.size();

    while(i2 - i1 > 1){
        int i = (i1 + i2) / 2;
        if(num(a, vals[i]) >= (total + 1) / 2){
            i1 = i;
        }else{
            i2 = i;
        }
    }

    cout << vals[i1];

    return 0;
}


template<typename T>
void readvec(vector<T> &a){
    REP(i, a.size()){
        cin >> a[i];
    }
}
void readindex(vector<int> &a){
    REP(i, a.size()){
        cin >> a[i];
        a[i]--;
    }
}

Measured memory_bytes: 4340
//
//*****************
//Created by corol
//*****************
//

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
#define wv(a, n) for (int i=0;i<(n);i++) {cin >> (a)[i];}
#define w(t) while (t--)
#define vi vector <int>
#define vs vector <string>
#define vll vector <long long>
#define vii vector <pair <int,int>>
#define fi(i,n) for (int (i)=0;(i)<(n);(i)++)
#define fo(i,n) for (int (i)=1;(i)<=(n);(i)++)
#define MM <<
#define all(x) sort((x).begin, (x).end());
#define rall(x) sort((x).rbegin, (x).end());
bool cmputd(pair <int,int> a, pair<int,int> b) {
    return a.first>b.first;
}
bool cmpdtu(pair<int,int> a, pair<int,int> b) {
    return a.first<b.first;
}

int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);
    int a,b,c;
    cin >> a >> b >> c;
    cout << (a<=b*c ? "Yes": "No");
    return 0;
}





Measured memory_bytes: 3644
#include<bits/stdc++.h>
using namespace std;
string s[22];
int dx[]= {-1,1,0,0};
int dy[]= {0,0,1,-1};
queue<int>q;
int vis[21][21];
int n,m;
int BFS(int st,int et)
{
    memset(vis,-1,sizeof(vis));
    int i,x,y,sz=INT_MIN;
    q.push(st);
    q.push(et);
    vis[st][et]=0;
    while(!q.empty())
    {
        x=q.front();
        q.pop();
        y=q.front();
        q.pop();
        for(i=0; i<4; i++)
        {
            int xx=x+dx[i];
            int yy=y+dy[i];
            if(vis[xx][yy]==-1 && s[xx][yy]=='.' && xx>=0 && xx<n && yy>=0 && yy<m)
            {
                vis[xx][yy]=vis[x][y]+1;
                q.push(xx);
                q.push(yy);
                sz=max(sz,vis[xx][yy]);
            }
        }
    }
    return sz;
}
int main()
{
    int i,j,k,l,ans=INT_MIN;
    cin>>n>>m;
    for(i=0; i<n; i++)
    {
        cin>>s[i];
    }
    for(i=0; i<n; i++)
    {
        for(j=0; j<m; j++)
        {
            if(s[i][j]=='.')
            {
                ans=max(ans,BFS(i,j));
            }
        }
    }
    cout<<ans<<"\n";
    return 0;
}



Measured memory_bytes: 256
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bitset>
#include <list>
#include <stdexcept>
#include <functional>
#include <utility>
#include <ctime>
#include <random>
#include <cassert>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
#define MEM(a,b) memset((a),(b),sizeof(a))
const LL INF = 1e9 + 7;
const int N = 1e2 + 10;

int main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	string str = "ACGT";
	string s;
	cin >> s;
	int cnt = 0;
	int ans = 0;
	for (auto& c : s)
	{
		if (count(str.begin(), str.end(), c)) cnt++;
		else cnt = 0;
		ans = max(ans, cnt);
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define uint unsigned
#define ull unsigned ll
#define pii pair<int,int>
#define pll pair<ll,ll>
#define PB push_back
#define fi first
#define se second
#define For(i,j,k) for (int i=(int)(j);i<=(int)(k);i++)
#define Rep(i,j,k) for (int i=(int)(j);i>=(int)(k);i--)
#define CLR(a,v) memset(a,v,sizeof(a))
#define CPY(a,b) memcpy(a,b,sizeof(a))
using namespace std;
const int mo=1000000007;
const int N=200005;
int n,m;
char s[N];
int f[N][2][2];
void solve1(){
	f[1][0][0]=f[1][1][1]=1;
	For(i,2,n) For(j,0,1) For(k,0,1) For(l,0,1)
		if (k|l) f[i][j][l]=(f[i][j][l]+f[i-1][j][k])%mo;
	int ans=0;
	For(i,0,1) For(j,0,1)
		if (i|j) ans=(ans+f[n][i][j])%mo;
	printf("%d\n",ans);
}
int pre[N];
int g[N],h[N];

void solve2(){
	pre[1]=1;
	int mnv=(1<<30);
	For(i,2,m)
		pre[i]=(s[i]==s[i-1]?pre[i-1]:0)+1;
	For(i,2,m) if (s[i-1]=='R'&&s[i]!='R')
		if (pre[i-1]==i-1){
			if (pre[i-1]%2==0) mnv=min(mnv,pre[i-1]+1);
			else mnv=min(mnv,pre[i-1]);
		}
		else if (pre[i-1]%2==1)
			mnv=min(mnv,pre[i-1]);
	g[0]=h[0]=1;
	For(i,1,n){
		g[i]=((i>=2?h[i-2]:0)+mo-(i>=mnv+3?h[i-mnv-3]:0))%mo;
		h[i]=(g[i]+(i>=2?h[i-2]:0))%mo;
	}
	int ans=0;
	for (int i=2;i<=min(mnv+1,n);i+=2)
		ans=(ans+1ll*i*g[n-i])%mo;
	printf("%d\n",ans);
}
int main(){
	scanf("%d%d%s",&n,&m,s+1);
	if (s[1]=='B'){
		For(i,1,m)
			if (s[i]=='R') s[i]='B';
			else s[i]='R';
	}
	bool flag=0;
	For(i,1,m) if (s[i]!=s[1]) flag=1;
	if (!flag) return solve1(),0;
	solve2();
}
/*
偶数个R||B回到该端点 
奇数个R||B到达另一端点

RBRBRBRBRB

一段长度为奇数的开头字母 
*/

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

using namespace std;

inline void Boost() {
	ios::sync_with_stdio(false);
	cin.tie(NULL); cout.tie(NULL);
}
typedef long long int ll;
typedef long double ld;

vector < int > DP;
vector < vector < int > > G;

int DFS(int node) {
	if (DP[node] != -1) return DP[node];
	DP[node] = 0;

	for (auto x: G[node]) {
		DP[node] = max(DP[node], 1 + DFS(x));
	}

	return DP[node];
}

int main() {
	Boost();

	int n, m; cin >> n >> m;

	G.assign(n, {});
	for (int i = 0; i < m; ++i) {
		int x, y; cin >> x >> y;
		--x; --y;

		G[x].push_back(y);
	}

	DP.assign(n, -1);
	for (int i = 0; i < n; ++i) {
		if (DP[i] == -1) {
			DFS(i);
		}
	}

	int mx = 0;
	for (auto x: DP) mx = max(mx, x);

	cout << mx;
	return 0;
}

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

int main() {
    int N;
    cin >> N;
    string A,B,C;
    cin >> A >> B >> C;
    int ans = 0;
    for(int i=0; i<N; ++i) {
        if(A[i] != B[i] && B[i] != C[i] && C[i] != A[i]) ans += 2;
        else if(!(A[i] == B[i] && B[i] == C[i] && C[i] == A[i])) ans += 1; 
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
/*
g++ -std=c++14 A.cpp && ./a.out <<< ""
*/

#include <bits/stdc++.h>
using namespace std;

#define rep(i, a, b) for (int i = a; i < (b); i++)
#define trav(a, x) for (auto& a : x)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

// Source: https://codeforces.com/blog/entry/62393
struct custom_hash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

int main() {
    cin.sync_with_stdio(0); cin.tie(0);
    cin.exceptions(cin.failbit);

    int a, b, c;
    cin >> a >> b >> c;
    int s = a + b + c;
    if (s >= 22) cout << "bust";
    else cout << "win";
    cout << endl;
}

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

int main(){

 
	int a,b,c,t,n,ar[200010],s=1;
	cin>>a;
	int mn;
	cin>>mn;
	for(int i=1;i<a;i++){
		cin>>n;
		if(mn>n) s++;
		mn=min(mn,n);
	}
	cout<<s;

	return 0;
}

Measured memory_bytes: 256