akhauriyash/Code-Regression huggingface dataset:
// 

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <deque>
#include <vector>
#include <set>
#include <string>
#include <queue>
#include <map>
#include <cmath>
#include <stack>
#include <cstring>

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

using namespace std;

int main(){
    int a[3][3];
    bool ans[3][3];
    int n, b;
    
    for(int i = 0; i < 3; i++){
        for(int k = 0; k < 3; k++){
            ans[i][k] = false;
            cin >> a[i][k];
        }
    }
    cin >> n;
    for(int i = 0; i < n; i++){
        cin >> b;
        for(int j = 0; j < 3; j++){
            for(int k = 0; k < 3; k++){
                if(a[j][k] == b) ans[j][k] = true;
            }
        }
    }

    // for(int i = 0; i < 3; i++){
    //     for(int k = 0; k < 3; k++){
    //         cout << ans[i][k] << " ";
    //     }
    //     cout << endl;
    // }

    for(int i = 0; i < 3; i++){
        if(ans[i][0] && ans[i][1] && ans[i][2]){
            cout << "Yes" << endl;
            return 0;
        }
    }
    for(int i = 0; i < 3; i++){
        if(ans[0][i] && ans[1][i] && ans[2][i]){
            cout << "Yes" << endl;
            return 0;
        }
    }
    if(ans[0][0] && ans[1][1] && ans[2][2]){
        cout << "Yes" << endl;
        return 0;
    }
    if(ans[0][2] && ans[1][1] && ans[2][0]){
        cout << "Yes" << endl;
        return 0;
    }
    cout << "No" << endl;

    return 0;
}


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

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

  vector<int> b(n);
  if (n % 2 == 0) {
    int j = 0;
    for (int i = n - 1; i >= 0; i -= 2) {
      b[j] = a[i];
      j++;
    }
    for (int i = 0; i < n; i += 2) {
      b[j] = a[i];
      j++;
    }
  } else {
    int j = 0;
    for (int i = n - 1; i >= 0; i -= 2) {
      b[j] = a[i];
      j++;
    }
    for (int i = 1; i < n; i += 2) {
      b[j] = a[i];
      j++;
    }
  }

  for (int i = 0; i < b.size(); i++) {
    if (i == b.size() - 1) cout << b[i] << endl;
    else cout << b[i] << " ";
  }

  return 0;
}

Measured memory_bytes: 3712
//
//  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/math/common_factor.hpp>
#include <boost/icl/interval_map.hpp>
#include <boost/algorithm/string.hpp>
#include <boost/pending/disjoint_sets.hpp>
#include <boost/graph/graph_traits.hpp>
#include <boost/graph/adjacency_list.hpp>
#include <boost/graph/dijkstra_shortest_paths.hpp>
#include <boost/graph/kruskal_min_spanning_tree.hpp>
#include <boost/graph/graph_utility.hpp>
#include <boost/numeric/ublas/vector.hpp>
// ↓これいる？
#include <boost/graph/strong_components.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::math;
using namespace boost::numeric;
using ll = long long;
namespace bst = boost;
template<class T> void fill(T& v) { for (auto&& i : v) cin >> i; }

//#include "atcoder.hpp"

int main() {
    int N;
    
    cin >> N;
    
    for (int i = 1; i <= 9; i++)
      if (N % i == 0 && N / i < 10) {
        cout << "Yes" << endl;
        return 0;
      }
  
  cout << "No" << endl;
    
    return 0;
}








Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<bool> vb;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1;} return 0;}
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1;} return 0;}
int const INF = 1 << 30;


int main()
{
    int x;
    cin >> x;
    cout << 1-x << endl;


    return 0;
}

Measured memory_bytes: 3620
//gcd(a1, …, aN) = 1 … 2,3を必ず使うことにすれば満たせる。（＆2の倍数 or 3の倍数は1～30000の中にちょうど20000個）
//Σa_i = Sとすると、gcd(a_i, S - a_i) = gcd(a_i, S). 2の倍数 or 3の倍数だけ使うとき、和が6の倍数なら満たせる。
//和を6の倍数にするには…値1～30000をmod 6 = 0,2,3,4で分類して、N:奇数(>=5), N:偶数(>=6)で構成すると、はいできた。

#include <iostream>
#include <vector>
#define rep(i, n) for (i = 0; i < n; i++)
using namespace std;

int n;
int cor[6];
vector<int> ans;

void push(int mod) {
	ans.push_back(mod + cor[mod] * 6 + (mod == 0) * 6);
	cor[mod]++;
}

int main() {
	int i;
	cin >> n;
	
	if (n == 3) { cout << "2 5 63" << endl; return 0; }
	if (n == 4) { cout << "2 5 20 63" << endl; return 0; }
	
	
	if (n % 2 == 0 || n == 19999) { //2 2 3 3 4 4 [2 4]…[3 3]…[0 0]…
		push(2); push(2);
		push(3); push(3);
		push(4); push(4);
		rep(i, 4998) { push(2); push(4); }
		rep(i, 2499) { push(3); push(3); }
		rep(i, 5000) { push(0); }
	}
	else {	//2 2 2 3 3 [3 3]…[2 4]…[4 4]…[0 0]…
		push(2); push(2); push(2);
		rep(i, 2500) { push(3); push(3); }
		rep(i, 4997) { push(2); push(4); }
		rep(i, 5000) { push(0); }
	}
	
	for (i = 0; i < n; i++) {
		cout << ans[i];
		if (i + 1 < n) cout << " ";
	}
	cout << endl;
	return 0;
}

Measured memory_bytes: 640
#include <cstdio>

int main ()
{
	int n, m, a[100005], in, temp;
	temp = scanf("%d %d", &n, &m);
	for (int i = 1; i <= n; i++)
		a[i] = -1;
	for (int i = 1; i <= m; i++)
	{
		temp = scanf("%d", &in);
		a[in] = 0;
	}
	if (a[1] != 0)
		a[1] = 1;
	if (a[2] != 0)
		a[2] = 1 + a[1];
	for (int i = 3; i <= n; i++)
		if (a[i] == -1)
			a[i] = (a[i - 2] + a[i - 1]) % 1000000007;
	temp = printf("%d", a[n]);
	return 0;
}

