akhauriyash/Code-Regression huggingface dataset:
#include <iostream>                                             
#include <cmath>                                                
using namespace std;                                            
                                                                
bool isprime(int x) {                                           
  if (x==2) {                                                   
    return true;                                                
  }                                                             
  if (x<2 || x%2==0) {                                          
    return false;                                               
  }                                                             
  int i=3; //for (i=3; i*i<=x; i+=2) {                          
  while (i<=sqrt(x)) { // i=???x                                 
    if (x%i==0) {                                               
      return false;                                             
    }                                                           
    i+=2;                                                       
  }                                                             
  return true;                                                  
}                                                               
                                                                
int main(void) {                                                
  int n;                                                        
  cin >> n;                                                     
  int a, ans=0;                                                 
  for (int i=0; i<n; i++) {                                     
    cin >> a;                                                   
    if (isprime(a)) {                                           
      ans++;                                                    
    }                                                           
  }                                                             
  cout << ans << endl;                                          
}                                                               
                           

Measured memory_bytes: 3080
# import sys
# sys.setrecursionlimit(10 ** 6)
# import bisect
# from collections import deque
# from decorator import stop_watch
#
#
# @stop_watch
def solve(S, T):
    alp = 'abcdefghijklmnopqrstuvwxyz'
    N = len(S)
    S_same = [[] for _ in range(N)]
    S_alphabet = {s: [] for s in alp}
    T_same = [[] for _ in range(N)]
    T_alphabet = {s: [] for s in alp}
    for i in range(N):
        S_alphabet[S[i]].append(i)
        T_alphabet[T[i]].append(i)
    for s in alp:
        stmp = S_alphabet[s]
        ttmp = T_alphabet[s]
        if len(stmp) > 0:
            S_same[stmp[0]] = stmp.copy()
        if len(ttmp) > 0:
            T_same[ttmp[0]] = ttmp.copy()
    for i in range(N):
        if len(S_same[i]) > 1:
            for ss in S_same[i][1:]:
                if T[S_same[i][0]] != T[ss]:
                    print('No')
                    return
        if len(T_same[i]) > 1:
            for tt in T_same[i][1:]:
                if S[T_same[i][0]] != S[tt]:
                    print('No')
                    return
    print('Yes')


if __name__ == '__main__':
    S = input()
    T = input()
    solve(S, T)

    # # test
    # from random import randint
    # from func import random_str
    # solve()


Measured memory_bytes: 51724
#include<bits/stdc++.h>
using namespace std;
//<<setprecision(30)
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define rep1(i, n) for (ll i = 1; i <= (ll)(n); i++)
#define INF 1000000000000
#define MOD 1000000007
using ll = long long;
using Graph = vector<vector<int>>;

int main(){
  int N,M; cin>>N>>M;
  vector<int> A(N);
  int s = 0;
  rep(i,N){
    cin>>A.at(i);
    s+=A.at(i);
  }
  sort(begin(A),end(A));
  if(A.at(N-M)*4*M<s)cout<<"No"<<endl;
  else cout<<"Yes"<<endl;
}

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

int main(){


  int pasta1;
  int pasta2;
  int pasta3;
  int juice1;
  int juice2;
  cin >> pasta1 >> pasta2 >> pasta3 >> juice1 >> juice2;
  cout << min( pasta1 , min( pasta2 ,pasta3)) + min( juice1 ,juice2) -50 <<endl;

  return 0;
}

Measured memory_bytes: 1160
#include<iostream>
#include<iomanip>
//#include<cstdio>
#include<vector>
#include<map>
#include<queue>
#include<algorithm>
#include<cmath>
using namespace std;
typedef long long ll;
int N;
string A[500];
int dist[1<<10];

int main(){
	cin >> N;
	for(int i=0; i<N; i++) cin >> A[i];

	vector<int> nrow(N, 0);
	vector<int> ncol(N, 0);
	for(int i=0; i<N; i++){
		for(int j=0; j<N; j++){
			if(A[i][j] == '#'){
				nrow[i]++;
				ncol[j]++;
			}
		}
	}

	int max_row = nrow[0];
	for(int i=0; i<N; i++){
		max_row = max(max_row, nrow[i]);
	}

	int done_col = 0;
	for(int i=0; i<N; i++){
		if(ncol[i] == N) done_col++;
	}

	int ans = 1e6;
	for(int i=0; i<N; i++){
		if(ncol[i] > 0){
			ans = min(ans, N-nrow[i]+N-done_col);
		}
		else{
			ans = min(ans, N-nrow[i]+1+N-done_col);
		}
	}

	if(max_row == 0){
		cout << -1 << endl;
	}
	else{
		cout << ans << endl;
	}

	return 0;
}


Measured memory_bytes: 640
#include <iostream>

using namespace std;

int a(string S) {
  if (S == "SUN") return 7;
  if (S == "MON") return 6;
  if (S == "TUE") return 5;
  if (S == "WED") return 4;
  if (S == "THU") return 3;
  if (S == "FRI") return 2;
  if (S == "SAT") return 1;
}

int main() {
  string S;
  cin >> S;

  cout << a(S);

  return 0;
}

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

typedef long long ll;

const int mod = 1000000007;

int n, a, b;

int toPower(int a, int p)
{
    int res = 1;
    while (p) {
        if (p & 1) res = ll(res) * a % mod;
        p >>= 1; a = ll(a) * a % mod;
    }
    return res;
}

int Inv(int x) { return toPower(x, mod - 2); }

int C(int n, int k)
{
    int res = 1;
    for (int i = 1; i <= k; i++)
        res = ll(res) * (n + 1 - i) % mod * Inv(i) % mod;
    return res;
}

int main()
{
    cin >> n >> a >> b;
    int res = (toPower(2, n) - 1 + mod) % mod;
    res = (res - C(n, a) + mod) % mod;
    res = (res - C(n, b) + mod) % mod;
    printf("%d\n", res);
    return 0;
}


Measured memory_bytes: 384
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
#include <iterator>  // std::back_inserter()
#include <set>
#include <algorithm>  // std::copy()
#include <functional>  // std::greater<T>()
#include <utility>  // std::swap()
#include <numeric>  // accumulate(ALL(vec), 0)  0 は初期値
#include <cmath>
#include <climits>  // INT_MIN
#include <cctype>  // std::isdigit()
using namespace std;

#define ALL(obj) (obj).begin(), (obj).end()
#define REP(i, n) for (int i=0; i < (int)(n); i++)  // 0 ~ n-1
#define REPN(i, n) for (int i=1; i <= (int)(n); i++)  // 1 ~ n
#define MIN(vec) min_element(ALL((vec)))  // イテレータのため、値を取り出すときは * を先頭につける
#define MAX(vec) max_element(ALL((vec)))
#define IDX(vec, element_iter) distance((vec).begin(), element_iter)
#define SUM(vec) accumulate(ALL((vec)), 0)  // 0 は初期値
#define COPY(vec1, vec2) copy(ALL(vec1), back_inserter(vec2))  // vec1をvec2にコピーする vec2は空にしておく必要あり
typedef long long ll;

