akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#include<iostream>
#include<fstream>
#define ll long long
using namespace std;

int main(){
    string S;
    cin >> S;
    int N = S.length();
    int win = 0;
    for(int i=0; i<N; i++){
        if(S[i]=='o') win++;
    }

    if(win + 15-N >= 8){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }
}


Measured memory_bytes: 256
#include<stdio.h>
int main(void){
  int a,b,c,d;
  double f;
  scanf("%d%d",&a,&b);
  c=a/b;
  d= a%b;
  f=(double)a/(double)b;
  printf("%d %d %f\n",c,d,f);
  return 0;
}



Measured memory_bytes: 2088
S = list(map(int, list(input())))
n = len(S)

if len(set(S)) == 1:
	print(len(S))
else:
	ans = 1000000
	for i in range(n-1):
		if S[i] != S[i+1]:
			m = max(n - i - 1, i + 1)
			if m < ans:
				ans = m

	print(ans)

Measured memory_bytes: 4652
#include<iostream>
#include<cmath>
#include<cstdlib>
#include<string>
#include<cstring>
#include<algorithm>
#include<vector>
#include<map>
#include<iomanip>

using namespace std;

typedef long long ll;

typedef std::pair<int, int> ipair;
bool lessPair(const ipair& l, const ipair& r){return l.second < r.second;}
bool morePair(const ipair& l, const ipair& r){return l.second > r.second;}

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

const ll MOD = 1e9 + 7;
// const long long INF = 1LL<<60;
void add(long long &a, long long b) { a += b; if (a >= MOD) a -= MOD; }
void sub(long long &a, long long b) { a -= b; if (a < 0) a += MOD; }
void mul(long long &a, long long b) { a *= b; a %= MOD; }
ll llmin(ll a, ll b) { if (a < b) return a; else return b; }
ll llmax(ll a, ll b) { if (a < b) return b; else return a; }
ll llabs(ll a) { if (a >= 0) return a; else return - a; }
ll llmodpow(ll a, ll n) {
   if (n == 0) return 1;
   ll tmp = llmodpow(a, n / 2);
   mul(tmp, tmp);
   if (n & 1) mul(tmp, a);
   return tmp;
}