Measured memory_bytes: 2124
#include <iostream>
#include <cstdlib>

#define TN_MAX 101

using namespace std;

int main () {
  while( 1 ) {
    int n, m, p;
    int sum = 0;
    int tn[ TN_MAX ];
    cin >> n >> m >> p;
    if ( !n && !m && !p ) {
      return EXIT_SUCCESS;
    }
    for( int i = 1; i <= n; i++ ) {
      cin >> tn[ i ];
      sum += tn[ i ];
    }
    if( tn[ m ] == 0 ){
      cout << 0 << endl;
    }else{
      int o = sum * ( 100 - p ) / tn[ m ];
      cout << o << endl;
    }
  }
}

Measured memory_bytes: 1160
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        if(a == b){
            System.out.println(2*a);
        }else{
            System.out.println(Math.max(a,b)*2-1);
        }
        sc.close();
    }

}

Measured memory_bytes: 21844
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>
#include <cstring>

#define rep(i, m, n) for(int i=int(m);i<int(n);i++)
#define all(c) begin(c),end(c)

template<typename T1, typename T2>
inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }

template<typename T1, typename T2>
inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }

//改造
typedef long long int ll;
using ll = long long int;
using ull = long long unsigned int;
using namespace std;
#define INF (1 << 30) - 1
#define INFl (ll)5e15
#define DEBUG 0 //デバッグする時1にしてね
#define dump(x)  cerr << #x << " = " << (x) << endl
#define MOD 1000000007


//ここから編集する
class Solve {
public:
    void solve() {
        int N;
        cin >> N;
        int cnt = 0;
        for (int i = 1; i <= N; ++i) {
            int tmp;
            cin >> tmp;
            if (tmp != i) {
                cnt++;
            }
        }

        if (cnt <= 2) {
            cout << "YES" << endl;
        } else {
            cout << "NO" << endl;
        }


    }
};


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);

    Solve().solve();


    return 0;
}


Measured memory_bytes: 888
a,b,c = map(int,input().split())
k = int(input())

for i in range(k):
  if(a >= b):
    b*=2
    continue
  if(b >= c):
    c*=2
    continue
    
if(a<b and b<c):
  print("Yes")
  exit()
else:
  print("No")

Measured memory_bytes: 9188
#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long q,h,s,d,n,ans=0;
	cin>>q>>h>>s>>d>>n;
	n*=4;
	if(d<2*s&&d<4*h&&d<8*q)
	{
		ans+=(n/8)*d;
		n%=8;
	}
	if(s<2*h&&s<4*q)
	{
		ans+=(n/4)*s;
		n%=4;
	}
	if(h<2*q)
	{
		ans+=(n/2)*h;
		n%=2;
	}
	ans+=n*q;
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int main(void)
{
	int h[3]={0},m[3]={0},s[3]={0};
	int H[3]={0},M[3]={0},S[3]={0};
	int temp=0;
	for(int i=0;i<3;i++){
		cin >> h[i] >> m[i] >> s[i] >> H[i] >> M[i] >> S[i];
		temp=(H[i]*3600+M[i]*60+S[i])-(h[i]*3600+m[i]*60+s[i]);
		h[i]=temp/3600;
		temp=temp%3600;
		m[i]=temp/60;
		s[i]=temp%60;
	}
	for(int i=0;i<3;i++){
		cout << h[i] << " " << m[i] << " " << s[i] << endl;
	}
	
	return 0;
}

Measured memory_bytes: 2992
#include <cstdio>
#include <algorithm>

int x[401000];
long long s[401000], Ans = 0;

int l, n;

long long S(int l, int r) {return s[r] - s[l - 1];}

int main()
{
	scanf("%d%d", &l, &n);
	for(int i = 1; i <= n; i++) scanf("%d", &x[i]), x[i + n] = x[i] + l;
	for(int i = 1; i <= 2 * n; i++) s[i] = s[i - 1] + x[i];
	for(int i = 1; i <= n; i++)
	{
		int sl = n - i + 1;
		int sr = n - sl;
		int j = n + sr;
		
		int k1 = std::min(sl - 1, sr);
		
		Ans = std::max(Ans, l - x[i] + 2 * (S(j - k1 + 1, j) - S(i + 1, i + k1) + (k1 != sr ? x[j - k1] - l : 0)));
		
		int k2 = std::min(sl, sr - 1);
		
		Ans = std::max(Ans, x[j] - l + 2 * (S(j - k2, j - 1) - S(i, i + k2 - 1) + (k2 != sl ? l - x[i + k2] : 0)));
	}
	
	printf("%lld\n", Ans);
}

Measured memory_bytes: 4864
#include <iostream>
#include <string>
#include <cstring>
#include <fstream>
#include <random>
#include <cmath>
#include <iomanip>
#include <climits>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <map>
#include <deque>
#include <map>
#include <set>
#include <unordered_set>
#include <queue>
#include <stack>
#include <list>
#include <unordered_map>
#include <bitset>
#include <sstream>
#include <new>
#include <typeinfo>
#include <iterator>
#include <cassert>

using ll = long long;
using ull = unsigned long long;
constexpr ll mop = 1000000007;
constexpr ll mop2 = 998244353;

using namespace std;

constexpr ll NOT_SPECIFIED_VALUE_MIN = INT64_MIN;
constexpr ll NOT_SPECIFIED_VALUE_MAX = INT64_MAX;


int main() {
	ll x;
	cin >> x;
	if (x >= 30) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
}


Measured memory_bytes: 3620
s= str(input())
op = ["+","-"]
for op1 in op:
  for op2 in op:
    for op3 in op:
       if eval(s[0] + op1 + s[1] + op2 + s[2] + op3 + s[3]) == 7:
         print(s[0] + op1 + s[1] + op2 + s[2] + op3 + s[3] + "=7")
         exit()

Measured memory_bytes: 3060
#include<bits/stdc++.h>
#define boost ios::sync_with_stdio(false); cin.tie(0)
#define ll              long long int
#define ld              long double
#define mk              make_pair
#define pb              push_back
#define f               first
#define s               second
#define fo(i,a,b)       for(i=a;i<b;i++)
#define foe(i,a,b)      for(i=a;i<=b;i++)
#define all(x)          x.begin(),x.end()
// #define vi               vector<int>
#define vl              vector <long long int>
// #define pii          pair <int,int>
#define pll             pair <long long int, long long int>
// #define vpii         vector< pair<int,int> >
#define vpll            vector < pair <long long int,long long int> >
#define MOD             1000000007
using namespace std;
const int inf = INT_MAX;
const ll inf64 = LLONG_MAX;

