akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <cstdio>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <map>
#include <set>
#include <cmath>
#include <cstdlib>

using namespace std;

void out() {
     cout.flush();
     cerr << endl << "OUT" << endl;
     int bred;
     cin >> bred;
}
const int MOD = 1000000007;
const int INF = 1000000000;
int n;
string s[1000];
int koli[1000], kolj[1000];

void solve() {
    cin >> n;
    for (int i = 0; i < n; ++i)
        cin >> s[i];
    int kol = 0;
    for (int i = 0; i < n; ++i)
        for (int j = 0; j < n; ++j)
            if (s[i][j] == '#') {
               koli[i]++;
               kolj[j]++;
               ++kol;
            }
    if (kol == 0) {
       cout << "-1\n";
       return;
    }
    int ans = INF;
    
    for (int i = 0; i < n; ++i) {
        bool isOK = false;
        for (int j = 0; j < n; ++j)
            if (s[j][i] == '#')
               isOK = true;
        
        int nans = n - koli[i];
        if (!isOK && koli[i] < n)
           ++nans;
        for (int j = 0; j < n; ++j)
            if (s[i][j] == '#')
               nans += (kolj[j] < n);
            else
                ++nans;
        ans = min(ans, nans);
    }
    
    if (ans == INF)
       ans = -1;
    cout << ans << "\n";
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    solve();
    out();
    return 0;
}


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

#ifdef LOCAL
#define debug(var) cerr << (#var) << " = " << (var) << endl;
#else
#define debug(var)
#endif

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

const int N = 1e5+23;

int a[N];

void solve() {
  int n, m; scanf("%d%d", &n, &m);
  for (int u, v, i = 0; i < m; ++i) {
    scanf("%d%d", &u, &v);
    if (u > v) swap(u, v);
    ++a[u]; --a[v];
  }
  for (int i = 1; i < n; ++i) {
    a[i] += a[i-1];
    if (a[i]%2) {
      puts("NO");
      return;
    }
  }
  puts("YES");
}

int main() {
  int t = 1; //scanf("%d", &t);
  while (t--) {
    solve();
  }
  return 0;
}


Measured memory_bytes: 4148
N, K = list(map(int,input().split()))
p = [int(x) for x in input().split()]

for i in range(N):
  p[i] = (1+p[i]) / 2

ans=0
for j in range(N-K+1):
  if j==0:
    tmp = sum(p[0:K])
  else:
    tmp = tmp - p[j-1] + p[j+K-1]
  
  if ans < tmp:
    ans = tmp

print(ans)

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

int main() {
  int N, H;
  cin >> N >> H;
  vector<pair<int,int>> dam(2*N);
  for (int i = 0; i < 2*N; i++) {
    int x;
    cin >> x;
    dam[i] = make_pair(x,i);
  }
  
  sort(dam.begin(), dam.end(), greater<pair<int,int>>());
  int AC = 0;
  int i = 0;
  while (H > 0) {
    if (dam[i].second % 2 == 1) {
      H -= dam[i].first;
      AC += 1;
      i++;
    }
    else {
      AC += (H-1) / dam[i].first + 1;
      break;
    }
  }
  cout << AC << endl;
}

Measured memory_bytes: 1792
import java.io.*;
import java.util.*;


public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int a = sc.nextInt();
		int b = sc.nextInt();

		if (a + b == 15) {
			pr.println('+');
		} else if (a * b == 15) {
			pr.println('*');
		} else {
			pr.println('x');
		}
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(INPUT == null ? System.in : new ByteArrayInputStream(INPUT.getBytes()));
		pr = new Printer(System.out);

		solve();

//		pr.close();
		pr.flush();
//		sc.close();
	}

	static String INPUT = null;

	private static class Printer extends PrintWriter {
		Printer(OutputStream out) {
			super(out);
		}
	}
}


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

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

int main()
{

    string s;
    cin >> s;

    if (s == "AAA" || s == "BBB")
    {
        cout << "No" << endl;
    }
    else
    {
        cout << "Yes" << endl;
    }
    return 0;
}

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

#define int long long

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
typedef vector<int>vint;
typedef pair<int,int>pint;
typedef vector<pint>vpint;

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