int main() {
   int N;
   cin >> N;
   int a[N];
   for (int i = 0; i < N; i++) cin >> a[i];
   sort(a, a + N);
   reverse(a, a + N);

   ll ans = 0;
   if (N % 2 == 0) {
      int k = N / 2;
      for (int i = 0; i < k - 1; i++) {
         ans += 2 * a[i];
      }
      ans += a[k - 1];
      ans -= a[k];
      for (int i = k + 1; i < N; i++) {
         ans -= 2 * a[i];
      }
   } else {
      int k = N / 2;
      for (int i = 0; i < k; i++) {
         ans += 2 * a[i];
      }
      ans += a[k];
      ans += a[k + 1];
      for (int i = k; i < N; i++) {
         ans -= 2 * a[i];
      }
      ll tmp = 0;
      for (int i = 0; i < k + 1; i++) {
         tmp += 2 * a[i];
      }
      tmp -= a[k - 1];
      tmp -= a[k];
      for (int i = k + 1; i < N; i++) {
         tmp -= 2 * a[i];
      }
      if (ans < tmp) ans = tmp;
   }
   cout << ans << endl;
   return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define rep(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define rrep(i,n) for(int i=1,i##_len=(n); i<=i##_len; ++i)
#define drep(i,n) for(int i=(n)-1; i>=0; --i)
#define srep(i,s,t) for(int i=(s);i<(t);++i)
#define rng(obj) (obj).begin(), (obj).end()
#define maxs(x,y) (x=max((x),(y)))
#define mins(x,y) (x=min((x),(y)))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x=max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define sz(x) (int)(x).size()
#define uni(x) x.erase(unique(rng(x)),x.end())
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T>>
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) vector<vector<T>>
using ll = long long;
using ull = unsigned long long;
using uint = unsigned int;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vp = vector<pii>;
template <class T> inline istream& operator>>(istream&i,v(T)&v)
{ rep(j,sz(v))i>>v[j];return i;}
template <class T> string join(const v(T)&v)
{ stringstream s;rep(i,sz(v))s<<' '<<v[i];return s.str().substr(1);}
template <class T> inline ostream& operator<<(ostream&o,const v(T)&v)
{ if(sz(v))o<<join(v); return o;}
template <class T1,class T2> inline istream& operator>>(istream&i ,pair<T1,T2>&v)
{ return i>>v.fi>>v.se;}
template <class T1,class T2> inline ostream& operator<<(ostream&o ,pair<T1,T2>&v)
{ return o<<v.fi<<","<<v.se;}
template <class T> inline ll suma(const v(T)& a) 
{ ll res(0); for(auto&& x:a) res += x; return res;}
const int INF = 1001001001;
const ll LINF = 1001002003004005006ll;
const double eps = 1e-10;
const int MX = 200005;
//----------------------------------------------------------------

#define fileio ifstream fio; if(argc>=2){fio.open(argv[1]); std::cin.rdbuf(fio.rdbuf());}
#define fastio ios_base::sync_with_stdio(false);
#define MOD 1000000007
//----------------------------------------------------------------
void Main(){
  int n;
  string s;
  cin>>n>>s;
  vi Lw(n,0),Re(n,0);
  Lw[0] = s[0]=='W';
  Re[n-1] = s[n-1]=='E';
  rep(i,n-1){
    Lw[i+1] = Lw[i] + (s[i+1]=='W');
  }
  drep(i,n-1){
    Re[i] = Re[i+1] + (s[i]=='E'); 
  }
  int ans = 1e6;
  mins(ans,Re[0]);
  mins(ans,Lw[n-1]);
  srep(i,1,n-1){
    mins(ans,Lw[i-1]+Re[i+1]);
  }
  cout<<ans<<endl;
} int main(int argc,char* argv[]){ 
    fastio; fileio; Main();}

Measured memory_bytes: 2964
#include<iostream>
#include<vector>
using namespace std;
#define inRange(x,a,b) (a <= x && x < b)

bool ok;

void dfs(int id, int cnt, const vector<vector<vector<char>>> v, vector<vector<char>> &board){
    if(cnt == 3){
        ok = true;
        return;
    }
    if(id == 4) return;

    for(int i = 0; i < 4; i++){
        for(int j = 0; j < 10; j++){
            bool put = true;
            for(int k = 0; k < v[id].size(); k++){
                for(int l = 0; l < v[id][0].size(); l++){
                    if(v[id][k][l] == '.')  continue;
                    if(!inRange(i+k,0,4) || !inRange(j+l,0,10) || board[i+k][j+l] == '#'){
                        put = false;
                        break;
                    }
                }
                if(!put)    break;
            }
            if(!put)    continue;
            for(int k = 0; k < v[id].size(); k++){
                for(int l = 0; l < v[id][0].size(); l++){
                    if(v[id][k][l] == '.')  continue;
                    board[i+k][j+l] = '#';
                }
            }
            dfs(id+1, cnt+1, v, board);
            for(int k = 0; k < v[id].size(); k++){
                for(int l = 0; l < v[id][0].size(); l++){
                    if(v[id][k][l] == '.')  continue;
                    board[i+k][j+l] = '.';
                }
            }
        }
    }

    if(3-id+cnt >= 3)   dfs(id+1, cnt, v, board);
}

int main(){
    vector<vector<vector<char>>> v;
    for(int i = 0; i < 4; i++){
        int h, w;
        cin >> h >> w;
        vector<vector<char>> tmp(h, vector<char>(w));
        for(int j = 0; j < h; j++){
            for(int k = 0; k < w; k++){
                cin >> tmp[j][k];
            }
        }
        v.push_back(tmp);
    }
    int n;
    cin >> n;
    while(n-- > 0){
        vector<vector<char>> board(4, vector<char>(10));
        for(int i = 0; i < 4; i++){
            for(int j = 0; j < 10; j++){
                cin >> board[i][j];
            }
        }
        ok = false;
        dfs(0, 0, v, board);
        cout << (ok ? "Yes" : "No") << endl;
    }
    return 0;
}


Measured memory_bytes: 3172
#include <iostream>

using namespace std;

int n;

void CountingSort(int A[], int B[], int k) {
	int C[10001] = {};
	for (int i = 0; i < n; ++i) C[A[i]]++;
	for (int i = 1; i <= k; ++i) C[i] += C[i - 1];
	for (int i = n - 1; i >= 0; --i) {
		B[C[A[i]]] = A[i];
		C[A[i]]--;
	}
}

int A[2000000], B[2000001];

int main() {
	cin >> n;
	for (int i = 0; i < n; ++i) cin >> A[i];
	CountingSort(A, B, 10000);
	for (int i = 1; i <= n; ++i) {
		if (i > 1) cout << " ";
		cout << B[i];
	}
	cout << endl;

	return 0;
}


Measured memory_bytes: 18728
// clang-format off
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define loop(i, a, n) for (int i = (a); i < (n); i++)
#define rep(i, n) loop(i, 0, n)
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define prec(n) fixed << setprecision(n)
constexpr int INF = sizeof(int) == sizeof(long long) ? 1000000000000000000LL : 1000000000;
constexpr int MOD = 1000000007;
constexpr double PI = 3.14159265358979;
template<typename A, typename B> bool cmin(A &a, const B &b) { return a > b ? (a = b, true) : false; }
template<typename A, typename B> bool cmax(A &a, const B &b) { return a < b ? (a = b, true) : false; }
bool odd(const int &n) { return n & 1; }
bool even(const int &n) { return ~n & 1; }
template<typename T> int len(const T &v) { return v.size(); }
template<typename T = int> T in() { T x; cin >> x; return x; }
template<typename T = int> T in(T &&x) { T z(forward<T>(x)); cin >> z; return z; }
template<typename T> istream &operator>>(istream &is, vector<T> &v) { for (T &x : v) is >> x; return is; }
template<typename A, typename B> istream &operator>>(istream &is, pair<A, B> &p) { return is >> p.first >> p.second; }
template<typename T> ostream &operator<<(ostream &os, const vector<vector<T>> &v) { int n = v.size(); rep(i, n) os << v[i] << (i == n - 1 ? "" : "\n"); return os; }
template<typename T> ostream &operator<<(ostream &os, const vector<T> &v) { int n = v.size(); rep(i, n) os << v[i] << (i == n - 1 ? "" : " "); return os; }
template<typename A, typename B> ostream &operator<<(ostream &os, const pair<A, B> &p) { return os << p.first << ' ' << p.second; }
template<typename Head, typename Value> auto vectors(const Head &head, const Value &v) { return vector<Value>(head, v); }
template<typename Head, typename... Tail> auto vectors(Head x, Tail... tail) { auto inner = vectors(tail...); return vector<decltype(inner)>(x, inner); }
// clang-format on

main() {
  int n = in();
  vector<int> a(n);
  cin >> a;
  vector<int> v;
  sort(all(a));
  rep(i, min(1000LL, n)) rep(j, min(1000LL, n)) {
    if (i == j) continue;
    v.emplace_back(stoi(to_string(a[i]) + to_string(a[j])));
  }
  sort(all(v));
  cout << v[2] << endl;
}



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

public class Main{
    PrintWriter out = new PrintWriter(System.out);
    int ans = 1, H, W;
    char[][] maze;
    int[] dr = new int[]{1,0,-1,0}, dc = new int[]{0,1,0,-1};
    static public void main(String[] args) throws Exception{
        //BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        //String[] buf = reader.readLine().split(" ")
        Main main = new Main();
        main.solve();
//        System.out.println(main.solve());
    }
    int solve(){
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        PriorityQueue<int[]> pq = new PriorityQueue<>(n,(e1,e2)->(e1[1]-e2[1]));
        for(int i=1;i<=n;i++){
            int a = sc.nextInt();
            pq.add(new int[]{i,a});
        }
        while(pq.size()>0){
            int[] now = pq.poll();
            out.print(now[0]);
            out.print(' ');
        }
        out.flush();
        int ans = 0;
        return ans;
    }

}



Measured memory_bytes: 59784
#include<iostream>
#include<vector>
#include<math.h>
using namespace std;
int main() {
	int h, w, n=0,x,y;
	vector<vector<int>> a,check;
	cin >> h >> w;
	a = vector<vector<int>>(h, vector<int>(w, 0));
	check = vector<vector<int>>(w*h, vector<int>(4, 0));
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			cin >> a[i][j];
		}
	}
	for (int i = 0; i < h-1; i++) {
		for (int j = 0; j < w;j++) {
			if (a[i][j] % 2 == 0)continue;
			n++;
			a[i][j]--;
			a[i + 1][j]++;
			check[n - 1][0] = i + 1; check[n - 1][1] = j + 1; check[n - 1][2] = i + 2; check[n - 1][3] = j + 1;
		}
	}
	for (int i = 0; i < w-1; i++) {
		if (a[h-1][i]%2==1)
		{
			n++;
			a[h - 1][i]--;
			a[h - 1][i + 1]++;
			check[n - 1][0] = h; check[n - 1][1] = i + 1; check[n - 1][2] = h; check[n - 1][3] = i + 2;
		}
	}
	cout << n << endl;
	for (int i = 0; i < n; i++) {
		cout << check[i][0] << ' ' << check[i][1] << ' ' << check[i][2] << ' ' << check[i][3] << endl;
	}
}