char arr[6][6];
ll ans;
ll h, w, k;
void work(ll a, ll b) {
    char temp[h][w];
    ll i, j;
    fo(i, 0, h)
    {
        fo(j, 0, w)temp[i][j] = arr[i][j];
    }
    fo(i, 0, h)
    {
        if (a & (1 << i))
        {
            fo(j, 0, w)temp[i][j] = '.';
        }
    }
    fo(i, 0, w)
    {
        if (b & (1 << i))
        {
            fo(j, 0, h)temp[j][i] = '.';
        }
    }
    ll cnt = 0;
    fo(i, 0, h)
    {
        fo(j, 0, w)
        {
            if (temp[i][j] == '#')cnt++;
        }
    }
    if (cnt == k)ans++;

}


int main()
{
    boost;
    cin >> h >> w >> k;
    ll i, j;
    fo(i, 0, h)fo(j, 0, w)cin >> arr[i][j];
    fo(i, 0, (1 << h))
    {
        fo(j, 0, (1 << w))
        {
            work(i, j);
        }
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 3608
#include <bits/stdc++.h>
using namespace std;
#define PI 3.14159265358979323
#define ll long long int
#define vi vector <int>
#define vl vector <ll>
#define all(v) (v).begin(),(v).end()
#define pb push_back
#define MOD 1000000007
ll power(ll a, ll b) { //a^b
	ll res = 1;
	a = a % MOD;
	while (b > 0) {
		if (b & 1) {res = (res * a) % MOD; b--;}
		a = (a * a) % MOD;
		b >>= 1;
	}
	return res;
}
 
ll gcd(ll a, ll b) {return (b == 0) ? a : gcd(b, a % b);}
 
int main() {
#ifndef ONLINE_JUDGE
	// for getting input from input.txt
	freopen("input.txt", "r", stdin);
	// for writing output to output.txt
	freopen("output.txt", "w", stdout);
#endif
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	int n;
	cin>>n;
	if(n>=30)
		cout<<"Yes";
	else
		cout<<"No";
}


Measured memory_bytes: 3636
# define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>

int main(){
    int A, B;
    int add, sub, mul;
    int ans;

    scanf("%d%d", &A, &B);
    add = A + B;
    sub = A - B;
    mul = A * B;

    ans = add;
    if (sub > ans){
        ans = sub;
    }
    if (mul > ans){
        ans = mul;
    }

    printf("%d", ans);

    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
#include <string.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define FOR(i, m, n) for(int i = m; i < n; i++) 
#define mod 1000000007
#define pi 3.1415926535
typedef long long ll;
int main(){
    int H1,M1,H2,M2,K;
    cin>>H1>>M1>>H2>>M2>>K;
    
    cout<<(H2-H1)*60+M2-M1-K<<endl;
    
    return 0;
}

Measured memory_bytes: 3636
import math
while True:
    x,y,s=map(int,input().split())
    t=0
    if x==0 and y==0 and s==0:
        break
    else:
        for ix in range(1,s):
            jx=s-ix
            i=math.ceil(ix*100/(100+x))
            j=math.ceil(jx*100/(100+x))
            if ix==math.floor(i*(100+x)/100) and jx==math.floor(j*(100+x)/100):
                iy=math.floor(i*(100+y)/100)
                jy=math.floor(j*(100+y)/100)
                if iy+jy>t:
                    t=iy+jy
                    continue
            else:
                continue
        print(t)


Measured memory_bytes: 5664
#include<bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
#define all(x) (x).begin(),(x).end()
typedef long long ll;
#define rep(i,n) for(ll i=0, i##_len=(n); i<i##_len; ++i)
#define REP(i,num,n) for(ll i=num, i##_len=(n); i<i##_len; ++i)
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
#define print(x) cout << (x) << endl;
#define sz(x) int(x.size())
 
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
const ll LLINF = 1LL<<60;
const int INF = 1<<29;
const int MOD = 1000000007;
 
void add(long long &a, long long b) {
  a += b;
  if (a >= MOD) a -= MOD;
}
 
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};


int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout<<fixed<<setprecision(10);
    int x;
    cin >> x;
    if(x == 7 or x == 5 or x == 3) {
      print("YES");
    } else print("NO");
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lvector vector<ll> 
#define P pair<ll,ll>
#define rep(i,n) for(ll (i)=0; (i)<(n); ++(i))
#define print(a) cout << (a) << endl

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n,a,b,ans=0,num=0;cin>>n>>a>>b;
  num=n/(a+b);
  ans+=a*num;
  ans+=min(a,n%(a+b));
  print(ans);
  return 0;
}

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

#define     fast()              ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); 
#define     ll                  long long int
#define     test()              ll t; cin>>t; while(t--) 
#define     lp0(i,begin,end)    for(ll i=begin;i<end;i++)
#define     lp1(i,begin,end)    for(ll i=begin;i<=end;i++)
#define     rlp(i,begin,end)    for(ll i=end;i>=begin;i--)
#define     prec(n)             fixed<<setprecision(n)
#define     initial(a,i)        memset(a,i,sizeof(a))
#define     pb                  push_back
#define     PI                  3.1415926535897932384626433832795
#define     MOD                 1000000007
#define     F                   first
#define     S                   second
#define     all(a)              (a).begin(),(a).end()
#define     BPC(x)              __builtin_popcountll(x)
#define     gcd(a,b)            __gcd(a,b)

ll gcd(ll a,ll b) {if (a==0) return b;return gcd(b%a,a);}

ll power(ll x,ll n)
{
    ll result = 1;
    while (n)
    {
        if (n & 1)
            result = result * x;
        n = n / 2;
        x = x * x;
    }
    return result;
}


// Solution Function
void solution(ll compte)
{
    // cout<<compte<<"\n";
    ll n;
    cin>>n;
    while(n>0)
    {
        if(n%10==7)
        {
            cout<<"Yes\n";
            return;
        }
        n/=10;
    }
    cout<<"No\n";
    return;
}
// Driver Function
int main()
{
    ll compte = 1;
    //test()
    //{
        solution(compte);
        compte++;
    //}
    return 0;
}


Measured memory_bytes: 3592
#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
int main() {
  ll l,r;cin>>l>>r;
  
  ll ans=2020;
  ll smaller=min(r,l+2019);
  
  for (ll i=l;i<smaller;i++) {
    for (ll j=i+1;j<=smaller;j++) {
      ans = min(ans,(i*j)%2019);
    }
  }
  cout<<ans<<endl;
}



Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <deque>
#include <queue>
#include <map>
#include <iomanip>
#include <cmath>
#include <boost/multiprecision/cpp_int.hpp>

using namespace std;
using ll = long long;
namespace mp = boost::multiprecision;

ll BASE_NUM = 1000000007;

long long extGCD(long long a, long long b, long long &x, long long &y)
{
    if (b == 0)
    {
        x = 1;
        y = 0;
        return a;
    }
    long long d = extGCD(b, a % b, y, x);
    y -= a / b * x;
    return d;
}

ll reverse(ll n,ll modulo){
    ll x,y;
    extGCD(n, modulo, x, y);
    return (x + ((abs(x / modulo) + 1) * modulo)) % modulo;
}

int main()
{
    // 整数の入力
    string S;
    cin >> S;
    for(int i = 0;i < S.length();i++){
        if (S[i] == '?'){
            S[i] = 'D';
        }
    }
    cout << S << endl;
    return 0;
}

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

    using namespace std;
    template <typename T>
    void debug(string t, T input) {
        cout<<t<<"-> "<<input<<"\n";
    }
    template <typename T>
    void debug(int i,string t, T input) {
        cout<<"Case#"<<i<<" "<<t<<"-> "<<input<<"\n";
    }


    int main(){
        ios::sync_with_stdio(0);
        cin.tie(0);
        cout.tie(0);
        int x;
        cin>>x;
        long long val=0;
        for(int i=1;i<=x;i++){
            for(int j=1;j<=x;j++){
                for(int k=1;k<=x;k++){
                    int z=__gcd(i,j);
                    z=__gcd(z,k);
                    val+=z;
                }
            }
        }
        cout<<val;
        return 0;
    }


Measured memory_bytes: 3656
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <cstring>
#include <math.h>
#include <bitset>
#include <queue>
#include <set>
#include <iomanip>
#include <math.h>
#include <assert.h>
// #include<bits/stdc++.h>
using namespace std;
typedef long long ll;
constexpr long long int INFLL = 1001001001001001LL;
constexpr int INF = 1000000007;
const int mod = 1000000007;

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

ll gcd(ll a, ll b)
{
    if (a % b == 0)
    {
        return (b);
    }
    else
    {
        return (gcd(b, a % b));
    }
}

ll lcm(ll a, ll b)
{
    return a / gcd(a, b) * b;
}

//----------------------------------------------------------------

int main()
{
    ll sum;
    cin >> sum;
    ll d = sum % 10;
    sum = sum / 10;
    ll c = sum % 10;
    sum = sum / 10;
    ll b = sum % 10;
    sum = sum / 10;
    ll a = sum % 10;
    bool flag = false;
    for (int i = 1; i <= 2; i++)
    {
        for (int j = 1; j <= 2; j++)
        {
            for (int k = 1; k <= 2; k++)
            {
                if (a + b * pow(-1, i) + c * pow(-1, j) + d * pow(-1, k) == 7)
                {
                    cout << a;
                    if (i == 1)
                    {
                        cout << "-";
                    }
                    else
                    {
                        cout << "+";
                    }
                    cout << b;
                    if (j == 1)
                    {
                        cout << "-";
                    }
                    else
                    {
                        cout << "+";
                    }
                    cout << c;
                    if (k == 1)
                    {
                        cout << "-";
                    }
                    else
                    {
                        cout << "+";
                    }
                    cout << d;
                    cout << "=7";
                    flag = true;
                    break;
                }
            }
            if (flag)
            {
                break;
            }
        }
        if (flag)
        {
            break;
        }
    }
}

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

int main () {
	string passwd;
	cin >> passwd;
	
	bool dflg, uflg, lflg;
	dflg = uflg = lflg = false;
	
	unsigned size = passwd.size();
	for (unsigned i = 0; i < size; i++) {
		if (isdigit(passwd[i])) {
			dflg = true;
		}
		if (isupper(passwd[i])) {
			uflg = true;
		}
		if (islower(passwd[i])) {
			lflg = true;
		}
	}
	
	if (size >= 6 && dflg && uflg && lflg) {
		cout << "VALID" << endl;
	}
	else {
		cout << "INVALID" << endl;
	}
	
	return 0;
}

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

int main() {
    int n,k;cin>>n>>k;
    int a[n];
    for (int i=0;i<n;i++)
        cin>>a[i];
    sort(a,a+n);
    int s=0;
    for (int i=n-1;i>n-1-k;i--)
        s+=a[i];
    cout<<s<<endl;
    return 0;
}

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

int main() {
  int a,b,c,d;
  cin >> a >> b >> c >> d;
  while(a>0 && c>0){
    c = c-b;
    if(c<=0)
      break;
    else
    a = a-d;
  }
  if(a<=0)
     cout << "No" << endl;
  else
    cout << "Yes" << endl; 
}


Measured memory_bytes: 3592
#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <string>
#include <bitset>
#include <algorithm>
#include <cstring>
#include <cstdlib>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
using vb = vector<bool>;
using vvi = vector<vector<int>>;
using vp = vector<pii>;
using vs = vector<string>;
using qi = queue<int>;
using qp = queue<pii>;
using pqi = priority_queue<int>;
using pqim = priority_queue<int, vector<int>, greater<int> >;
using ppp = pair<int, pair<int, int>>;
#define all(vec) vec.begin(), vec.end()
#define rall(vec) vec.rbegin(), vec.rend()
#define pb push_back
const ll mod = 998244353;
//const ll inf = 1e18;
const int inf = 1e9 + 7;
const int mxn = 2e5;

int n, q;
vi a;


void input() {

	cin >> n;
	a = vi(n);
	for (int& x : a) cin >> x;
	cin >> q;

}

void solve() {

	vl cnt(100001);
	for (int x : a) cnt[x]++;

	ll sum = 0;
	for (int i = 0; i <= 100000; ++i) {
		sum += cnt[i] * i;
	}

	while (q--) {
		ll b, c; cin >> b >> c;
		ll t = cnt[b];
		cnt[b] = 0;
		cnt[c] += t;
		sum -= t * b;
		sum += t * c;
		cout << sum << '\n';
	}


	return;
}

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

	input();
	solve();
}