signed main(){
    int N;cin>>N;
    map<int,int>mp;
    mp[0]++;
    int ans=0;
    int sum=0;
    rep(i,N){
        int a;cin>>a;
        sum+=a;
        ans+=mp[sum];
        mp[sum]++;
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 12800
#include<iostream>
#include<iomanip>
#include<cstdio>
#include<cmath>
#include<cstring>
#include<algorithm>
using namespace std;
int main(){
	
char a[52],b[52];
	cin>>a;
    cin>>b;
    int la=strlen(a),lb=strlen(b);
    int l=min(la,lb),ll=max(la,lb);
    for(int i=0;i<=l-1;i++)
        cout<<a[i]<<b[i];
    if(la>lb)
        for(int i=l;i<=ll-1;i++)
            cout<<a[i];
    else for(int i=l;i<=ll-1;i++)
            cout<<b[i];
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
const int MAX_N = 1 << 20;
string s;
int dat[2*MAX_N-1]['z'-'a'+1];
int teihen = 0;
int init(int n){
  int a = 1;
  int nw = 2;
  while(a < n){
    a*=2;
    teihen += nw;
    nw *=2;
  }
  teihen-=nw/2;
  for(int i = 0; 2*a > i; i++){
    for(int j = 'a'; 'z' >= j; j++){
      dat[i][j-'a'] = 0;
    }
  }

  return a;
}

void initupdate(int k, int a){
  k += teihen+1;
  dat[k][a]++;
  //cout << k << " " << a << "!" << dat[k][a] << endl;
  while(k > 0){
    k = (k-1)/2;
    dat[k][a]++;
    //cout << k << " " << a << "!" << dat[k][a] << endl;
  }
}

void update(int k, int a, int b){
  k += teihen+1;
  dat[k][a]--;
  dat[k][b]++;
  while(k > 0){
    k = (k-1)/2;
    dat[k][a]--;
    dat[k][b]++;
  }
}

bool tmp['z'-'a'+1];
void queryinit(){
  for(int i = 'a'; 'z' >= i; i++)tmp[i-'a']=false;
}

void query(int a,int b,int k,int l,int r){
  /* Debug Log 
  cout << l << " " << r <<" "<<k<< ":" << s.substr(l,r-l+1) << endl;
  for(int i = 'a'; 'z' >= i; i++)cout << (char)i << ":" << dat[k][i-'a'] << " ";
  cout << endl;
  /* This it */
  if(a <= l && r <= b){
    int ans = 0;
    for(int i = 'a'; 'z' >= i; i++)tmp[i-'a']=(dat[k][i-'a']||tmp[i-'a']);
  }else if(!(r < a || b < l)){
    query(a,b,k*2+1,l,(l+r)/2);
    query(a,b,k*2+2,(l+r)/2+1,r);
  }
}

int main() { 
  int z;cin>>z;
  cin>>s;int a = init(s.size());
  for(int i = 0; s.size() > i; i++)initupdate(i,s[i]-'a');
  int q;cin>>q;
  for(int i = 0; q > i; i++){
    int c;cin>>c;
    if(c==1){
      int p;char w;cin>>p>>w;p--;
      update(p,s[p]-'a',w-'a');s[p]=w;
    }else{
      int l,r;cin>>l>>r;l--;r--;
      query(l,r,0,0,a-1);
      int ans = 0;for(int i = 'a'; 'z' >= i; i++)if(tmp[i-'a'])ans++;
      queryinit();
      cout << ans << endl;
    }
  }
  return 0;
}

Measured memory_bytes: 109444
#include <iostream>
#include <string>
#include <cstring>
#include <fstream>
#include <cmath>
#include <iomanip>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <map>
#include <deque>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <unordered_map>

using namespace std;


int main() {
    
    
    int a,b;
    cin >> a >> b;
    cout << a*b <<" "<< 2*(a+b) << endl;

}


Measured memory_bytes: 3084
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();

		ArrayList<Integer> value = new ArrayList<Integer>();
		ArrayList<Integer> cost = new ArrayList<Integer>();

		for (int i = 0; i < n; i++) {
			final int v = sc.nextInt();
			value.add(v);
		}
		for (int i = 0; i < n; i++) {
			final int c = sc.nextInt();
			cost.add(c);
		}

		int result = 0;
		for (int j = 0; j < n; j++) {
			final int result1 = value.get(j) - cost.get(j);
			if (result1 > 0) {
				result = result + result1;
			}
		}

		System.out.println(result);

	}

}


Measured memory_bytes: 21844
#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<ll,ll>;
const int mod = 1e9 + 7;
//const int mod = 998244353;
const ll infll = (1LL << 62) - 1;
const int inf = (1 << 30) - 1;
void YesNo(bool j){cout << (j ? "Yes" : "No") << endl; return;}
void yesno(bool j){cout << (j ? "yes" : "no") << endl; return;}
template<class Head> void pt(Head&& head){cout << head << endl; return;}



int main() {
    int x,n;
    cin >> x >> n;
    int r=inf;
    int ans=1;
    vector<int> a(n);
    rep(i,n) cin >> a[i];
    rep(i,120) {
      bool ok=false;
      rep(j,n) {
        if(i==a[j]) ok=true;
      }
      if(ok) continue;
      if(abs(x-i)<r) {
        r=abs(x-i);
        ans=i;
      }
      else if(abs(x-i)==r) ans=min(ans,i);
    }
    pt(ans);
    return 0;
}


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


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

int compress(vector<int> &x1, vector<int> &x2, int w) {
    int n = x1.size();
    vector<int> xs;
    rep(i, n) {
        rep(d, 2) {
            int tx1 = x1[i] - d;
            int tx2 = x2[i] + d;
            if (0 <= tx1 && tx1 < w) xs.push_back(tx1);
            if (0 <= tx2 && tx2 < w) xs.push_back(tx2);
        }
    }
    sort(all(xs));
    xs.erase(unique(all(xs)), xs.end());
    rep(i, n) {
        x1[i] = find(all(xs), x1[i]) - xs.begin();
        x2[i] = find(all(xs), x2[i]) - xs.begin();
    }
    return xs.size();
}

int main() {
    while (true) {
        int w, h, n;
        cin >> w >> h;
        if (w == 0 && h == 0) break;
        cin >> n;
        vector<int> x1(n);
        vector<int> x2(n);
        vector<int> y1(n);
        vector<int> y2(n);
        rep(i, n) {
            cin >> x1[i] >> y1[i] >> x2[i] >> y2[i];
            x2[i]--; y2[i]--;
        }
        w = compress(x1, x2, w);
        h = compress(y1, y2, h);

        bool board[h][w];
        memset(board, 0, sizeof(board));
        rep(i, n) {
            for (int y = y1[i]; y <= y2[i]; y++) {
                for (int x = x1[i]; x <= x2[i]; x++) {
                    board[y][x] = true;
                }
            }
        }

        int ans = 0;
        rep(y, h) rep(x, w) {
            if (board[y][x]) continue;
            ans++;

            queue<pair<int, int> > que;
            que.push(make_pair(x, y));
            while (!que.empty()) {
                int sx = que.front().first, sy = que.front().second;
                que.pop();

                rep(i, 4) {
                    int tx = sx + dx[i], ty = sy + dy[i];
                    if (tx < 0 || w <= tx || ty < 0 || h <= ty) continue;
                    if (board[ty][tx]) continue;
                    que.push(make_pair(tx, ty));
                    board[ty][tx] = true;
                }
            }
        }
        cout << ans << endl;
    }
}



Measured memory_bytes: 4008
/*
 * written by Yaqi Zhang
 * University of Wisconsin-Madison
 * 2020
 */

#include<algorithm>
#include<cstring>
#include<iostream>
#include<map>
#include<queue>
#include<set>
#include<stdio.h>
#include<vector>

using namespace std;

#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

#define INF 0x3f3f3f3f


const int N = 100005;
const int MOD = 1e9 + 7;

vector<int> graph[N];

// return {number of ways to paint u black, ... white}
pair<int, int> post_order(int u, int parent) {
    int all_white = 1;
    int sth_is_black = 0;
    for(int v : graph[u]) {
        if(v != parent) {
            auto p = post_order(v, u);
            int black = p.first, white = p.second;
            int memo_all_white = all_white;
            all_white = ((long long) all_white * white) % MOD;
            sth_is_black = ((long long) memo_all_white * black % MOD
                    + (long long) sth_is_black * (black + white) % MOD) % MOD;
        }
    }
    // debug() << imie(u);
    debug() << imie(u) imie(all_white) imie(sth_is_black);
    return {all_white, (all_white + sth_is_black) % MOD};
}


int main(int argc, char *argv[])
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    scanf("%d", &n);
    for(int i = 0; i < n - 1; ++i) {
        int u, v;
        scanf("%d %d", &u, &v);
        graph[u].push_back(v);
        graph[v].push_back(u);
    }
    pair<int, int> p = post_order(1, -1);
    cout << (p.first + p.second) % MOD << endl;
    return 0;

}