const int MOD = 1000000007;  // 1 000 000 007


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

    // input
    string str;
    cin >> str;
    
    // calculation
    size_t len = str.length();
    int NUM = 753, num, res = 10000;
    REP(i, len - 2) {
        res = min(res, abs(NUM - stoi(str.substr(i, 3))));
    }
    cout << res << "\n";
    
    return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
int main(void)
{
    long int n;
    scanf("%ld\n",&n);
    long long int a[200005]={};
    for(int p=0;p<n;p++)scanf("%lld\n",&a[p]);
    long int pointer;
    long long int sum=0;
    long long int keep=0;
    if(a[0]!=0)
    {
        printf("-1");
        return 0;
    }
    for(pointer=1;pointer<n;pointer++)
    {
        if(a[pointer]-a[pointer-1]>=2)
        {
            printf("-1");
            return 0;
        }
    }
    for(pointer=n-1;pointer>=0;pointer--)
    {
        keep--;
        if(keep<a[pointer])
        {
            sum+=a[pointer];
            keep=a[pointer];
            //printf("##%lld##\n",a[pointer]);
        }
    }
    printf("%lld\n",sum);
    return 0;
}


Measured memory_bytes: 1664
#include <bits/stdc++.h>
#define maxn 505
using namespace std;

int n;
string s[maxn];
int col[maxn];

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

	bool any_black = false;
	for (int j = 0; j < n; j++) {
		for (int i = 0; i < n; i++) if (s[i][j] == '#') {
			col[j]++;
			any_black = true;
		}
	}

	if (!any_black) {
		printf("-1\n");
		return 0;
	}

	int ret = 1e9;
	for (int i = 0; i < n; i++) {
		int cur = 0;
		if (col[i] == 0) {
			cur++;
		}
		for (int j = 0; j < n; j++) if (s[i][j] == '.') {
			cur++;
		}
		for (int j = 0; j < n; j++) if (col[j] < n) {
			cur++;
		}
		ret = min(ret, cur);
	}

	printf("%d\n", ret);
	return 0;
}

Measured memory_bytes: 512
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <vector>
#include <queue>
#include <iostream>
#include <set>
#include <map>
#include <string>
#include <algorithm>

using namespace std;

typedef long long int ll;
typedef pair<int, int> Pii;
typedef pair<int, double> Pid;
typedef pair<double, int> Pdi;
typedef pair<double, double> Pdd;
typedef pair<ll, ll> P;
typedef pair<P, ll> PP;

const ll mod = 1e9+7;
const int INF = 2e9;
const double epsilon = 1e-7;
const double PI = 3.1415926535;

ll mi(ll x, ll y){
    if(x<y)return x;
    return y;
}

int main(void){
    int n, a, b; cin >> n >> a >> b;
    cout << mi(b, a * n) << endl;
	return 0;
}


Measured memory_bytes: 256
Scanf.scanf "%f %f %f %f" (fun a b h m ->
    let pi = 3.1415926535897932384626 in
    let hdeg = (h +. m /. 60.) /. 6. *. pi in
    let mdeg = m /. 30. *. pi in

    let x1 = a *. cos hdeg in
    let y1 = a *. sin hdeg in
    let x2 = b *. cos mdeg in
    let y2 = b *. sin mdeg in

    let f g h = (g -. h) *. (g -. h) in
    let ans = sqrt (f x1 x2 +. f y1 y2) in
    Printf.printf "%.10f\n" ans
)


Measured memory_bytes: 4384
import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int n = sc.nextInt();
        int[] w = new int[n];
        
        for(int i = 0; i < n; i++) w[i] = sc.nextInt();
        
        int min = Integer.MAX_VALUE;
        
        for(int i = 0; i < n-1; i++){ //何個目を指定するか
            int l = 0; //左の総和
            int r = 0; //右の総和
            
            for(int j = i; j >= 0; j--){ //左
                l+=w[j];
            }
            
            for(int j = i+1; j < n; j++){ //右
                r+=w[j];
            }
            
            min = Math.min(min, Math.abs(l - r));
        }
        
        System.out.println(min);
    }
}


Measured memory_bytes: 23252
N, M = map(int, input().split())
X = list(map(int, input().split()))
ans = 0
if M>N:
  X.sort()
  D = []
  for i in range(M-1):
    d = X[i+1]-X[i]
    D.append(d)
  
  D.sort()
  D = D[:(M-N)]
  ans = sum(D)
  
print(ans)
  


Measured memory_bytes: 13968
H, W, M = map(int, input().split())
bom = set()
row = [0] * H
col = [0] * W

for _ in range(M):
    h, w = map(int, input().split())
    bom.add((h-1, w-1))
    row[h-1] += 1
    col[w-1] += 1

max_row = max(row)
max_col = max(col)
ans = max_row + max_col - 1

p, q = [], []

for i in range(H):
    if row[i] == max_row:
        p.append(i)

for j in range(W):
    if col[j] == max_col:
        q.append(j)

flag = False
for i in p:
    for j in q:
        if (i, j) not in bom:
            ans += 1
            flag = True
            break
    if flag:
        break

print(ans)


Measured memory_bytes: 83412
#define _USE_MATH_DEFINES
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <climits>
#include <clocale>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <deque>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <regex>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>

using namespace std;

#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i, s, n) for(int i = (s), i##_len=(n); i < i##_len; ++i)
#define FORS(i, s, n) for(int i = (s), i##_len=(n); i <= i##_len; ++i)
#define VFOR(i, s, n) for(int i = (s); i < (n); ++i)
#define VFORS(i, s, n) for(int i = (s); i <= (n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define REPS(i, n) FORS(i, 0, n)
#define VREP(i, n) VFOR(i, 0, n)
#define VREPS(i, n) VFORS(i, 0, n)
#define RFOR(i, s, n) for(int i = (s), i##_len=(n); i >= i##_len; --i)
#define RFORS(i, s, n) for(int i = (s), i##_len=(n); i > i##_len; --i)
#define RREP(i, n) RFOR(i, n, 0)
#define RREPS(i, n) RFORS(i, n, 0)
#define IREP(i, v) for(auto i = (v).begin(); i != (v).end(); ++i)
#define IRREP(i, v) for(auto i = (v).rbegin(); i != (v).rend(); ++i)
#define ALL(v) (v).begin(), (v).end()
#define SORT(v) sort(ALL(v))
#define RSORT(v) sort(ALL(v), greater<decltype(v[0])>())
#define SZ(x) ((int)(x).size())
#define REV(x) reverse(ALL(x))
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define MT make_tuple
#define BIT(n) (1LL<<(n))
#define UNIQUE(v) v.erase(unique(ALL(v)), v.end())