Measured memory_bytes: 4492
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
const int INF=0;
int n,dat[1200010];
void init(int n_){
  n=1;
  while(n<n_){
    n=n*2;
  }
  for(int i=0;i<2*n-1;i++){
    dat[i]=INF;
  }
}
void update(int x,int a){
  x+=(n-1);
  dat[x]=a;
  while(x>0){
    x=(x-1)/2;
    dat[x]=max(dat[2*x+1],dat[2*x+2]);
  }
}
int query(int a,int b,int k=0,int l=0,int r=n){
  if(r<=a || b<=l){
    return INF;
  }
  if(a<=l && r<=b){
    return dat[k];
  }
  else{
    int vl=query(a,b,2*k+1,l,(l+r)/2);
    int vr=query(a,b,2*k+2,(l+r)/2,r);
    return max(vl,vr);
  }
}
void set(int i,int x){
  dat[i+n-1]=x;
}
void build(){
  for(int k=n-2;k>=0;k--){
    dat[k]=max(dat[2*k+1],dat[2*k+2]);
  }
}
int main(){
  int n,k;
  cin >> n >> k;
  init(300001);
  int i;
  for(i=0;i<n;i++){
    int a;
    cin >> a;
    int l,r;
    if(a-k<0){
      l=0;
    }
    else{
      l=a-k;
    }
    if(a+k>300000){
      r=300001;
    }
    else{
      r=a+k+1;
    }
    int res=query(l,r)+1,res1=query(a,a+1);
    if(res>res1){
      update(a,res);
    }
  }
  cout << query(0,300001) << endl;
}