Measured memory_bytes: 12672
const int LG = 21;
const int FN = 400005;
const long long MOD = 1e9 + 7;
const long long INF = 1e9;
const long long INFLL = 1e18;

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;

#define forn(i, n) for (int (i) = 0; (i) != (n); (i)++)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define popcount(x) __builtin_popcount(x)
#define popcountll(x) __builtin_popcountll(x)
#define fi first
#define se second
#define re return
#define pb push_back
#define uniq(x) sort(all(x)); (x).resize(unique(all(x)) - (x).begin())

#ifdef LOCAL
#define dbg(x) cerr << __LINE__ << " " << #x << " " << x << endl
#define ln cerr << __LINE__ << endl
#else
#define dbg(x) void(0)
#define ln void(0)
#endif // LOCAL

int cx[4] = {-1, 0, 1, 0};
int cy[4] = {0, -1, 0, 1};
string Ans[2] = {"No", "Yes"};
string ANS[2] = {"NO", "YES"};

ll inq(ll x, ll y)
{
    if (!y) re 1 % MOD;
    ll l = inq(x, y / 2);
    if (y % 2) re l * l % MOD * x % MOD;
    re l * l % MOD;
}

ll rev(ll x)
{
    return inq(x, MOD - 2);
}

bool __precomputed_combinatorics = 0;
vector<ll> __fact, __ufact, __rev;

void __precompute_combinatorics()
{
    __precomputed_combinatorics = 1;
    __fact.resize(FN);
    __ufact.resize(FN);
    __rev.resize(FN);
    __rev[1] = 1;
    for (int i = 2; i < FN; i++) __rev[i] = MOD - __rev[MOD % i] * (MOD / i) % MOD;
    __fact[0] = 1, __ufact[0] = 1;
    for (int i = 1; i < FN; i++) __fact[i] = __fact[i - 1] * i % MOD, __ufact[i] = __ufact[i - 1] * __rev[i] % MOD;
}

ll fact(int x)
{
    if (!__precomputed_combinatorics) __precompute_combinatorics();
    return __fact[x];
}

ll cnk(int n, int k)
{
    if (k < 0 || k > n) return 0;
    if (!__precomputed_combinatorics) __precompute_combinatorics();
    return __fact[n] * __ufact[n - k] % MOD * __ufact[k] % MOD;
}

int Root(int x, vector<int> &root)
{
    if (x == root[x]) return x;
    return root[x] = Root(root[x], root);
}

void Merge(int v, int u, vector<int> &root, vector<int> &sz)
{
    v = Root(v, root), u = Root(u, root);
    if (v == u) return;
    if (sz[v] < sz[u])
    {
        sz[u] += sz[v];
        root[v] = u;
    }
    else
    {
        sz[v] += sz[u];
        root[u] = v;
    }
}

int ok(int x, int n)
{
    return 0 <= x && x < n;
}

void bfs(int v, vi &dist, vector<vi> &graph)
{
    fill(all(dist), -1);
    dist[v] = 0;
    vi q = {v};
    for (int i = 0; i < q.size(); i++)
    {
        for (auto u : graph[q[i]])
        {
            if (dist[u] == -1)
            {
                dist[u] = dist[q[i]] + 1;
                q.push_back(u);
            }
        }
    }
}

int A[505][505];

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int a;
    cin >> a;
    cout << "ABC" << a;
}

/* Note:
Check constants at the beginning of the code.
    N is set to 4e5 but be careful in problems with large constant factor.
    Setting N in every problem is more effective.
Check corner cases.
    N = 1
No def int long long for now.
Add something here.
*/


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define INF INT_MAX
#define ll  long long
#define ull unsigned long long
#define rep(i,n) for(ll i=0; i<n; ++i)
#define FOR(i, s, e) for(ll i=s; i<e; ++i)
#define MOD 1000000007
using namespace std;
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;}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int L, R, d;
  cin >> L >> R >> d;
  int ans = 0;
  for(int i=L; i<=R; ++i) {
    if(i%d == 0) ++ans;
  }
  cout << ans << endl;
}


Measured memory_bytes: 3604
#include <bits/stdc++.h>
#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 sp(n) cout << fixed << setprecision(n)
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; }
typedef long long ll;
using namespace std;
int main(void){
    int n;cin>>n;
    for(int i=0;i*4<=n;i++){
        for(int j=0;j*7+i*4<=n;j++){
            if(i*4+j*7==n){
                cout<<"Yes"<<endl;
                return 0;
            }
        }
    }
    cout<<"No"<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define LL long long
#define sc(a) scanf("%d", &a)
#define sc2(a, b) scanf("%d%d", &a, &b)
#define sc3(a, b, c) scanf("%d%d%d", &a, &b, &c)
#define scl(a) scanf("%lld", &a)
#define scl2(a, b) scanf("%lld%lld", &a, &b)
#define ss(a) scanf("%s", a)
#define mem(a, b) memset(a, b, sizeof(a))
#define PII pair<int, int>
using namespace std;
const int N = 2e5+5;
int n,k;
int a[N];
bool check(int x){
    int res=0;
    for(int i=1;i<=n;i++){
        res+=ceil(a[i]*1.0/x)-1;
    }
    return res<=k;
}
int main(){
    sc2(n,k);
    int res=0;
    for(int i=1;i<=n;i++){
        sc(a[i]);
        res=max(res,a[i]);
    }
    int l=1,r=res,ans=0;
    while(l<=r){
        int mid=l+r>>1;
        if(check(mid))r=mid-1,ans=mid;
        else l=mid+1;
    }
    cout<<ans<<endl;
    system("pause");
    return 0;
}

Measured memory_bytes: 4592
import sys

sys.setrecursionlimit(10 ** 8)

input = sys.stdin.readline


def main():
    N = int(input())
    A = [int(input()) for _ in range(N)]
    for a in A:
        if a & 1:
            print("first")
            return
    else:
        print("second")


if __name__ == '__main__':
    main()



Measured memory_bytes: 7072
import java.util.*;

class Main {
    public static void main(String args[]) {
        Scanner inp = new Scanner(System.in);
        do_(inp);
        inp.close();
    }
    public static void do_(Scanner inp) {
        int a = inp.nextInt();
        int b = inp.nextInt();
        System.out.println(Math.max(0, a - b * 2));
    }
}


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

using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
	REP(i, v.size()) { if (i)os << " "; os << v[i]; }return os;
}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
	REP(i, v.size()) { if (i)os << endl; os << v[i]; }return os;
}

