akhauriyash/Code-Regression huggingface dataset:
//高知能系Vtuberの高井茅乃です。
//Twitter: https://twitter.com/takaichino
//YouTube: https://www.youtube.com/channel/UCTOxnI3eOI_o1HRgzq-LEZw

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

#define INF 1999999999
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(int i=1;i<=n;i++)
#define MODA 1000000007 

int main() {
	int ans = 0, pn = 0;
	int tmp;
	int n, m;
	cin >> n >> m;
	bool sl[n+1]={};
	int wa[n+1] = {};
	int p;
	string s;
	REP(i, m){
		cin >> p >> s;
		if(sl[p]) continue;
		else{
			if(s == "AC"){
				sl[p] = true;
				pn += wa[p];
				ans ++;
			}
			else {
				wa[p]++;
			}
		}
	}
	cout << ans << " " << pn << endl;
}

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

int main()
{
    int n,k;
    cin>>n>>k;
    double a[n];
    for(int i=0; i<n; i++)
    {
        long double x; cin>>x;
        a[i]=log(x);
    }
    long double sum=0; int j=0;
    for(int i=0; i<k; i++)
        sum+=a[i];
    for(int i=k; i<n; i++)
    {
        long double y=sum;
        sum-=a[j]; sum+=a[i];
        if(sum>y) cout<<"Yes\n";
        else cout<<"No\n";
        j++;
    }
    return 0;
}

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

#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define int long long int
#define pb push_back
#define all(a) a.begin(),a.end()

signed main(){
	IOS;
	string s;
	cin>>s;
	if(s[0]==s[1] || s[1]==s[2] || s[2]==s[3]){
		cout<<"Bad";
	}
	else cout<<"Good";
}

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