Measured memory_bytes: 7736
#pragma GCC optimize ("Ofast")
#include<bits/stdc++.h>
using namespace std;
inline void rd(long long &x){
  int k;
  int m=0;
  x=0;
  for(;;){
    k = getchar_unlocked();
    if(k=='-'){
      m=1;
      break;
    }
    if('0'<=k&&k<='9'){
      x=k-'0';
      break;
    }
  }
  for(;;){
    k = getchar_unlocked();
    if(k<'0'||k>'9'){
      break;
    }
    x=x*10+k-'0';
  }
  if(m){
    x=-x;
  }
}
inline void wt_L(char a){
  putchar_unlocked(a);
}
inline void wt_L(long long x){
  int s=0;
  int m=0;
  char f[20];
  if(x<0){
    m=1;
    x=-x;
  }
  while(x){
    f[s++]=x%10;
    x/=10;
  }
  if(!s){
    f[s++]=0;
  }
  if(m){
    putchar_unlocked('-');
  }
  while(s--){
    putchar_unlocked(f[s]+'0');
  }
}
template<class T> inline T GCD_L(T a,T b){
  T r;
  while(a){
    r=b;
    b=a;
    a=r%a;
  }
  return b;
}
template<class T> inline T LCM_L(T a,T b){
  return a/GCD_L(a,b)*b;
}
int main(){
  long long A;
  long long B;
  long long res;
  rd(A);
  rd(B);
  res =LCM_L(A, B);
  wt_L(res);
  wt_L('\n');
  return 0;
}
// cLay varsion 20191214-1
 
// --- original code ---
// {
//   ll A, B, res;
//   rd(A,B);
//   res = lcm(A,B);
//   wt(res);
// }

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <tuple>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cassert>
#include <cstdint>
#include <cctype>
#include <numeric>
#include <bitset>
#include <functional>

using namespace std;

using ll =  long long;
using Pll = pair<ll, ll>;
using Pii = pair<int, int>;

constexpr int INF = 1 << 30;
constexpr ll LINF = 1LL << 60;
constexpr ll MOD = 1000000007;
constexpr long double EPS = 1e-10;
constexpr int dyx[4][2] = {
    { 0, 1}, {-1, 0}, {0,-1}, {1, 0}
};