using ld = long double;
using ll = long long;
using ui = unsigned int;
using ull = unsigned long long;
using Pi_i = pair<int, int>;
using Pll_ll = pair<ll, ll>;
using VB = vector<bool>;
using VC = vector<char>;
using VD = vector<double>;
using VI = vector<int>;
using VLL = vector<ll>;
using VS = vector<string>;
using VSH = vector<short>;
using VULL = vector<ull>;

const int MOD = 1000000007; 
const int INF = 1000000000; //1e9
const int NIL = -1;
const ll LINF = 1000000000000000000; // 1e18
const double EPS = 1E-10;

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


int main(){
    int N; cin >> N;
    VI a(N), b(N);
    REP(i, N) cin >> a[i];
    REP(i, N) cin >> b[i];
    ll cnt(0), cnt_2(0);
    REP(i, N){
        cnt += b[i] - a[i];
        if(b[i] > a[i]) cnt_2 += (b[i]-a[i]+1) / 2;
    }
    cout << ((cnt_2 <= cnt) ? "Yes" : "No") << endl;
    return 0;
}


Measured memory_bytes: 384
//
//  atcoder.cpp
//
//
///
#include <bits/stdc++.h>
#include <boost/optional.hpp>
#include <boost/range/irange.hpp>
#include <boost/range/algorithm.hpp>
#include <boost/range/numeric.hpp>
#include <boost/bimap/bimap.hpp>
#include <boost/bimap/multiset_of.hpp>
#include <boost/multi_array.hpp>
#include <boost/integer/common_factor_rt.hpp>
#include <boost/algorithm/string.hpp>

#define REP(i, N) for(int i=0; i<(N); i++)
#define REC(f, ...) (void)0; const auto f = [&](const auto f, __VA_ARGS__)
using namespace std;
using namespace boost::integer;

using ll = long long;
namespace bst = boost;
template<typename T> class in {
    T value;
public:
    in() { cin >> value; }
    operator const T&() const { return value; }
    operator T&() { return value; }
    in& operator=(T source) { value = source; return *this; }
};
template<> class in<string> : public string {
public:
    in() { cin >> *this; }
};
template<class T> class inseq : public T {
public:
    template<typename... Arg> inseq(Arg... arg) : T(forward<Arg>(arg)...) { for (auto&& i : *this) cin >> i; }
};
template<class T> using invec = inseq<vector<T>>;

auto solve() {
  in<long double> A, B, H, M;
  
  long double arad = 3.1415926535897932 * 2.0 * (H*60.0+M) / (12.0*60.0),
  brad = 3.1415926535897932 * 2.0 * (M) / (60.0),
  ax = A * sin(arad),ay = A  * cos(arad), bx = B  * sin(brad), by = B  * cos(brad);
  
  


  long double aa = ax-bx, aaa = ay-by;
  return sqrt(aa*aa + aaa*aaa);
}

template<typename T> void plot(const T& func) { cout << func() << endl; }
template<> void plot<void()>(void(&func)()) { func(); }
template<> void plot<long double()>(long double(&func)()) { cout << setprecision(11) << func() << endl; }

int main() {
  plot(solve);

  return 0;
}



Measured memory_bytes: 4188
import java.util.*;
class Main {
	static int[][] map;
	static int x;
	static int y;
	public static void main(String[] args) {
		Scanner stdIn = new Scanner(System.in);
		while(true) {
			x = stdIn.nextInt();
			y = stdIn.nextInt();
			if(x == 0 && y == 0) break;
			map = new int[y+1][x];
			for(int i = 0; i < y; i++) {
				for(int j = 0; j < x; j++) {
					map[i][j] = stdIn.nextInt();
				}
			}
			int sum = 0;
			for(int i = 0; i < x; i++) {
				sum += solv(y-1,i,false);
				if(y >= 2 && map[y-1][i] == 2) {
					sum += solv(y-1,i,true);
				}
				if(y >= 2 && map[y-2][i] == 2) {
					sum += solv(y-2,i,true);
				}
			}
			System.out.println(sum);
		}
	}
	
	static int solv(int y, int x, boolean jump) {
		int ret = 0;
		
		if(y < 0 || x < 0 || x >= Main.x) return 0;
		
		if(map[y][x] == 1) return 0;
		
		if(map[y][x] == 2 && !jump) return 0;
		if(y == 0) return 1;
		
		if(y >= 2 && map[y-2][x] == 2) {
			ret += solv(y-2,x,true);
		}
		if(!jump) {
		ret += solv(y-1,x-1,false);
		ret += solv(y-1,x+1,false);
		}
		ret += solv(y-1,x,false);
		
		return ret;
	}
}

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

int main(){
  int h, w, k, a = 0;
  cin >> h >> w >> k;
  vector<string> v(h);
  rep(i, h) cin >> v[i];
  rep(i, 1 << (h + w)){
    int tmp = 0;
    rep(j, h){
      rep(l, w){
        if(i & 1 << j || i & 1 << (l + h)) continue;
        else if(v[j][l] == '#') ++tmp;
      }
    }
    if(tmp == k) ++a;
  }
  cout << a << "\n";
  return 0;
}

Measured memory_bytes: 3580
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#include <queue>
#include <stack>

using namespace std;

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

const ll mod = 1000000007;

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

  ll n, k;
  cin >> n >> k;
  vector<ll> a(n), f(n);
  for (auto &x: a) cin >> x;
  for (auto &x: f) cin >> x;

  sort(a.begin(), a.end());
  sort(f.rbegin(), f.rend());

  ll ok = (ll) 1e18;
  ll ng = -1;
  while (abs(ok - ng) > 1) {
    ll target = (ok + ng) / 2;
    ll needed = 0;
    for (int i = 0; i < n; i++) needed += max(0LL, (a[i] * f[i] - target + f[i] - 1) / f[i]);
    if (needed <= k) ok = target;
    else ng = target;
  }

  cout << ok << endl;

  return 0;
}


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

int main()
{
    int H,W;
    cin >> H >> W;
    vector<string> S(H);
    for(int i=0; i<H; i++){
        cin >> S[i];
    }
    vector<bool> yoko(W, false);
    vector<bool> tate(H,false);
    
    for(int i=0; i<H; i++){
        for(int j=0; j<W; j++){
            if(S[i][j] == '#'){
                yoko[j] = true;
                tate[i] = true;
            }
        }
    }
    for(int i=0; i<H; i++){
        if(tate[i] == true){
            for(int j=0; j<W; j++){
                if(yoko[j] == true){
                    cout << S[i][j];
                }
            }
            cout << endl;
        }
    }
}



Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int MAXN = 100 * 1000 + 10;