Measured memory_bytes: 16768
#include <iostream>
#include <algorithm>
#include <string>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <vector>
#include <queue>
#include <stack>
using namespace std;

#define rep(i, s) for (int i = 0; i < s; ++i)
#define all(v) (v.begin(), v.end())
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)
#define VEC(a, n) vector<int>a(n)
#define PQ(a, n) priority_queue<int>a(n)
#define PQmin(a, n) priority_queue< int, std::vector<int>, std::greater<int> >a(n)

typedef long long  ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int main() {
    int k,a,b;
    cin>>k>>a>>b;
    if(a+1>=b){
        cout<<k+1<<endl;
    }
    else{
        int cnt=0;
        int yen=0;
        ll biscuit=0;
        while(cnt<=k-1){
            if(yen>=1){
                yen--;
                biscuit+=b;
            }
            else if(biscuit>=a){
                biscuit-=a;
                yen++;
            }
            else{
                biscuit++;
            }
            cnt++;
        }
        if(yen>=1){
            biscuit+=b;
        }
        else{
            biscuit++;
        }
        cout<<biscuit<<endl;
    }





    return 0;
}


Measured memory_bytes: 256
import java.util.*;

public class Main{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    long a = scan.nextLong();
    long b = scan.nextLong();
    long x = scan.nextLong();

    long c = (long) a/x;
    long d = (long) b/x;

    long sum = 0;
    if (c*x == a){
      sum += 1;
    }
    sum += (long) (d-c);
    System.out.println(sum);
  }

}


Measured memory_bytes: 35484
#include <iostream>

using namespace std;

int main(){
  int a,b,c;
  cin >> a >> b >> c;
  int counter=0;
  for(int i=a;i<=b;i++){
    if(c % i == 0){
      counter++;
    }
  }
  cout << counter << endl;
  return 0;
}

Measured memory_bytes: 3096
#include<bits/stdc++.h>
using namespace std;
int main(){
    while(1){
        int x,y;
        cin>>x>>y;
        if(x==0 && y==0) break;
        if(x>y) swap(x,y);
        cout<<x<<" "<<y<<endl;
    }
    return 0;
}


Measured memory_bytes: 2980
#include <queue>
#define REP(i,n) for(int i=0; i<(int)(n); i++)

#include <cstdio>
inline int getInt(){ int s; scanf("%d", &s); return s; }

#include <set>

using namespace std;

pair<int, int> heap[1024 * 1024];
int idx[1024 * 1024];

bool cmp(pair<int, int> lhs, pair<int, int> rhs){
  if(lhs.second != rhs.second) return lhs.second < rhs.second;
  return lhs.first > rhs.first;
}

int main(){
  const int n = getInt();
  const int q = getInt();

  REP(i,n) heap[i].first = idx[i] = i;

  REP(i,q){
    const int a = getInt() - 1;
    const int v = getInt();

    int pos = idx[a];
    heap[pos].second += v;

    {
      while(pos > 0){
        const int parent = (pos - 1) / 2;
        if(!cmp(heap[pos], heap[parent])){
          swap(heap[pos], heap[parent]);
          idx[heap[pos].first] = pos;
          idx[heap[parent].first] = parent;
          pos = parent;
        }else{
          break;
        }
      }
    }

    {
      while(pos * 2 + 1 < n){
        vector<int> cand;
        bool change = false;
        if(pos * 2 + 1 < n) cand.push_back(pos * 2 + 1);
        if(pos * 2 + 2 < n) cand.push_back(pos * 2 + 2);

        if(cand.size() == 2 && cmp(heap[cand[0]], heap[cand[1]]))
          swap(cand[0], cand[1]);

        REP(i,cand.size()){
          const int next = cand[i];
          if(cmp(heap[pos], heap[next])){
            swap(heap[pos], heap[next]);
            idx[heap[pos].first] = pos;
            idx[heap[next].first] = next;
            pos = next;
            change = true;
            break;
          }
        }
        if(!change) break;
      }
    }

    /*
    REP(i,n) printf("%d ", idx[i]); puts("");
    int b = 0;
    REP(i,n){
      printf("(%d, %d)", heap[i].first, heap[i].second);
      if(i == b){ puts(""); b = (b + 2) * 2 - 2; }
    }
    */

    printf("%d %d\n", heap[0].first + 1, heap[0].second);
  }

  return 0;
}

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

using namespace std;

int main()
{
  int N;
  cin >> N;
  vector<long long> A(N), B(N);
  for (int i = 0; i < N; i++)
    cin >> A[i];
  for (int i = 0; i < N; i++)
    cin >> B[i];
  long long sum = 0, minus = 0, cnt = 0;
  vector<long long> dif(N);
  for (int i = 0; i < N; i++)
  {
    dif[i] = A[i] - B[i];
    sum += dif[i];
    if (dif[i] < 0)
    {
      minus -= dif[i];
      cnt++;
    }
  }
  if (sum < 0)
  {
    cout << -1 << endl;
    return 0;
  }
  sort(dif.begin(), dif.end(), greater<long long>());
  long long tmp = 0;
  for (int i = 0; i < N && 0 < dif[i]; i++)
  {
    if (minus <= tmp)
    {
      cout << cnt + i << endl;
      return 0;
    }
    tmp += dif[i];
  }
  cout << N << endl;

  return 0;
}


Measured memory_bytes: 2560
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define lf long double
#define pb push_back
#define mp make_pair
#define F first
#define S second
typedef pair <ll,ll> ii;
typedef vector <ll> vi;
typedef vector <ii> vii;
typedef vector <bool> vb;
typedef vector <vector <ll> > vv;
typedef vector <string> vs;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll n;
    cin>>n;
    vector <lf> a(n);
    for(ll i=0;i<n;i++)
    {
        cin>>a[i];
    }
    lf b=0;
    for(ll i=0;i<n;i++)
    {
        b+=1/a[i];
    }
    b=1/b;
    printf("%.6Lf\n",b);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = int(a); i < int(b); i++)
#define rer(i, a, b) for(int i = int(a) - 1; i >= int(b); i--)