const ll INF = 1LL << 60;
ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

ll dp[1001][1001];

int main() {
	ll n, m, x, y, z, sum;
	vector<ll> v[8];
	ll ans = 0;

	cin >> n >> m;

	REP(i, n) {
		cin >> x >> y >> z;
		v[0].push_back(x + y + z);
		v[1].push_back(x + y - z);
		v[2].push_back(x - y + z);
		v[3].push_back(-x + y + z);
		v[4].push_back(x - y - z);
		v[5].push_back(-x + y - z);
		v[6].push_back(-x - y + z);
		v[7].push_back(-x - y - z);
	}

	REP(i, 8) {
		sort(v[i].begin(), v[i].end(), greater<ll>());
		sum = 0;
		REP(j, m) {
			sum += v[i][j];
		}
		ans = max(ans, sum);
	}

	cout << ans << endl;
}

Measured memory_bytes: 384
#include <iostream>

 

using namespace std;

 

int main()
{
    int w, h, x, y, r;
    cin >> w >> h >> x >> y >> r;
    
    if (x-r >= 0 && y-r >= 0 && x+r <= w && y+r <= h)
       cout << "Yes" << endl;
    else
       cout << "No" << endl;
    
}


Measured memory_bytes: 3116
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <stack>

using namespace std;

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

    cout << "AC x " << dict["AC"] << endl;
    cout << "WA x " << dict["WA"] << endl;
    cout << "TLE x " << dict["TLE"] << endl;
    cout << "RE x " << dict["RE"] << endl;
}


Measured memory_bytes: 3632
#include <iostream>
#include <cstdio>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <string>
#include <algorithm>

using namespace std;

bool check(char s1, char s2) {
    if (s1 == 'A') {
        if (s2 == 'B') return true;
        if (s2 == 'D') return true;
    }
    if (s1 == 'B') {
        if (s2 == 'A') return true;
        if (s2 == 'C') return true;
        if (s2 == 'E') return true;
    }
    if (s1 == 'C') {
        if (s2 == 'B') return true;
        if (s2 == 'F') return true;
    }
    if (s1 == 'D') {
        if (s2 == 'A') return true;
        if (s2 == 'E') return true;
        if (s2 == 'G') return true;
    }
    if (s1 == 'E') {
        if (s2 == 'B') return true;
        if (s2 == 'D') return true;
        if (s2 == 'F') return true;
        if (s2 == 'H') return true;
    }
    if (s1 == 'F') {
        if (s2 == 'C') return true;
        if (s2 == 'E') return true;
        if (s2 == 'I') return true;
    }
    if (s1 == 'G') {
        if (s2 == 'D') return true;
        if (s2 == 'H') return true;
    }
    if (s1 == 'H') {
        if (s2 == 'E') return true;
        if (s2 == 'G') return true;
        if (s2 == 'I') return true;
    }
    if (s1 == 'I') {
        if (s2 == 'F') return true;
        if (s2 == 'H') return true;
    }
    return false;
}

int main (int argc, char *argv[]) {
    for (int i = 0; i < 1000; ++i) {
        string str;
        bool valid = true;
        cin >> str;
        for (int n = 0; n < str.length() - 1; ++n) {
            char s1 = str[n];
            char s2 = str[n+1];
            if (!check(s1, s2) || s1 == s2) {
                valid = false;
                break;
            }
        }
        if (valid) cout << str << endl;
    }
    return 0;
}


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

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

typedef long long ll;
using namespace std;
int mod = 1000000007;