int main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    vector<vector<int>> a(3, vector<int>(3, 0));
    for(int i=0;i<9;++i) cin >> a[i/3][i%3];

    int n, b;
    cin >> n;
    for(int k=0;k<n;++k) {
        cin >> b;
        for(int i=0;i<9;++i) {
            if(b == a[i/3][i%3]) {
                a[i/3][i%3] = -1;
            }
        }
    }

    for(int i=0;i<3;++i) {
        bool bingo = true;
        for(int j=0;j<3;++j) {
            if(a[i][j] != -1) bingo = false;
        }
        if(bingo) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    for(int j=0;j<3;++j) {
        bool bingo = true;
        for(int i=0;i<3;++i) {
            if(a[i][j] != -1) bingo = false;
        }
        if(bingo) {
            cout << "Yes" << endl;
            return 0;
        }
    }

    bool bingo = true;
    for(int i=0;i<3;++i) {
        if(a[i][i] != -1) bingo = false;
    }
    if(bingo) {
        cout << "Yes" << endl;
        return 0;
    }

    bingo = true;
    for(int i=0;i<3;++i) {
        if(a[i][2-i] != -1) bingo = false;
    }
    if(bingo) {
        cout << "Yes" << endl;
        return 0;
    }

    cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 256
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

N, M = mapint()
As = list(mapint())
num_lis = [2, 5, 5, 4, 5, 6, 3, 7, 6]
need_m = [num_lis[a-1] for a in As]
dp = [-1]*(N+1)
dp[0] = 0

for i in range(1, N+1):
    for a, need in zip(As, need_m):
        if need>i:
            continue
        elif dp[i-need]==-1:
            continue
        elif dp[i-need]==0:
            dp[i] = max(dp[i], a)
        else:
            dp[i] = max(dp[i], dp[i-need]*10+a)

print(dp[-1])

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

#define ff first
#define ss second
#define int long long
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pii>
#define pb push_back
#define mp make_pair
#define endl "\n"      // Comment in INTERACTIVE(there just use endl which flushes output , no need of fflush(sdtout)).
//  for counting setbits -> __builtin_popcountll(x)
// for counting zerobits -> __builtin_ctzll(x)
#define fastio() ios_base::sync_with_stdio(false);        cin.tie(NULL); //(unties i/o buffer).
            // DON'T USE SCANF/PRINTF WITH IT (c/c++ -> seperates buffer).

const int mod = 1000000007;
const int inf = 1000000009;
// const int N = 2*(1e5) + 2;
// int arr[N];

int32_t main(){
    fastio();

    // #ifndef ONLINE_JUDGE
    //  freopen("input.txt", "r", stdin);
    //  freopen("output.txt", "w", stdout);
    // #endif

     // ***** AC_chahiye EK BAR MEIN

     // BEGIN CODE HERE
    int n , k;
    cin>>n>>k;
    vi h(n+1);
    for(int i = 1;i <= n; ++i)
        cin>>h[i];
    vi dp(n+1,inf);

    dp[1] = 0;
    // for(int i = 3;i <= n; ++i)
    //     dp[i] = min(dp[i - 1] + abs(h[i] - h[i-1])  ,  dp[i - 2] + abs(h[i] - h[i - 2]));
    for(int i = 1;i <= n; ++i){
        for(int j = 1;j <= k ; ++j){
            if(i+j > n)
                continue;
            dp[i + j] = min(dp[i + j], dp[i] + abs(h[i] - h[i+j]));
        }
    }
    cout<<dp[n];
    //getch();
}


Measured memory_bytes: 1792
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
use std::io::{BufWriter, Write};
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};
    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, [graph1; $len:expr]) => {{
        let mut g = vec![vec![]; $len];
        let ab = read_value!($next, [(usize1, usize1)]);
        for (a, b) in ab {
            g[a].push(b);
            g[b].push(a);
        }
        g
    }};
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };
    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };
    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };
    ($next:expr, usize1) => (read_value!($next, usize) - 1);
    ($next:expr, [ $t:tt ]) => {{
        let len = read_value!($next, usize);
        read_value!($next, [$t; len])
    }};
    ($next:expr, $t:ty) => ($next().parse::<$t>().expect("Parse error"));
}

#[allow(unused)]
macro_rules! debug {
    ($($format:tt)*) => (write!(std::io::stderr(), $($format)*).unwrap());
}
#[allow(unused)]
macro_rules! debugln {
    ($($format:tt)*) => (writeln!(std::io::stderr(), $($format)*).unwrap());
}

fn solve() {
    let out = std::io::stdout();
    let mut out = BufWriter::new(out.lock());
    macro_rules! puts {
        ($($format:tt)*) => (let _ = write!(out,$($format)*););
    }
    input! { n: i32, m: i32 }
    let mut ans = 0;
    let mut i = 1;
    while i * i <= m {
        if m % i == 0 {
            if i >= n { ans = max(ans, m/i); }
            if m/i >= n { ans = max(i, ans); }    
        }
        i += 1;
    }
    puts!("{}\n", ans);
}

fn main() {
    // In order to avoid potential stack overflow, spawn a new thread.
    let stack_size = 104_857_600; // 100 MB
    let thd = std::thread::Builder::new().stack_size(stack_size);
    thd.spawn(|| solve()).unwrap().join().unwrap();
}

Measured memory_bytes: 2244
package main

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

var as, cs []int

func main() {
	var N, M int
	fmt.Scan(&N, &M)
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)

	as = make([]int, N)
	for i := range as {
		sc.Scan()
		as[i], _ = strconv.Atoi(sc.Text())
	}
	cs = make([]int, N)
	for i := len(as)/2 - 1; i >= 0; i-- {
		maxHeapify(i)
	}
	for i := 0; i < M; i++ {
		cs[0]++
		maxHeapify(0)
	}
	sum := 0
	for i := range as {
		sum += calc(i)
	}
	fmt.Println(sum)

}

func maxHeapify(i int) {
	l := i<<1 + 1
	r := i<<1 + 2
	h := len(as)
	largest := i
	if l < h && calc(l) > calc(i) {
		largest = l
	}
	if r < h && calc(r) > calc(largest) {
		largest = r
	}
	if largest != i {
		as[i], as[largest] = as[largest], as[i]
		cs[i], cs[largest] = cs[largest], cs[i]
		maxHeapify(largest)
	}
}

func calc(n int) int {
	x, y := as[n], cs[n]
	div := 1
	for i := 0; i < y; i++ {
		div *= 2
		if x/div == 0 {
			return 0
		}
	}
	return x / div
}


Measured memory_bytes: 5116
#include <bits/stdc++.h>
using namespace std;
#define endl '\n'

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

    int n,k;

    cin >> n >> k;

    vector<int> a(n);
    vector<int> p,m;
    bool z = false;

    p.push_back(0);
    m.push_back(0);
    for(int i = 0;i < n;i++){ cin >> a[i]; if(a[i]==0) z = true; }
    for(int i = 0;i < n;i++) if(a[i]>0) p.push_back(a[i]);
    for(int i = n-1;i >= 0;i--) if(a[i]<0) m.push_back(-a[i]);

    int mn = INT_MAX;

    for(int i = 0;i <= k;i++)
    {
        if(i>=m.size()) continue;
        if(!z and k-i>=p.size()) continue;
        if(z and k-i-1>=p.size()) continue;
        int each = 0;
        int l = m[i];
        int r;
        if(z and i!=k) r = p[k-i-1];
        else r = p[k-i];
        each = l+r+min(l,r);
        mn = min(mn,each);
    }

    cout << mn;
}


Measured memory_bytes: 1404
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;

/*
<url:https://cf16-exhibition-final-open.contest.atcoder.jp/tasks/cf16_exhibition_final_b>
問題文============================================================
 すぬけ君は、誕生日プレゼントに三角形をもらいました。
 三頂点の座標は (x1,y1), (x2,y2), (x3,y3) でした。
 
 すぬけ君は、三角形の内部に半径の等しい二つの円を、重ならないように描きたいです (二円が点で接していてもいいです)。
 円の半径の最大値を求めてください。

=================================================================

解説=============================================================

================================================================
*/