using namespace std;
typedef long long int ll;
typedef pair <int, int> P;
int X[200000], Y[200000], Z[200000];
P p[200000];
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int H,W,N;
    cin>> H>>W>>N;
    if(N>=1){
        rep(i,0,N) {
            cin>>X[i]>>Y[i];
            Z[i]=X[i]-Y[i];
        }
        rep(i,0,N) p[i]=make_pair(X[i], Z[i]);
        sort(p,p+N);
        int temp1=0, temp2=0;
        if(p[temp1].second>=1) {
            cout<<p[temp1].first-1<<"\n";
            return 0;
        }
        else{
            rep(i,1,N){
                if(p[temp2].first<p[i].first&&p[temp2].second<p[i].second){
                    if(p[i].second>max(p[temp2].second+1,0)){
                        if(temp1==0){
                            if(!(p[temp1].first+1==p[i].first&&p[temp1].second+1==p[i].second)){
                                cout<<p[i].first-1<<"\n";
                                return 0;
                            }
                        }
                        else{
                            if(!(p[temp1].first+1==p[i].first&&p[temp1].second+1==p[i].second)&&!(p[temp1-1].first+1==p[i].first&&p[temp1-1].second+1==p[i].second)){
                                cout<<p[i].first-1<<"\n";
                                return 0;
                            }
                        }
                    }
                    temp1=temp2;
                    temp2=i;
                }
                else{
                    if(p[temp2].first==p[i].first){
                        if(p[i].second>max(p[temp1].second+1,0)){
                            if(temp1==0){
                                if(!(p[temp1].first+1==p[i].first&&p[temp1].second+1==p[i].second)){
                                    cout<<p[i].first-1<<"\n";
                                    return 0;
                                }
                            }
                            else{
                                if(!(p[temp1].first+1==p[i].first&&p[temp1].second+1==p[i].second)&&!(p[temp1-1].first+1==p[i].first&&p[temp1-1].second+1==p[i].second)){
                                    cout<<p[i].first-1<<"\n";
                                    return 0;
                                }
                            }
                        }
                        temp2++;
                    }
                }
            }
        }
        cout<<H<<"\n";
    }
    else cout<<H<<"\n";
}

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