int main() {
	ll n, x;
	cin >> n >> x;
	vector<ll> a(n);
	rep(i, n) cin >> a[i];
	ll ans = 0;
	rep(i, n) {
		if(a[i] > x) {
			ans += a[i] - x;
			a[i] = x;
		}
	}
	rep(i, n-1) {
		if(a[i]+a[i+1] > x) {
			ll dif = a[i] + a[i+1] - x;
			a[i+1] -= dif;
			ans += dif;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1024
def main():
    N = int(input())
    import itertools
    from bisect import bisect_left,bisect
    L=[]

    S = "753"
    m = 6
    for i in range(3,10):
        for j in itertools.product(S, repeat=i):
            flag7 = 0
            flag5 = 0
            flag3 = 0
            tmp = ""
            for s in j:
                if s == "7":
                    flag7 = 1
                elif s == "5":
                    flag5 = 1
                elif s == "3":
                    flag3 = 1
                tmp += s
            if flag3 == flag5 == flag7 == 1:
                tmp = int(tmp)
                L.insert(bisect_left(L,tmp), tmp)
    ans = bisect(L,N)
    print(ans)


main()

Measured memory_bytes: 4176
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>

using namespace std;

//----------------------- Print Function ----------------------//

inline void print() {
    cout << endl;
}
template <typename First, typename... Rest>
void print(const First &first, const Rest &... rest) {
    cout << first << ' ';
    print(rest...);
}

template <typename T>
void print(const vector<T> &v) {
    for (auto e : v) cout << e << ' ';
    cout << endl;
}

//------------------------- Libraries -------------------------//

//--------------------------- Solve ---------------------------//

void solve() {
    int N; cin >> N;
    vector<int> s(N);
    int sum = 0;
    for (int i = 0; i < N; i++) {
        cin >> s[i];
        sum += s[i];
    }

    sort(s.begin(), s.end());

    if (sum % 10 == 0) {
        for (int i = 0; i < N; i++) {
            if (s[i] % 10 != 0) {
                sum -= s[i];
                cout << sum << '\n';
                return;
            }
        }
        cout << 0 << '\n';
        return;
    }
    else cout << sum << '\n';
}

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

    solve();

    return 0;
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
#define fi first
#define se second
using namespace std;

int h, w;
int dp[1005][1005] = {0};
int d[4] = {0, 1, 0, -1};
string s[1005];
queue<pair<int, int>> qu;

int solve();
bool ch(pair<int, int> p) {
  return p.fi >= 0 && p.fi < h && p.se >= 0 && p.se < w;
}

int main() {
  cin >> h >> w;
  for(int i = 0; i < h; ++i) cin >> s[i];
  cout << solve() << endl;
  return 0;
}

int solve() {
  int ans = 0;
  for(int i = 0; i < h; ++i)
    for(int j = 0; j < w; ++j) {
      dp[i][j] = (int)1e8;
      if(s[i][j] == '#') {
        qu.push({i, j});
        dp[i][j] = 0;
      }
    }
  while(qu.size() > 0) {
    pair<int, int> now = qu.front();
    qu.pop();
    for(int i = 0; i < 4; ++i) {
      pair<int, int> nextp = now;
      nextp.fi += d[i];
      nextp.se += d[1 ^ i];
      if(!ch(nextp)) continue;
      if(dp[nextp.fi][nextp.se] > dp[now.fi][now.se] + 1) {
        dp[nextp.fi][nextp.se] = dp[now.fi][now.se] + 1;
        qu.push(nextp);
        ans = max(ans, dp[nextp.fi][nextp.se]);
      }
    }
  }
  return ans;
}

Measured memory_bytes: 13456
#include<iostream>
#include<algorithm>
using namespace std;
int n,s[100],sum;
main(){
    cin>>n;
    for(int i=0;i<n;i++){
        cin>>s[i];
        sum+=s[i];
    }
    sort(s,s+n);
    for(int i=0;i<n;i++){
        if(sum%10){
            cout<<sum<<endl;
            return 0;
        }
        if(s[i]%10!=0)sum-=s[i];
    }
    cout<<0<<endl;
}

Measured memory_bytes: 256
from collections import deque
import sys
sys.setrecursionlimit(10000000)
input=lambda : sys.stdin.readline().rstrip()

sx,sy,gx,gy=map(int,input().split())
n=int(input())
que=deque()
field=[[[0 for k in range(6)] for j in range(201)]for i in range(201)]

for i in range(n):
    x,y=map(int,input().split())
    for j in range(6):
        field[y+100][x+100][j]+=1
lx,ly=map(int,input().split())

field[sy+100][sx+100][0]=0
que.append((sy+100,sx+100,0,0))
r = [[(1,0),(0,1),(-1,1),(-1,0),(-1,-1),(0,-1)],[(1,0),(1,1),(0,1),(-1,0),(0,-1),(1,-1)]]
while que:
    y,x,t,c=que.popleft()
    if field[y][x][t%6]:
        continue
    else:
        field[y][x][t%6]=1
    if (y,x)==(gy+100,gx+100):
        print(c)
        break
    for i in range(6):
        if abs(y-100+r[x%2][i][0])<=ly and abs(x-100+r[x%2][i][1])<=lx and not field[y+r[x%2][i][0]][x+r[x%2][i][1]][(t+1)%6]:
            if i==abs((y-100)*(x-100)*(t))%6:
                que.appendleft((y+r[x%2][i][0],x+r[x%2][i][1],t+1,c))
            else:
                que.append((y+r[x%2][i][0],x+r[x%2][i][1],t+1,c+1))
    if not field[y][x][(t+1)%6]:
        que.append((y,x,t+1,c+1))
else:
    print(-1)




Measured memory_bytes: 13640
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <vector>
#include <string>
#include <queue>
#include <deque>
#include <list>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <bitset>
#include <random>
#include <complex>
#include <assert.h>

using namespace std;

constexpr int mod = 1000000007;
constexpr int v[] = { 0, 765144583, 346175634, 347662323, 5655049, 184117322, 927321758, 444014759, 542573865, 237315285, 417297686, 471090892, 183023413, 660103155, 727008098, 539588932, 729548371, 700407153, 404391958, 962779130, 184117322, 927321758, 444014759, 542573865, 237315285, 417297686, 471090892, 183023413, 660103155, 727008098 };

int main() {
	int N, T; scanf("%d", &T);
	for (int _t = 0; _t < T; _t++) {
		scanf("%d", &N);
		int ans = 869418286;
		if (N & 1) {// odd
			for (int i = 14, j = 29; i >= 0; i--, j--) {
				ans = ((long long)ans * N + v[j]) % mod;
			}
		}
		else {// even
			for (int i = 14; i >= 0; i--) {
				ans = ((long long)ans * N + v[i]) % mod;
			}
		}
		printf("%d\n", ans);
	}

	return 0;
}

Measured memory_bytes: 3220
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include<limits.h>
#include<iomanip>
#define rep(i, n) for(int i = 0; i < n; i++)
#define REP(i, m, n) for(int i = m; i < n; i++)
#define ALL(v) v.begin(),v.end()
#define RALL(v) v.rbegin(),v.rend()
#define check(v) rep(i,v.size()) cout << v[i] << " ";\
cout << endl
#define INF 1e8
typedef long long ll;
using namespace std;
//オーバーフローに気をつけろよおおおおおお
//確認忘れるなよおおおおおお

int rate[8];
int main() {
    int n; cin >> n;
    int pro = 0;
    rep(i,n){
        int num; cin >> num;
        if(num<400) rate[0]++;
        else if(num<800) rate[1]++;
        else if(num<1200) rate[2]++;
        else if(num<1600) rate[3]++;
        else if(num<2000) rate[4]++;
        else if(num<2400) rate[5]++;
        else if(num<2800) rate[6]++;
        else if(num<3200) rate[7]++;
        else pro++;
    }
    int color = 0;
    rep(i,8){
        if(rate[i]) color++;
    }
    if(color==0){
        cout << 1 << endl;
    }else cout << color << endl;
    cout << color+pro << endl;

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
struct bcj
{
    int f[200001];
    int size[200001];
    int find(int n)
    {
        if(f[n]==n)
            return n;
        else
            f[n]=find(f[n]);
        return f[n];
    }
    int add(int x,int y)
    {
        int a=find(x);
        int b=find(y);
        if(a==b)
            return 0;
        else
        {
            f[a]=b;
            size[b]+=size[a];
        }
        return 1;
    }
    void clear(int n)
    {
        for (int i=1;i<=n;i++)
        {
            f[i]=i;
            size[i]=1;
        }
    }
}S;
int n,m,x,y,ans;
int main()
{
    scanf("%d %d",&n,&m);
    S.clear(n);
    while(m--)
    {
        scanf("%d %d",&x,&y);
        S.add(x,y);
    }
    for(int i=1;i<=n;++i)
    {
        ans=max(ans,S.size[i]);
    }
    printf("%d\n",ans);
    return 0;
}


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

typedef long long ll;
#define ar array
#define vi vector<int>
#define vvi vector<vector<int>>
#define vll vector<long long>
#define all(x) (x).begin(), (x).end()
#define en '\n'
#define FILL(x, v) memset(x, v, sizeof(x))
#define pb push_back
#define fast                     \
	ios::sync_with_stdio(false); \
	cin.tie(NULL);               \
	cout.tie(NULL);
#define F_OR(i, a, b, s) for (int i = (a); ((s) > 0 ? i < (b) : i > (b)); i += (s))
#define F_OR1(e) F_OR(i, 0, e, 1)
#define F_OR2(i, e) F_OR(i, 0, e, 1)
#define F_OR3(i, b, e) F_OR(i, b, e, 1)
#define F_OR4(i, b, e, s) F_OR(i, b, e, s)
#define GET5(a, b, c, d, e, ...) e
#define F_ORC(...) GET5(__VA_ARGS__, F_OR4, F_OR3, F_OR2, F_OR1)
#define FOR(...)       \
	F_ORC(__VA_ARGS__) \
	(__VA_ARGS__)

#define E_ACH2(x, a) for (auto &x : a)
#define E_ACH3(x, y, a) for (auto &[x, y] : a)
#define E_ACH4(x, y, z, a) for (auto &[x, y, z] : a)
#define E_ACHC(...) GET5(__VA_ARGS__, E_ACH4, E_ACH3, E_ACH2)
#define EACH(...)       \
	E_ACHC(__VA_ARGS__) \
	(__VA_ARGS__)

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

const int mxn = 5e5;
const int M = 1e9 + 7;

ll pw(ll b, ll e)
{
	ll res = 1;
	while (e)
	{
		if (e % 2)
			res = (res * b) % M;
		b = (b * b) % M;
		e >>= 1; // e/=2;
	}
	return res;
}

ll iv[mxn + 1], f1[mxn + 1], f2[mxn + 1];
ll nck(int n, int k)
{
	return f1[n] * f2[k] % M * f2[n - k] % M;
}

int main()
{
	fast;
	int d, t, s;
	cin >> d >> t >> s;
	cout << (s * t >= d ? "Yes" : "No");
}

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

const int maxn = 60;
int h, w, dirx[4] = {1, -1, 0, 0}, diry[4] = {0, 0, 1, -1};
string s[maxn];
bool check;

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

	for(int i=0; i<h; i++){
		for(int j=0, temp; j<w; j++){
			if(s[i][j] == '.'){
				continue;
			}

			check = false;
			for(int k=0, x, y; k<4; k++){
				x = dirx[k]+j;
				y = diry[k]+i;
				if(x<0||x>=w||y<0||y>=h){
					continue;
				}
				if(s[y][x] == '#'){
					check = true;
				}
			}
			if(!check){
				cout << "No" << endl;
                return 0;
			}
		}
	}

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

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

int main()
{
    int N, tmp;
    cin >> N;
    vector<int> list(N);

    for (int i = 0; i < N - 1; i++)
    {
        cin >> tmp;
        list[tmp - 1]++;
    }
    for (int i = 0; i < N; i++)
    {
        cout << list[i];
        if (i != N - 1)
            cout << endl;
    }
}

Measured memory_bytes: 4052
#include<iostream>  
#include<cstdio>
#include<stdio.h>
#include<cstring>
#include<cstdio>
#include<climits>   
#include<cmath> 
#include<vector>  
#include <bitset>  
#include<algorithm>    
#include <queue>  
#include<map> 
#define inf 9999999; 
using namespace std;

int a,b;
int main()
{
	cin>>a>>b;
	if((a+b)%3==0||a%3==0||b%3==0)
	{
		cout<<"Possible"<<endl;
	}
	else
	{
		cout<<"Impossible"<<endl;
	}
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define vll vector<ll>
#define vi vector<int>
#define vpll vector<pair<ll,ll>>
#define pii pair<int,int>
#define REP(i,a) for(int (i)=0; (i)<(a); (i)++)
#define RREP(i,a) for(int (i)=a-1; (i)>=(0); (i)--)
#define REP2(i,a,b) for(int (i)=(a); (i)<(b); (i)++)
#define MOD 1000000007
#define INF 0x7FFFFFFF
#define ALL(v) v.begin(), v.end()
#define m0(x) memset(x,0,sizeof(x))
typedef long long ll;

using namespace std;

int gcd(int a,int b){return b?gcd(b,a%b):a;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int N;
  cin>>N;
  vll A(N);
  REP(i,N){
    cin>>A[i];
  }
  reverse(ALL(A));
  vll dp(N,INF);
  REP(i,N){
    *upper_bound(ALL(dp),A[i]) = A[i];
  }
  cout << lower_bound(ALL(dp),INF) - dp.begin() <<"\n";
  return 0;
}

Measured memory_bytes: 1792
#include <stdio.h>

int main(void)
{
	int a,b,c;
	scanf("%d %d",&a,&b);
	
	if(b%a==0){
		c=a+b;
	}else{
		c=b-a;
	}
	
	printf("%d\n",c);
	
	return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
 
bool isprime(int p) {
	if(p==1){
	     return false;
	}
	for(int i = 2; i < p; i++) {
		if(p%i == 0){
		     return false;
		}
	}
	return true;
}
 
int n;
int main() {
	cin >> n;
	for(int i = 31;i<=55555;i += 30) {
		if (isprime(i) == true) {
			if (i != 31){
			     cout << " ";
			}
			n-=1;
			cout << i; 
			
		}
		if(n == 0){
		     break;
		}
	}
	cout << endl;
	return 0;
}

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

int n;
string str[10];
int t[10][10];
string u[10][10];
int v[10];
int w[10];

string ans,tmp;
int ans_size,tmp_size;
int count(string&,string&,int,int);
int main(){
  while(cin>>n&&n){
    for(int i=0;i<n;i++){
      cin>>str[i];
      for(int j=0;j<i;j++){
	t[i][j]=count(str[i],str[j],i,j);
	t[j][i]=count(str[j],str[i],j,i);
      }
    }
    ans_size=(1<<24);
    for(int i=0;i<n;i++)w[i]=i;
    do{
      for(int i=0;i<n;i++)v[i]=w[i];
      tmp_size=str[v[0]].size();
      for(int i=1;i<n;i++){
	tmp_size+=t[v[i-1]][v[i]];
	if(t[v[i-1]][v[i]]==0)v[i]=v[i-1];
      }
      if(tmp_size<ans_size){
	ans_size=tmp_size;
	ans=str[v[0]];
	for(int i=1;i<n;i++)ans+=u[v[i-1]][v[i]];
      }else if(tmp_size==ans_size){
	tmp=str[v[0]];
	for(int i=1;i<n;i++)tmp+=u[v[i-1]][v[i]];
	if(tmp<ans)ans=tmp;
      }
    }while(next_permutation(w,w+n));
    cout<<ans<<endl;
  }
  return 0;
}

int count(string& a,string& b,int I,int J){
  int i,j,c=a.size(),d=b.size();
  bool flg;
  for(i=0;i<c;i++){
    flg=true;
    for(j=0;(j<d&&i+j<c);j++)if(a[i+j]!=b[j])flg=false;
    if(flg){
      if(j<d)u[I][J]=b.substr(j);
      else u[I][J]="";
      return u[I][J].size();
    }
  }
  u[I][J]=b;
  return d;
}

Measured memory_bytes: 1216
#include <bits/stdc++.h>
using namespace std;
#define int         long long
#define mp          make_pair
#define pb          push_back
#define pii         pair<int,int>
#define vi          vector<int>
// #define vb          vector<bool>
// #define vc          vector<char>
#define vii         vector<pii>
//#define mi          map<int,int>
//#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (int)x.size()
// #define ub(x)       upper_bound(x)
// #define lb(x)       lower_bound(x)
#define endl        '\n'
#define file        freopen("input.txt","r",stdin);freopen("output.txt","w",stdout)
#define fastio      ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
// #define N            1e5+5
#define PRIME           1000000007
#define MAX         50000
#define mem0(a)     memset(a,0,sizeof(a))
#define prec        cout<<std::setprecision(9)<<std::fixed
#define forn(i,a,b)  for(int i=a;i<b;i++)
#define pi          3.14159265358979323
int i,j,k;
int power(int x,int y){
    if(y==0)return 1;
    if(y==1)return x;
    if(y&1)return (((power(x,y/2)*power(x,y/2))%PRIME)*x)%PRIME;
    else return (power(x,y/2)*power(x,y/2))%PRIME;
}
const bool cmp(pair<int,char> &a,pair<int,char> &b){
    return a.F>b.F;
}
 
void Anon_mouS(){
    string s,t;
    cin>>s>>t;
    int ans=0;
    for(i=0;i<s.length();i++){
        if(s[i]!=t[i])ans++;
    }
    cout<<ans<<endl;
}
 
int32_t main(){
    fastio;
    int q=1;
    // cin>>q;
    // SieveOfEratosthenes();
    while(q--){
        Anon_mouS();
    }
    return 0;   
}

Measured memory_bytes: 3800
#include <bits/stdc++.h>
using namespace std;
#define endl "\n"
#define faster ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
typedef long long ll;
 
typedef vector<int> vi;;
typedef vector<ll> vll;

#define l() length()
#define sz() size()
 
#define b() begin()
#define e() end()
#define all(x) x.begin(), x.end()
 
#define pb(i) push_back(i)
#define PB() pop_back()
 
 
typedef pair<int, int> pii;
typedef pair<ll,ll> pll;
#define mp make_pair
#define Fi first
#define Se second
 
const int maxx=1e6+9;
 
// Happy Coding!

int remSum(int m,vi arr){
    int c=0;
    for(int x:arr){
        c+=(m%x);
    }
    return c;
}

void solve(){
    
    int n;
    cin>>n;
    
    
    int sum=0;
    for(int i=0;i<n;i++){
        int c;
        cin>>c;
        sum+=c;
    }
    
    cout<<sum-n<<endl;
    
    
}

int main() {
    faster;
    int t=1;
    // cin>>t;
    while(t-->0){
        solve();
    }
	return 0;
}

Measured memory_bytes: 3628
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pll pair<ll,ll>
#define pq priority_queue
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define lb(c,x) distance(c.begin(),lower_bound(all(c),x))
#define ub(c,x) distance(c.begin(),upper_bound(all(c),x))

using namespace std;

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

const ll mod=1e9+7;

int main(){
    ll n;
    cin >> n;
    vector<ll> a(n);
    ll ans=0;
    rep(i,n){
        cin >> a[i];
        ans+=a[i]-1;
    }
    cout << ans << endl;
    return 0;
} 


Measured memory_bytes: 256
from collections import Counter

MOD = 2019
S = input()
S = tuple(map(int, reversed(S)))
counter = Counter([0])
digit = 1
cumsum = 0

for i in range(len(S)):
    cumsum += S[i] * digit % MOD
    cumsum %= MOD
    counter[cumsum] += 1
    digit = digit * 10 % MOD

print(sum([v * (v - 1) // 2 for v in counter.values()]))


Measured memory_bytes: 11320
#include <cstdio>

using namespace std;

int main() {
	int n, c = 0, i;
	
	scanf("%d", &n);
	
	for (i = 0; i < n; i++) {
		int x;
		
		scanf("%d", &x);
		
		if (x % 2 == 1) c++;
	}
	
	if (c % 2 == 1) {
		puts("NO");
	} else {
		puts("YES");
	}
	
	return 0;
}


Measured memory_bytes: 128
L,R = map(int, input().split())

if R - L >= 2019:
    print(0)
else:
    m = 2020
    for i in range(L, R+1):
        for j in range(L, R+1):
            if i == j:
                continue
            m = min(m, (i * j) % 2019)
    print(m)


Measured memory_bytes: 2940
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <cstring>
#include <utility>
#include <set>
#include <stack>
#include <climits>
#include <cmath>
#include <iomanip>
#include <unordered_map>
#include <map>
#include <boost/multiprecision/cpp_int.hpp>

#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define rep1(i,n) for(int i=1, i##_len=(n); i<=i##_len; ++i)
#define reps(i,s,n) for(int i=s, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
#define MEMSET(v, h) memset((v), h, sizeof(v))
typedef long long ll;
typedef long double ld;
const char sp = ' ';

using namespace boost::multiprecision;
using namespace std;

int main(void){
    ll A, B;
    cin>>A>>B;
    cout<<max({A+B, A*B, A-B})<<endl;
    return 0;
}


Measured memory_bytes: 3636
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;

static const double EPS = 1e-8;
static const double PI = 4.0 * atan(1.0);
static const double PI2 = 8.0 * atan(1.0);

#define REP(i,n)	for(int i=0;i<(int)n;++i)
#define ALL(c)		(c).begin(),(c).end()
#define CLEAR(v)	memset(v,0,sizeof(v))
#define MP(a,b)		make_pair((a),(b))
#define ABS(a)		((a)>0?(a):-(a))
#define FOR(i,s,n)	for(int i=s;i<(int)n;++i)

int main(int argc, char **argv) {
	char c;
	cin >> c;
	cout << (string("aeiou").find(c) == string::npos ? "consonant" : "vowel") << endl;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;

const long long N = 1e3 + 17;
ll cnt, lnt, mn = N, mx;
pair<ll,ll>pr[N];
vector<ll>v,v2,v3;
map<ll,ll>mp;
bool used[N], t1, t2;
vector<string>sv;

int main()
{
    double ans = 0;
    ll n, m;
    cin >> n >> m;
    for(ll i = 1; i <= n; i ++)
    {
        double ver = 1.0 / n;
        int now = i;
        while(now < m)
        {
            now *= 2;
            ver /= 2;
        }
        ans += ver;
    }
    printf("%.9f" , ans);
}


Measured memory_bytes: 256
#include"bits/stdc++.h"
#include<boost/multi_array.hpp>
#include<boost/range/irange.hpp>
#include<boost/range/algorithm.hpp>
#include<boost/range/adaptors.hpp>

namespace adaptor = boost::adaptors;

void solve()
{
    int64_t X, Y;
    std::cin >> X >> Y;
    int64_t ans = 0;
    while(X <= Y)
    {
        ans++;
        X *= 2;
    }

    std::cout << ans << std::endl;
}

int main()
{
    std::cin.tie(nullptr);
    std::ios_base::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(15);
    solve();
}


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

int main() {
    string ans = "Christmas";
    int d; cin >> d;
    if (d == 22) ans = "Christmas Eve Eve Eve";
    else if (d == 23) ans = "Christmas Eve Eve";
    else if (d == 24) ans = "Christmas Eve";
    cout << ans << endl;
    
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int mod=1e9+7;
long long d[1<<20],d0[1<<20],z[1<<20],v[1<<20];
int n,c;
int main()
{
	cin>>n;
	for(int i=1,a;i<=n;i++)
	{
		z[i]=z[i-1];
		cin>>a;
		c^=a;
		if(!c)
		{
			z[i]++;
			d[0]=max(d[0]*2,1ll)%mod;
			continue;
		}
		if(v[c])d0[c]=(d0[c]+d[c]*(z[i]-z[v[c]]))%mod;
		else d0[c]=1;
		d[c]=(d[c]+d0[c])%mod;
		v[c]=i;
	}
	if(c)cout<<d0[c]<<'\n',exit(0);
	long long ans=0;
	for(int i=0;i<(1<<20);i++)ans+=d[i];
	cout<<ans%mod<<'\n';
}


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

namespace B_019_42
{
    internal class Program
    {
        private static void Main(string[] args)
        {
            new Logic_A().Start();
            Console.ReadLine();
        }

        public class Logic_A
        {
            public void Start()
            {
                var str = Console.ReadLine().Split(' ');
                var a = Convert.ToInt32(str[0]);
                var b = Convert.ToInt32(str[1]);
                var c = Convert.ToInt32(str[2]);

                var valid =
                    a == 7 && b == 5 && c == 5 ||
                    a == 5 && b == 7 && c == 5 ||
                    a == 5 && b == 5 && c == 7;

                Console.WriteLine(valid ? "YES" : "NO");
            }
        }
    }
}

Measured memory_bytes: 11220
def is_month(v):
  return (v >= 1 and v <= 12)

#yymm = list(map(int, list(input())))
yymm = int(input())
a = yymm // 100
b = yymm % 100

# yy : 00-99
# month : 01-12
if (not is_month(a)) and (not is_month(b)):
  print('NA')
elif is_month(a) and is_month(b):
  print('AMBIGUOUS')
elif is_month(b):
  print('YYMM')
elif is_month(a):
  print('MMYY')



Measured memory_bytes: 3060
#include <stdio.h>

int main(void) {
  int a, b;
  char op;
  while(1) {
    scanf("%d %c %d", &a, &op, &b);
    if (op == '?') break;
    switch (op) {
      case '+' :
        printf("%d\n", a + b); break;
      case '-' :
        printf("%d\n", a - b); break;
      case '*' :
        printf("%d\n", a * b); break;
      case '/' :
        printf("%d\n", a / b); break;
    }
  }
  return 0;
}



Measured memory_bytes: 2108
#include <iostream>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <unordered_map>
#include <random>
#include <queue>

#define BIG 1000000007
#define LLMAX 9223372036854775807
#define LLMIN (-9223372036854775808)
#define long long long

using namespace std;


int main() {
    long n,m;
    cin >> n >> m;
    vector<int> cards(n,0);
    unordered_map<int,list<int>> indexes;
    int now = 1;
    for(int i = 0;i < m;++i){
        int x,y,z;
        cin >> x >> y >> z;
        --x;
        --y;
        if(cards[x] == 0 && cards[y] == 0){
            cards[x] = now;
            cards[y] = now;
            indexes[now].push_back(x);
            indexes[now].push_back(y);
            ++now;
        }
        else if(cards[x] == 0){
            cards[x] = cards[y];
            indexes[cards[y]].push_back(x);
        }
        else if(cards[y] == 0){
            cards[y] = cards[x];
            indexes[cards[x]].push_back(y);
        }
        else if(cards[x] != cards[y]){
            int oldi = cards[y];
            list<int> oldix = indexes[cards[y]];
            for(auto au = oldix.begin();au != oldix.end();++au){
                indexes[cards[x]].push_back((*au));
                cards[(*au)] = cards[x];
            }
            indexes[oldi].clear();
        }
    }
    long c = 0;
    for(int i = 0;i < n;++i)if(cards[i] == 0)++c;
    for(auto au = indexes.begin();au != indexes.end();++au){
        if(!(*au).second.empty())++c;
    }
    cout << c << endl;
}







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

using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
typedef long long ll;
typedef map<string, int> msi;
typedef pair<int, int> PII;

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

Measured memory_bytes: 3592
#include<iostream>
#include<cstdio>
#include<cstring>
#include<queue>
#include<vector>
using namespace std;
const int maxn=10010;
const int Max=10000001;
int n;
int dis[maxn];
bool vis[maxn];

struct edge
{
	int u,v,w;
	edge(int u=0,int v=0,int w=Max):u(u),v(v),w(w){}
};
vector<edge> G[maxn];

struct node
{
	int d,id;
	bool operator < (const node& rhs) const
	{
		return d>rhs.d;
	}
	node(int d=0,int id=0):d(d),id(id){}
};
priority_queue<node> Q;

void dijkstra(int s)
{
	memset(dis,0x7f,sizeof(dis));
	memset(vis,0,sizeof(vis));
	dis[s]=0;
	Q.push(node(0,s));
	while(!Q.empty())
	{
		node u=Q.top();
		Q.pop();
		if(vis[u.id]) continue;
		vis[u.id]=1;
		for(unsigned int i=0;i<G[u.id].size();++i)
		{
			edge e=G[u.id][i];
			if(dis[e.v]>dis[u.id]+e.w)
			{
				dis[e.v]=dis[u.id]+e.w;
				Q.push(node(dis[e.v],e.v));
			}
		}
	}
}

void print()
{
	for(int i=0;i<n;++i)
	  printf("%d %d\n",i,dis[i]);
	return;
}

int main()
{
	scanf("%d",&n);
	for(int i=0;i<n;++i)
	{
		int id,k;
		scanf("%d%d",&id,&k);
		for(int j=0;j<k;j++)
		{
			int v,w;
			scanf("%d%d",&v,&w);
			G[id].push_back(edge(id,v,w));
		}
	}
	dijkstra(0);
	print();
	return 0;
} 

Measured memory_bytes: 3568
import Control.Applicative
import Control.Monad
import Numeric

main = do
    (a:b:angC':_) <- (map read.words) <$> getLine :: IO [Double]
    let angC = angC' * pi / 180.0
    let s = ( a * b * sin angC ) / 2.0
    let l = a + b + sqrt( a * a + b * b - 2.0 * a * b * cos angC )
    let h = b * sin angC
    putStrLn $ showFFloat (Just 7) s ""
    putStrLn $ showFFloat (Just 7) l ""
    putStrLn $ showFFloat (Just 7) h ""
    

Measured memory_bytes: 4052
#include <iostream>
#include <cmath>
#include <vector>

using namespace std;

bool Primality(int);

int main(){
	int n, count = 0;
	int ain;
	vector<int> a;
	
	cin >> n;
	for(int i = 0;i < n;++i){
		cin >> ain;
		a.push_back(ain);
	}
	for(int i = 0;i < n;++i) 
		if(Primality(a[i]))++count;
	cout << count << endl;
	
	return 0;
}

bool Primality(int x){
	if(x < 2)return false;
	else if(x == 2)return true;
	else if(x % 2 == 0) return false;
	for(int i = 3;i <= sqrt(x);++i)
		if(x % i == 0)return false;
	return true;
}


Measured memory_bytes: 3164
import java.util.Scanner;

//B
public class Main {


	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);

		int n=sc.nextInt();
		int[]p=new int[n];
		for(int i=0;i<n;i++) {
			p[i]=sc.nextInt();
		}
		int cnt=0;
		for(int i=1;i<n-1;i++) {
				if(p[i-1]<p[i]&&p[i]<p[i+1])cnt++;
				else if(p[i-1]>p[i]&&p[i]>p[i+1])cnt++;
		}
		System.out.println(cnt);
	}

}


Measured memory_bytes: 22868
#include <stdio.h>
#include <stdlib.h>
int main(void){
    int  n,k,a[100],ans=0 ;
    scanf ("%d%d",&n,&k) ;
    for (int i=0; i<n; i++) {
        scanf ("%d",&a[i]) ;
        if (a[i]*2<abs(k-a[i])*2) {
            ans += a[i]*2 ;
        } else {
            ans += abs(k-a[i])*2 ;
        }
    }
    printf ("%d\n",ans) ;
    return 0 ;    
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
long long MOD = 1000000007;
int main(){
  int n, m;
  cin >> n >> m;
  vector<long long> x(n);
  for (int i = 0; i < n; i++){
    cin >> x[i];
  }
  vector<long long> y(m);
  for (int i = 0; i < m; i++){
    cin >> y[i];
  }
  long long sum1 = 0;
  for (int i = 0; i < n - 1; i++){
    sum1 += (x[i + 1] - x[i]) * (i + 1) % MOD * (n - i - 1) % MOD;
    sum1 %= MOD;
  }
  long long sum2 = 0;
  for (int i = 0; i < m - 1; i++){
    sum2 += (y[i + 1] - y[i]) * (i + 1) % MOD * (m - i - 1) % MOD;
    sum2 %= MOD;
  }
  cout << sum1 * sum2 % MOD << endl;
}

Measured memory_bytes: 1792
#include<iostream>
#include<algorithm>
#include<functional>
#include<cmath>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<map>
using namespace std;
#define ll long long
const int mod = 1000000007;
const ll INF = 1000000000000000000;

struct cake {
	ll R[3], A;
	bool operator <(const cake& b) {
		return A > b.A;
	}
};

cake C[1010];
int main()
{
	int N, M;
	cin >> N >> M;
	for (int i = 0; i < N; i++) {
		cin >> C[i].R[0] >> C[i].R[1] >> C[i].R[2];
	}
	ll ans = 0;
	for (int bit = 0; bit < (1 << 3); bit++) {
		int tmp = bit;
		for (int i = 0; i < N; i++) {
			C[i].A = 0;
		}
		for (int i = 0; i < 3; i++) {
			int s = (tmp % 2 == 0) ? 1 : -1;
			tmp /= 2;
			for (int j = 0; j < N; j++) {
				C[j].A += C[j].R[i] * s;
			}
		}
		sort(C, C + N);
		/*for (int i = 0; i < N; i++) {
			cout << C[i].A << " ";
		}
		cout << endl;*/
		ll sum[3] = { 0 }, SUM = 0;
		for (int i = 0; i < 3; i++) {
			for (int j = 0; j < M; j++) {
				sum[i] += C[j].R[i];
			}
			SUM += abs(sum[i]);
		}
		ans = max(ans, SUM);
	}
	cout << ans << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
 
int main(void)
{
	char s[17];
	char t[] = "CODEFESTIVAL2016";
	scanf("%s", s);

	int c = 0;
	for ( int i = 0; i < 16; i++ ) {
		if ( s[i] != t[i] ) c++;
	}
	printf("%d\n", c);
	return 0;
}

Measured memory_bytes: 128
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>

using namespace std;

int main()
{
    string str, cmd, p;
    int q, a, b, i;

    cin >> str >> q;

    for (i = 0; i < q; i++)
    {
        cin >> cmd;
        if (cmd == "print")
        {
            cin >> a >> b;
            cout << str.substr(a, b - a + 1) << endl;
        }
        else if (cmd == "reverse")
        {
            cin >> a >> b;
            reverse(str.begin() + a, str.begin() + b + 1);
        }
        else
        {
            cin >> a >> b >> p;
            str.replace(a, b - a + 1, p);
        }
    }
}


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

#define rep(i,m,n) for(int (i)=(int)(m);i<(int)(n);i++)
#define rep2(i,m,n) for(int (i)=(int)(n)-1;i>=(int)(m);i--)
#define REP(i,n) rep(i,0,n)
#define REP2(i,n) rep2(i,0,n)
#define FOR(i,c) for(decltype((c).begin())i=(c).begin();i!=(c).end();++i)
#define all(hoge) (hoge).begin(),(hoge).end()
#define en '\n'
using ll = long long;
using ull = unsigned long long;
template <class T> using vec = vector<T>;
template <class T> using vvec = vector<vec<T>>;
typedef pair<ll, ll> P;
constexpr long long INF = 1LL << 60;
constexpr int INF_INT = 1 << 25;
constexpr long long MOD = (ll) 1e9 + 7;
//constexpr long long MOD = 998244353LL;
typedef vector<ll> Array;
typedef vector<Array> Matrix;


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

struct Edge {
	ll to, cap, rev;
	Edge(ll _to, ll _cap, ll _rev) {
	to = _to; cap = _cap; rev = _rev;
	}
};
using Edges = vector<Edge>;
using Graph = vector<Edges>;

void add_edge(Graph& G, ll from, ll to, ll cap, bool revFlag, ll revCap) {
	G[from].push_back(Edge(to, cap, (ll)G[to].size()));
	if (revFlag)G[to].push_back(Edge(from, revCap, (ll)G[from].size() - 1));
}

void solve(){
    ll n;
    cin>>n;
    vec<pair<pair<string,ll>,ll>> sp;
    REP(i,n){
        string s;
        ll p;
        cin>>s>>p;
        sp.push_back({{s,-p},i});
    }
    sort(all(sp));
    for(auto i:sp){
        cout<<i.second+1<<en;
    }
}

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

    solve();
    //ll t;cin>>t;REP(i,t) solve();

    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>

int main(){
	int x1, y1, x2, y2;
	scanf("%d%d%d%d", &x1,&y1,&x2,&y2);
	printf("%d %d %d %d", y1-y2+x2, x2-x1+y2, x1+y1-y2, y1-x1+x2);
	
	return 0;
}

Measured memory_bytes: 128
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <cstring>
#include <string>
#include <sstream>
#include <algorithm>
#include <iomanip>
#include <iostream>

#define rep(i,n) for(int i=0;i<(int)(n);i++)
const int INF = 10000000;
using namespace std;

int main()
{
	char b[100][100];
	int n, d, dx[4]={1, 0, -1, 0}, dy[4]={0, 1, 0, -1};
	
	cin >> d;
	rep(t, d) {
		memset(b, ' ', sizeof(b));
		
		cin >> n;
		rep(i, n) b[0][i]='#';
		int x=0, y=0, nn = n, direct=0;
		
		while (1) {
			for (int i=0; i<nn; i++) {
				b[x][y] = '#';
				x+=dx[direct]; y+=dy[direct];
			}
			x-=dx[direct]; y-=dy[direct];
			direct++; direct%=4;
			
			if (n%2==0 && nn<=2) break;
			
			for (int i=0; i<nn; i++) {
				b[x][y] = '#';
				x+=dx[direct]; y+=dy[direct];
			}
			x-=dx[direct]; y-=dy[direct];
			direct++; direct%=4;
			nn-=2;
			
			if (nn<=1)
				break;
		}
		
		if (t>0) cout << endl;
		rep(y, n) {
			rep(x, n)
			cout << b[x][y];
		cout << endl;
		}

	}
	return 0;
}

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

int main (void){
  
  long X;
  long deposit = 100;
  int years = 0;
  scanf("%ld",&X);
  long rishi = 0;
  
  while(deposit<X){
    years ++;
    deposit += deposit / 100;
  }
  printf("%d",years);
  
  return 0;
}

Measured memory_bytes: 1728
/*
    author:ujwalll
*/
#pragma GCC optimize("O2")
#include <bits/stdc++.h>
using namespace std; 
#define rep(i,n) for(int i=0;i<(n);i++)
#define for1(i,n) for(int i=1;i<=n;i++)
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define FORD(i,a,b) for(int i=(a);i>=(b);i--)
const int INF = 1<<29;
const int MOD=1073741824;
#define pp pair<ll,ll>
#define ppi pair<int,int>
typedef long long int ll;
bool isPowerOfTwo (ll x)  
{  
    return x && (!(x&(x-1)));  
}
void fastio()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0); cout.tie(0);
}
long long binpow(long long a, long long b) {
    long long res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}
const int dx[] = {1,0,-1,0,1,1,-1,-1};
const int dy[] = {0,-1,0,1,1,-1,-1,1};
////////////////////////////////////////////////////////////////////

int main(){
    int tc=1;
    // cin>>tc;
    while(tc--){
        string s,t;
        cin>>s>>t;
        int ans=5000;
        rep(i,s.length()){
            if((i+t.length()-1)>=s.length())break;
            int cnt=0;
            for(int j=0;j<t.length();j++){
                if(s[i+j]==t[j])continue;
                cnt++;
            }
            ans=min(ans,cnt);
        }
        cout<<ans;
    }
    return 0;
}

Measured memory_bytes: 3628
import java.util.Scanner;
import java.util.List;
import java.util.ArrayList;

public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();  // input Integer
    int b = sc.nextInt();  // input Integer
    int t = sc.nextInt();  // input Integer
    //    String a = sc.next();  // input String
    int now = 0;
    now+=a;
    int count=0;
    while (now<=t){
      now+=a;
      count+=b;
    }
    System.out.println(count);
  }
}

Measured memory_bytes: 21844
// In the name of god
#include <bits/stdc++.h>
#pragma GCC optimze("02")
using namespace std;
using ll =long long;
const ll maxn=1e5+5,inf=1e18+5,lg=15;
ll n,m,a[15][15],c[15],sum[15],x,y,z,mx,ans=inf,s,sum2[15];
bool  bl;
ll  pow(ll xx,ll yy){
	if(yy==0)return 1;
	if(yy%2==0)return pow(xx*xx,yy/2);
	return xx*pow(xx,yy-1);
}
int main(){
	ios::sync_with_stdio(false) , cin.tie(0) , cout.tie(0);
	cin>>n>>m>>x;
	for(int i=0;i<n;i++){
		cin>>c[i];
		for(int j=0;j<m;j++){
			cin>>a[i][j];
			sum[j]+=a[i][j];
		}
	}
	for(int i=0;i<m;i++){
		if(sum[i]<x){
			cout<<-1;
			return 0;
		}
	}
	mx=pow(2,n);
	for(int mask=1;mask<mx;mask++){
		bl=0;
		y=0;
		fill (sum2,sum2+m+1,0);
		for(int i=0;i<lg;i++){
			if(mask&1<<i){
				for(int j=0;j<m;j++){
					sum2[j]+=a[i][j];
				}
				y+=c[i];
			}
		}
		for(int  i=0;i<m;i++){
			if(sum2[i]<x)bl=1;
		}
		if(!bl)ans=min(ans,y);
	}
	cout<<ans;
}


Measured memory_bytes: 4116
import itertools

int1 = lambda x: int(x) - 1

H, W, M = map(int, input().split())
rows, columns = [0] * H, [0] * W
Bomb = set()
for _ in range(M):
    h, w = map(int1, input().split())
    rows[h] += 1
    columns[w] += 1
    Bomb.add((h, w))

r_first = []
r_max = max(rows)
for i, x in enumerate(rows):
    if x == r_max:
        r_first.append(i)

c_first = []
c_max = max(columns)
for i, x in enumerate(columns):
    if x == c_max:
        c_first.append(i)

ans = 0
for i, j in itertools.product(r_first, c_first):
    if (i, j) in Bomb:
        ans = r_max + c_max - 1
    else:
        ans = r_max + c_max
        break
print(ans)


Measured memory_bytes: 166428
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <iomanip>

using namespace std;
using ll = long long;

int main() {
    int n, k, d, s;
    cin >> n >> k;
    int ans = 0;
    vector<bool> a(n, false);

    for (int i = 0; i < k; i++) {
        cin >> d;
        for (int j = 0; j < d; j++) {
            cin >> s;
            a.at(s - 1) = true;
        }
    }

    for (int i = 0; i < n; i++) {
        if (a.at(i) == false) {
            ans++;
        }
    }
    cout << ans << endl;
    
}

Measured memory_bytes: 3636
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long int LL;
typedef LL ll;
typedef long double ld;
typedef string str;
typedef pair<ll,ll> pll;
typedef vector<ll> vll;
typedef stringstream strs;
 
#define X first
#define Y second
#define PB push_back
#define For(i,a,b) for (int i=a;i<b;i++)
#define Ford(i,a,b) for (int i=a;i>=b;i--)
#define smax(a,b) a=max(a,b)
#define smin(a,b) a=min(a,b)
#define SZ(a) ((ll)a.size())
#define ER(a) cout << #a << ' ' << a << endl
#define LB(a,n,x) (lower_bound(a,(a)+(n),x)-(a))
#define RET(x) { cout << x; exit(0); } 
const ll M=2e5+5,LG=64,SM=600+5,inf=1e18+1;
ll mod=1e9+7;

ll n,m;
vll g[M];
bool mark[M];
deque<ll> mas;

void doo(ll x)
{
    for (ll y:g[x])
    {
        if (!mark[y])
        {
            mark[y]=1;
            mas.PB(y);
            doo(y);
            return;            
        }
    }
}

void dooo(ll x)
{
    for (ll y:g[x])
    {
        if (!mark[y])
        {
            mark[y]=1;
            mas.push_front(y);
            dooo(y);
            return;            
        }
    }
}

int main()
{
	ios::sync_with_stdio(0);
    ll u,v;
    cin >> n >> m;
    For(i,0,m)
    {
        cin >> u >> v;
        u--;
        v--;
        g[u].PB(v);
        g[v].PB(u);
    }
    mark[u]=mark[v]=1;
    mas.PB(v);
    mas.PB(u);
    doo(u);
    dooo(v);
    cout << SZ(mas) << '\n';
    for (ll x:mas) cout << x+1 << ' ';
}    

Measured memory_bytes: 10240
;; C - HonestOrUnkind2

(defun main ()
  (let* ((N (read))
         (testimonies
           (loop repeat N collect
             (let ((A (read)))
               (loop repeat A collect
                 (cons (read) (read))))))) ; (x_ij . y_ij)
    (print (solve N testimonies))
    (fresh-line)))

(defun solve (N testimonies)
  (let ((patterns (bit-patterns N)))
    (sort patterns #'> :key #'(lambda (p) (apply #'+ p)))
    (loop for pattern in patterns
      when (satisfy pattern testimonies)
      return (apply #'+ pattern))))

(defun satisfy (pattern testimonies)
  (every #'(lambda (testimony)
             (every #'(lambda (xy)
                        (= (nth (1- (car xy)) pattern) (cdr xy)))
                    testimony))
    (honest-testimonies pattern testimonies)))

(defun honest-testimonies (pattern testimonies)
  (mapcar #'cdr
    (remove-if #'(lambda (pt) (= (car pt) 0))
      (mapcar #'cons pattern testimonies))))

(defun bit-patterns (n)
  (if (> n 0)
      (let ((tail (bit-patterns (1- n))))
        (append
          (mapcar #'(lambda (p) (cons 1 p)) tail)
          (mapcar #'(lambda (p) (cons 0 p)) tail)))
      (list nil)))

(main)


Measured memory_bytes: 35296
#include <iomanip>
#include <limits>
#include <thread>
#include <utility>
#include <iostream>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <vector>
#include <stack>
#include <queue>
#include <cmath>
#include <numeric>
#include <cassert>
#include <random>
#include <chrono>
#include <unordered_set>
#include <unordered_map>
#include <fstream>
#include <list>
#include <functional>
#include <bitset>
#include <complex>
#include <tuple>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef long double D;
typedef complex<D> P;
const ll E = 1e18 + 7;
const ll MOD = 1000000007;
#define REP(i, a, b) for (int i = a; i < b; i++)
#define rep(i, n) REP(i, 0, n)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define fill(x, y) memset(x, y, sizeof(x))
#define pcnt __builtin_popcount
#define buli(x) __builtin_popcountll(x)
#define pb push_back
#define mp make_pair
#define F first
#define S second
template <class... A>
void prints() { cout << endl; }
template <class... A>
void prints_rest() { cout << endl; }
template <class T, class... A>
void prints_rest(const T &first, const A &... rest) { cout << " " << first; prints_rest(rest...); }
template <class T, class... A>
void prints(const T &first, const A &... rest) { cout << first; prints_rest(rest...); }

template <class T>
T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
template <class T>
T lcm(T a, T b) { return a / gcd(a, b) * b; }

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

    int N;
    vector<int> A;
    int in;

    cin >> N;
    rep(_, N) {
        cin >> in;
        A.push_back(in);
    }

    int nowmax = A[N-1];

    rep(i, N) {
        if (A[N-i-1] >= nowmax + 2) {
            prints("No");
            return 0;
        }

        nowmax = min(nowmax, A[N-i-1]);
    }

    prints("Yes");
    return 0;
}



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

int main(void) {
    string str;
    cin >> str;
    for (char alp = 'a'; alp <= 'z'; alp++) {
        string cmp(1, alp);
        if (str.find(cmp) == string::npos)
        {
            cout << cmp << endl;
            return 0;
        }
    }
    cout << "None" << endl;
    return 0;
}

Measured memory_bytes: 512
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <unordered_map>
#include <queue>
#include <algorithm>

#include <bits/stdc++.h>
#include <cmath>
#include <limits>

using namespace std;

/*
 * 問題文
 *
 * 長さ n の数列 a1,...,an が与えられます。 空の数列 b に対して、以下の操作を n回行うことを考えます。
 *  i回目には数列の i番目の要素 ai を bの末尾に追加する。
 *  bを逆向きに並び替える。
 *
 * この操作をしてできる数列 bを求めて下さい。
 *
 */

long long N;
vector<long long> A;

int main(int argc, char* argv[]){
	cin.tie(0);
	ios::sync_with_stdio(false);

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

	if(N == 1){
		printf("%lld\n", A[0]);
		return 0;
	}
	else if(N == 2){
		printf("%lld %lld\n", A[1], A[0]);
		return 0;
	}
	else if(N == 3){
		printf("%lld %lld %lld\n", A[2], A[0], A[1]);
		return 0;
	}
	else if(N == 4){
		printf("%lld %lld %lld %lld\n", A[3], A[1], A[0], A[2]);
		return 0;
	}

	int print_zero = 0;
	for(int i=A.size() - 1; i >= 0; i -= 2){
		if(i == A.size() - 1){
			printf("%lld", A[i]);
		}
		else{
			printf(" %lld", A[i]);
			if(i == 0){
				print_zero = 1;
			}
		}
	}
	for(int i=0; i<A.size(); i += 2){
		if(i == 0 && print_zero == 1){
			i++;
		}
		printf(" %lld", A[i]);
	}
	printf("\n");
	return 0;
}

Measured memory_bytes: 3824
#include <stdio.h>
int main(void){
  int N,M;
  int A[10010];
  int i;
  scanf("%d %d",&N,&M);
  int s=0;
  for(i=0;i<M;i++){
    scanf("%d",&A[i]);
    s=s+A[i];
  }
  if(N-s<0){
    printf("-1\n");
  }
  else{
    printf("%d\n",N-s);
  }
  return 0;
}

Measured memory_bytes: 1724
n,k  =map(int, input().split())
A = list(map(int, input().split()))

d = {}
for a in A:
    d[a] = d.get(a, 0) + 1

if len(d) <= k:
    print(0)
else:
    d = sorted(d.values())
    cnt = 0
    for i in range(len(d)-k):
        cnt += d[i]
    print(cnt)

Measured memory_bytes: 34860
#include<iostream>
using namespace std;
typedef long long li;
#define rep(i,n) for(int i=0;i<(n);i++)
#define df 0
template<class T> void print(const T& t){ cout << t << "\n"; }
template<class T, class... Ts> void print(const T& t, const Ts&... ts) { cout << t; if (sizeof...(ts)) cout << " "; print(ts...); }

int main(){
  li a,b,c,k; cin >>a >>b >>c >>k;
  li s=0;
  s+=min(a,k);
  k-=s;
  if(k>=0){
    k-=b;
  }
  if(k>=0){
    s-=k;
  }
  print(s);
}

Measured memory_bytes: 3620