typedef long double ld;
typedef complex<ld> Point;
const ld eps = 1e-9, pi = acos(-1.0);
namespace std {
    bool operator<(const Point &lhs, const Point &rhs) {
        if (lhs.real() < rhs.real() - eps) return true;
        if (lhs.real() > rhs.real() + eps) return false;
        return lhs.imag() < rhs.imag();
    }
}
Point input_point() { ld x, y; cin >> x >> y; return Point(x, y); } // 点の入力
bool eq(ld a, ld b) { return (abs(a - b) < eps); } // 誤差つき等号判定
ld dot(Point a, Point b) { return real(conj(a) * b); } // 内積
ld cross(Point a, Point b) { return imag(conj(a) * b); } // 外積

ld solve(){
    Point p1 = input_point(), p2 = input_point(), p3 = input_point();
    ld a = abs(p1-p2), b = abs(p2-p3), c = abs(p3-p1);
    ld S = abs(cross(p2-p1,p3-p1)/2);
    ld r = 2*S/(a+b+c);
    ld M = max({a,b,c});
    ld ret = M/(2+M/r);
    return ret;
}
int main(void) {
	cin.tie(0); ios::sync_with_stdio(false);
    cout << fixed << setprecision(15) << solve() << endl;
	return 0;
}


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

string board[60];
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

