akhauriyash/Code-Regression huggingface dataset:
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")

#include <algorithm>
#include <iostream>
#include <map>
#include <unordered_map>

using namespace std;
typedef long long ll;

const int rdigit = 30;
const ll MOD = 1E+09 + 7;
const ll R = 1LL << rdigit;
const ll modRmask = (1LL << (rdigit + 1)) - 1;
const ll R2 = (R * R) % MOD;
const ll Y = 79133769;

ll MR(ll T);
ll MGmodPow(ll x, ll a);

const int MAX_N = 100000;

ll N;
ll A[MAX_N];

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

    cin >> N;

    unordered_map<ll, int> mp;

    for (int i = 0; i < N; i++) {
        cin >> A[i];
        if (mp.count(A[i])) {
            mp[A[i]]++;
        } else {
            mp.insert(make_pair(A[i], 1));
        }
    }

    bool isPossible = true;

    ll j = !(N & 1);

    for (; j <= N - 1; j += 2) {
        if (mp.count(j)) {
            if (mp[j] != 2 && !(j == 0 && mp[j] == 1)) {
                isPossible = false;
            }
        } else {
            isPossible = false;
        }
    }

    ll ans;

    if (isPossible) {
        ans = MR(MGmodPow(MR(2 * R2), N / 2));
    } else {
        ans = 0;
    }

    cout << ans << "\n";

    return 0;
}

ll MR(ll T)
{
    ll t = (T + ((T * Y) & modRmask) * MOD) >> rdigit;
    if (t >= MOD) {
        return t - MOD;
    } else {
        return t;
    }
}

ll MGmodPow(ll x, ll a)
{
    if (a == 0)
        return MR(R2);
    if (a == 1)
        return x;
    if (a % 2 == 0) {
        ll t = MGmodPow(x, a / 2);
        return MR(t * t);
    } else {
        return MR(x * MGmodPow(x, a - 1));
    }
}

Measured memory_bytes: 7436
#include <bits/stdc++.h>
// Hey! 僕の提出を見てくれてありがとう.
// ロボ子さん可愛いぞ！！！！！君もV沼にはまろう↓
// https://www.youtube.com/channel/UCDqI2jOz0weumE8s7paEk6g
using namespace std;
/*
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>
namespace mp = boost::multiprecision;// 任意長整数型
using bint = mp::cpp_int;// 仮数部長が32の浮動小数点数型
using real32 = mp::number<mp::cpp_dec_float<32>>;// 仮数部長が1024の浮動小数点数型
using real1024 = mp::number<mp::cpp_dec_float<1024>>;// ついでに有理数型
using rat = boost::rational<bint>;
*/
using ll = long long;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}//a,bの最大公約数(gcd)を求める
ll lcm(ll a,ll b){return abs(a*b)/gcd(a,b);}//a,bの最小公倍数(lcm)を求める
vector<ll> enum_div(ll n){vector<ll> ret;for(int i=1 ; i*i<=n ; i++){if(n%i == 0){ret.push_back(i);if(i!=1 && i*i!=n)ret.push_back(n/i);}}ret.push_back(n);return ret;}
//↑nの約数を求める
vector<bool> IsPrime; void sieve(size_t max){if(max+1 > IsPrime.size())IsPrime.resize(max+1,true);IsPrime[0] = false;IsPrime[1] = false;for(size_t i=2; i*i<=max; ++i)if(IsPrime[i])for(size_t j=2; i*j<=max; ++j)IsPrime[i*j] = false;}
//↑エラトステネスの篩で素数を求める
#define roundup(divisor,dividend) (divisor + (dividend - 1)) / dividend //切り上げ割り算
#define all(x) (x).begin(),(x).end() //xの初めから終わりまでのポインタ
#define size_t ll //size_tは自動でllに変換される
#define pb(x) push_back(x)
#define pri_queue priority_queue //優先度付きキュー
#define syo(x) fixed << setprecision(x) //iostreamで小数をx桁表示
//sortを降順にする時は greater<型>()
int main(){ //srand((unsigned)time(NULL));
  ll n,m;
  cin >> n >> m;
  vector<vector<ll>> A(n,vector<ll>(m));
  for (int i = 0; i < n; i++) {
    for (int l = 0; l < m; l++) {
      cin >> A[i][l];
    }
  }
  vector<ll> b(m);
  for (int i = 0; i < m; i++) {
    cin >> b[i];
  }
  for (int i = 0; i < n; i++) {
    ll c=0;
    for (int l = 0; l < m; l++) {
      c += A[i][l] * b[l];
    }
    cout << c << endl;
  }
}



Measured memory_bytes: 3176
#include <iostream>
#include <vector>

using namespace std;

int main() {

	int n, a, b, c, x;
	while (cin >> n >> a >> b >> c >> x) {
		if (n == 0 && a == 0 && b == 0 && c == 0 && x == 0) {
			break;
		}
		vector<int> y(n);
		for (int i = 0; i < n; i++) {
			cin >> y[i];
		}
		int ans = 0;
		for (int i = 0; i < n; i++) {
			if (i > 0) {
				x = (a*x + b) % c;
				ans++;
			}
			while (x != y[i] && ans <= 10000) {
				x = (a*x + b) % c;
				ans++;
			}
			if (ans > 10000) {
				ans = -1;
				break;
			}
		}
		cout << ans << endl;
	}

	return 0;
}


Measured memory_bytes: 3000
import java.util.Scanner;

public class Main {
	public static void main(String[] args){
	    Scanner in = new Scanner(System.in);
	    int lo = in.nextInt();
	    int hi = in.nextInt();
	    in.close();
	    String sl = Integer.toBinaryString(lo);
	    String sh = Integer.toBinaryString(hi);
	    if ( (sl.length() == 32 ^ sh.length() == 32) || lo == 0 || hi == 0 ) {
	    	System.out.println("Zero");
	    } else if (sl.length() < 32) {
	    	System.out.println("Positive");
	    } else {
	    	if (sl.charAt(31) == sh.charAt(31)) {
	    		System.out.println("Negative");
	    	} else {
	    		System.out.println("Positive");
	    	}
	    }
	}
}