vector <int> adj[MAXN];


int reponse[MAXN];

vector <int> prefixe[MAXN];
vector <int> suffixe[MAXN];
int dfs1(int noeud , int pere , int MOD)
{
	reponse[noeud] = 1;
	for (auto voisin : adj[noeud])
	{
		if (voisin != pere)
		{
			reponse[noeud] = ((1 + dfs1(voisin , noeud , MOD)) * reponse[noeud]) % MOD;
		}
	}
	prefixe[noeud].push_back(1);
	for (int i = 0 ; i < adj[noeud].size() ; i++)
	{
		prefixe[noeud].push_back(prefixe[noeud][i]);
		if (adj[noeud][i] == pere) continue;
		prefixe[noeud][i + 1] = (prefixe[noeud][i + 1] * (1 + reponse[adj[noeud][i]])) % MOD;
	}
	suffixe[noeud].push_back(1);
	for (int i = 0 ; i < adj[noeud].size() ; i++)
	{
		int voisin = adj[noeud][adj[noeud].size() - 1 - i];
		suffixe[noeud].push_back(suffixe[noeud][i]);
		if (voisin == pere) continue;
		suffixe[noeud][i + 1] = (suffixe[noeud][i + 1] * (1 + reponse[voisin])) % MOD;
	}
	return reponse[noeud];
}

void dfs2(int noeud , int pere , int ajout , int MOD)
{
	reponse[noeud] = (reponse[noeud] * ajout) % MOD;
	for (int i = 0 ; i < adj[noeud].size() ; i++)
	{
		int voisin = adj[noeud][i];
		if (voisin == pere) continue;
		dfs2(voisin , noeud , (1 + ((ajout * prefixe[noeud][i]) % MOD) * suffixe[noeud][adj[noeud].size() - 1 - i]) % MOD , MOD);
	}
}
int32_t main()
{
	int N , MOD;
	cin >> N >> MOD;
	for (int i = 0 ; i < N - 1; i++)
	{
		int a,b;
		cin>>a>>b;
		a--;b--;
		adj[a].push_back(b);
		adj[b].push_back(a);
	}
	dfs1(0 , 0 , MOD);
	dfs2(0 , 0 , 1 , MOD);
	for (int i = 0 ; i < N ; i++)
	{
		cout<<reponse[i]<<endl;
	}
}

Measured memory_bytes: 29056
#include<iostream>
#include<cstdio>
#include<iomanip>
#include<vector>
#include<map>
#include<set>
#include<algorithm>
#include<numeric>
#include<limits>
#include<bitset>
#include<functional>
#include<type_traits>
#include<queue>
#include<stack>
#include<array>
#include<random>
#include<utility>
#include<cstdlib>
#include<ctime>

#define ld  long double
#define ll  long long int
#define ull unsigned long long int
#define pb  push_back
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLr(obj) (obj).rbegin(), (obj).rend()
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,s,n) for(int i=s;i<n;i++)

const int    INF = 1e11;
const double EPS = 1e-11;

//切り上げ整数除算
int divRoundUp(const int& a, const int& b) { return (a + b - 1) / b; }
//四捨五入
int roundOff(const double& a) { return (int)(a + 0.5); }
// r の(誤差付きの)符号に従って, -1, 0, 1 を返す.
int sgn(const ld& r) { return (r > EPS) - (r < -EPS); }
// a, b の(誤差付きの)大小比較の結果に従って, -1, 0, 1 を返す.
int sgn(const ld& a, const ld& b) { return sgn(a - b); }

using namespace std;

inline void Main() {
	int s; cin >> s;
	int l = s / 100;
	int r = s - l * 100;
	string ans;
	if (1 <= l && l <= 12) {
		if (1 <= r && r <= 12)
			ans = "AMBIGUOUS";
		else
			ans = "MMYY";
	}
	else {
		if (1 <= r && r <= 12)
			ans = "YYMM";
		else
			ans = "NA";
	}
	cout << ans << endl;
}

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

	Main();

	return 0;
}

Measured memory_bytes: 256
#include <iostream>

using std::cin;
using std::cout;
using std::endl;

int
main()
{
  int N, K;
  cin >> N >> K;
  int ret = K;
  for (int n = 1; n < N; n++)
  {
    ret *= K - 1;
  }
  cout << ret << endl;
  return 0;
}


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

int main() {
  long n,y,ans1=-1,ans2=-1,ans3=-1;
  cin >> n >> y;
  for(long i=0;i<=n&&i*10000<=y;i++) {
    for(long j=0;i+j<=n&&i*10000+j*5000<=y;j++) {
      if(i+j+(y-i*10000-j*5000)/1000==n) ans1=i,ans2=j,ans3=(y-i*10000-j*5000)/1000;
    }
  }
  cout << ans1 << " " << ans2 << " " << ans3 << endl;
}

Measured memory_bytes: 3660
import sys
stdin = sys.stdin
inf = 1 << 60
mod = 1000000007
 
ni      = lambda: int(ns())
nin     = lambda y: [ni() for _ in range(y)]
na      = lambda: list(map(int, stdin.readline().split()))
nan     = lambda y: [na() for _ in range(y)]
nf      = lambda: float(ns())
nfn     = lambda y: [nf() for _ in range(y)]
nfa     = lambda: list(map(float, stdin.readline().split()))
nfan    = lambda y: [nfa() for _ in range(y)]
ns      = lambda: stdin.readline().rstrip()
nsn     = lambda y: [ns() for _ in range(y)]
ncl     = lambda y: [list(ns()) for _ in range(y)]
nas     = lambda: stdin.readline().split()

n = ni()
a = na()

x = [0] * n
x1 = a[0]
for i in range(1, n):
    if i % 2 == 1:
        x1 -= a[i]
    else:
        x1 += a[i]

x[0] = x1 // 2
for i in range(n - 1):
    x[i + 1] = a[i] - x[i]

x = [i * 2 for i in x]

print(*x)

Measured memory_bytes: 15032
#include "bits/stdc++.h"

using namespace std;
#ifdef _DEBUG
#define _GLIBCXX_DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

#define int long long
#define ll long long
#define DBG 1
#define rep(i, a, b) for (int i = (a); i < (b); i++)
#define rrep(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define loop(n) rep(loop, (0), (n))
#define all(c) begin(c), end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
using pii = pair<int, int>;
// template<class T> ostream &operator<<(ostream &os,T &t){dump(t);return os;}
template <typename T, typename S>istream &operator>>(istream &is, pair<T, S> &p) { is >> p.first >> p.second; return is; }
//template <typename T, typename S>ostream &operator<<(ostream &os, pair<T, S> &p) {os << p.first << " " << p.second;return os;}