int main() {
  int N;
  cin >> N;
  string S, T;
  cin >> S >> T;
  string ans;
  ans = S + T;
  for (int i = 0; i < N; i++) {
    ans.at(i * 2) = S.at(i);
    ans.at(i * 2 + 1) = T.at(i);
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define MOD 1000000007LL
using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int h,w;
int n;
int sx,sy;
string s[2];
string dir="LRUD";
int dx[4]={-1,1,0,0};
int dy[4]={0,0,-1,1};

int getdir(int v){
	if(v%2==0){
		for(int i=0;i<4;i++){
			if(dir[i]==s[0][v/2])return i;
		}
	}else{
		for(int i=0;i<4;i++){
			if(dir[i]==s[1][v/2])return i;
		}
	}
}

bool solve(){
	int x_l=0,x_r=w,y_l=0,y_r=h;
	for(int i=n*2-2;i>=0;i--){
		int col=getdir(i);
		//printf("%d %d %d %d %d\n",col,x_l,x_r,y_l,y_r);
		if(i%2==1){
			if(col==0){
				x_r=min(x_r+1,w);
			}
			if(col==1){
				x_l=max(x_l-1,0);
			}
			if(col==2){
				y_r=min(y_r+1,h);
			}
			if(col==3){
				y_l=max(y_l-1,0);
			}
		}else{
			if(col==0){
				x_l=min(x_l+1,w);
			}
			if(col==1){
				x_r=max(x_r-1,0);
			}
			if(col==2){
				y_l=min(y_l+1,h);
			}
			if(col==3){
				y_r=max(y_r-1,0);
			}
		}
		if(x_l==x_r || y_l==y_r)return false;
	}
	if(x_l<=sx && sx<x_r){
		if(y_l<=sy && sy<y_r){
			return true;
		}
	}
	return false;
}

int main(void){
	scanf("%d%d%d",&h,&w,&n);
	scanf("%d%d",&sy,&sx);
	sy--;
	sx--;
	cin >> s[0];
	cin >> s[1];
	printf("%s\n",solve()?"YES":"NO");
	return 0;
}


Measured memory_bytes: 776
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
int main() {
    int n;
    cin >> n;
    if (n % 2 == 0)
        cout << 0.5000000000 << endl;
    else {
        double a = n / 2 + 1.0;
        double ans = a / double(n);
        cout << ans << endl;
    }
    return 0;
}

Measured memory_bytes: 256
import sys
stdin = sys.stdin
sys.setrecursionlimit(10**6)
ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
nn = lambda: list(stdin.readline().split())
ns = lambda: stdin.readline().rstrip()

n = ni()
a = na()
b = na()

from collections import deque
d = deque(b)
i = 0
j = 0
ans = []

while d:
    k = d.popleft()
    if k == a[i]:
        d.append(k)
        j+=1
        if j > n:
            break
        continue
    ans.append(k)
    i+=1
else:
    print('Yes')
    print(*ans)
    exit()

d = deque(b)
i = 0
j = 0
ans = []

while d:
    k = d.pop()
    if k == a[i]:
        d.appendleft(k)
        j+=1
        if j > n:
            print('No')
            exit()
        continue
    ans.append(k)
    i+=1

print('Yes')
print(*ans)

Measured memory_bytes: 120012
//#include "bits/stdc++.h"
#include <iostream>
#include <vector>
#include <map>
#include <utility>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <stack>
#include <queue>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <numeric>
#include <complex>
#include <bitset>
#include <functional>
#include <stack>
#include <regex>
#include <tuple>
#include <iomanip>


#define int long long
#define REP(i,l,r) REPEAT(i,l,r,true) // [l, r)
#define rep(i,n) REP(i,0,n)           // [0, n)
#define REPEAT(i,l,r,condition) for(int i=(condition)?l:r-1;(condition)?i<r:i>=l;(condition)?++i:--i) // false<-[l, r)->true
#define all(e) e.begin(),e.end()
#define rall(e) e.rbegin(),e.rend()
#define pb push_back
#define fs first
#define sc second
#ifdef LOCAL
#define show(...) cerr<<#__VA_ARGS__<<" = ";_DEBUG(__VA_ARGS__)
#define showlr(n,l,r) cerr<<#n<<" = ";for(int i=l;i<r;i++){cerr<<n[i]<<", ";}cerr<<endl // [l, r)
#else
#define show(...)
#define showlr(n,l,r)
#endif

#define YN(condition) puts((condition)?"YES":"NO")
#define Yn(condition) puts((condition)?"Yes":"No")
#define yn(condition) puts((condition)?"yes":"no")
#define YES puts("YES")
#define Yes puts("Yes")
#define yes puts("yes")
#define NO  puts("NO")
#define No  puts("No")
#define no  puts("no")

#define case(i) printf("Case #%lld: ",i)

using namespace std;

using vi=vector<int>;
using pint=pair<int,int>;

struct io{io(){cin.tie(0);ios::sync_with_stdio(false);cout.tie(0);cout<<fixed<<setprecision(20);}}io;

template<class T> istream& operator >>(istream &is, vector<T> &v){for(T &e:v)is>>e;return is;}
template<class T> ostream& operator <<(ostream &os, vector<T> v){os<<"{";for(T &e:v)os<<e<<(v.size()-(int)(&e-&v[0])>1?", ":"");os<<"}";return os;}

void _DEBUG(){}
template<typename H,typename... T> void _DEBUG(H a,T...b){cerr<<a<<(sizeof...(b)?",":"\n");_DEBUG(b...);}

inline void in(){}
template<typename H,typename... T>void in(H &a, T&... b){cin>>a;in(b...);}
inline void out(){}
template<typename H,typename... T> void out(H a, T... b){cout<<a<<(sizeof...(b)?" ":"\n");out(b...);}

template<class T> void resz(int n,T& v){v.resize(n);}
template<class H,class... T> void resz(int n,H& a,T&... b){a.resize(n);resz(n,b...);}

template<typename V,typename H> void resize(vector<V>& v,const H a){v.resize(a);}
template<typename V,typename H,typename... T> void resize(vector<V>& v,const H& a,const T... b){v.resize(a);for(auto &v:v) resize(v,b...);}

const int INF=1LL<<55;
const int MOD=1000000007;
const double EPS=1e-8;
/*------------end of definitions------------*/

int A,B,C;

signed main(){

    in(A,B,C);
    Yn((A<=C&&C<=B)||B<=C&&C<=A);

    return 0;
}


Measured memory_bytes: 888
S = list(str(input()))
N = len(S)
if ((N-1)//2)%2:
  n = (N-1)//2
  e = (n-1)//2
  s = (n+3)//2-1
else:
  n = N//2
  e = n//2
  s = n//2
#print(S[:(N-1)//2] , S[(N+3)//2-1:] , S[:e], S[s:n])
if S[:(N-1)//2] == S[(N+3)//2-1:] and S[:e] ==  S[s:n][::-1]:
  print("Yes")
else:
  print("No")  


Measured memory_bytes: 38384
#include <bits/stdc++.h>
using namespace std;
int main(){
    long long n,ans=0;cin >> n;
    for(long long i=0, j=0; i<n; i++){
        j++;
        if(j%3!=0&&j%5!=0){
            ans = ans+j;
        }
    }
    cout << ans;
}

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

const int N = 1e5 + 5;
const int steps = 2;
ll dp[N];
ll h[N];
int n;

int main() {
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin >> n;
    for (int i = 0; i < n; i++)
        cin >> h[i];
    for (int i = 1; i < n; i++) {
        ll start = max(0, i - steps), mn = 1e9;
        for (int j = start; j < i; j++)
            mn = min(mn, dp[j] + abs(h[i] - h[j]));
        dp[i] = mn;
    }
    cout << dp[n - 1];
    return 0;
}


Measured memory_bytes: 1792
import sys; input = sys.stdin.readline
from collections import deque
n, m = map(int, input().split())
graph = [set() for _ in range(n)]
for _ in range(m):
	a, b = map(int , input().split())
	if (b-1) not in graph[a-1]: graph[a-1].add(b-1)
	if (a-1) not in graph[b-1]: graph[b-1].add(a-1)
clusters = 0
v = [False]*n
for i in range(n):
	if not v[i]:
		v[i] = True
		q = deque([i])
		cluster = 0
		while q:
			node = q.popleft()
			cluster+=1
			for j in graph[node]:
				if not v[j]: v[j] = True; q.append(j)
		clusters = max(clusters, cluster)
print(clusters)



Measured memory_bytes: 149452
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;

using namespace std;

//Binary exponent
ll Bin_pow(ll a,ll b)
{
    ll res=1;
    while(b>0)
    {
        if(b&1)
        {
            res=res*a;
        }
        a=a*a;
        b>>=1;
    }
    return res;
}

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

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

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	
	string s;
	string t;
	
	cin>>s>>t;
	ll count=0;
	
	for(ll i=0;i<s.length();i++)
	{
	    if(s[i]!=t[i])
	        count++;
	}
	
	cout<<count<<"\n";
}


Measured memory_bytes: 3788
#include<bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef pair<int,int> pii;
typedef vector< pii > vii;

#define ll          long long
#define ff          first
#define ss          second
#define pb          push_back
#define mkp         make_pair
#define sz          size()

#define forf(a,b,c)    for(int i=a;i<=b;i+=c)
#define forr(a,b,c)    for(int i=a;i>=b;i-=c)
#define all(a)      a.begin(),a.end()
#define mem(a,b)    memset(a,b,sizeof(a))
#define pi          2*acos(0.0)
#define End         return 0;
#define nl endl

#define scan1(a)    scanf("%d",&a)
#define scan2(a,b)  scanf("%d %d",&a,&b)
#define scan3(a,b,c)  scanf("%d %d %d",&a,&b,&c)
#define scanl(a)    scanf("%lld",&a)
#define scanll(a,b) scanf("%lld %lld",&a,&b)
#define scanlll(a,b,c) scanf("%lld %lld %lld",&a,&b,&c)

#define print1(a)    printf("%d",a)
#define print2(a,b)  printf("%d %d",a,b)
#define print3(a,b,c)  printf("%d %d %d",a,b,c)
#define printl(a)    printf("%lld",a)
#define printll(a,b) printf("%lld %lld",a,b)
#define printlll(a,b,c) printf("%lld %lld %lld",a,b,c)

#define MAXN        100000007
#define INF 0x3f3f3f3f

vi prime;
//void seive(ll N){for(int i=2;i<=N;i++){if(mark[i]==false){prime.pb(i);for(int j=i+i;j<N;j+=i)mark[j]=true;}}}
//freopen("input.txt", "r", stdin);

int main()
{
   ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
   int n;
   cin>>n;
   vll v(n+3),vv(n+3);
   for(int i=1;i<=n;i++) cin>>v[i];

   vv[1]=0;vv[2]=abs(v[2]-v[1]);
   for(int i=3;i<=n;i++){
    vv[i]=min(vv[i-1]+abs(v[i]-v[i-1]), vv[i-2]+abs(v[i]-v[i-2]));
   }
   cout<<vv[n]<<endl;
   return 0;
}


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

#define rep(i,n) for(int i = 0; i < (n); i++)
#define rrep(i,n) for(int i = (n)-1; i >= 0; i--)
#define rep1(i,n) for(int i = 1; i <= (n); i++)
#define rrep1(i,n) for(int i = (n); i > 0; i--)

#define ll long long
#define pi pair<int, int>
#define pll pair<ll, ll>

#define MOD 1000000007
#define INF 1000000000000000LL

using namespace std;

#define MAXN 10000
#define MAXD 100

ll dp[MAXN+1][MAXD][2];

int main(){
  string s;cin>>s;
  int n = s.size();
  int d;cin>>d;

  dp[0][0][1]=1;
  rep(i, n)rep(j, d)rep(k, 10){
    int cd = s[i]-'0';
    int nj = (j+k)%d;
    if(k>cd){
      dp[i+1][nj][0] += dp[i][j][0];
    }else if(k==cd){
      dp[i+1][nj][1] += dp[i][j][1];
      dp[i+1][nj][0] += dp[i][j][0];
    }else{
      dp[i+1][nj][0] += dp[i][j][1];
      dp[i+1][nj][0] += dp[i][j][0];
    }
    dp[i+1][nj][0] %= MOD;
    dp[i+1][nj][0] %= MOD;
  }

  cout<<(dp[n][0][0]+dp[n][0][1]-1+MOD)%MOD<<endl;

  return 0;
}

Measured memory_bytes: 19256
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <math.h>
#include <iomanip>
using namespace std;
#define int long long

int gcd(int a,int b){
    return b ? gcd(b, a % b) : a;
}
int lcm(int a,int b){
    return b / gcd(a,b) * a;
}


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

    int n,m; cin >> n >> m;
    string s,t; cin >> s >> t;

    int nmlcm = lcm(n,m);
    int nmgcd = gcd(n,m);
    int nn = n / nmgcd;
    int mm = m / nmgcd;

    bool hantei = true;

    for(int i = 0;i < nmgcd;i ++){
        if(s.at(i * nn) != t.at(i * mm)) hantei = false;
    }

    if(hantei) cout << nmlcm << endl;
    else cout << -1 << endl;
}

Measured memory_bytes: 640
n = gets.to_i
hash = {}
for i in 1..n
  s = gets.chomp.split("").sort.join
  if hash[s]
    hash[s] += 1
  else
    hash[s] = 1
  end
end
 
ctn = 0
hash.values.each do |v|
  ctn += v * (v - 1) / (1 * 2)
end
 
puts ctn

Measured memory_bytes: 19196
package main
 
import (
	"fmt"
	"strconv"
)
 
func dfs(sum int, s string) int {
	res := sum
	for idx := 1; idx < len(s); idx++ {
		n, _ := strconv.Atoi(s[0:idx])
		res += dfs(sum + n, s[idx:])
	}
	n, _ := strconv.Atoi(s)
	return res + n
}
 
 
func main() {
	var s string
	fmt.Scan(&s)
	fmt.Println(dfs(0, s))
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
using ll =long long;
#define all(v) v.begin(),v.end()
 
int main() {
  string S,T;
  cin>>S>>T;
  for(ll i=0;i<3;i++) {
if(S[i]!=T[2-i]) {
  cout<<"NO"<<endl;
  return 0;
}
  }
  
  cout<<"YES"<<endl;
}


Measured memory_bytes: 3584
#include <bits/stdc++.h>
#define pb push_back
#define fi first
#define se second
#define ins insert
#define sz(x) (long long)x.size()
typedef long long ll;
typedef long double ld;
const int N = 1e5 + 5;
const ld pi = 3.141592653;
const ll MOD = 1e9 + 7;
const ll mod = 998244353;
const ll INF = __LONG_LONG_MAX__;

using namespace std;

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

int cnt;
vector<bool> vis(2*N);

void dfs (vector<int> g[], int t){
        vis[t]=true;
        cnt++;
        for(int i = 0; i<sz(g[t]); i++){
                if(vis[g[t][i]]==false) dfs(g, g[t][i]);
        }
}

int main()
{
        ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
        int T = 1;
        //cin>>T;
        while(T--)
        {
                int n, m, i, ans = 0;
                cin>>n>>m;
                vector<int> g[2*N];
                for(i=0; i<m; i++){
                        int u, v;
                        cin>>u>>v;
                        g[u].pb(v); g[v].pb(u);
                }
                for(i=0; i<=n; i++) vis[i]=false;
                for(i=1; i<=n; i++){
                        if(vis[i]==false){
                                cnt = 0;
                                dfs(g, i);
                                ans = max(ans, cnt);
                        }
                }
                cout<<ans;
        }
        return 0;
}

Measured memory_bytes: 23876
#include<iostream>
using namespace std;
int main() {
	int d;
	cin >> d;
	if (d == 25) {
		cout << "Christmas" << endl;
	}
	else if (d == 24) {
		cout << "Christmas Eve" << endl;
	}
	else if (d == 23) {
		cout << "Christmas Eve Eve" << endl;
	}
	else cout << "Christmas Eve Eve Eve" << endl;
}

Measured memory_bytes: 256
N,T=map(int,input().split())
A=[int(i) for i in input().split()]
b=0
count=0
for i in range(N):
  if i==0:
    min_A=A[i]
  else:
    if b<A[i]-min_A:
      b=A[i]-min_A
      count=1
    elif b==A[i]-min_A:
      count+=1
    if min_A>A[i]:
      min_A=A[i]
print(count)

Measured memory_bytes: 62832
//Make Purse Light
#include<bits/stdc++.h>
using namespace std;

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

int p;
int num(int c10, int c50, int c100, int c500){
  int ret=0, x=(c10*10+c50*50+c100*100+c500*500)-p;
  while(x!=0){
    if(x>=500){ret++; x-=500;}
    else if(x>=100){ret++; x-=100;}
    else if(x>=50){ret++; x-=50;}
    else if(x>=10){ret++; x-=10;}
  }
  return ret;
}

int main(){
  bool flag=false;
  while(true){
    cin>>p;
    if(p==0)break;
    if(flag)cout<<endl;
    int c10, c50, c100, c500;
    int mn=INF, cn10=0, cn50=0, cn100=0, cn500=0;
    cin>>c10>>c50>>c100>>c500;
    rep(i,c10+1)rep(j,c50+1)rep(k,c100+1)rep(l,c500+1){
      if(i*10+j*50+k*100+l*500>=p){
        int tmp=(c10+c50+c100+c500)-(i+j+k+l)+num(i, j, k, l);//支払後のコイン数
        if(mn>tmp){mn=tmp; cn10=i; cn50=j; cn100=k; cn500=l;}
      }
    }
    if(cn10!=0)cout<<"10 "<<cn10<<endl;
    if(cn50!=0)cout<<"50 "<<cn50<<endl;
    if(cn100!=0)cout<<"100 "<<cn100<<endl;
    if(cn500!=0)cout<<"500 "<<cn500<<endl;
    flag=true;
  }
  return 0;
}

Measured memory_bytes: 1164
import java.util.*;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt(), B = sc.nextInt();
    int now  = 1, ans = 0;
    while (now < B) {
      now += A - 1;
      ans++;
    }
    System.out.println(ans);
  }
}

Measured memory_bytes: 22740
#include <map>
#include <algorithm>
#include <cstdio>
using namespace std;

int main(){
	map<long long,int>m={{0,-1}};
	long long s=0,x;
	int N,r=0;
	scanf("%d",&N);
	for(int i=0;i<N;i++){
		scanf("%lld",&x);
		s+=x;
		if(m.find(s)==m.end())m[s]=i;
		r=max(r,i-m[s]);
	}
	printf("%d\n",r);
}

Measured memory_bytes: 15156
function Main(input) {
	const row = input.split(" ");
	const X = parseInt(row[0], 10);
	const K = parseInt(row[1], 10);
	const D = parseInt(row[2], 10);
	const even = num => num % 2 === 0;
	const av_x = X < 0 ? X * -1 : X;
	const cnt = av_x / D;

	if(cnt >= K) {
		console.log(av_x - K * D);
	} else {
		if(even(K - Math.floor(cnt))){
			console.log(av_x - D * Math.floor(cnt));
		} else {
			console.log(D * (Math.floor(cnt) + 1) - av_x);
		}
	}
};

Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 29580
#include <iostream>
int main(void){
	using namespace std;
	int a,b;
	cin >> a >> b;
	int s;
	if(a > b){
		s += a;
		a --;
	} else{
		s += b;
		b--;
	}
	if(a > b){
		s += a;
		a --;
	} else{
		s += b;
		b--;
	}
	cout << s;
	return 0;
}


Measured memory_bytes: 256
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush
from bisect import bisect_left,bisect_right 
import sys,math,itertools,fractions,pprint
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n,k = inpl()
a = inpl()
for i,x in enumerate(a):
    if i < k:
        continue
    else:
        if x > a[i-k]:
            print('Yes')
        else:
            print('No')



Measured memory_bytes: 32960
#include <iostream>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <vector>
#include <algorithm>
#include <set>
#include <string>
#include <bitset>
#include <tuple>
#include <queue>
#include <map>
#include <cmath>
#include <iomanip>
using namespace std;
#define ll long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, k, n) for (int i = (int)(k); i <(int)(n); i++)
#define rrep(i, n) for (int i = (int)(n)-1; i >= 0; i--)
#define rREP(i,k,n) for (int i = (int)(n)-1; i >= k; i--)

using namespace std;

uint64_t popcnt(uint64_t n)
{
    uint64_t c = 0;
    c = (n & 0x5555555555555555) + ((n>>1) & 0x5555555555555555);
    c = (c & 0x3333333333333333) + ((c>>2) & 0x3333333333333333);
    c = (c & 0x0f0f0f0f0f0f0f0f) + ((c>>4) & 0x0f0f0f0f0f0f0f0f);
    c = (c & 0x00ff00ff00ff00ff) + ((c>>8) & 0x00ff00ff00ff00ff);
    c = (c & 0x0000ffff0000ffff) + ((c>>16) & 0x0000ffff0000ffff);
    c = (c & 0x00000000ffffffff) + ((c>>32) & 0x00000000ffffffff);
    return(c);
}
using vvpi = vector<vector<pair<int,int>>>;
bool check(int bit,int n,vvpi v){
    rep(i,n){
        if(((bit>>i)&1) == 0) continue;
        for(pair<int,int> o:v[i]){
            if(((bit>>o.first)&1) != o.second){
                return false;
            }
        }
    }
    return true;
}
int main(){
    int n;
    cin >> n;
    vvpi v(n);
    rep(i,n){
        int a;
        cin >> a;
        rep(j,a){
            int x1,x2;
            cin >> x1 >> x2;
            v[i].push_back(make_pair(x1-1,x2));
        }
    }
    int popc = 0;
    rep(bit,1<<n){
        if(check(bit,n,v)) {
            popc = max((int)popcnt(bit),popc);
        }
    }
    cout << popc << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
#define tablesize 60010
#include <math.h>

int main(void){
    int table[tablesize];
    for(int i=0;i<tablesize;i++){
        table[i]=1;
    }
    int k;
    table[0]=0;
    table[1]=0;
    for(int i=2;i<(int)sqrt(tablesize)+10;i++){
        if(table[i]==1){
            k=2;
            while(k*i<=tablesize){
                table[k*i]=0;
                k++;
            }
        }
    }

    int n;
    int small, big;
    while(cin>>n){
      for(int i=n-1;i>0;i--){
        if(table[i]==1){
          small=i;
          break;
        }
      }
      for(int i=n+1;i<tablesize;i++){
        if(table[i]==1){
          big=i;
          break;
        }
      }
      cout<<small<<" "<<big<<endl;
    }
    return 0;
}



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

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

Measured memory_bytes: 256
#include "iostream"
#include "algorithm"
#include "string"
using namespace std;

int main() {
	string str;
	cin >> str;
	int cntA = 0, cntB = 0;
	for (int i = 0; i < str.size(); i++) {
		if (i % 2) {
			if (str[i] != '0')cntA++;
			else cntB++;
		}
		else {
			if (str[i] != '0')cntB++;
			else cntA++;
		}
	}
	cout << min(cntA, cntB) << endl;
}

Measured memory_bytes: 512
#include<cstdio>
#include<algorithm>
using namespace std;
typedef pair<int,int>P;
P box[101];
int main(void)
{
	int n,num[101],i,a,b,c,d,j;
	scanf("%d",&n);
	for(i=1;i<=n;i++){
		box[i].first=0;
		box[i].second=i;
	}
	for(i=1;i<n;i++){
		for(j=i+1;j<=n;j++){
			scanf("%d %d %d %d",&a,&b,&c,&d);
			if(c>d){
				box[a].first+=3;
			}
			if(c<d){
				box[b].first+=3;
			}
			if(c==d){
				box[a].first++;
				box[b].first++;
			}
		}
	}
	sort(box+1,box+n+1);
	box[n+1].first=-1;
	for(i=n;i>=1;i--){
		if(box[i].first==box[i+1].first){
			num[box[i].second]=num[box[i+1].second];
		}
		else{
			num[box[i].second]=n-i+1;
		}
	}
	for(i=1;i<=n;i++){
		printf("%d\n",num[i]);
	}
	return 0;
}


Measured memory_bytes: 2732
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pli = pair<ll, int>;
template <typename T>
using Graph = vector<vector<T>>;
const int MOD = 1e9 + 7;

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

    int N, M;
    cin >> N >> M;

    vector<pair<pii, int>> idist(M);
    Graph<int> dist(N, vector<int>(N, 1e9));
    for (int i = 0; i < N; ++i)
        dist[i][i] = 0;
    for (int i = 0; i < M; ++i) {
        int a, b, c;
        cin >> a >> b >> c;
        a--, b--;
        dist[a][b] = dist[b][a] = c;
        idist[i] = {{a, b}, c};
    }

    for (int k = 0; k < N; ++k)
        for (int i = 0; i < N; ++i)
            for (int j = 0; j < N; ++j)
                dist[i][j] = min(dist[i][k] + dist[k][j], dist[i][j]);

    int ans = 0;
    for (int i = 0; i < M; ++i) {
        int a = idist[i].first.first;
        int b = idist[i].first.second;
        int c = idist[i].second;
        if (dist[a][b] < c)
            ans++;
    }

    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <utility>
#include <vector>
#include <string>
#include <map>

using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
#define REP(i, n) for (int i = 0; i < (n); i++)
#define RREP(i, n) for (int i = (n) - 1; i >= 0; i--)
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (a); i > (b); i--)
#define ALL(a) (a).begin(), (a).end()

int H, W, D, A[300][300];
int Q, L, R;
map<int, pii> A_i;
int c_sum[300 * 300 + 1];

int main() {
    cin >> H >> W >> D;
    REP(i, H) REP(j, W) {
        cin >> A[i][j];
        A_i[A[i][j]] = {i, j};
    }

    FOR(j, 1, H * W - D + 1) {
        int cur_x = A_i[j + D].first, cur_y = A_i[j + D].second;
        int pri_x = A_i[j].first,     pri_y = A_i[j].second;
        int cost = abs(cur_x - pri_x) + abs(cur_y - pri_y);
        c_sum[j + D] = c_sum[j] + cost;
    }

    cin >> Q;
    REP(i, Q) {
        cin >> L >> R;
        cout << c_sum[R] - c_sum[L] << endl;
    }
    return 0;
}

Measured memory_bytes: 7424
#include<bits/stdc++.h>
using namespace std;
int main(){
int K;string S;
  cin>>K>>S;
  int N=S.size();
  if(N<=K)
    cout<<S<<endl;
  else{
  string s=S.substr(0,K);
    cout<<s<<"..."<<endl;
  
  }
   return 0;
}

Measured memory_bytes: 3592
def I(): return int(input())
def MI(): return map(int, input().split())
def LI(): return list(map(int, input().split()))

def main():
    mod=10**9+7
    O=input()
    E=input()
    ans=["a"]*100
    NO=len(O)
    NE=len(E)
    for i in range(NO):
        ans[i*2]=O[i]
    for i in range(NE):
        ans[i*2+1]=E[i]
        
    print(''.join(map(str, ans[:NO+NE])))

main()


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

#define F first    
#define S second
#define mp make_pair
#define pii pair<int,int>         
// mikty prikoldar
#define ll long long  
#define pb push_back
#define sz(a) (int)(a.size())
#define Accepted 0
#define endl '\n'
//everything goes according to the plan
#define y1 		 NOT
#define left   NEEDED
#define right  THINGS  
//countdown BEGAN. 10 , 9 , 8 ...
const int Mod = (int)1e9 + 7;
const int MX = 1073741822;
const ll MXLL = 9223372036854775807;
const int Sz = 1110111;
// ai dyn dyn dyn dirindai ai dyn dyn dirindai
using namespace std;
// skr skr skr v chernih naikah
inline void Read_rap () {	// smoke weed everyday
  ios_base :: sync_with_stdio(0);
	cin.tie(0);      
}                          
ll a[4];
                  
ll ans = MXLL;
int main() 
{
	Read_rap ();
	cin >> a[1] >> a[2] >> a[3];
	
	if (a[1] & 1 && a[2] & 1 && a[3] & 1)
		cout << min ( min (a[1]*a[2], a[2]*a[3]), a[1]*a[3]);
			else
				cout << 0;	
	return Accepted;
}	









// Coded by Z...

Measured memory_bytes: 256
H, W = map(int, input().split())
A = [input() for _ in range(H)]

ans = "Possible"
now = 0
for i in range(H):
    nxt = now
    for j in range(W):
        if j < now and A[i][j] == '#':
            ans = "Impossible"
        elif j == now:
            if A[i][j] == '.':
                ans = "Impossible"
        else:
            if j == nxt+1 and A[i][j] == '#':
                nxt = j
            elif A[i][j] == '#':
                ans = "Impossible"
    now = nxt

print(ans)


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

class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = Integer.parseInt(sc.next());
    int[] h = new int[N];
    for (int i = 0; i < N; i++) {
      h[i] = Integer.parseInt(sc.next());
    }
    
    int count = 0;
    int sum = 0;
    boolean flag = false;
    while (true) {
      for (int i = 0; i < N; i++) {
        if (h[i] != 0) {
          if (i == 0) {
            count++;
            flag = false;
          } else if (h[i-1] == 0 && flag) {
            count++;
            flag = false;
          }
          h[i]--;
        } else {
          flag = true;
        }
      }
      if (count == 0) {
        System.out.println(sum);
        return;
      }
      sum += count;
      count = 0;
    }
  }
}