Measured memory_bytes: 21844
#include <stdio.h>
#include <string.h>
int ans[100000];
int main(void){
    int n,m,x,i,AC=0,WA=0;
    char y[3];
    scanf("%d%d",&n,&m);
    for(i=0;i<m;i++){
        scanf("%d%s",&x,y);
        if(ans[x-1]!=-1 && strcmp(y,"WA")==0) ans[x-1]++;
        if(ans[x-1]!=-1 && strcmp(y,"AC")==0){
            WA+=ans[x-1];
            AC++;
            ans[x-1]=-1;
        }
    }
    printf("%d %d",AC,WA);
    return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <cctype>
#include <cstdlib>
#include <string>
#include <algorithm>
#define rep(i, n) for(int i = 0; i < n; ++i)
using namespace std;

int comp(const void* a, const void* b){
	return *(int*)a - *(int*)b;
}

int main() {
	char x, y;
	cin >> x >> y;
	if((int)x > (int)y){
		cout << ">" << endl;
	}else if ((int)x == (int)y){
		cout << "=" << endl;
	}else{
		cout << "<" << endl;
	}
}

Measured memory_bytes: 256
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, tan, asin, acos, atan, radians, degrees, log2, gcd
from itertools import accumulate, permutations, combinations, combinations_with_replacement, product, groupby
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from bisect import bisect, bisect_left, insort, insort_left
from heapq import heappush, heappop
from functools import reduce
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def ZIP(n): return zip(*(MAP() for _ in range(n)))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7
from decimal import *
#import numpy as np
#decimal.getcontext().prec = 10


N = INT()
AB = [LIST() for _ in range(N)]

A, B = zip(*AB)
A = list(A)
B = list(B)

A.sort()
B.sort()

if N%2:
	a = A[N//2]
	b = B[N//2]
	print(b-a+1)
else:
	a = (A[N//2-1]+A[N//2])/2
	b = (B[N//2-1]+B[N//2])/2
	print(int((b-a)*2+1))


Measured memory_bytes: 62468
N, X = map(int, input().split())

a, p = [1], [1]
for i in range(N):
    a.append(a[i] * 2 + 3)
    p.append(p[i] * 2 + 1)

def f(N, X): # X <= 0 や X > a_N を許容し解説本文から簡略化
    if N == 0:
        return 0 if X <= 0 else 1
    elif X <= 1 + a[N-1]:
        return f(N-1, X-1)
    else:
        return p[N-1] + 1 + f(N-1, X-2-a[N-1])

print(f(N, X))


Measured memory_bytes: 9132
#include <bits/stdc++.h>
#define F first
#define S second
#define mp make_pair
#define pb push_back
//#define ll __int128
#define ll long long int
#define LEFT(a) ((a)<<1)
#define RIGHT(a) (LEFT(a) + 1)
#define MID(a,b) ((a+b)>>1)
#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))

/*
#pragma GCC optimize ("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("avx2,fma")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC target ("avx2")
#pragma GCC optimization ("unroll-loops")

#pragma comment(linker, "/STACK: 20000000005")
*/

using namespace std;

const int N = 200005;

int num[N];

int n;
string S;

int dp[N];

int l[N];

main()
{
    //freopen ("in.in", "r", stdin);freopen ("out.out", "w", stdout);
    ios_base::sync_with_stdio(0);
    cin >> S;
    n = (int)S.size();
    S = "#" + S;
    num[1] = 1;
    num[2] = 1;
    for (int i = 3; i <= n; i++)
        num[i] = num[i - 3] + 2;
    for (int i = 1; i <= n; i++){
        l[i] = i;
        if (S[i] == S[i - 1])
            l[i] = l[i - 1];
    }
    for (int i = 1; i <= n; i++){
        int x = i - l[i] + 1;
        dp[i] = dp[i - x] + num[x];
        if (2 <= l[i]){
            dp[i] = max (dp[i], dp[l[i] - 2] + num[x - 1] + 1);
        }
    }
    cout << dp[n] << endl;
    return 0;
}


Measured memory_bytes: 2896
#include <bits/stdc++.h>
using namespace std;
#define mod 1000000007 
#define endl '\n'
#define all(n)      (n).begin(), (n).end()
#define ll long long int

void solve(){
	int n; cin >> n;
	while(n){
		if(n%10 == 7){
			cout << "Yes" << endl; return;
		}
		n /= 10;
	}
	cout << "No" << endl;
	

}


int main (){
	#ifndef ONLINE_JUDGE
		freopen ("input.txt","r",stdin);
		freopen ("output.txt", "w", stdout);
	#endif
	ios::sync_with_stdio(0);
	cin.tie(0);
	//Write from here.
	
		solve();
	
	return 0;
}

Measured memory_bytes: 3620
use std::io::*;
use std::str::FromStr;


fn main() {
    let n: usize = read();
    let m: usize = read();
    let mut s: Vec<char> = read::<String>().chars().collect();
    s.reverse();
    let s = s;
    let mut ans: Vec<usize> = vec![];
    let mut next = vec![0; n+1];
    for i in 1..m+1 {
        if i < s.len() && s[i] == '0' {
            next[0] = i;
        }
    }
    if next[0] == 0 {
        println!("-1");
        return;
    }
    for i in 1..s.len() {
        if i + m > n {
            next[i] = n;
        } else {
            if s[i + m] == '0' {
                next[i] = i + m;
            } else {
                next[i] = next[i-1];
            }
        }
    }
    let mut now = 0;
    while now < n {
        if next[now] <= now {
            println!("-1");
            return;
        }
        let d = next[now] - now;
        now = next[now];
        ans.push(d);
    }
    ans.reverse();
    for i in 0..ans.len() {
        if i != 0 {
            print!(" ");
        }
        print!("{}", ans[i]);
    }
    println!();
}

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()
}


Measured memory_bytes: 6524
from copy import copy
import random
import math
import sys
input = sys.stdin.readline
D = int(input())
c = list(map(int,input().split()))
s = [list(map(int,input().split())) for _ in range(D)]
last = [0]*26
ans = [0]*D
score = 0
for i in range(D):
    ps = [0]*26
    for j in range(26):
        pl = copy(last)
        pl[j] = i+1
        ps[j] += s[i][j]
        for k in range(26):
            ps[j] -= c[k]*(i+1-pl[k])
    idx = ps.index(max(ps))
    last[idx] = i+1
    ans[i] = idx+1
    score += max(ps)
for k in range(1,37001):
    na = copy(ans)
    x = random.randint(1,365)
    y = random.randint(1,365)
    z = random.randint(min(x,y),max(x,y))
    if x == y:
        continue
    na[x-1],na[y-1] = na[y-1],na[x-1]
    na[x-1],na[z-1] = na[z-1],na[z-1]
    last = [0]*26
    ns = 0
    for i in range(D):
        last[na[i]-1] = i+1
        ns += s[i][na[i]-1]
        for j in range(26):
            ns -= c[j]*(i+1-last[j])
    if k%100 == 1:
        T = 300-(298*k/37000)
    p = pow(math.e,-abs(ns-score)/T)
    if ns > score or random.random() < p:
        ans = na
        score = ns
for a in ans:
    print(a)

Measured memory_bytes: 91744
#pragma region _head

#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<cmath>
#include<map>
#include<set>
#include<iomanip>
#include<queue>
#include<stack>
#include<numeric>
#include<utility>
#include<regex>

#pragma region _define

#define int LL
#define f(i,a,b) for(LL i=a;i<b;i++)
#define f_vI(v,n) f(i,0,n)cin>>v[i]
#define f_v2I(v1,v2,n) f(i,0,n)cin>>v1[i]>>v2[i]
#define f_v3I(v1,v2,v3,n) f(i,0,n)cin>>v1[i]>>v2[i]>>v3[i]
#define f_vO(v,n) f(i,0,n)cout<<v[i]<<endl
#define ei else if
#define all(a) a.begin(),a.end()
#define size(s) ((LL)s.size())
#define F first
#define S second
#define check() cout<<"! ! !"
#define endl "\n"
#define _y() cout<<"Yes"<<endl
#define _Y() cout<<"YES"<<endl
#define _n() cout<<"No"<<endl
#define _N() cout<<"NO"<<endl
#define int_INF 1<<29
#define ll_INF 1LL<<60
#define MOD 1000000007

#pragma endregion

#pragma region _using

using namespace std;

using LL = long long;
using st = string;
using vi = vector<LL>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vc = vector<char>;
using vs = vector<st>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvvb = vector<vvb>;
using qi = queue<LL>;
using qc = queue<char>;
using qs = queue<st>;
using si = stack<LL>;
using sc = stack<char>;
using ss = stack<st>;
using pi = pair<LL, LL>;
using mll = map<LL, LL>;
using mcl = map<char, LL>;
using vpi = vector<pi>;

#pragma endregion

#pragma region _graph

#define node 50  //グラフの最大位数　適宜変更
//bool graph[node][node]; bool visited[node] = { false };
#define link(a,b,m) f(i,0,m){cin>>a[i]>>b[i]; a[i]--; b[i]--; graph[a[i]][b[i]]=graph[b[i]][a[i]]=true;}

#pragma endregion

void y_n(bool p) {
	p ? _y() : _n();
}

void Y_N(bool p) {
	p ? _Y() : _N();
}

LL gcd(LL a, LL b) {
	LL r;
	while ((r = a % b) != 0) {
		a = b;
		b = r;
	}
	return b;
}
LL lcm(LL a, LL b) {
	return (a / gcd(a, b) * b);
}

//素数判定
bool is_prime(int n) {
	for (int i = 2; i*i <= n; i++) {
		if (n % i == 0) {
			return false;
		}
	}
	return true;
}

//階乗計算
LL factorial(LL n) {
	LL a = 1, ret = 1;
	while (a < n) {
		a++;
		ret *= a;
		ret %= MOD;
	}
	return ret;
}

#pragma endregion 




/*****************************************************************************/

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

	st s, t;
	cin >> s >> t;
	vvi dp(size(s) + 1, vi(size(t) + 1, 0));
	f(i, 0, size(s)) {
		f(j, 0, size(t)) {
			if (s[i] == t[j]) {
				dp[i + 1][j + 1] = max(dp[i + 1][j + 1], dp[i][j] + 1);
			}
			dp[i + 1][j + 1] = max(dp[i + 1][j + 1], dp[i + 1][j]);
			dp[i + 1][j + 1] = max(dp[i + 1][j + 1], dp[i][j + 1]);
		}
	}
	int i = size(s), j = size(t);
	st ans = "";
	while (i > 0 && j > 0) {
		if (dp[i][j] == dp[i - 1][j]) {
			i--;
		}ei(dp[i][j] == dp[i][j-1]) {
			j--;
		}
		else {
			ans = s[i - 1] + ans;
			i--; j--;
		}
	}
	cout << ans;
	return 0;
}

Measured memory_bytes: 70784
#include<bits/stdc++.h>
#define inf 0x3f3f3f3f
#define maxn 300005
#define eps 1e-5
using namespace std;
typedef long long ll;
const ll mod = 1000000007;
inline ll read()
{
    ll x=0,f=1;char ch=getchar();
    while(ch>'9'||ch<'0'){if(ch=='-')f=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
    return x*f;
}
int n,m,p,k;
int main()
{
	int i,j,l,op,x,y;
    //freopen("a.in","r",stdin);
    //freopen("a.out","w",stdout);
    n=read(),m=read();
    printf("%d",(n-1)*n/2+(m-1)*m/2);
    return 0;
} 

Measured memory_bytes: 256
#include<iomanip>
#include<limits>
#include<thread>
#include<utility>
#include<iostream>
#include<string>
#include<algorithm>
#include<set>
#include<map>
#include<vector>
#include<stack>
#include<queue>
#include<cmath>
#include<math.h>
#include<numeric>
#include<cassert>
#include<random>
#include<deque>
#include<chrono>
#include<unordered_map>
#include<list>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pi;
const ll E=1e18+7;
#define F first
#define S second
#define MK make_pair
const ll MOD=1000000007;
const ll C=1000;




int main(){
    ll k,s;
    cin>>k>>s;
    ll ans=0;
    for(int i=0;i<=k;i++){
        for(int t=0;t<=k;t++){
            if(s-i-t<=k && 0<=s-i-t){ans++;}
        }
    }
    cout<<ans<<endl;
    
    
    return 0;
}



Measured memory_bytes: 256
x,y=map(int, input().split())
if y!=0:
    l=list(map(int, input().split()))
else:
    l=[]
num=x
num1=x
val=0
val1=0
while True:
    if num not in l:
        val=1
        break
    if num1 not in l:
        val1=1
        break
    num=num-1
    num1=num1+1
if val==1:
    if num1 not in l:
        val1=1
if val==0 and val1==1:
    print(num1)
elif val==1 and val1==0:
    print(num)
else:
    print(min(num,num1))

Measured memory_bytes: 9220
#include <iostream>
#include <cctype>
#include <cstdlib>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#define rep(i, n) for(int i = 0; i < n; ++i)
using namespace std;

int comp(const void* a, const void* b){
	return *(int*)a - *(int*)b;
}

int main() {
	int a, b, x;
	cin >> a >> b >> x;
	if(a <= x){
		if(a+b >= x){
			cout << "YES" << endl;
		}else{
			cout << "NO" << endl;
		}
	}else{
		cout << "NO" << endl;
	}
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
//#define int long long
const int mod = 1e9 + 7;
const int N = 2e5 + 50;
const int i2 = 500000004;
int n;
int ai[N], bi[N];
int dp[4058][4058];
int C[8050][4058];
int main() {
	cin >> n;
	C[0][0] = 0; C[1][0] = C[1][1] = 1;
	for(int i = 2; i <= 8025; ++i)
	{
		C[i][0] = C[i][i] = 1;
		for(int j = 1; j <= 4050; ++j)
			C[i][j] = (C[i-1][j] + C[i-1][j-1]) % mod;
	}
//	cout << C[6][3]<<endl;
	for(int i = 1; i <= n; ++i) 
	{
		cin >> ai[i] >> bi[i];
		dp[2002 - ai[i]][2002 - bi[i]]++;
	}
	for(int i = 1; i <= 4050; ++i) 
		for(int j = 1; j <= 4050; ++j) {
			(dp[i][j] = dp[i][j] + (dp[i - 1][j] + dp[i][j - 1]) % mod) %= mod;
		}
	long long ans = 0;
	for(int i = 1; i <= n; ++i) {
		ans += dp[2002 + ai[i]][2002 + bi[i]]; ans%=mod;
//		cout << dp[2002 + ai[i]][2002 + bi[i]] << endl;
		ans = ans - C[2*ai[i] + 2*bi[i]][2*ai[i]];
		ans+=mod;ans%=mod;
//		cout << C[2*ai[i] + 2*bi[i]][2*ai[i]] << endl;
	}
	ans = ans * i2;ans%=mod;
	cout << ans;
}

Measured memory_bytes: 196608
import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.math.*;
import java.util.*;

public class Main {

	static int n = 0;
	static Set<Long> set = new HashSet<>();

	public static void main(String[] args) throws IOException {
		FastReader in = new FastReader(System.in);
		PrintWriter out = new PrintWriter(System.out);
		n = in.nextInt();
		dfs(0);
		int ans = 0;
		for (Long a : set) {
			String x = String.valueOf(a);
			if (x.contains("3") && x.contains("5") && x.contains("7")) {
				++ans;
			}
		}
		out.println(ans);
		out.flush();
		out.close();

	}

	static void dfs(long x) {
		if (x > n) {
			return;
		}
		if (x != 0) {
			set.add(x);
		}
		dfs(x * 10 + 3);
		dfs(x * 10 + 5);
		dfs(x * 10 + 7);
	}

	static class FastReader {
		StringTokenizer st;
		BufferedReader br;

		public FastReader(InputStream s) {
			br = new BufferedReader(new InputStreamReader(s));
		}

		public FastReader(FileReader fileReader) {
			br = new BufferedReader(fileReader);
		}

		public String next() throws IOException {
			while (st == null || !st.hasMoreTokens())
				st = new StringTokenizer(br.readLine());
			return st.nextToken();
		}

		public int nextInt() throws IOException {
			return Integer.parseInt(next());
		}

		public double nextDouble() throws IOException {
			return Double.parseDouble(next());
		}

		public long nextLong() throws IOException {
			return Long.parseLong(next());
		}

		public String nextLine() throws IOException {
			return br.readLine();
		}

		public boolean ready() throws IOException {
			return br.ready();
		}
	}

}

Measured memory_bytes: 28368
a,b,k = map(int,input().split())
ans_set= set()
for i in range(a, min(a+k, b+1)):
    ans_set.add(i)
for i in range(b, max(b-k, a-1), -1):
    ans_set.add(i)
ans = list(ans_set)
ans.sort()
for i in range(len(ans_set)):
    print(ans[i])


Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

ll dp[1000001][4]{};

int main() {
    int N;
    cin >> N;
    ll mod = pow(10, 9) + 7;
    dp[0][0] = 1;
    for (int i = 0; i < N; i++) {
        dp[i + 1][0] = dp[i][0] * 8;
        dp[i + 1][1] = dp[i][0] + dp[i][1] * 9; 
        dp[i + 1][2] = dp[i][0] + dp[i][2] * 9;
        dp[i + 1][3] = dp[i][3] * 10 + dp[i][1] + dp[i][2];
        for (int j = 0; j < 4; j++) {
            dp[i + 1][j] %= mod;
        }
    }
    cout << dp[N][3] << "\n";
    return 0;
}

Measured memory_bytes: 34700
#include<bits/stdc++.h>
#define V vector
#define VI vector<int>
#define VVI vector<vector<int>>
#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 MOD 1000000007
#define INF 1e9
#define F first
#define S second
#define All(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;

int main(void){
    string t,b;
    cin>>t>>b;
    ll dp[1010][1010];
    dp[0][0]=1;
    REP(i,t.length()){
        REP(j,b.length()){
            if(t[i]==b[j]){
                dp[i+1][j+1]+=dp[i][j];
                dp[i+1][j+1]%=MOD;
            }
            dp[i+1][j]+=dp[i][j];
            dp[i+1][j]%=MOD;
        }
    }
    
    ll ans=0;
    REP(i,t.length()+1)ans=(ans+dp[i][b.length()])%MOD;
    cout<<ans<<endl;
}





Measured memory_bytes: 11020
n = int(input())
sp = [list(input().split()) for _ in range(n)]
ans = [0]*n

for i in range(1, n+1):
    sp[i-1][1] = int(sp[i-1][1])
    sp[i-1].append(i)

sp = sorted(sp, key=lambda x:(x[0],-x[1]))

for i in range(n):
    ans[i] += sp[i][2]

print(*ans, sep='\n')

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vll = vector<long long>;
using vp = vector<pair<int, int>>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using vvll = vector<vector<long long>>;
template<class T> inline bool chmax(T &a, T b) { if (a<b) {a=b; return 1;} return 0;}
template<class T> inline bool chmin(T &a, T b) { if (b<a) {a=b; return 1;} return 0;}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int a, b;
    cin >> a >> b;
    cout << max(0, a - 2*b) << endl;
}

Measured memory_bytes: 256
//author : raghav_0901
#include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define int long long int
#define f(i,s,e) for(i=s;i<e;++i)
#define fr(i,s,e) for(i=s;i>=e;i--)
#define all(x) (x).begin(),(x).end()
#define _in(v) for(auto &x:v) cin>>x;
#define ff(i,s,e,f) for(i=s;i<e && f;++i)
#define mem(arr,val) memset(arr, val, sizeof(arr));
#define _out(v) for(auto x:v) cout<<x<<' '; cout<<'\n';
#define _var register int i,j,num,ans=0,cnt=0,sum=0,t=1;
#define ARENA ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
typedef vector<int> vec;
typedef pair<int,int> pr;

const int lim = 1000000;
const int mod = 1000000;

signed main(void)
{
    ARENA
    int n,i,j,k,ans=0;cin>>n;
    f(i,1,n+1)
        f(j,1,n+1)
            f(k,1,n+1)
                ans+=__gcd(i,__gcd(j,k));
    cout<<ans<<endl;
    return 0;
}


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

template<class T> void vin(vector<T>& v, int n) {
    v.resize(n);
    for (int i = 0; i < n; ++i) {
        cin >> v[i];
    }
}

int main() {
    double N, K;
    cin >> N >> K;

    double sum = 0;
    for (double i=1; i<min(N+1, K); ++i) {
        int x = 0;
        double tmp = i;
        for (; tmp<K; ++x) tmp *= 2;
        sum += (1/N) * powf(0.5, x);
    }

    int sz = max(0.0, N-K+1);
    rep(i, sz) sum += (1/N);
    printf("%.12f\n", sum);
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <math.h>
#include <complex>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <unordered_map>
#include <set>
#include <bitset>
#include <functional>
#include <assert.h>
using ll=long long;
#define int ll
#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,b) rng(i,0,b)
#define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--)
#define per(i,b) gnr(i,0,b)
#define eb emplace_back
#define all(x) x.begin(),x.end()
#define SZ(x) x.size()
#define fi first
#define se second
const int INF = 1e9;
using namespace std;

template<class T> using vc=vector<T>;
template<class T> using vvc=vc<vc<T>>;

using pi=pair<int,int>;
using vi=vc<int>;

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

signed main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    cout<<fixed<<setprecision(20);

    while(true){
        int N,M; cin >> N >> M;
        if(N==0 && M==0) break;
        map<int,int> m;
        rep(i,N){
            int a; cin >> a;
            rep(j,a){
                int b; cin >> b;
                m[b]++;
            }
        }
        int ans=0;
        int pos=0;
        for(auto p:m){
            if(p.se>=M){
                if(chmax(pos,p.se)){
                    ans=p.fi;
                }
            }
        }
        cout << ans << "\n";
    }
}


Measured memory_bytes: 3152
#include <algorithm>
#include <cassert>
#include <cctype>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstring>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <vector>
#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define show(x) cout << #x << " = " << x << endl;
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
struct edge {
    int to;
    ll cost;
};
vector<edge> G[100005];
ll d[100005];
void dfs(int from, int s, ll cost) {
    if (d[s] == 1LL << 60) {
        if (from != -1)
            d[s] = d[from] + cost;
        else
            d[s] = 0;
        rep(i, G[s].size()) { dfs(s, G[s][i].to, G[s][i].cost); }
    } else {
        if (d[s] != d[from] + cost) {
            puts("No");
            exit(0);
        }
    }
}
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, m;
    cin >> n >> m;
    rep(i, m) {
        int l, r;
        ll d;
        cin >> l >> r >> d;
        l--, r--;
        G[l].push_back(edge{r, d});
        G[r].push_back(edge{l, -d});
    }
    fill(d, d + n, 1LL << 60);
    rep(i, n) {
        if (d[i] == 1LL << 60) {
            dfs(-1, i, 0);
        }
    }
    puts("Yes");
    return 0;
}

Measured memory_bytes: 16512
#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <cstdlib>
using namespace std;
#define Ma_PI 3.141592653589793
#define eps 0.00000001
#define LONG_INF 3000000000000000000
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define REP(i,n) for(long long i = 0;i < n;++i)
#define seg_size 524288
#define PI 3.1415926535
using namespace std;
int main() {
	int n;
	cin >> n;
	vector<long long> a, b;
	REP(i, n) {
		long long tmp;
		cin >> tmp;
		a.push_back(tmp);
	}
	REP(i, n) {
		long long tmp;
		cin >> tmp;
		b.push_back(tmp);
	}
	vector<long long> c;
	REP(i, n) {
		c.push_back(b[i] - a[i]);
	}
	sort(c.begin(), c.end());
	int now_itr = n - 1;
	for (int i = 0;i < n;++i) {
		if (c[i] >= 0) {
			cout << "Yes" << endl;
			return 0;
		}
		while (c[i] != 0) {
			if (c[now_itr] <= 1) {
				if (now_itr == 0 || c[now_itr - 1] <= 1) {
					cout << "No" << endl;
					return 0;
				}
				now_itr--;
			}
			if (c[i] + (c[now_itr]/2) >= 0) {
				//can be deleted
				c[now_itr] += 2 * c[i];
				c[i] = 0;
			}
			else {
				//goto next itr
				c[i] += c[now_itr] / 2;
				c[now_itr] %= 2;
			}
		}
	}
	cout << "Yes" << endl;
	return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
using ll = long long int;
#define REP(i,n) for(ll i=0; i<(n); i++)
#define REP2(i,x,n) for(ll i=x; i<(n); i++)
#define REP3(i,x,n) for(ll i=x; i>(n); i--)
#define zero_pad(num) setfill('0') << std::right << setw(num)
#define space_pad(num) setfill(' ') << std::right << setw(num)
#define ALL(n) begin(n),end(n)
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
const long long INF = numeric_limits<long long>::max();
int main(){
    ll N,K,h,ans=0;
    priority_queue<ll >H;
    cin >> N >> K;
    REP(i,N){
        cin >> h; 
        H.push(h);
    }
    
    REP(i,K){H.pop();}
    REP(i,N-K){ans += H.top();H.pop();}
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 2420
// Author -- Frame

#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<algorithm>
#include<vector>
#include<iostream>
#include<queue>

#define lowbit(x) ((x)&(-x))
#define Finline __inline__ __attribute__ ((always_inline))
#define DEBUG printf("Running on Line %d in Function %s\n",__LINE__,__FUNCTION__)

typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;

const int inf=0x3f3f3f3f,Inf=0x7fffffff;
const ll INF=0x7fffffffffffffff;
const double eps=1e-10;

uint seed=19260817;
const uint _RAND_MAX_=4294967295u;
Finline uint Rand(){return seed=seed*998244353u+1000000007u;}

template <typename _Tp>_Tp gcd(const _Tp &a,const _Tp &b){return (!b)?a:gcd(b,a%b);}
template <typename _Tp>Finline _Tp abs(const _Tp &a){return a>0?a:-a;}
template <typename _Tp>Finline _Tp max(const _Tp &a,const _Tp &b){return a<b?b:a;}
template <typename _Tp>Finline _Tp min(const _Tp &a,const _Tp &b){return a<b?a:b;}
template <typename _Tp>Finline void chmax(_Tp &a,const _Tp &b){(a<b)&&(a=b);}
template <typename _Tp>Finline void chmin(_Tp &a,const _Tp &b){(a>b)&&(a=b);}
template <typename _Tp>Finline bool _cmp(const _Tp &a,const _Tp &b){return abs(a-b)<=eps;}
template <typename _Tp>Finline void read(_Tp& x)
{
    register char ch(getchar());
    bool f(false);
    while(ch<48||ch>57) f|=ch==45,ch=getchar();
    x=ch&15,ch=getchar();
    while(ch>=48&&ch<=57) x=(((x<<2)+x)<<1)+(ch&15),ch=getchar();
    if(f) x=-x;
}
template <typename _Tp,typename... Args>Finline void read(_Tp &t,Args &...args)
{
    read(t);read(args...);
}
Finline int read_str(char *s)
{
    register char ch(getchar());
    while(ch==' '||ch=='\r'||ch=='\n') ch=getchar();
    register char *tar=s;
    *tar=ch,ch=getchar();
    while(ch!=' '&&ch!='\r'&&ch!='\n'&&ch!=EOF) *(++tar)=ch,ch=getchar();
    return tar-s+1;
}

const int N=100005;
int fa[N];
int a[N];
int id[N];
std::vector<int> v[N];
int find(const int &x){return x==fa[x]?x:fa[x]=find(fa[x]);}
int b[N];
Finline bool cmp(const int &a,const int &b)
{
	return ((int)v[a].size()>1?v[a][1]:Inf)<((int)v[b].size()>1?v[b][1]:Inf);
}
std::priority_queue<int,std::vector<int>,std::greater<int> > q;
int main()
{
	int n,m;
	read(n,m);
	for(int i=1;i<=n;++i) read(a[i]),fa[i]=i;
	int x,y;
	for(int i=1;i<=m;++i)
	{
		read(x,y);
		++x,++y;
		fa[find(x)]=find(y);
	}
	int cnt=0;
	for(int i=1;i<=n;++i)
	{
		if(fa[i]==i)
		{
			id[i]=++cnt;
		}
	}
	for(int i=1;i<=n;++i)
	{
		v[id[find(i)]].push_back(a[i]);
	}
	int minn=Inf,pos=0;
	for(int i=1;i<=cnt;++i)
	{
		std::sort(v[i].begin(),v[i].end());
		if(v[i][0]<minn)
		{
			minn=v[i][0];
			pos=i;
		}
	}
	std::swap(v[1],v[pos]);
	for(int i=2;i<=cnt;++i) b[i]=i;
	std::sort(b+2,b+cnt+1,cmp);
	for(auto it:v[1])
	{
		q.push(it);
	}
	ll ans=0;
	for(int i=2;i<=cnt;++i)
	{
		if(q.empty())
		{
			printf("Impossible\n");
			return 0;
		}
		x=q.top();
		q.pop();
		ans+=x+v[b[i]][0];
		for(int j=1;j<(int)v[b[i]].size();++j)
		{
			q.push(v[b[i]][j]);
		}
	}
	printf("%lld\n",ans);
    return 0;
}
// I A K I O I

Measured memory_bytes: 7296
public class Main {
  private static void solve() {
    char[] s = ns();
    int now = 0;
    int ret = 0;
    for (char c : s) {
      if ( c == 'A' || c == 'C' || c=='T'||c=='G') {
        now ++;
        ret = Math.max(ret, now);
      } else {
        now = 0;
      }
    }
    out.println(ret);
  }

  public static void main(String[] args) {
    new Thread(null, new Runnable() {
      @Override
      public void run() {
        long start = System.currentTimeMillis();
        String debug = args.length > 0 ? args[0] : null;
        if (debug != null) {
          try {
            is = java.nio.file.Files.newInputStream(java.nio.file.Paths.get(debug));
          } catch (Exception e) {
            throw new RuntimeException(e);
          }
        }
        reader = new java.io.BufferedReader(new java.io.InputStreamReader(is), 32768);
        solve();
        out.flush();
        tr((System.currentTimeMillis() - start) + "ms");
      }
    }, "", 64000000).start();
  }

  private static java.io.InputStream is = System.in;
  private static java.io.PrintWriter out = new java.io.PrintWriter(System.out);
  private static java.util.StringTokenizer tokenizer = null;
  private static java.io.BufferedReader reader;

  public static String next() {
    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
      try {
        tokenizer = new java.util.StringTokenizer(reader.readLine());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return tokenizer.nextToken();
  }

  private static double nd() {
    return Double.parseDouble(next());
  }

  private static long nl() {
    return Long.parseLong(next());
  }

  private static int[] na(int n) {
    int[] a = new int[n];
    for (int i = 0; i < n; i++)
      a[i] = ni();
    return a;
  }

  private static char[] ns() {
    return next().toCharArray();
  }

  private static long[] nal(int n) {
    long[] a = new long[n];
    for (int i = 0; i < n; i++)
      a[i] = nl();
    return a;
  }

  private static int[][] ntable(int n, int m) {
    int[][] table = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        table[i][j] = ni();
      }
    }
    return table;
  }

  private static int[][] nlist(int n, int m) {
    int[][] table = new int[m][n];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        table[j][i] = ni();
      }
    }
    return table;
  }

  private static int ni() {
    return Integer.parseInt(next());
  }

  private static void tr(Object... o) {
    if (is != System.in)
      System.out.println(java.util.Arrays.deepToString(o));
  }
}


Measured memory_bytes: 22484
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;

using System.Collections;

class Program
{
    static void Main()
    {

        Regex reg = new Regex("AB");
        int N = int.Parse(Console.ReadLine());
        string[] strs = Enumerable.Range(0, N).Select(n => Console.ReadLine()).ToArray();
        int ans = strs.Select(s => reg.Matches(s).Count).Sum();

        int cnt_bxa = strs.Count(s => s.StartsWith("B") && s.EndsWith("A"));
        int cnt_xa = strs.Count(s => s.EndsWith("A")) - cnt_bxa;
        int cnt_bx = strs.Count(s => s.StartsWith("B")) - cnt_bxa;


        if (cnt_bxa != 0)
        {
            ans += cnt_bxa - 1;
            if (cnt_xa != 0)
            {
                ans += 1;
                cnt_xa -= 1;
            }
            if (cnt_bx != 0)
            {
                ans += 1;
                cnt_bx -= 1;
            }
            ans += Math.Min(cnt_bx, cnt_xa);
        }
        else
        {
            ans += Math.Min(cnt_bx, cnt_xa);
        }

        Console.WriteLine(ans);
    }
}


static class MathUtil
{
    public static IEnumerable<IEnumerable<int>> GetPermutation(int n)
    {
        if (n == 0)
        {
            yield return Single(0);
            yield break;
        }

        for (int i = 0; i <= n; i++)
        {
            foreach (var x in GetPermutation(n - 1))
            {
                yield return Single(i).Concat(x.Select(itm => itm < i ? itm : itm + 1));
            }
        }
    }

    private static IEnumerable<int> Single(int x)
    {
        yield return x;
    }

    public static IEnumerable<int> EnumeratePrimeNumbers()
    {
        List<int> primes = new List<int>() { 2 };
        yield return 2;

        for (int i = 3; i < int.MaxValue; i++)
        {
            bool isPrime = true;
            int Sqrt = (int)Math.Sqrt(i) + 1;

            foreach (var prime in primes)
            {
                if (prime > Sqrt)
                {
                    break;
                }
                if (i % prime == 0)
                {
                    isPrime = false;
                    break;
                }
            }

            if (isPrime)
            {
                primes.Add(i);
                yield return i;
            }
        }
    }
}


Measured memory_bytes: 18380
#include <stdio.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <iterator>
#include <assert.h>
#pragma warning(disable:4996) 
 
typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF 9223300000000000000
#define INF 2140000000
const long long MOD = 1000000007;
//const long long MOD = 998244353;
using namespace std;

vector<vector<int> > g;
vector<int> vis;
vector<int> loop;

int dfs( int curr )       // return 1: loop is detected and writing loop data now   2: loop is detected
{
    vis[curr]=1;
    int siz=(int)g[curr].size();
    int i;
    for(i=0; i<siz; i++) {
        int next=g[curr][i];

        if(vis[next]==1) {
            loop.push_back(next);
            return 1;
        }

        int chk=dfs(next);
        if(chk==1) {
            loop.push_back(next);
            if(curr==loop[0]) {
                return 2;
            }
            return 1;
        }
        else if(chk==2) {
            return 2;
        }
    }
    vis[curr]=2;

    return 0;
}

int main(int argc, char* argv[])
{
    int n,m;
    scanf("%d%d", &n, &m);

    g.resize(n);
    vis.resize(n);
    int i;
    for(i=0; i<m; i++) {
        int a,b;
        scanf("%d%d", &a, &b); a--; b--;
        g[a].push_back(b);
    }

    int chk=0;
    for(i=0; i<n; i++) {
        chk = dfs(i);
        assert(chk!=1);
        if(chk==2) {
            break;
        }
    }
    if(chk==0) {   // loop is not detected
        printf("-1\n"); return 0;
    }
    reverse(loop.begin(), loop.end());

    int siz=(int)loop.size();
    while( 1 ) {
        vector<int> id(n,-1);
        for(i=0; i<siz; i++) {
            id[loop[i]]=i;
        }

        vector<int> loop_new;
        for(i=0; i<siz; i++) {
            int curr=loop[i];
            int j,next;
            for(j=0; j<(int)g[curr].size(); j++) {
                next=g[curr][j];
                if(id[next]>=0 && id[next]!=(i+1)%siz) {
                    break;
                }
            }
            if(j<(int)g[curr].size()) {
                loop_new.push_back(curr);
                loop_new.push_back(next);
                int tmp=(id[next]+1)%siz;
                while(tmp!=i) {
                    loop_new.push_back(loop[tmp]);
                    tmp=(tmp+1)%siz;
                }
                break;
            }
        }
        if(i<siz) {
            assert(loop.size()>loop_new.size());
            loop.swap(loop_new);
            siz=(int)loop.size();
        }
        else {
            break;
        }
    }

    printf("%d\n", (int)loop.size());
    for(i=0; i<(int)loop.size(); i++) {
        printf("%d\n", loop[i]+1);
    }

    return 0;
}


Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
const int maxN=100005;
int n,k,a[maxN];
int cal(int x,int y){return x?(x-1)/y+1:0;}
int main(){
 // freopen("aa.in","r",stdin);
  int i,j;
  scanf("%d%d",&n,&k);
  for(i=1;i<=n;++i)scanf("%d",a+i);
  for(i=1;i<=n;++i)if(a[i]==1)break;
  int ans=n;
  for(int l=1;l<=n;++l){
    int r=min(l+k-1,n);
    ans=min(ans,cal(l-1,k-1)+1+cal(n-r,k-1));
  }
  printf("%d\n",ans);
  return 0;
}

Measured memory_bytes: 640
#include<stdio.h>
int time[24][60];
int main(void)
{
	int i, j, h, m, f;
	for (i=0; i<2; ++i) {
		scanf("%d", &j);
		for (; j>0; --j) {
			scanf("%d %d", &h, &m);
			time[h][m] = 1;
			}   }   f = 1;
			for (i=0; i<24; ++i)
			for (j=0; j<60; ++j)
			if ( time[i][j] ){
				if ( !f ) printf(" ");
					else f = 0;
					printf("%d:%02d", i, j);
					}   printf("\n");
				return 0;
}

Measured memory_bytes: 620
#include <iostream>
#include <algorithm>
#include <map>
#include <string>
#include <math.h>
typedef long long ll;

using namespace std;

int main(){
    double A,B,C,D,E,F;
    cin >> A >> B >> C >> D >> E >> F;
    A*=100;
    B*=100;

    double res1=100,res2=0;
    for (int i=0;A*i<=F;i++){
	for (int j=0;(A*i+B*j)<=F;j++){
	    for (int k=0;(A*i+B*j+C*k)<=F;k++){
	       for (int l=0;(A*i+B*j+C*k+D*l)<=F;l++){
		   double a=A*i+B*j,b=C*k+D*l;
		   if (E*a >= 100*b){
		       if (b*res1 >= res2*(a+b)){
			   res1=a+b;
			   res2=b;
		       }
		   }
	       }
	   }
	}
    }

    cout << res1 << " " << res2 << endl;

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdlib>
#include<cstring>
#include<stack>
#include<queue>
#include<algorithm>
#include<vector>
#include<math.h>
#include<bitset>
#include<iomanip>
#include<numeric>
#include<list>
using namespace std;

typedef stack<int> IntStack;
typedef queue<int> IntQueue;

const double pi = 3.141592653589793;


//最大公約数
template<class T> T gcd(T a, T b)
{
	while (true)
	{
		T r;
		if (a%b == 0) return b;
		else
		{
			r = a % b;
			a = b;
			b = r;
		}
	}
}
//最小公倍数
template<class T> T lcm(T a, T b)
{
	return a / gcd(a, b)*b;
}
//文字0~9をint型0~9に変換
int char_to_int(char c)
{
	if (c == '0') return 0;
	if (c == '1') return 1;
	if (c == '2') return 2;
	if (c == '3') return 3;
	if (c == '4') return 4;
	if (c == '5') return 5;
	if (c == '6') return 6;
	if (c == '7') return 7;
	if (c == '8') return 8;
	if (c == '9') return 9;
	else return -1;
}
//int型0~9を文字0~9に変換
char int_to_char(int c) {
	if (c == 0) return '0';
	if (c == 1) return '1';
	if (c == 2) return '2';
	if (c == 3) return '3';
	if (c == 4) return '4';
	if (c == 5) return '5';
	if (c == 6) return '6';
	if (c == 7) return '7';
	if (c == 8) return '8';
	if (c == 9) return '9';
	else return'x';
}
//a^b mod MODを計算
long long int ModPower(long long int a, long long int b, long long int MOD)
{
	if (b == 0) return 1;
	else if (b % 2 == 0)
	{
		long long int d = ModPower(a, b / 2, MOD);
		return (d*d) % MOD;
	}
	else
	{
		return (a*ModPower(a, b - 1, MOD)) % MOD;
	}
}
//nCr mod MODを計算
long long int ModCombi(long long int n, long long int r, long long int MOD)
{
	if (n == 0 || r == 0) return 1;

	long long int Kn = 1, Kr = 1, Knr = 1;

	long long int temp = 1;
	for (long long int i = 1; i <= n; i++)
	{
		temp *= i;
		temp %= MOD;
		if (i == n) Kn = temp;
		if (i == r) Kr = temp;
		if (i == n - r) Knr = temp;
	}

	long long int x = ModPower(Kr, MOD - 2, MOD);
	long long int y = ModPower(Knr, MOD - 2, MOD);

	long long int ans;
	ans = Kn * x;
	ans %= MOD;
	ans *= y;
	ans %= MOD;

	return ans;
}
//int型10進数をord桁のstring型2進数に変換する
string binary(int x, int ord)
{
	int y;
	string ans = "";
	for (int i = 0; i < ord; i++)
	{
		y = x / (int)pow(2, ord - 1 - i);
		y %= 2;
		if (y == 0) ans += "0";
		else ans += "1";
	}

	return ans;
}
//ord桁のstring型2進数をint型10進数に変換する
int rep_binary(string x, int ord)
{
	int res = 0;
	for (int i = 0; i < ord; i++)
	{
		if (x[i] == '1') res += (int)pow(2, ord - 1 - i);
	}
	return res;
}
//xとyのビットごとの排他的論理和
template<class T> T XOR(T x, T y)
{
	T n = 0;
	while (max(x, y) > pow(2, n)) n++;
	T ans=0;
	for (int i = 0; i <= n; i++)
	{
		T x1 = (x % (T)pow(2, i + 1)) / (T)pow(2, i);
		T y1 = (y % (T)pow(2, i + 1)) / (T)pow(2, i);
		if (x1 != y1) ans += (T)pow(2, i);
	}
	return ans;
}

/*ここまでテンプレ*//*ここまでテンプレ*//*ここまでテンプレ*//*ここまでテンプレ*/



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

	long long x = N / K;

	long long y;
	if (K % 2 == 1) y = 0;
	else
	{
		y = N / (K / 2);
		y -= x;
	}

	cout << x*x*x + y*y*y << endl;
	
		 
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <unordered_map>
#include <unordered_set>
#include <set>
#include <map>
#include <climits>
#include <queue>

using namespace std;

#define int long long int

// int MOD = 1e9 + 7;
int dp[101];

int32_t main(){
	ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	int N;
	cin>>N;
	int ans = N+1;
	for(int i = 2; i*i< 2*N; i++){
		if(N%i == 0){
			ans = min(ans, N/i + i);
		}
	}
	cout<<ans-2<<endl;
	return 0;
}

Measured memory_bytes: 256
// inputに入力データ全体が入る
function Main(input) {
  var list = input.split("\n")[1].split(" ").map((list)=>Number(list));
  var max = Math.max.apply(null,list);
  list.splice(list.indexOf(max),1);
  var sum = 0;
  for(var i = 0; i < list.length; i++){
    sum += list[i];
  }
  if(sum > max){
     console.log("Yes");
     }else{
     console.log("No");
     }
}

//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7372
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long ll;

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

    int a = A;
    if (a < B)
    {
        a = B;
    }
    vector<int> res;
    for (int i = 1; i <= a; i++)
    {
        if (A % i == 0 && B % i == 0)
        {
            res.push_back(i);
        }
    }
    cout << res.at(res.size() - K) << endl;
}

Measured memory_bytes: 256
import math
import sys
import numpy as np
from collections import defaultdict, deque, Counter 
from itertools import accumulate, product, permutations,combinations, combinations_with_replacement
from operator import itemgetter
from bisect import bisect_left,bisect
from heapq import heappop,heappush
from fractions import gcd

max_value = 1000000000
min_value = -1000000000
sys.setrecursionlimit(max_value)


n = int(input())
v_list = list(map(float,input().split()))
v_list.sort()

v_list = np.array(v_list)


for i in range(n):
	v_list[i] = v_list[i] / (2**(n-i))
v_list[0] = v_list[0] * 2

print((np.sum(v_list)))

Measured memory_bytes: 13708
#include <bits/stdc++.h>
using namespace std;
int x,y,xx,yy;
int main(){
    cin>>xx>>yy>>x>>y;
    x-=xx;y-=yy;
    for(int i=0;i<x;i++)cout<<"R";
    for(int i=0;i<y;i++)cout<<"U";
    for(int i=0;i<x;i++)cout<<"L";
    for(int i=0;i<y;i++)cout<<"D";
    cout<<"D";
    for(int i=0;i<=x;i++)cout<<"R";
    for(int i=0;i<=y;i++)cout<<"U";
    cout<<"L";
    cout<<"U";
    for(int i=0;i<=x;i++)cout<<"L";
    for(int i=0;i<=y;i++)cout<<"D";
    cout<<"R";
    return 0;
}


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

using std::inplace_merge;
using std::sort;

const int MAXN=200005;
int n;
int a[MAXN],b[MAXN];

void mge_sort(int a[],long long mid){
	int pos=n;
	for(int i=0;i<n;++i){
		if(pos==n&& a[i]>=mid) pos=i;
		a[i]&=mid-1;
	}
	inplace_merge(a,a+pos,a+n);
}

inline int cal(long long lim){
	long long ret=0;
	for(int i=0,cur=n-1;i<n;++i){
		while(cur>=0 && a[i]+b[cur]>=lim)
			--cur;
		ret+=n-1-cur;
	}
	return ret&1;
}

int main(){
	scanf("%d",&n);
	for(int i=0;i<n;++i)
		scanf("%d",&a[i]);
	for(int i=0;i<n;++i)
		scanf("%d",&b[i]);
	sort(a,a+n),sort(b,b+n);
	int ans=0;
	for(int i=29,tmp;i>=0;--i){
		mge_sort(a,2LL<<i),mge_sort(b,2LL<<i);
		tmp=cal(1LL<<i)^cal(2LL<<i)^cal(3LL<<i);
		ans|=tmp<<i;
	}
	printf("%d",ans);
	return 0;
}

Measured memory_bytes: 2176
<?php
$in = trim(fgets(STDIN));
$h = 0;
$m = 0;
$s = 0;
$a = 0;
if($in >= 3600)
{
    $h = $in / 3600;
    $a = $in % 3600;
    if($in >= 60)
    {
        $m = $a / 60;
        $s = $a % 60;
    }
}
elseif($in >= 60)
{
    $m = $in / 60;
    $s = $in % 60;
}
else {
    $s = $in;
}
echo floor($h) . ":" . floor($m) . ":" . floor($s);
echo "\n";

Measured memory_bytes: 15324