int main() {
  int X, Y;
  cin >> X >> Y;
  rep(i, X) cin >> board[i];
  
  rep(i, X) {
    rep(j, Y) {
      if (board[i][j] == '.') {
        int count = 0;
        rep(k, 8) {
          int x = i + dx[k];
          int y = j + dy[k];
          if (x >= 0 && x < X && y >= 0 && y < Y && board[x][y] == '#') count++;
        }
        
        board[i][j] = '0' + count;
        
      }
    }
  }
  
  rep(i, X) cout << board[i] << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <stdio.h>
#include <math.h>
using namespace std;
using vi = vector<int>;
using vll = vector<long long int>;
using vb = vector<bool>;
using vvi = vector<vector<int>>;
using vvll = vector<vector<long long int>>;
using ll = long long int;

int main(){
    ll N; cin >> N;
    vector<long double> p(N+1);
    for(int i=1; i<N+1; i++){
        cin >> p[i];
    }

    long double dp[N+1][N+1];
    dp[1][1] = p[1];
    dp[1][0] = 1-p[1];
    
    for(int i=1; i<N+1; i++){
        for(int j=0; j<N+1; j++){
            if(i==1&&j==1){continue;}
            else if(i==1&&j==0){continue;}
            else if(i < j){dp[i][j] = 0;}
            else if(j == 0){dp[i][j] = dp[i-1][j]*(1-p[i]);}
            else{
                dp[i][j] = dp[i-1][j-1]*p[i] + dp[i-1][j]*(1-p[i]);
            }
        }
    }

    long double ans = 0;
    if(N%2==0){
        ll n = N/2 + 1;
        for(int i=n; i<N+1; i++){
            ans += dp[N][i];
        }
    }else{
        ll n = N/2 +1;
        for(int i=n; i<N+1; i++){
            ans += dp[N][i];
        }
    }
    cout << setprecision(10) << ans;
}

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

 
int main()
{
	int n;
	string s;
	bool a[200010];
	cin >> n;
	cin >> s;
	for (int i=0;i<n;i++)
	{
		if(s[i]=='.') a[i]=true;
		else a[i]=false;
	}
	int b[200010]={}, w[200010]={};
   for (int i=0;i<n;i++)
	{
		b[i+1]=b[i];
		w[i+1]=w[i];
		if(a[i]) w[i+1]++;
		else b[i+1]++;
	}
	int ans=n;
for (int i=0;i<n+1;i++)
	{
		ans=min(ans, b[i]+(w[n]-w[i]));
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 2308
import numpy as np

H,W = map(int,input().split())
temp = np.array([list(input()) for _ in range(H)])
# 周りに壁を、0,1化、壁をTrueで持つ
grid = np.ones((H+2,W+2),dtype=np.bool)
grid[1:-1,1:-1] = (temp == '#')

# x軸方向の集計
def F(transpose):
  x = grid.copy()
  if transpose:
    x = x.T
  x = np.ravel(x) # to 1D array
  
  zero_idx = np.nonzero(x)[0]
  zero_span = np.diff(zero_idx) - 1 # 次の0までにある1の個数
  
  y = np.zeros(x.shape[0],dtype=np.int32)
  y[1:][zero_idx[:-1]] = zero_span # 1の個数の加算の起点
  y[zero_idx[1:]] -= zero_span # 1の個数の反映をやめる
  y = y.cumsum()
  if transpose:
    y = y.reshape(grid.T.shape).T
  else:
    y = y.reshape(grid.shape)
  return y

answer = (F(True) + F(False)).max() - 1
print(answer)

Measured memory_bytes: 248972
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
using static System.Math;
namespace AtCoder
{
    class Program
    {
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }

        static readonly long Mod = 1000000000 + 7;

        static void Main(string[] args)
        {
            SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
            var NAB = Sarray();
            var N = NAB[0];
            var A = NAB[1];
            var B = NAB[2];
            var S = ReadLine();
            var passNum = 0L;
            var bPassNum = 0L;
            foreach(var s in S)
            {
                var bPass = false;
                if(s=='a')
                {
                    if(passNum< A+B)
                    {
                        bPass = true;
                        ++passNum;
                    }
                }
                else if(s=='b')
                {
                 if(passNum<A+B && bPassNum < B)
                    {
                        bPass = true;
                        ++passNum;
                        ++bPassNum;
                    }
                }
                if (bPass)
                {
                    WriteLine("Yes");
                }
                else
                {
                    WriteLine("No");
                }
            }

            Out.Flush();
        }
    }
}

Measured memory_bytes: 15840
#include <iostream>
#include <queue>

using namespace std;

static const int MAX = 100;
static const int WHITE = 1;
static const int GRAY = 2;
static const int BLACK = 3;

class BFS {
private:
    int color[MAX];
    int n;
    int M[MAX][MAX];
    queue<int> Q;
    int distance[MAX];

public:
    BFS()
    {
        cin >> n;
        for(int i = 0; i < n; i++)
            for(int j = 0; j < n; j++)
                M[i][j] = 0;
        int vertex;
        int degree;
        for(int i = 0; i < n; i++)
        {
            color[i] = WHITE;
            cin >> vertex;
            cin >> degree;
            int to_v;
            for(int j = 0; j < degree; j++)
            {
                cin >> to_v;
                M[vertex - 1][to_v - 1] = 1;
            }
        }
    }

    void bfs()
    {
        for(int i = 0; i < n; i++)
            distance[i] = -1;

        distance[0] = 0;
        Q.push(0);
        color[0] = GRAY;
        while(Q.size() != 0)
        {
            int u = Q.front();
            Q.pop();
            color[u] = BLACK;
            for(int v = 0; v < n; v++)
            {
                if(M[u][v] && color[v] == WHITE)
                {
                    distance[v]  = distance[u] + 1;
                    Q.push(v);
                    color[v] = GRAY;
                }
            }
        }
    }

    void print()
    {
        for(int i = 0; i < n; i++)
            cout << i + 1 << " " << distance[i] << endl;
    }
};

int main()
{
    BFS bfs;
    bfs.bfs();
    bfs.print();
}


Measured memory_bytes: 3124
#include<stdio.h>
#define MAX 10000
#define NIL -1

struct Node {int p, l, r;};
struct Node T[MAX];
int n;

/* 先行順巡回 */
void preParse(int u){
    if (u == NIL) return;
    printf(" %d", u);
    preParse(T[u].l);
    preParse(T[u].r);
}

/* 中間順巡回 */
void inParse(int u){
    if (u == NIL) return;
    inParse(T[u].l);
    printf(" %d", u);
    inParse(T[u].r);
}

/* 後行順巡回 */
void postParse(int u){
    if (u == NIL) return;
    postParse(T[u].l);
    postParse(T[u].r);
    printf(" %d", u);
}

int main(){
    int i, v, l, r, root;

    scanf("%d", &n);
    for (i = 0; i < n; i++){
        T[i].p = NIL;
    }

    for (i = 0; i < n; i++){
        scanf("%d %d %d", &v, &l, &r);
        T[v].l = l;
        T[v].r = r;
        if (l != NIL) T[l].p = v;
        if (r != NIL) T[r].p = v;
    }

    for (i = 0; i < n; i++) if (T[i].p == NIL) root = i;

    printf("Preorder\n");
    preParse(root);
    printf("\n");
    printf("Inorder\n");
    inParse(root);
    printf("\n");
    printf("Postorder\n");
    postParse(root);
    printf("\n");

    return 0;
}


Measured memory_bytes: 2088
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int , int> i_i;
typedef vector<ll> vel;
typedef vector<int> vei;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<int>> ve_vei;
typedef vector<vector<char>> ve_vec;
typedef vector<vector<bool>> ve_veb;
typedef vector<vector<string>> ve_ves;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define rep2(i,n) for(int i=2;i<(int)(n);i++)
#define repk(i,k,n) for(int i=k;i<(int)(n);i++)
#define fs first
#define sc second
#define pub push_back
#define pob pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define maxel(a) max_element(all(a))
#define acc accumulate
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)

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

    ll A,B,C,D; cin >> A >> B >> C >> D;

    ll l = C*D/__gcd(C,D);
    ll ans1 = B - (B/C) - (B/D) + (B/l);
    ll ans2 = (A-1) - ((A-1)/C) - ((A-1)/D) + ((A-1)/l);

    cout << ans1 - ans2 << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int gcd(int, int);

int main(void){
    for(int a, b; cin >> a >> b; cout << gcd(a, b) << endl);

    return 0;
}

int gcd(int a, int b){
    int r;
    while((r = a % b) != 0){
        a = b;
        b = r;
    }
    
    return b;
}

Measured memory_bytes: 1160
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
#include<string>
#include<numeric>
#include<set>
#include<math.h>
using namespace std;

string S;

int main(){
    cin >> S;
    int N = S.length();
    int cnt = 0;

    for(int i = 0; i < N; i++){
        if(S[i] == '0') cnt++;
    }
    
    cout << 2 * min(cnt, N-cnt) << "\n";

    return 0;
}

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

string s; int p;

int expression(int p, string &s) {
	int i;
	int d = p % 10;
	int c = (p / 10) % 10;
	int b = (p / 100) % 10;
	int a = (p / 1000) % 10;
	
	stack<int> stk;
	int x, y;
	
	for (i = s.length() - 1; i >= 0; i--) {
		if (s[i] == '[' || s[i] == ']') continue;
		if (s[i] == 'a') stk.push(a);
		if (s[i] == 'b') stk.push(b);
		if (s[i] == 'c') stk.push(c);
		if (s[i] == 'd') stk.push(d);
		if (s[i] == '+' || s[i] == '*' || s[i] == '^') {
			x = stk.top(); stk.pop(); y = stk.top(); stk.pop();
		}
		if (s[i] == '+') stk.push(x | y);
		if (s[i] == '*') stk.push(x & y);
		if (s[i] == '^') stk.push(x ^ y);
	}
	return stk.top();
}

int main() {
	while (cin >> s) {
		if (s == ".") break;
		cin >> p;
		int hashNum = expression(p, s);
		int cnt = 0;
		for (int i = 0; i < 10000; i++) if (expression(i, s) == hashNum) cnt++;
		cout << hashNum << " " << cnt << endl;
	}
	return 0;
}


Measured memory_bytes: 3152
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
#define debug(x) cerr<<#x<<": "<<x<<endl;
#define MOD 1000000007ULL;
#define rep(i,n) for(int i=0;i<n;i++)


int main() {
	ll N;
  	cin>>N;
  	
	if(N%1000==0) cout<<0<<endl;
  	else cout<<1000-(N%1000)<<endl;
}

Measured memory_bytes: 3676
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
using namespace std;
int main()
{
  long mod = 1000000007;
  long N;
  string S;
  cin >> N >> S;
  long a[26] = {};
  for (int i = 0; i < N; i++)
    a[S[i] - 'a']++;
  long ans = 1;
  for (int i = 0; i < 26; i++)
  {
    ans *= 1 + a[i];
    ans %= mod;
  }
  cout << ans - 1 << endl;
  return 0;
}

Measured memory_bytes: 512