int main(void){
    ll N, M; cin >> N >> M;
    ll A[N]; rep(i, N) cin >> A[i];
    ll ans = 0;
    sort(A, A+N, greater<ll>());
    ll S[N]; S[0] = A[0]; rep(i, N-1) S[i+1] = S[i] + A[i+1];
    ll ok = A[N-1]*2, ng = A[0]*2+1;
    ll m = (ok+ng)/2;
    while(abs(ok-ng) > 1){
        //足してm以上になるペアの個数がM以上かどうか
        ll acc = 0;
        rep(i, N){
            ll aim = m-A[i];
            //aim以上の数はAの中にいくつあるか
            ll aim_ok = -1, aim_ng = N; //aim_ok+1個ある
            ll aim_m = (aim_ok + aim_ng)/2;
            while(abs(aim_ng-aim_ok) > 1){
                if(A[aim_m] >= aim) aim_ok = aim_m;
                else aim_ng = aim_m;
                aim_m = (aim_ok + aim_ng)/2;
            }
            acc += aim_ok+1;
        }
        if(acc >= M) ok = m;
        else ng = m;
        m = (ok+ng)/2;
    }
    //ok以上のものを集めればいい
    ll num_add = 0;
    rep(i, N){
        ll aim = ok - A[i];
        ll aim_ok = -1, aim_ng = N;
        ll aim_m = (aim_ok+aim_ng)/2;
        while(abs(aim_ok-aim_ng) > 1){
            if(A[aim_m] >= aim) aim_ok = aim_m;
            else aim_ng = aim_m;
            aim_m = (aim_ok + aim_ng)/2;
        }
        //S[aim_ok] + A[i]*(aim_ok + 1)だけスコアが加算される
        if(aim_ok >= 0) ans += S[aim_ok] + A[i]*(aim_ok + 1);
        num_add += aim_ok+1;
    }
    ans -= ok*max(0ll, num_add-M);
    cout << ans << endl;
     
    return 0;
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
#define ll long long
#define inf 999999999999
#define F first
#define S second
#define eb emplace_back
#define mp make_pair
#define P(x) cout<<__LINE__ <<": "<<#x<<' '<<(x)<<'\n'
#define dbg cout<<__LINE__ <<": 0manush\n"
#define read(x) freopen("input.txt","r",stdin)
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define pi 2*acos(0.0)
#define ee exp(1)
#define mx 200009
#define mod 1000000007
using namespace std;

int main(){//read(x);
//fast;
ll r,g,h,i,j,x,t,y,z=0,e,f,a,b,c,d,n,l;
string s,u,v;
cin>>s>>u;
n=s.size();
t=u.size();
l=inf;
for(i=0;i<n-t+1;i++){
    v=s.substr(i,t);a=0;
    for(j=0;j<t;j++){
        if(u[j]!=v[j])a++;
    }
    l=min(l,a);
}
cout<<l<<endl;
}























Measured memory_bytes: 3544
#include <stdio.h>
#include <string.h>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
#include <math.h>
#include <complex>
using namespace std;

long long int a[100005];

int main() {
    int n;
    scanf("%d", &n);
    long long int neg = 0;
    long long int sum = 0;
    long long int mi = 10000000000;
    for (int i = 0; i < n; i++) {
        scanf("%lld", &a[i]);
        sum += abs(a[i]);
        mi = min(mi, abs(a[i]));
        if (a[i] < 0) {
            neg++;
        }
    }
    if (neg % 2 == 0) {
        printf("%lld\n", sum);
    } else {
        printf("%lld\n", sum - 2 * mi);
    }
}

Measured memory_bytes: 1152
def examA():
    ABC =LI(); ABC.sort()
    if ABC[0]==ABC[-1]:
        print("Yes")
    else:
        print("No")
    return

def examB():
    ans = 0
    print(ans)
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

import sys,copy,bisect,itertools,heapq,math
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
alphabet = [chr(ord('a') + i) for i in range(26)]

if __name__ == '__main__':
    examA()

"""

"""

Measured memory_bytes: 3572
#include <iostream>
#include <vector>
#include <string>
#define rep(i, n)   for(int i = 0; i < (n); i++)
using namespace std;
typedef long long ll;

int main(){
    string s;   cin >> s;
    int ab[2] = {0};
    rep(i, 3){
        if(s[i] == 'A') ab[0]++;
        else            ab[1]++;
    }
    if(ab[0] && ab[1]){
        cout << "Yes" << endl;
    }else{
        cout << "No" << endl;
    }
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <cmath>
using namespace std;
const int N=210,Mo=1000000007;
int rt,tt,tim,tp,sz,n,m,k,ans=1;
int head[N],to[N],nxt[N],dfn[N],low[N],C[N][N];
inline int gi() {
    int x=0,o=1;
    char ch=getchar();
    while(ch!='-'&&(ch<'0'||ch>'9')) ch=getchar();
    if(ch=='-') o=-1,ch=getchar();
    while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
    return x*o;
}
inline int gcd(int x,int y) {return y?gcd(y,x%y):x;}
inline int Pow(int x,int y) {
    int ret=1;
    while(y) {
	if(y&1) ret=1LL*ret*x%Mo;
	x=1LL*x*x%Mo,y>>=1;
    }
    return ret;
}
inline void tarjan(int x,int fa) {
    dfn[x]=low[x]=++tim,++sz;
    for(int i=head[x];i;i=nxt[i]) {
	int y=to[i],s1=sz-1,s2=tp;
	if(y!=fa) {
	    if(!dfn[y]) {
		++tp,tarjan(y,x);
		low[x]=min(low[x],low[y]);
		if(dfn[x]<=low[y]||x==rt) {
		    if(sz-s1>=tp-s2) {
			int sum=0;
			for(int j=0;j<tp-s2;j++)
			    sum=(sum+Pow(k,gcd(tp-s2,j)))%Mo;
			ans=1LL*ans*sum%Mo*Pow(tp-s2,Mo-2)%Mo;
		    }
		    else ans=1LL*ans*C[tp-s2+k-1][k-1]%Mo;
		    sz=s1+1,tp=s2;
		}
	    }
	    else if(dfn[y]<dfn[x])
		++tp,low[x]=min(low[x],dfn[y]);
	}
    }
}
int main() {
    cin>>n>>m>>k;
    for(int i=0;i<=m+k;i++)
	for(int j=C[i][0]=1;j<=i;j++)
	    C[i][j]=(C[i-1][j]+C[i-1][j-1])%Mo;
    for(int i=1;i<=m;i++) {
	int x=gi(),y=gi();
	to[++tt]=y,nxt[tt]=head[x],head[x]=tt;
	to[++tt]=x,nxt[tt]=head[y],head[y]=tt;
    }
    for(int i=1;i<=n;i++)
	if(!dfn[i]) rt=i,tarjan(i,0);
    cout<<ans;
    return 0;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
using namespace std;
///Welcome to Nasif's Code
#define bug printf("bug\n");
#define bug2(var) cout<<#var<<" "<<var<<endl;
#define co(q) cout<<q<<endl;
typedef long long int ll;
typedef unsigned long long int ull;
const int MOD = (int)1e9+7;
const int MAX = 1e6;
#define pi acos(-1)
#define inf 1000000000000000LL
#define FastRead    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int vis[1200][1200],dis[1200][1200];
int R,C,f;
int row[]= {1,0,-1,0,1,-1,1,-1};
int colm[]= {0,1,0,-1,1,-1,-1,1};
string paint[500];
void bfs(int input_x,int input_y)
{
    queue<pair<int,int> >q;
    vis[input_x][input_y] = 1;
    dis[input_x][input_y]   = 0;
    q.push(make_pair(input_x,input_y));
    int child=0;
    while(!q.empty())
    {
        int x = q.front().first;
        int y = q.front().second;
        q.pop();
        child++;
        for(int i=0; i<4; i++)
        {
            int u = x+row[i];
            int v = y+colm[i];
            if(0<=u && u<R && 0<=v && v<C)
            {
                if(vis[u][v]==0 && paint[u][v]=='#')
                {
                    vis[u][v]=1;
                    dis[u][v] = dis[x][y]+1;
                    q.push(make_pair(u,v));
                }
            }
        }
    }
   if(child==1)
    f=1;
}

int main()
{
    FastRead
    //freopen("output.txt", "w", stdout);

    cin>>R>>C;
    for(int i=0;i<R;i++)
        cin>>paint[i];
    for(int i=0;i<R;i++){
        for(int j=0;j<C;j++){
            if(!vis[i][j] && paint[i][j]=='#')
                bfs(i,j);
        }
    }
    if(f)
        cout<<"No"<<endl;
    else
        cout<<"Yes"<<endl;



    return 0;
}


Measured memory_bytes: 4080
#include <iostream>
#include <algorithm>
using namespace std;
typedef long long ll;


int main(void){
  int n,k,i;
  ll fac[200005],inv[200005],finv[200005],vyt,ans=0;
  const int mod=1e9+7;
  
  cin >> n >> k;
  
  fac[0]=fac[1]=1;
  finv[0]=finv[1]=1;
  inv[1]=1;
  for (i=2;i<=n+2;i++){
    fac[i]=fac[i-1]*i%mod;
    inv[i]=mod-inv[mod%i]*(mod/i)%mod;
    finv[i]=finv[i-1]*inv[i]%mod;
  }
  
  for (i=0;i<min(n,k+1);i++){
    vyt=fac[n]*finv[i]%mod*finv[n-i]%mod;
    vyt=vyt*fac[n-1]%mod*finv[n-i-1]%mod*finv[i]%mod;
    ans=(ans+vyt)%mod;
  }
  
  cout << ans << endl;
  
  return 0;
}

Measured memory_bytes: 4992
#include <iostream>
#include <assert.h>
#include <queue>
#include <algorithm>
#include <vector>

struct cell{
    char color;
    int32_t row;
    int32_t col;
    cell() : color('.'), row(0), col(0) {}
    cell(char color, int32_t row, int32_t col) 
        : color(color), row(row), col(col)
        {}
    bool isBlack(){
        return color == '#';
    }
};
    
int main(){
    std::cin.tie(0);
    std::ios::sync_with_stdio(false);

    int32_t H, W;
    std::cin >> H >> W;
    cell cells[H][W];
    int32_t num_black = 0;
    for(int32_t h = 0; h < H; h++){
        for(int32_t w = 0; w < W; w++){
            cell tmp('.', h, w);
            std::cin >> tmp.color;
            cells[h][w] = tmp;
            if(tmp.isBlack()) num_black++;
        }
    }

    //find shortest path
    std::vector<std::vector<int32_t>> dist(H,std::vector<int32_t>(W,-1));
    dist[0][0] = 0;
    std::queue<cell> cellq;
    cellq.push(cells[0][0]);
    int32_t path_length = -1;
    while(!cellq.empty()){
        //pop
        cell c = cellq.front();
        cellq.pop();
        //std::cout << "new cell: " << c.row << "," << c.col << ", " << path_length << std::endl;

        //check reached to the destination
        if(c.row == H - 1 && c.col == W - 1){
            path_length = dist[c.row][c.col];
            //std::cout << "reached to destination : " << path_length << std::endl;
            break;
        }

        //check next
        std::vector<cell> nexts;
        if(c.row < H - 1) nexts.push_back(cells[c.row+1][c.col]);
        if(c.col < W - 1) nexts.push_back(cells[c.row][c.col+1]);
        if(c.row > 0) nexts.push_back(cells[c.row-1][c.col]);
        if(c.col > 0) nexts.push_back(cells[c.row][c.col-1]);
        for(auto next : nexts){
            if(next.isBlack()) continue;
            if(dist[next.row][next.col] != -1) continue;
            dist[next.row][next.col] = dist[c.row][c.col] + 1;
            cellq.push(next);            
        }
    }

    if(path_length != -1)
        std::cout << W*H - num_black - path_length - 1 << std::endl;
    else
        std::cout << -1 << std::endl;


    return 0;
}


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

typedef long long int ll;
ll n;
string s;
ll ac, tle, wa, re;

int main() {
    scanf("%lld", &n);
    for(ll i = 0; i < n; ++i) {
        cin >> s;
        if(s == "AC") ac++;
        else if(s == "TLE") tle++;
        else if(s == "WA") wa++;
        else re++;
    }

    printf("AC x %lld\nWA x %lld\nTLE x %lld\nRE x %lld\n", ac, wa, tle, re);
    return 0;
}

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

using namespace std;

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

    int n;
    cin >> n;
    string s;
    cin >> s;

    int ans = 0;
    for(int i = 1; i < n; i++)
    {
        int cnt = 0;
        for(char c = 'a'; c <= 'z'; c++)
        {
            bool left = false, right = false;
            for(int j = 0; j < i; j++)
            {
                if(s[j] == c)
                {
                    left = true;
                    break;
                }
            }
            for(int j = i; j < n; j++)
            {
                if(s[j] == c)
                {
                    right = true;
                    break;
                }
            }
            if(left && right)
                cnt++;
        }
        ans = max(ans, cnt);
    }

    cout << ans;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int n,k;
double sol,x,sum[200005];
int main()
{
    cin>>n>>k;
    for(int i=1;i<=n;i++)
    {
        cin>>x;
        sum[i]=sum[i-1]+(x+1)/2;
    }
    for(int i=k;i<=n;i++)
    {
        sol=max(sol,sum[i]-sum[i-k]);
    }
    cout<<fixed<<setprecision(6)<<sol;
    return 0;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h> 
//#define <- プログラムの文字列を置換する
//typedef <- 新しい型に名前を付けるためのキーワード

using namespace std;

#define MAX_N 1

typedef long long ll;

const double PI = 3.141592653589793;
const long long MOD = 1e9 + 7;
const long long INF = 1e15;
const int INF_INT = 1e9;


int main(){
    int H,W,h,w;
    cin >> H >> W >> h >> w;
    cout << H * W  - h * W - w * H + h * w << endl;
    return 0;
}

Measured memory_bytes: 384
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		long d = sc.nextInt();

		int count = 0;
		for(int i = 0; i < n; i++){
			long x = sc.nextLong();
			long y = sc.nextLong();

			long distPow2 = x*x + y*y;
			if(distPow2 <= d*d){
				count++;
			}
		}

		System.out.println(count);
	}
}


Measured memory_bytes: 49156
import collections


def solve():

    N = int(input())

    def GetDivider(num):
        cnt = 0
        for i in range(1, num+1):
            if num % i == 0:
                cnt += 1

        return cnt

    ans = 0

    for i in range(1, N+1):
        if GetDivider(i) == 8:
            if i % 2 != 0:
                ans += 1

    print(ans)


if __name__ == "__main__":
    solve()


Measured memory_bytes: 38768
n = int(input())
a = list(map(int, input().split()))

count = 0
for i in range(n):
    mini = i
    for j in range(i,n):
        if a[j]<a[mini]:
            mini = j
    key = a[mini]
    a[mini] = a[i]
    a[i] = key
    if mini!=i:count += 1

string = ''
for s_val in a[:-1]:
    string += str(s_val) + ' '
string += str(a[-1])
print(string)
print(count)


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

#define int long long
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define ms(a, b) memset((a), (b), sizeof(a))
#define len(a) (int)((a).size())
#define all(a) (a).begin(), (a).end()
#define rall(a) (a).rbegin(), (a).rend()
#define lb lower_bound
#define ub upper_bound
#define fore(i, a, b) for (int i = (a), _b = (b); i < _b; ++i)
#define fort(i, a, b) for (int i = (a), _b = (b); i <= _b; ++i)
#define ford(i, a, b) for (int i = (a), _b = (b); i >= _b; --i)
#define bug(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <class T> void __f(const char* name, T&& a) {
    cerr << name << ": " << a << '\n';
}
template <class T, class... Ts> void __f(const char* names, T&& a, Ts&&... b) {
    const char* comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << ": " << a << " /";
    __f(comma + 1, b...);
}

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
template <class T> bool mini(T& a, const T& b) { return a > b ? (a = b, 1) : 0; }
template <class T> bool maxi(T& a, const T& b) { return a < b ? (a = b, 1) : 0; }

typedef long long ll;
typedef double db;
typedef pair<int, int> pi;
typedef pair<int, pi> ti;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pi> vpi;
typedef vector<ti> vti;
typedef vector<vpi> vvpi;

const int inf = (int)0x3f3f3f3f3f3f3f3f;
const int ninf = (int)0xc0c0c0c0c0c0c0c0;
const int M = (int)1e9 + 7;
const int N = 1e7 + 3;

int n, ans, cnt[N], pw[N], f[N];
bool p[N];
vi pr;

void sieve() {
    f[1] = 1;
    fore(i, 2, N) {
        if (!p[i]) {
            pr.pb(i);
            cnt[i] = 1;
            pw[i] = i;
            f[i] = 2;
        }
        for (int j = 0; i * pr[j] < N; ++j) {
            p[i * pr[j]] = 1;
            if (i % pr[j] == 0) {
                cnt[i * pr[j]] = cnt[i] + 1;
                pw[i * pr[j]] = pw[i] * pr[j];
                f[i * pr[j]] = f[i / pw[i]] * (cnt[i * pr[j]] + 1);
                break;
            } else {
                cnt[i * pr[j]] = 1;
                pw[i * pr[j]] = pr[j];
                f[i * pr[j]] = f[i] * 2;
            }
        }
    }
}

main() {
//    freopen("CP.out", "w", stdout);
    ios_base::sync_with_stdio(0); cin.tie(0);
    sieve();
    cin >> n;
    fort(i, 1, n) ans += f[i] * i;
    cout << ans << '\n';
}


Measured memory_bytes: 255752
#include <bits/stdc++.h>
using namespace std;
int N, M;
int a[305][305];
int main() {
  ios::sync_with_stdio(false);
  cin >> N >> M;
  for (int i = 0; i < N; ++i) {
    for (int j = 0; j < M; ++j) {
      int c;
      cin >> c;
      c--;
      a[i][j] = c;
    }
  }
  vector<int> valid(M, 1);
  vector<vector<int>> head(M);
  vector<int> pos(N, 0);
  int ret = INT_MAX;
  for (int row = 0; row < N; ++row) {
    int h = a[row][0];
    head[h].push_back(row);
  }
 
  int cmax = 0;
  int ci = -1;
  for (int i = 0; i < M; ++i) {
    if (head[i].size() > cmax) {
      cmax = head[i].size();
      ci = i;
    }
  }
 
  ret = min(ret, cmax);
  int last = M;
  while (last > 1) {
    valid[ci] = 0;
    for (auto row : head[ci]) {
      int &ind = pos[row];
      while (valid[a[row][ind]] == 0) ind++;
      head[a[row][ind]].push_back(row);
    }
 
    head[ci].clear();
    int cmax = 0;
    for (int i = 0; i < M; ++i) {
      if (head[i].size() > cmax) {
        cmax = head[i].size();
        ci = i;
      }
    }
 
    ret = min(ret, cmax);
    last--;
  }
 
  cout << ret << endl;
}

Measured memory_bytes: 1280
from collections import Counter

N = int(input())
c = Counter(int(s) for s in input().split())
if len(c) > 3:
    print("No")
elif len(c) == 1:
    print("Yes" if c.most_common()[0][0] == 0 else "No")
elif len(c) == 2:
    mc = sorted(c.most_common())
    if mc[0][0] == 0 and mc[0][1] * 2 == mc[1][1]:
        print("Yes")
    else:
        print("No")
else:
    mc = sorted(c.most_common())
    if mc[0][0] ^ mc[1][0] ^ mc[2][0] == 0 and mc[0][1] == mc[1][1] == mc[2][1]:
        print("Yes")
    else:
        print("No")


Measured memory_bytes: 15652
#ifdef DEBUG_IS_VALID
#define DEB 1 
#define _LIBCPP_DEBUG 0
#else
#define DEB 0
#define NDEBUG
#endif

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

#define ALL(g) (g).begin(),(g).end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i, x, n) for(int i = x; i >= n; i--)
#define rrep(i, n) RREP(i,n,0)
#define pb push_back
#define fi first
#define se second
#pragma GCC optimize ("-O3")

using namespace std;

#define DUMPOUT cout
#define dump(...) if(DEB) DUMPOUT<<"  "<<#__VA_ARGS__<<" :["<<__LINE__<<":"<<__FUNCTION__<<"]"<<endl<<"    "; if(DEB) dump_func(__VA_ARGS__)
template<typename T1,typename T2>ostream& operator << (ostream& os, pair<T1,T2> p){cout << "(" << p.first << ", " << p.second << ")"; return os;}
template<typename T>ostream& operator << (ostream& os, vector<T>& vec) { os << "{"; for (int i = 0; i<vec.size(); i++) os << vec[i] << (i + 1 == vec.size() ? "" : ", "); os << "}"; return os; }
template<typename T>ostream& operator << (ostream& os, set<T>& st){cout << "{"; for(auto itr = st.begin(); itr != st.end(); itr++) cout << *itr << (next(itr)!=st.end() ? ", " : ""); cout << "}"; return os;}
template<typename T1,typename T2>ostream& operator << (ostream& os, map<T1,T2> mp){cout << "{"; for(auto itr = mp.begin(); itr != mp.end(); itr++) cout << "(" << (itr->first) << ", " << (itr->second) << ")" << (next(itr)!=mp.end() ? "," : ""); cout << "}"; return os; }

void dump_func(){DUMPOUT << endl;}
template <class Head, class... Tail>void dump_func(Head&& head, Tail&&... tail){ DUMPOUT << head; if (sizeof...(Tail) == 0) { DUMPOUT << " "; } else { DUMPOUT << ", "; } dump_func(std::move(tail)...);}
template<class T> inline bool chmax(T& a,T const& b){if(a>=b) return false; a=b; return true;}
template<class T> inline bool chmin(T& a,T const& b){if(a<=b) return false; a=b; return true;}

using ll = long long;
using P = pair<int,int>;
using Pl = pair<ll,ll>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using vp = vector<Pl>;
using vvp = vector<vp>;

const int INF = 1<<29;
const long long LINF=1LL<<59;

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

void solve(long long N, long long M, std::vector<long long> a){
  bool chk = true;
  rep(i,N) chk &= (a[i]%2LL == 0);
  if(!chk){
    cout << 0 << endl; return;
  }
  rep(i,N) a[i] /= 2LL;
  
  ll x = a[0];
  rep(i,N){
    x = lcm(a[i], x);
    dump(i,x);
    if(x>M){
      cout << 0 << endl;
      return;
    }
  }
  rep(i,N){
    if((x/a[i])%2LL==0){
      cout << "0" << endl;
      return;
    }
  }
  dump(a);
  dump(x);
  ll ans = M/x - M/(2LL*x);
  cout << ans << endl;
}

int main(){
  std::cout << std::fixed << std::setprecision(15);
  long long N;
  scanf("%lld",&N);
  long long M;
  scanf("%lld",&M);
  std::vector<long long> a(N);
  for(int i = 0 ; i < N ; i++){
    scanf("%lld",&a[i]);
  }
  solve(N, M, std::move(a));
  return 0;
}


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

int main() {
	string s, t;
	cin >> s >> t;
	int a, b;
	cin >> a >> b;
	string u;
	cin >> u;
	if (s == u) a--;
	else b--;
	cout << a << ' ' << b << endl;
	return 0;
}


Measured memory_bytes: 256
# coding: utf-8

# https://atcoder.jp/contests/abc115
# 10:10-


def main():
    d = int(input())
    if d == 25:
        return "Christmas"
    elif d == 24:
        return "Christmas Eve"
    elif d == 23:
        return "Christmas Eve Eve"
    else:
        return "Christmas Eve Eve Eve"


print(main())


Measured memory_bytes: 9088
#include <iostream>
#include <cstdio>
#define N 1005
using namespace std;
typedef long long ll;

ll n, a, b, c, d, M=1e9+7, dp[N]={1}, fac[N]={1}, fiv[N]={1};

ll pow(ll p, ll q) {
	return q ? pow(p*p%M, q/2) * (q&1 ? p : 1) % M : 1;
}

int main() {
	ll i, j, k;
	cin >> n >> a >> b >> c >> d;
	for(i=1; i<=n; i++) {
		fac[i] = fac[i-1] * i % M;
		fiv[i] = pow(fac[i], M-2);
	}
	for(i=a; i<=b; i++) for(j=n; j>=0; j--) for(k=c; k<=d && j-k*i>=0; k++) {
		dp[j] = (dp[j] + dp[j-k*i] * pow(fiv[i], k) % M * fiv[k] % M) % M;
	}
	cout << dp[n] * fac[n] % M;
	return 0;
}

Measured memory_bytes: 256
#pragma region Macros
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define REPR(i, n) for(int i=(n); i>=0; --i)
#define FOR(i, n, m) for(int i=(m), i##_len=(n); i<i##_len; ++i)
#define EACH(i, v) for(const auto& i : v)
#define ALL(x) (x).begin(),(x).end()
#define ALLR(x) (x).rbegin(),(x).rend()
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; }
template<class Value>using vec = vector< Value >;
using ll = long long;
using P = pair< long long, long long >;
#define fi first
#define se second
#define el endl
#pragma endregion