template <typename T> void printvv(const vector<vector<T>> &v) {
	cerr << endl;
	rep(i, 0, v.size()) rep(j, 0, v[i].size()) {
		if (typeid(v[i][j]).name() == typeid(INF).name() and v[i][j] == INF) {
			cerr << "INF";
		}
		else
			cerr << v[i][j];
		cerr << (j == v[i].size() - 1 ? '\n' : ' ');
	}
	cerr << endl;
}

#ifndef _DEBUG
#define printvv(...)
#endif
void YES(bool f) { cout << (f ? "YES" : "NO") << endl; }
void Yes(bool f) { cout << (f ? "Yes" : "No") << endl; }
template <class T, class U>bool chmin(T& a, U b) { if (a > b) { a = b; return true; }return false; }
template <class T, class U>bool chmax(T& a, U b) { if (a < b) { a = b; return true; }return false; }

signed main(signed argc, char *argv[]) {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(12);

	string S; cin >> S;
	int x = 15 - S.size();
	YES(count(all(S), 'o')+x >= 8);

	return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    int n = scan.nextInt();
    int m = scan.nextInt();
    int sum = 0;
    if (n>=m){
      sum = m;
    }
    else{
      sum = n;
    }
    int what = -1;
    for (int i=sum;i>1;i--){
      if ((n%i == 0) && (m%i == 0)){
        what = i;
        break;
      }
    }

    if (what == -1){
      what = 1;
    }


    long g = (long) n*m/what;
    System.out.println(g);
  }
}


Measured memory_bytes: 35688
#include<bits/stdc++.h>
#include<list>
#include<iterator>
using namespace std;
int main()
{
  int q,f,d,x;
  list<int>lst;
  list<int>::iterator it=lst.end();
  cin>>q;
  while(q--){
    cin>>f;

    if(f==0){
      cin>>d;
      it=lst.insert(it,d);
    }

    if(f==1){
                  cin>>x;
                if(x>0)
              {
                while(x--)
                  it++;
                  }
                else if(x<0)
                  {
                  while(x++)
                  it--;
                }
         }


    else if(f==2)
      it=lst.erase(it);
  }
for(it=lst.begin();it != lst.end();it++)
  cout<<*it<<endl;

  return 0;
}


Measured memory_bytes: 18536
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define all(x)(x).begin(), (x).end() // 昇順ソート
#define rall(v)(v).rbegin(), (v).rend() // 降順ソート
#define INF 1LL << 60
typedef long long int LL;
typedef long long int ll;
#define pll pair < ll, ll >
#define F first
#define S second
const int MOD = 1000000007;
template < class T > bool chmax(T & a,const T & b) { if (a < b) { a = b; return true; } return false; }
template < class T > bool chmin(T & a,const T & b) { if (a > b) { a = b; return true; } return false; }
// 任意のlogは　対数の底の変換を使う    log(N) / log(任意の底)

int main() {
    LL X;cin >> X;
    LL ans = 0;

    bool ok = false;
    for(LL i = -1000;i <= 1000;i++){
        for(LL j = -1000;j <= 1000;j++){
            LL a = pow(i,5);
            LL b = pow(j,5);
            if(a - b == X){
                cout << i << " " << j  << endl;
                ok = true;
                break;
            }
        }
        if(ok)break;
    }
}

Measured memory_bytes: 4100
#include"bits/stdc++.h"
using namespace std;

int main() {

	int A, B, C;
	cin >> A >> B >> C;

	if (A == B && B != C) {
		cout << "Yes" << endl;
	}
	else if (B == C && C != A) {
		cout << "Yes" << endl;
	}
	else if (C == A && A != B) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}

}

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

#define ll long long int
#define pb push_back
#define FastIO cin.sync_with_stdio(false),cin.tie(NULL)

ll max(ll a, ll b){
    if(a>b) return a;
    return b;}

ll min(ll a, ll b){
    if(a<b) return a;
    return b;}

const ll MOD = 1e9 + 7, N = sqrt(1e13) + 1, INF = INT_MAX, M = 1e6;
#define val first
#define lst second
bool b[N];
std::vector<ll> pr;

int main(){
	//FastIO;
	

	int n, a, b;
	cin >> n >> a >> b;

	cout << min(n*a, b) << "\n";

	return 0;
}



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

int main() {
	ll n; cin >> n;
	ll ans=0;
	for(int i=1;i<=n;i++) {
		ll y=n/i;
		ans += y * (y + 1) * i / 2;
	}
	cout << ans << endl;
}

Measured memory_bytes: 3576
#include <algorithm>
#include <cstdio>
#include <iostream>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
#include <stdlib.h>
#include <stdio.h>
#include <bitset>
#include <cstring>
#include <deque>
#include <iomanip>
#include <limits>
#include <fstream>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define MOD1 1000000007