Measured memory_bytes: 22612
//(最長共通部分列)
#include <stdio.h>
#include <string.h>

#define N 1000

/*typedef struct{
  struct Node begin, end;
}Node;

int size(char D){
  Node N;
  if(N.begin>N.end) return N.begin-N.end;
  else return N.end-N.begin;
  }*/

//static const int N=1000;

int max(int a, int b){
  if(a<b) return b;
  else return a;
}

int lcs(char *X, char *Y){
  int i, j, c[N+1][N+1], m=strlen(X), n=strlen(Y), maxl=0;
  //X = ' '+X;
  //Y = ' '+Y;
  for(i=0; i<=m; i++) c[i][0]=0;
  for(j=1; j<=n; j++) c[0][j]=0;
  for(i=1; i<=m; i++){
    for(j=1; j<=n; j++){
      if(X[i-1]==Y[j-1]) c[i][j]=c[i-1][j-1]+1;
      else c[i][j]=max(c[i-1][j], c[i][j-1]);
      maxl = max(maxl, c[i][j]);
    }
  }
  return maxl;
}

int main(){
  int n, i;
  char s1[N], s2[N];

  scanf("%d", &n);

  for(i=0; i<n; i++){
    scanf("%s%s", s1, s2);
    printf("%d\n", lcs(s1, s2));
  }

  return 0;
}



Measured memory_bytes: 5616