void Main();

int main(){
    std::cin.tie(nullptr);
    std::cout << std::fixed << std::setprecision(15);
    Main();
    return 0;
}

int f(int n){
    int sum = 0;
    while(n>0){
        sum += n%10;
        n/=10;
    }
    return sum;
}

void Main(){
    int A, B, N;
    cin >> N >> A >> B;
    ll sum = 0;
    FOR(i, N+1, 1){
        int t=f(i);
        if(A<=t && t<=B){
            sum += i;
        }
    }
    cout << sum << el;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long ll;
ll gcd(ll a,ll b){return b!=0?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a*b/gcd(a,b);}

int main(){
    string s;
    cin>>s;
    ll r=0,l=0,n=s.size();
    s+='R';
    vector<ll> v(n,0);
    for(ll i=0;i<s.size();i++){
        if(s[i]=='L') l++;
        if(s[i]=='R'){
            if(l==0) r++;
            else{
                if((l+r)%2==0) v[i-l-1]=v[i-l]=(l+r)/2;
                else{
                    if((r<l && l%2==0)||(r>l && r%2!=0)){
                        v[i-l-1]=(l+r)/2+1;
                        v[i-l]=(l+r)/2;
                    }else{
                        v[i-l-1]=(l+r)/2;
                        v[i-l]=(l+r)/2+1;
                    }
                }
                r=1;
                l=0;
            }
        }
    }
    for(ll i=0;i<n;i++){
        cout<<v[i];
        if(i!=n-1) cout<<' ';
    }
    cout<<endl;
    return 0;
}


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

long long n, ans=1, M=1e9+7, cnt[1005];
int main() {
	int i, j, k;
	cin >> n;
	for(i=2; i<=n; i++) {
		for(k=i, j=2; k>1; ) {
			if(k%j==0) k/=j, cnt[j]++;
			else j++;
		}
	}
	for(i=2; i<=n; i++) ans = ans * (cnt[i]+1) % M;
	cout << ans;
	return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
using namespace std;
int a[105][105];
int x,y;

int main()
{
	scanf("%d%d",&x,&y);
	for(int i = 1; i <= x; i++)
		for(int j = 1; j <= y; j++)
			scanf(" %c",&a[i][j]);
	for(int i = 0; i <= y + 1; i++) printf("#");
	printf("\n");
	for(int i = 1;i <= x;i++)
	{
		printf("#");
		for(int j = 1; j <= y; j++) printf("%c",a[i][j]);
		printf("#");
		printf("\n");
	}
	for(int i = 0; i <= y + 1; i++) printf("#");
	printf("\n");

	return 0;
}

Measured memory_bytes: 256