int main() {
  string s;
  cin >> s;
  int a[4];
  rep(i, 4) a[i] = s[i] - '0';

  rep(i, (1 << 3)) {

    int ans = a[0];
    rep(j, 3) {
      if (i & (1 << j)) {
        ans += a[j + 1];
      }
      else {
        ans -= a[j + 1];
      }
    }

    if (ans == 7) {
      string t = "0-0-0-0=7";
      rep(i, 4) t[2 * i] = s[i];
      rep(j, 3) {
        if (i & (1 << j)) {
          t[2 * j + 1] = '+';
        }
      }
      cout << t << endl;
      return 0;

    }

  }
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cctype>
using namespace std;
inline int read()
{
	int ans=0,f=1;
	char c=getchar();
	while (!isdigit(c))
	{
		if (c=='-')
			f=-1;
		c=getchar();
	}
	while (isdigit(c))
	{
		ans=(ans<<3)+(ans<<1)+(c^48);
		c=getchar();
	}
	return ans*f;
}
void write(int x)
{
	if (x>=10)
	{
		write(x/10);
		x%=10;
	}
	putchar(x+'0');
}
int main()
{
	int n;
	n=read();
	int ans=0;
	for (int i=1;i<=n;i++)
		ans+=read()-1;
	write(ans);
	return 0;
}


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

const long long inf = 0x3f3f3f3f3f3f3f3fLL;
typedef pair<int, int> PII;
typedef unsigned int uint;
typedef unsigned long long uLL;

const int N = 1e5 + 10;

int n, m;

vector<PII> adj[N], radj[N];

uLL cnt1[N], cnt2[N];
long long dis1[N], dis2[N];

struct node {
	int u, v; long long dis;
	node (int u = 0, int v = 0, long long dis = 0)
		:u(u), v(v), dis(dis) {}
	bool operator < (const node &rhs) const {
		return dis > rhs.dis;
	}
};

vector<node> E;

int main() {
	int n, m; scanf("%d%d", &n, &m);
	for (int i = 0; i < m; i++) {
		int u, v, w; scanf("%d%d%d", &u, &v, &w);
		adj[u].push_back(make_pair(v, w));
		radj[v].push_back(make_pair(u, w));
		E.push_back(node(u, v, w));
	}

	memset (dis1, 0x3f, sizeof dis1);
	memset (dis2, 0x3f, sizeof dis2);
	//count all shortest route from 1 to other nodes
	priority_queue<node> pq;
	pq.push(node(0, 1, 0));
	cnt1[0] = 1;
	while (!pq.empty()) {
		node cur = pq.top(); pq.pop();
		if (dis1[cur.v] < cur.dis) continue;
		if (dis1[cur.v] == cur.dis) {
			cnt1[cur.v] += cnt1[cur.u];
			continue;
		}
		dis1[cur.v] = cur.dis;
		cnt1[cur.v] = cnt1[cur.u];
		for (int i = 0; i < adj[cur.v].size(); i++) {
			long long d = dis1[cur.v] + adj[cur.v][i].second;
			if (dis1[adj[cur.v][i].first] >= d) 
				pq.push(node(cur.v, adj[cur.v][i].first, d));
		}
	}

	assert (pq.empty() == true);
	//count all shortest route from 2 to other nodes
	pq.push(node(0, 2, 0));
	cnt2[0] = 1;
	while (!pq.empty()) {
		node cur = pq.top(); pq.pop();
		if (dis2[cur.v] < cur.dis) continue;
		if (dis2[cur.v] == cur.dis) {
			cnt2[cur.v] += cnt2[cur.u];
			continue;
		}
		dis2[cur.v] = cur.dis;
		cnt2[cur.v] = cnt2[cur.u];
		for (int i = 0; i < radj[cur.v].size(); i++) {
			long long d = dis2[cur.v] + radj[cur.v][i].second;
			if (dis2[radj[cur.v][i].first] >= d) 
				pq.push(node(cur.v, radj[cur.v][i].first, d));
		}
	}

	long long shortdis = dis1[2];
	for (int i = 0; i < E.size(); i++) {
		if (i == 5)
			i = i;
		node cur = E[i];
		long long newdis = dis1[cur.v] + dis2[cur.u] + cur.dis;
		if (shortdis > dis1[cur.v] + dis2[cur.u] + cur.dis) {
			puts("HAPPY");
		} else if (shortdis == newdis) {
			puts("SOSO");
		} else if (shortdis < dis1[cur.u] + dis2[cur.v] + cur.dis) {
			puts("SOSO");
		} else if (cnt1[cur.u] * cnt2[cur.v] == cnt1[2]) {
			puts("SAD");
		} else {
			puts("SOSO");
		}
	}

	return 0;
}
/*
4 5
1 3 5
3 4 6
4 2 7
2 1 18
3 2 13
*/	


Measured memory_bytes: 18544
def main():
    s = open(0).read()
    b = s.count('-')
    z = s.count(' 0 ')
    _, *c, = map(int, s.replace('-', '').split())

    d = min(c)
    e = sum(c)

    if b % 2 == 0 or z > 0:
        print(e)
    else:
        print(e - 2 * d)


if __name__ == '__main__':
    main()


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

#define ll long long
#define MOD 998244353

int main(){
    ll n;
    scanf("%lld", &n);

    switch (n%10){
    case 0: case 1: case 6: case 8:
        printf("pon\n");
        return 0;
    case 3:
        printf("bon\n");
        return 0;
    default:
        printf("hon\n");
        return 0;
    }

    return 0;
}

Measured memory_bytes: 1640
#include<iostream>
#include<vector>
#define MAX int(7.4*1e6)
using namespace std;

int main(){
  int n, m;
  while(1) {
    scanf("%d %d\n", &m, &n);
    if(n == 0)break;
    vector<bool> isBoring(MAX, false);
    for (;n != 0; n--) {
      while(isBoring[m]) m++;
      for (int j = m; j < MAX; j+=m) isBoring[j] = true;
    }
    while(isBoring[++m]);
    std::cout << m << std::endl;
  }
  return 0;
}

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

#define EPS (1e-10)
#define rep(i, a, b) for (int i = a; i < (int)(b); ++i)
#define rrep(i, a, b) for (int i = b - 1; i >= (int)(a); --i)
#define all(a) a.begin(), a.end()

using namespace std;
using ll = long long;
using vi = vector<int>;
using vb = vector<bool>;
using vll = vector<ll>;
using vd = vector<double>;
using vvi = vector<vi>;
using vvb = vector<vb>;

constexpr int MOD = 1000000007;

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

    int n, k;
    cin >> n >> k;

    double ans = 0.0;
    rep(i, 1, n + 1) {
        if (i >= k) {
            ans += 1.0;
        } else {
            int p = 1;
            while (i * p < k) { p *= 2; }
            ans += 1.0 / double(p);
        }
    }
    printf("%.10f\n", ans / double(n));
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>

#define MAX_LEN 4

int
main(void)
{
	char S[MAX_LEN];
	scanf("%s", S);

	if (S[0] != S[1] && S[1] != S[2] && S[2] != S[0])
		puts("Yes");
	else
		puts("No");
	return (0);
}


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

// for loop
#define rep(i,a,n) for(int i=(a);i<(n);++i)
#define repe(i,a,n) for(int i=(a);i<=(n);++i)
#define rrep(i,n,a) for(int i=(n);n>(a);--i)
#define rrepe(i,n,a) for(int i=(n);n>=(a);--i)

// abbreviati
#define PB(v) push_back(v)
#define MP make_pair
#define F first
#define S second
#define all(v) v.begin(),v.end()
#define ENDL << "\n"

using ll = long long;
using P = pair<int,int>;
using itn = int;

// constant
const int INF = 1<<30;
const ll INFLL = 1LL << 60;
const ll MOD = 1000000007;
const long double PI =(acos(-1));

/***Snippet***************************************************
ifelse, isprime, torad, todeg, lcm, bfs,chmin,chmax
**************************************************************/

// adjacency list
vector<int> to[100005];

// Graph
using Graph = vector<vector<int>>;

// Grid
int H,W;
vector<vector<int>> field;

//4方向への移動ベクトル
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};


int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int a,b; cin >> a >> b;
    int i=0;
    while((a)>=i || b>=i){
        if(abs(a-i)==abs(b-i)){
            cout << i ENDL;
            return 0;
        }
        ++i;
    }
    
    cout << "IMPOSSIBLE" ENDL;
    return 0;
}

Measured memory_bytes: 5900
X, Y, A, B, C = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))

p.sort(reverse=True)
q.sort(reverse=True)
r.sort(reverse=True)

sa = sum(p[:X])
sb = sum(q[:Y])

p.append(float('inf'))
q.append(float('inf'))


ans = sa + sb
nr = 0
np = X-1
nq = Y-1
while nr < len(r):
  if r[nr] <= min(p[np], q[nq]):
    break
  elif p[np] > q[nq]:
    ans += r[nr] - q[nq]
    nr += 1
    nq -= 1
    continue
  else:
    ans += r[nr] - p[np]
    nr += 1
    np -= 1
    continue

  
print(ans)

Measured memory_bytes: 28784
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()



int main() {
  double r;
  cin >> r;
  cout << 2*M_PI*r << endl;
  
}



Measured memory_bytes: 3788
#include <stdio.h>
//#include <stdlib.h>
#include <string.h>
//#include <stdbool.h>
//#include <limits.h>
//#include <math.h>

int main() {
  char s[101];
  scanf("%s", s);
  int n = strlen(s), ans = 0;
  for (int i=0; i<n/2; i++) {
    if (s[i] == s[n-1-i]) continue;
    ans++;
  }
  printf("%d\n", ans);
  return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
using pll = pair<ll, ll>;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define rrep(i, m, n) for(ll i = m; i > n; i--)
#define Rep(i, m, n) for(ll i = m; i < n; i++)
#define all(vec) vec.begin(), vec.end()
#define lmax(x, y) max<ll>(x, y)
#define lmin(x, y) min<ll>(x, y)
#define tmax(x, y, z) lmax((x), lmax((y), (z)))
#define tmin(x, y, z) lmin((x), lmin((y), (z)))
#define MINUS(a) memset(a, 0xff, sizeof(a))
#define ZERO(a) memset(a, 0, sizeof(a))
const ll INF = 1LL << 60;
const ll MM = 1000000000; const ll MOD = MM + 7; const ll MMM=9223372036854775807;//2^63 -1
#define ADD(a,b) a = (a + ll(b)) % MOD
#define MUL(a,b) a = (a * ll(b)) % MOD
ll GCD(ll x, ll y){ if(y == 0) return x; else return GCD(y, x % y);}
ll LCM(ll x, ll y){ return x / GCD(x, y) * y;}
template<class T> inline bool chmin(T& a, T b){ if(a > b){ a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b){ if(a < b){ a = b; return true;} return false;}
template<typename A, size_t N, typename T> void FILL(A (&array)[N], const T &val){ fill( (T*)array, (T*)(array+N), val );}
// struct edge{ ll from, to, cost; };
// struct edge{ ll to, cost; };
// using Graph = vector<vector<ll>>;  // 重み無し
// using Graph = vector<edge>;  // 辺
// using Graph = vector<vector<edge>>;  // 重み付き
ll dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
ll ddx[8] = {1, 1, 0, -1, -1, -1, 0, 1}, ddy[8] = {0, 1, 1, 1, 0, -1, -1, -1};
//cout << fixed << setprecision(10);
// priority_queue<ll, vector<ll>, greater<ll>> pq;


struct UnionFind{
    vector<int> par;
 
    UnionFind(int n) : par(n, -1){ }
    void init(int n){ par.assign(n, -1); }
 
    int root(int x){
        if(par[x] < 0) return x;
        else return par[x] = root(par[x]);
    }
 
    bool issame(int x, int y){
        return root(x) == root(y);
    }
 
    bool unite(int x, int y){
        x = root(x); y = root(y);
        if(x == y) return false;
        if(par[x] > par[y]) swap(x, y);
        par[x] += par[y];
        par[y] = x;
        return true;
    }
 
    int size(int x){
        return -par[root(x)];
    }
};


int main(){
    ll n, m; cin >> n >> m;
    UnionFind uf(n);
    rep(i, m){
        ll a, b;
        cin >> a >> b;
        a--, b--;
        uf.unite(a, b);
    }
    ll ans = -1;
    rep(i, n){
        chmax(ans, (ll)uf.size(i));
    }
    cout << ans << endl;
}


Measured memory_bytes: 4048
#include <bits/stdc++.h>
#include <algorithm>
#include <string>
using namespace std;
 
int main() {
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    string S;
    cin >> S;
    cout << ((S.at(5) == '0' && S.at(6) <= '4') ? "Heisei" : "TBD") << endl;
    return 0;
}

Measured memory_bytes: 256
def recording(N: int, C: int, info: list) -> int:
    _, max_time, _ = max(info, key=lambda x: x[1])
    max_time = 2*max_time

    # 各チャンネルでのレコーダーの使用数を累積和として求める。
    # recorders が累積和であり、S-0.5 を配列で表すために
    # 2*(max_time) のサイズにしている。
    recorders = [[0] * C for _ in range(max_time + 1)]

    # スタート時間を +1 、終了時間を -1 とすることで、あとで
    # 累積和をとるときに、録画している時間帯が 1 、していない
    # 時間が 0 になるようにできる。
    for s, t, ch in info:
        recorders[2*s-1][ch-1] += 1
        recorders[2*t][ch-1] -= 1

    # 累積和をとる。
    for t in range(max_time):
        for ch in range(C):
            recorders[t+1][ch] += recorders[t][ch]

    # 各時間帯でのレコーダーの使用台数の最大値をとる。
    return max(
        sum(used > 0 for used in recorders[t])
        for t in range(max_time+1))


if __name__ == "__main__":
    N = 0
    N, C = map(int, input().split())
    info = [tuple(map(int, input().split())) for _ in range(N)]
    ans = recording(N, C, info)
    print(ans)


Measured memory_bytes: 81528
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <numeric>
//#include <stdio.h>
//#include <stack>
//#include <queue>
#include <cstdio>
#include <cmath>
#include <iterator>
#include <map>
//#include <fstream>
//#include <list>
//#include <iomanip>
#include <stdlib.h>
#include <cctype>
 
using namespace std;
 
#define MOD 1000000007
#define Int int64_t
#define PI 3.14159265358979
#define ssort(z) sort(z.begin(),z.end())
#define rsort(z) sort(z.rbegin(),z.rend())
#define eerase(z) z.erase(unique(z.begin(),z.end()),z.end())
#define ccnt(z,w) count(z.begin(),z.end(),w)
 
 
void printVec(std::vector<int> & vec) {
	std::cout << "";
	for (auto it = vec.begin(); it != vec.end(); ++it) {
		std::cout << *it << " ";
	}
	std::cout << std::endl;
}
void printVec1(std::vector<string>& vec) {
	std::cout << "";
	for (auto it = vec.begin(); it != vec.end(); ++it) {
		std::cout << *it << " ";
	}
	std::cout << std::endl;
}
void printVec2(std::vector<Int>& vec) {
	std::cout << "";
	for (auto it = vec.begin(); it != vec.end(); ++it) {
		std::cout << *it << " ";
	}
	std::cout << std::endl;
}
 
Int gcd(Int a, Int b) {
	return b != 0 ? gcd(b, a % b) : a;
}
Int lcm(Int a, Int b) {
	return a / gcd(a, b) *b;
	//a*bは64bit integer overflow
}
 
bool comp(const string a, const string b) {
	return a.length() < b.length();
}
 
bool integer(double num) {
	return floor(num) == num;
}
 
string gen(int num) {
	string str = "";
	for (int i = 0; i < num; i++) str += ".";
	return str;
}
Int fact(int num) {
	if (num == 0) return 1;
	else return num * fact(num - 1);
}
 
 
int main() {
	//int a, b, c; cin >> a >> b;
	string s,t; cin >> s>>t;
	if (s == "H") {
		if (t == "H")cout << "H";
		else cout << "D";
	}
	else {
		if (t == "H")cout << "D";
		else cout << "H";
	}
 
	cout << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <map>
#include <iomanip>
#include <stdlib.h>
#include <queue>

using namespace std;

const int nmax = 1e9 + 7;
typedef long long ll;

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

  bool ans = false;


  for (int i = 0; i < N + 1; i++){
    for (int j = 0; j < M + 1; j++){
      int black = i * M + j * N - 2 * i * j;
      if (black == K){
        ans = true;
      }
    }
  }
  
  if (ans == true){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  

  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>
#define pi 2*acos(0.0)
int main()
{
   int r;
   double c;
   scanf("%d",&r);
   if(r>=1 && r<=100)
   {
   c=2*pi*r;
   printf("%.18lf\n",c);
   }
   return 0;
}


Measured memory_bytes: 1720
# -*- coding: utf-8 -*-
import sys
sys.setrecursionlimit(10**9)
INF=10**18
MOD=10**9+7
input=lambda: sys.stdin.readline().rstrip()
YesNo=lambda b: bool([print('Yes')] if b else print('No'))
YESNO=lambda b: bool([print('YES')] if b else print('NO'))
int1=lambda x:int(x)-1

def main():
    H,W=map(int,input().split())
    S=[[] for _ in range(H+2)]
    S[0]=S[H+1]=['.']*(W+2)
    for i in range(1,H+1):
        S[i]=['.']+list(input())+['.']
    ans=[['']*W for _ in range(H)]
    for i in range(1,H+1):
        for j in range(1,W+1):
            if S[i][j]=='#':
                ans[i-1][j-1]='#'
            else:
                c=0
                for dy in range(-1,2):
                    for dx in range(-1,2):
                        if dy==dx==0:
                            continue
                        c+=(S[i+dy][j+dx]=='#')
                ans[i-1][j-1]=str(c)
    for row in ans:
        print(''.join(row))

if __name__ == '__main__':
    main()


Measured memory_bytes: 42096
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for(int i = 0; i < (n); i++)
#define all(v) v.begin(), v.end()
#define MOD 1000000007
const int INF = 1LL<<30;

int main(){
    ll n,k;
    cin>>n>>k;

    ll ans=0;
    ll sum=n*(n+1)/2;
    for(ll i=k;i<=n+1;i++){
        ll mi=(i-1)*i/2;
        ll ma=sum-(n-i)*(n-i+1)/2;
        ll tmp=ma-mi+1;
        ans=(ans+tmp)%MOD;
    }

    cout<<ans<<endl;
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;
int main() {
long long N;
cin>>N;
long long a;
a=N;
long long x;
long long y;
x=N/1000000000+1;
y=N%1000000000;
y=1000000000-y;
if(x==1000000001){
cout<<0<<" "<<0<<" "<<1000000000<<" "<<0<<" "<<0<<" "<<1000000000<<endl;}
else
cout<<0<<" "<<0<<" "<<1000000000<<" "<<y<<" "<<1<<" "<<x<<endl;}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define mod 1000000007
ll pr(ll x, ll y)
{
    ll res = 1; 
    x = x % mod;
    while (y > 0){
        if (y & 1)
            res = (res*x) % mod;
        y >>= 1;
        x = (x*x) % mod;  
    }
    return res;
}
signed main(){
	vector <int> fact(3000006), invfact(3000006);
	fact[0] = 1;
	invfact[0] = 1;
	for(int i = 0; i < 3000003; i++){
		fact[i+1] = (fact[i] * (i+1))%mod;
		invfact[i+1] = pr(fact[i+1], mod - 2);
	}
	int x, y;
	cin >> x >> y;
	if(x > y)
		swap(x, y);
	int Y = y - x;
	int X = (x - Y)/3;
	if((x - Y)%3 || X < 0 || Y < 0){
		cout << "0\n";
		return 0;
	}
	// cout << X <<' ' << Y << '\n';
	int no_of_steps = 2 * X + Y;
	int ans = 1;
	ans *= fact[2*X + Y];
	ans %= mod;
	ans *= invfact[X + Y];
	ans %= mod;
	ans *= invfact[X];
	ans %= mod;
	cout << ans << '\n';
}

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

namespace ABC110B
{
    internal class Program
    {
        public static void Main(string[] args)
        {
            int[] ints = Input.IntArray();
            int[] Xi = Input.IntArray();
            int[] Yi = Input.IntArray();
            int N = ints[0];
            int M = ints[1];
            int X = ints[2];
            int Y = ints[3];

            int XX = Math.Max(Xi.Max(), X);
            int YY = Math.Min(Yi.Min(), Y);
            if (XX >= YY)
            {
                Console.WriteLine("War");
                return;
            }
            Console.WriteLine("No War");
        }
    }
    
    
    internal static class Input
    {
        public static string String()
        {
            return Console.ReadLine();
        }

        public static int Int()
        {
            return int.Parse(Console.ReadLine());
        }

        public static int[] IntArray()
        {
            return Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        }

        public static long Long()
        {
            return long.Parse(Console.ReadLine());
        }

        public static long[] LongArray()
        {
            return Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
        }

        public static double[] DoubleArray()
        {
            return Console.ReadLine().Split(' ').Select(double.Parse).ToArray();
        }
    }
}

Measured memory_bytes: 13396
#include<iostream>
#include<string>

using namespace std;

int main() {
    int N;
    string S;

    cin >> N >> S;

    char map[26];
    for(int i = 0; i < 26; i++) {
        map[i] = 'A' + i;
    }

    for(int i = 0; i < S.length(); i++) {
        S[i] = map[(S[i] - 'A' + N) % 26];
    }

    cout << S << endl;

    return 0;
}

Measured memory_bytes: 256