akhauriyash/Code-Regression huggingface dataset:
#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);
}

void rek(int i) {
  
}

const int N = 2e5+23;

int a[N];

void solve() {
  int n; scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%d", a+i);
  vector<int> b;
  for (int i = n; i >= 1; --i) {
    if (!a[i]) continue;
    b.push_back(i);
    for (int j = 1; j*j <= i; ++j) {
      if (i%j) continue;
      a[j] = !a[j];
      if (i/j == j) continue;
      a[i/j] = !a[i/j];
    }
  }
  printf("%d\n", b.size());
  for (int e: b) printf("%d ", e);
}

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


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

#define rep( i, n, m ) for(int i = ( n ); i < ( m ); i++)
#define rep_d( i, n, m ) for(int i = ( n ) - 1; i >= ( m ); i--)
#define sort_asc( X ) sort(( X ).begin(), ( X ).end())
#define sort_desc( X ) sort(( X ).begin(), ( X ).end(), greater <>())
#define endl "\n"

template <class T> bool chmax( T& a, T b );
template <class T> bool chmin( T& a, T b );
int* eratosthenes( int N );
bool bit_search( int pattern, int N );
void initialize( void );

const ll INF = 1LL << 60;
const int k_mod = 1e9 + 7;
template <typename T, typename K> struct P {
	T a; K b;
};
typedef struct {
	vector <int> to;
	int cost;
} edge;

int main( void ){
	// initialize();
	int N;
	cin >> N;
    ll sum = 0, prev;
    cin >> prev;
    rep(i,1,N){
        int now; cin >> now;
        if (prev > now){
            sum += prev-now;
        }
        else
            prev = now;
    }
    cout << sum << endl;
}

template <class T> bool chmax( T& a, T b ) {
	if (a < b){
		a = b; return true;
	}
	return false;
}
template <class T> bool chmin( T& a, T b ) {
	if (a > b){
		a = b; return true;
	}
	return false;
}
int* eratosthenes( int N ){
	int* prime_array = new int[ N + 1 ];
	int lim = N;
	prime_array[ 0 ] = 0;
	prime_array[ 1 ] = 0;
	rep( i, 2, N + 1 ){
		prime_array[ i ] = 1;
	}
	rep( i, 2, lim ){
		if (prime_array[ i ] == 0)
			continue;
		lim = N / i;
		for(int j = i * 2; j < N + 1; j += i){
			prime_array[ j ] = 0;
		}
	}
	return prime_array;
}
bool bit_search( int pattern, int N ){
	int cnt = 0;
	rep( bit, 0, N ){
		if (pattern & ( 1 << bit )){
			cnt++;
		}
	}
	return true;
}
void initialize( void ){
	cout << fixed << setprecision( 10 );
}


Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int N,Y,ans[3] = {-1,-1,-1};
    cin >> N >> Y;
    bool ok = false;
    for(int ten=0;ten<=N;ten++) {
        for(int five=0;five<=N-ten;five++) {
            int rem = N - ten - five;
            if(ten*10000 + five*5000 + rem*1000 == Y) {
                ok = true;
                ans[0] = ten; ans[1] = five; ans[2] = rem;
                break;
            }
        }
    }
    if(ok)
        cout << ans[0] <<" "<<ans[1]<<" "<<ans[2];
    else
        cout << ans[0] <<" "<<ans[1] <<" "<<ans[2];
    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#include <cmath>
#include <utility>
#include <iostream>
#include <algorithm>
#include <vector>
#include <forward_list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#define rep(i, s, g) for ((i) = (s); (i) < (g); ++(i))
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const ll MOD = 1e9 + 7;
const ll INF = (1e18) + 1;

int main(void)
{
    ll n, k;
    vector<ll> a, f;
    int i;
    ll asum = 0;
    ll x;
    ll ok, ng;

    cin >> n >> k;

    a.resize(n);
    f.resize(n);

    rep(i, 0, n)
    {
        cin >> a[i];
    }
    
    rep(i, 0, n)
    {
        cin >> f[i];
    }

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

    ok = INF, ng = -1;

    while (ok - ng > 1)
    {
        ll mid = (ok + ng) / 2;
        x = 0;

        rep(i, 0, n)
        {
            if (mid < a[i] * f[i])
            {
                x += max(0ll, a[i] - mid / f[i]);
            }
        }

        if (x <= k)
        {
            ok = mid;
        }
        else
        {
            ng = mid;
        }
    }

    cout << ok << endl;
}

Measured memory_bytes: 3456
#include<iostream>
#include<algorithm>
using namespace std;
int main()
{
    int n;
    cin >> n;

    int max;
    int min;

    for (int i = 0; i < n;i++){
        int x;
        cin >> x;
        if (i == 0)
        {
            max = x;
            min = x;
        }else{
            max = std::max(x, max);
            min = std::min(x, min);
        }
    }

    cout << max - min << endl;
}

Measured memory_bytes: 256
//agc011_b.cpp
//Tue Jul 30 20:28:45 2019

#include <iostream>
#include <string>
#include <queue>
#include <map>
#include <unordered_map>
#include <vector>
#include <algorithm>
#include <math.h>
#include <set>
#define INTINF 2147483647
#define LLINF 9223372036854775807
using namespace std;
using ll=long long;
typedef pair<int,int> P;

int main(){
	int n;
	cin >> n;

	vector<ll> a;
	for (int i=0;i<n;i++){
		ll temp;
		cin >> temp;
		a.push_back(temp);
	}

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

	vector<ll> ruiseki;
	ruiseki.push_back(a[0]);
	for (int i=1;i<n;i++){
		ruiseki.push_back(ruiseki[i-1]+a[i]);
	}

	ll ans = 1;
	for (int i=n-2;i>=0;i--){
		if (ruiseki[i]*2>=a[i+1]){
			ans++;
		}else {
			break;
		}
	}

	cout << ans << endl;
//	printf("%.4f\n",ans);
}

Measured memory_bytes: 2548
using System;
class aizu{
    public static int Main(){
        int i,m;
        long sum,max,min;
        int[] n = new int[10000];
        string[] str = new string[10000];
        str = Console.ReadLine().Split(' ');
        m = int.Parse(str[0]);
        str = Console.ReadLine().Split(' ');
        n[0] = int.Parse(str[0]); min=n[0]; max=n[0]; sum=n[0];
        for(i=1;i<m;i++){
            n[i] = int.Parse(str[i]);
            sum += n[i];
            if(n[i]>max) max=n[i];
            if(min>n[i]) min=n[i];
        } 
        Console.WriteLine("{0} {1} {2}",min,max,sum);          
        return 0;
    }  
}

Measured memory_bytes: 9788
#include<bits/stdc++.h>
#define maxn 3005
#define Mod 1000000007ll
#define Val(x) (((long long)x) % Mod)
using namespace std;
struct op {
	int l,r;
};
int sum[maxn],C[maxn][maxn];
int dp[maxn][maxn];
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n,m;
	cin >> n >> m;
	string s;
	cin >> s;
	vector<op> ops;
	for(int i=0,l,r;i<m;i++) {
		cin >> l >> r;
		if(!ops.empty() && ops.back().r >= r)	continue;
		if(!ops.empty() && ops.back().l == l)	ops.pop_back();
		ops.emplace_back(op{l,r});
	}
		
	reverse(s.begin(),s.end());
	s += "0";
	reverse(s.begin(),s.end());
	for(int i=1;i<=n;i++)
		sum[i] = sum[i-1] + s[i] - '0';
		
	C[1][0] = C[1][1] = 1;
	for(int i=2;i<=n;i++) {
		C[i][0] = C[i][i] = 1;
		for(int j=1;j<i;j++)
			C[i][j] = Val(C[i-1][j] + C[i-1][j-1]);
	}
	
	m = (int)ops.size();
	dp[ops.front().l-1][sum[ops.front().l-1]] = 1;
	for(int i=0;i<m-1;i++) {
		int l = ops[i].l , r = ops[i].r;
		int nxt_l = ops[i+1].l;
		if(r <= nxt_l - 1) {
			for(int j=0;j<=l-1;j++) {
				if(dp[l-1][j] == 0)		continue;
				int rem = sum[r] - j;
				dp[nxt_l-1][sum[nxt_l-1]] = Val(dp[l-1][j] * C[r-l+1][rem] + dp[nxt_l-1][sum[nxt_l-1]]);
			}
		}
		else {
			for(int j=0;j<=l-1;j++) {
				if(dp[l-1][j] == 0)		continue;
				int rem = sum[r] - j;
				int len = nxt_l-1 - l + 1, num = min(len,rem);
				for(int k=0;k<=num;k++)
					if(rem - k <= r - nxt_l + 1)	// won't remain too many '1' in [nxt_l,r]
						dp[nxt_l-1][j+k] = Val(dp[l-1][j] * C[len][k] + dp[nxt_l-1][j+k]);
			}
		}
	}
	
	int ans = 0;
	for(int i=0;i<=n;i++)
		if(dp[ops.back().l-1][i] != 0)
			ans = Val(dp[ops.back().l-1][i] * C[ops.back().r-ops.back().l+1][sum[ops.back().r]-i] + ans);
	
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 69120
//ProblemC

#ifdef _MYPC
#include "mypc.h"
#endif // _MYPC

#include <iostream>
#include <string>
#include <vector>
#include <bitset>
#include <list>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <algorithm>
#include <numeric>
#include <functional>
#include <memory>
#include <complex>
#include <cstdio>
#include <cstring>
#include <cmath>

using namespace std;

//ProblemC

#define MAXN 50
#define MAXP 50

class Solve {
private:

	bool can(int a[], int b[], bool used[], int n) {
		bool path[MAXP + 1][MAXP + 1]{};
		for (int i = 1; i <= MAXP; i++) {
			for (int j = 1; j < MAXP; j++) {
				if (used[j]) {
					path[i][i % j] = true;
				}
			}
		}
		for (int i = 0; i <= MAXP; i++) {
			path[i][i] = true;
		}

		for (int k = 0; k <= MAXP; k++)
			for (int i = 0; i <= MAXP; i++)
				for (int j = 0; j <= MAXP; j++) {
					path[i][j] = path[i][j] || path[i][k] && path[k][j];
				}

		for (int i = 0; i < n; i++) {
			if (!path[a[i]][b[i]]) {
				return false;
			}
		}
		return true;
	}

	void solve() {
		int n;
		int a[MAXN], b[MAXN];

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

		bool must[MAXP]{};
		for (int i = 1; i < MAXP; i++) must[i] = true;

		if (!can(a, b, must, n)) {
			cout << -1 << endl;
			return;
		}

		for (int i = MAXP - 1; i >= 1; i--) {
			must[i] = false;
			if (!can(a, b, must, n)) {
				must[i] = true;
			}
		}

		long long rst = 0;
		for (int i = 1; i < MAXP; i++) if(must[i]) rst += 1LL << i;
		cout << rst << endl;

	}

public:
	Solve() { solve(); }
};

int main(int argc, char* argv[]) {
	unique_ptr<Solve> solve = make_unique<Solve>();
	return 0;
}


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

int main() {
  int a, b;
  cin >> a >> b;

  int tap = 1;
  int ans = 0;
  while (tap < b) {
    ans++;
    tap += a - 1;
  }
  cout << ans << endl;
  return 0;
}


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

using namespace std;

int a[111];

int main() {
    int n;
    cin >> n;
    string s;
    cin >> s;
    int k = 1;
    for (int i = 1; i < n; i++) {
        if (s[i] != s[i - 1]) {
            k++;
        }
    }
    cout << k << endl;
}


Measured memory_bytes: 512
import sys
N,M = map(int, input().strip().split(' '))
broken = set(int(line.strip()) for line in sys.stdin) if M > 0 else set()
p = [0]*(N+2)
p[0] = 1
for i in range(N):
  # 今i段目にいる
  if i in broken:
    continue
  p[i+1] += p[i]
  p[i+2] += p[i]
print(p[N]%1000000007)

Measured memory_bytes: 462708
/*
LANG:C++
PROB:

*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <functional>
#include <iostream>
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for (int i = 0; i < (int)(n); ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)


using namespace __gnu_pbds;
using namespace std;


typedef tree<int, null_type, less<int>, rb_tree_tag,
            tree_order_statistics_node_update>
    ordered_set;

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpi;
typedef vector<vi> vvi;
typedef long long i64;
typedef vector<i64> vi64;
typedef vector<vi64> vvi64;
typedef pair<i64, i64> pi64;
typedef double ld;
typedef unsigned long long ui64;

template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }
const int mod=1000000007;
  i64 poww(i64 a, i64 b)
  {
    a%=mod;
    i64 res=1;
    while(b)
      {
if(b&1)res=res*a%mod;

      a=a*a%mod;
      b/=2;

      }
      return res;
  }
  i64 inv(i64 a)
  {
    return poww(a,mod-2);
  }


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

    // ifstream fin(".in");
    // ofstream fout(".in");

i64 sum=0,n,q;
cin>>n;
map<int,int>mp;
forn(i,n)
{
  int x;
  cin>>x;
  mp[x]++;
  sum+=x;
}
// cout<<sum<<"\n";
  cin>>q;
  while(q--)
  {
    int a,b;
    cin>>a>>b;

    sum-=1LL*mp[a]*a;
    sum+=1LL*mp[a]*b;
    mp[b]+=mp[a];
    mp[a]=0;

    cout<<sum<<"\n";

  }



    return 0;
  }


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

int main()
{
string s;
cin>>s;
int i,c,n,t,k=0,l;
string s1;

n=s.size();
s1.resize(n);
c=(n-1)/2;
t=c-1;
for(i=0;i<c;i++)
{
	s1[i]=s[t];
	t--;	
}
for(i=0;i<c;i++)
{
	if(s1[i]!=s[i])
		{
			k=1;
			break;
		}
}

l=(n+3)/2;
t=0;
for(i=l-1;i<s.size();i++)
{
	s1[t]=s[i];
	t++;	
}
t=0;
for(i=l-1;i<s.size();i++)
{
	if(s1[t]!=s[i])
		{
			k=1;
			break;
		}
	
	t++;	
}
string ss;
ss=s;
reverse(ss.begin(),ss.end());
if(ss!=s)
k=1;

if(k)
cout<<"No";
else
cout<<"Yes";
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-
import heapq
N,K=map(int,input().split())
H=list(map(lambda x: int(x)*(-1), input().split()))
heapq.heapify(H)
ans=0
if K>=N:
    ans=0
else:
    for i in range(K):
        a=heapq.heappop(H)
    ans=-1*sum(H)
print(ans)

Measured memory_bytes: 25896
/*    *** Bismillahir Rahmanir Rahim***
          *A S M Masud Parvez*
             *18ICTCSE035*
           *SHIICT(BSMRSTU)*
*/
#include<bits/stdc++.h>
using namespace std;
#define MP ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define      for0(i,n) for(int i=0;i<n;i++)
#define      for1(i,n) for(int i=1;i<n;i++)
#define      forn(i,n) for(int i=1;i<=n;i++)
#define      fors(i,s) for(int i=0;i<s.size();i++)
#define      nl   "\n"
#define      End  return 0
#define      gt   greater<int>()
#define      ll   long long int
#define      mp   make_pair
#define      pb   push_back
#define      vi   vector<int>
#define      vl   vector<ll>
#define      mod  1000000007
#define      ull  unsigned long long int
int          Max = INT_MIN,Min = INT_MAX;
#define      sp(n) fixed<<setprecision(n)
#define      pi acos(-1)
int main()
{
MP;

int n,m;
cin>>n;
string s;
cin>>s;
m=s.size();
if(m<=n)
{
  fors(i,s){
    cout<<s[i];
  }
}
else
{
  for(int i=0;i<n;i++){
    cout<<s[i];
  }
  cout<<"...";
}


End;
}


Measured memory_bytes: 3652
def dfs(v, p, a):
    global ans
    # print(v, p, a, ans)
    # print(pre)
    # print(low)
    if pre[v] != -1:
        low[a] = min(low[a], low[v])
        return low[a]
    pre[v] = p
    low[v] = p
    for u in links[v]:
        if u == a:
            continue
        low[v] = min(low[v], dfs(u, p + 1, v))
    if pre[v] == low[v]:
        ans += 1
    return low[v]


n, m = map(int, input().split())
links = [set() for _ in range(n)]

for _ in range(m):
    a, b = map(int, input().split())
    a -= 1
    b -= 1
    links[a].add(b)
    links[b].add(a)

ans = 0
pre = [-1] * n
low = [-1] * n
dfs(0, 0, None)
print(ans - 1)


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define R cin>>
#define ll long long
#define ln cout<<'\n'
#define in(a) insert(a)
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define all(c) (c).begin(),(c).end()
#define iter(c) __typeof((c).begin())
#define rrep(i,n) for(ll i=(ll)(n)-1;i>=0;i--)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define tr(it,c) for(iter(c) it=(c).begin();it!=(c).end();it++)
ll check(ll n,ll m,ll x,ll y){return x>=0&&x<n&&y>=0&&y<m;}void pr(){ln;}
template<class A,class...B>void pr(const A &a,const B&...b){cout<<a<<(sizeof...(b)?" ":"");pr(b...);}
template<class A>void PR(A a,ll n){rep(i,n)cout<<(i?" ":"")<<a[i];ln;}
const ll MAX=1e9+7,MAXL=1LL<<61,dx[8]={-1,0,1,0,-1,-1,1,1},dy[8]={0,1,0,-1,-1,1,1,-1};
typedef pair<ll,ll> P;

void Main() {
  ll a[5];
  rep(i,5) R a[i];
  rep(i,5) {
    if(a[i]==0) {
      pr(i+1);
      return;
    }
  }
}

int main(){ios::sync_with_stdio(0);cin.tie(0);Main();return 0;}


Measured memory_bytes: 3660
#include <iostream>
#include <cstdio>
#include <complex>
#include <vector>
#define EPS 1e-10
#define EQ(a, b) (abs((a) - (b)))
using namespace std;

typedef complex<double> P;
double cross(P a, P b) {
    return(a.real() * b.imag() - a.imag() * b.real());
}

int main(void) {
    int num; cin >> num;
    
    for(int r = 0; r < num; r++) {
        vector<P> vec;
        for(int c = 0; c < 3; c++) {
            double x, y; cin >> x >> y;
            vec.push_back(P(x, y));
        }
        //中点
        P mid1((vec[0] + vec[1]) / 2.0), mid2((vec[1] + vec[2]) / 2.0);
        //法線ベクトル
        //cout << mid1  << " " << mid2 << endl;
        P cross1((vec[0] - vec[1]) * P(0, 1)), cross2((vec[1] - vec[2]) * P(0, 1));
        //cout << cross1  << " " << cross2 << endl;
        //交点
        P ans(mid1 + cross1 * cross(cross2, (mid2 - mid1)) / cross(cross2, cross1));
        double half_r = abs(ans - vec[0]);
        printf("%.3f %.3f %.3f\n", ans.real(), ans.imag(), half_r);
    }
    return(0);
}

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

int main() {
 
  string s1, s2, s3;
  cin >> s1 >> s2 >> s3;
  
  cout << char(s1[0] - 32) << char(s2[0] - 32) << char(s3[0] - 32) << endl;

}

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

int main(void) {
  int k, n;
  cin >> k >> n;
  vector<int> dist(n);
  rep(i, n)
    cin >> dist.at(i);
  
  int max_dist = 0;
  rep(i, n - 1) {
    if (max_dist < dist.at(i + 1) - dist.at(i))
      max_dist = dist.at(i + 1) - dist.at(i);
  }
  if (max_dist < (k - dist.at(n - 1)) + dist.at(0))
    max_dist = (k - dist.at(n - 1)) + dist.at(0);
  
  cout << k - max_dist << endl;
  
  return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
#define int long long
int ncm(int n,int m){
  int ans=1;
  for(int i=1;i<=m;i++,n--){
    ans*=n;
    ans/=i;
  }
  return ans;
}
signed main(){
  int l,k,ans=0;
  cin>>l>>k;
  int h=l-1;
  for(int i=0;i<l;i++){
    if(i*2>h)break;
    for(int j=0;j<l;j++){
      if(i*2+j*(k+1)<=h)ans+=ncm(i+j,j);//,cout<<i<<" "<<j<<endl;
      else break;
    }
  }
  h=l-k;
  for(int i=0;i<l;i++){
    if(i*2>h)break;
    for(int j=0;j<l;j++){
      if(i*2+j*(k+1)<=h)ans+=ncm(i+j,j);//,cout<<i<<" "<<j<<endl;
      else break;
    }
  }
  cout<<ans<<endl;
  return 0;
}

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

#define int long long
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define REPS(i, n) for (int i = 1, i##_len = (n); i <= i##_len; ++i)
#define FOR(i, a, b) for (int i = (a), i##_len = (b); i <= i##_len; ++i)
#define REV(i, a, b) for (int i = (a); i >= (b); --i)
#define CLR(a, b) memset((a), (b), sizeof(a))
#define DUMP(x) cout << #x << " = " << (x) << endl;
#define INF 1001001001001001001ll
#define fcout cout << fixed << setprecision(10)

using namespace std;

typedef pair<int, int> P;

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

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

    int A, B, K;
    cin >> A >> B >> K;

    int cnt = 0;
    REV(i, max(A, B), 1) {
        if (A % i == 0 && B % i == 0) {
           cnt++;
           if (cnt == K) {
               cout << i << endl;
               break;
           }
        }
    }
    return 0;
}


Measured memory_bytes: 256
/*
    24.03.2019 15:03:21
*/

#include <bits/stdc++.h>

using namespace std;

#ifdef HOME
#define TAG_LENGTH 45
#define LR_LEFT left
#define LR_RIGHT right
#define LR_VALUE value
#define LR_SECOND_VALUE mn
#include "C:/C++ libs/print.cpp"
#define showl cout << endl;
#define shows cout << string(5, ' ') + string(TAG_LENGTH, '-') << endl;
#else
#define show(...) 42;
#define showt(...) 42;
#define showl 42;
#define shows 42;
#define print(...) 42;
#define printTree(...) 42;
#define printLRTree(...) 42;
#define printMatrix(...) 42;
#endif

int main() {
    string s;
    cin >> s;
    int i1 = 0, i2 = 0;
    s = s + " ";
    for (auto& c : s) {
        if (c == 'A' || c == 'C' || c == 'G' || c == 'T') c = '0';
    }
    int mx = 0;
    while (i1 < s.size()) {
        while (i1 < s.size() && s[i1] != '0')
            ++i1;
        i2 = i1;
        while (i2 < s.size() && s[i2] == '0')
            ++i2;
        mx = max(mx, i2 - i1);
        i1 = i2;
    }
    cout << mx << '\n';
    return 0;
}


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

int main(){
  int n, m;
  ll k;
  cin >> n >> m >> k;
  vector<ll> a(n+1), b(m+1);
  a[0] = 0;
  b[0] = 0;
  rep(i,n){
    ll t;
    cin >> t;
    a[i+1] = t + a[i];
  }
  rep(i,m){
    ll t;
    cin >> t;
    b[i+1] = t + b[i];
  }

  int cnt = 0;
  int j = m;
  rep(i,n+1){
    if(a[i] > k) break;
    ll l = k - a[i];
    while(j > 0 && b[j] > l){
      j--;
    }
    cnt = max(cnt,i+j);
  }

  cout << cnt << endl;

  return 0;
}


Measured memory_bytes: 6428
#include "bits/stdc++.h"
#include <regex>
#define _USE_MATH_DEFINES
#include <math.h>

using namespace std;

#ifndef _DEBUG
#define main_ main
#endif
#define FOR(i,s,e) for (int i = int(s); i != int(e); i++)
#define INF (INT_MAX/2)
#define EPS (1.0e-8)
#define LINF (LONG_MAX/2)

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

template <typename T>
using keyVal = pair<string, T>;
template<typename T>
bool val_greater(const keyVal<T>& left, const keyVal<T>& right) {
	return left.second > right.second;
}

void init_global() {}

int main_() {
	ll A, B, X;
	cin >> A >> B >> X;

	ll nb = B / X + 1;
	ll na_1 = A == 0 ? 0 : (A - 1) / X + 1;

	ll ans = nb - na_1;

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


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

signed main(){
	int q;
	multimap<string,int>m;
	cin>>q;
	while(q--){
		int t,y;
		string x;
		cin>>t;
		if(t==0){
			cin>>x>>y;
			m.insert(make_pair(x,y));
		}
		if(t==1){
			string l;
			cin>>l;
			map<string,int>::iterator end,it;
			it=m.lower_bound(l);
			end=m.upper_bound(l);
			for(;it!=end;it++){
				cout<<(*it).second<<endl;
			}
		}
		if(t==2){
			cin>>x;
			m.erase(x);
		}
		if(t==3){
			string l,r;
			cin>>l>>r;
			map<string,int>::iterator end,it;
			it=m.lower_bound(l);
			end=m.upper_bound(r);
			for(;it!=end;it++){
				cout<<(*it).first<<' '<<(*it).second<<endl;
			}
		}
	}
}


Measured memory_bytes: 24852
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <cmath>
#include <tuple>
#include <cstdio>
#include <bitset>
#include <sstream>
#include <iterator>
#include <numeric>
#include <map>
#include <cstring>
#include <set>

using namespace std;

//#define DEBUG_ //!!提出時にコメントアウト!!
#ifdef DEBUG_
	#define dump(x)  cerr << #x << " = " << (x) << endl;
#else
	#define dump(x)  ; //何もしない文
#endif

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define SZ(x) ((int)(x).size()) //unsignedのサイズをint型に変換
#define pb push_back
#define eb emplace_back

//#define int long long

typedef long long LL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;

template <typename T>
std::string printVector(const std::vector<T> &data)
{
    std::stringstream ss;
    std::ostream_iterator<T> out_it(ss, ", ");
    ss << "[";
    std::copy(data.begin(), data.end() - 1, out_it);
    ss << data.back() << "]";
    return ss.str();
}

const int MOD = 1e9+7;
const LL LINF = 1001002003004005006ll;
const int INF = 1001001001;

signed main(int argc, char const *argv[])
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int R,G,B,N; cin >> R>>G>>B>>N;

    LL ans = 0;
    for(int i = 0; i <= N / R; i++){
        for(int j = 0; j <= N / G; j++){
            if((N-R*i-G*j)% B != 0) continue;
            int tmp = (N-R*i-G*j)/ B;
            if(0 <= tmp) {
                dump(i)
                dump(j)
                dump(tmp)
                ans++;

            }
        }
    }
    cout << ans << endl;

}

Measured memory_bytes: 256
import math
N_MAX = 1 ** 15
letters=list("abcdefghijklmnopqrstuvwxyz")
A_TO_Z = len(letters)
N = int(input())

temp = N
cnt = 1
while temp - A_TO_Z ** cnt > 0:
  temp -= A_TO_Z ** cnt
  cnt += 1
r = [0] * cnt
  
q = temp - 1
while q > 0:
  r[cnt-1] = q % A_TO_Z
  cnt -= 1
  q = q // A_TO_Z
for i in r:
  print(letters[i],end="")


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

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define each(x, y) for (auto &x : y)
#define all(a) (a).begin(), (a).end()
#define bit(b) (1ll << (b))
#define uniq(v) (v).erase(unique(all(v)), (v).end())
#define rsort(v) sort(all(v)); reverse(all(v))

using namespace std;

using i32 = int;
using i64 = long long;
using f80 = long double;
using vi32 = vector<i32>;
using vi64 = vector<i64>;
using vf80 = vector<f80>;
using vstr = vector<string>;

inline void yes() { cout << "Yes" << '\n'; exit(0); }
inline void no() { cout << "No" << '\n'; exit(0); }
inline i64 gcd(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); if (a % b == 0) return b; return gcd(b, a % b); }
inline i64 lcm(i64 a, i64 b) { return a / gcd(a, b) * b; }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }
template<typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template<typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template<typename T> inline void amax(T &x, T y) { if (x < y) x = y; }
template<typename T> inline void amin(T &x, T y) { if (x > y) x = y; }
template<typename T> inline T power(T x, i64 n) { T r = 1; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template<typename T> istream& operator>>(istream &is, vector<T> &v) { for (auto &x : v) is >> x; return is; }
template<typename T> ostream& operator<<(ostream &os, const vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }

void solve() {
  i64 X, Y; cin >> X >> Y;
  if (abs(X - Y) <= 1) cout << "Brown" << '\n'; else cout << "Alice" << '\n';
}


Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            int[,] bingo = new int[3, 3]; 
            for (var i = 0; 3 > i; i++)
            {
                var line = Console.ReadLine().Split(' ');
                for (var j = 0; 3 > j; j++) bingo[i, j] = int.Parse(line[j]);
            }

            var n = int.Parse(Console.ReadLine());
            for (var h = 0; n > h; h++)
            {
                var num = int.Parse(Console.ReadLine());
                for (var i = 0; 3 > i; i++)
                    for (var j = 0; 3 > j; j++)
                        if (bingo[i, j] == num)
                            bingo[i, j] = 0;
            }

            var call1 = 0;
            var call2 = 0;
            var call3 = 0;
            var c1 = 0;
            var c2 = 0;
            var c3 = 0;
            for (var i = 0; 3 > i; i++)
                for (var j = 0; 3 > j; j++)
                {
                    if (i == 0) call1+=bingo[i, j];
                    else if (i == 1) call2+=bingo[i, j];
                    else if (i == 2) call3+=bingo[i, j];
                    if (j == 0) c1 += bingo[i, j];
                    else if (j == 1) c2 += bingo[i, j];
                    else if (j == 2) c3 += bingo[i, j];
                }
            if (bingo[0, 0] + bingo[1, 1] + bingo[2, 2] == 0 || bingo[0,2] + bingo[1,1] + bingo[2, 0] == 0 || c1 == 0 || c2 == 0 || c3 == 0 || call1 == 0 || call2 == 0|| call3 == 0)
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }
        }
    }
}


Measured memory_bytes: 11092
stack = []

for x in input().split():
    try:
        t = int(x)
        stack.append(t)
    except:
        a = stack.pop()
        b = stack.pop()
        if x == '+':
            stack.append(a+b)
        elif x == '-':
            stack.append(b-a)
        else:
            stack.append(a*b)

print(stack[0])


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

using namespace std;

const int mod = 1e9+7, nax = 1e5+7;
int steps[nax], a[nax];
int main(){
 int N, M;
 cin >> N >> M;
 for(int i=0; i<M; ++i){
    int x; cin >> x;
    a[x] = 1;
 }
 steps[0] = 1;
 for(int i=1; i<=N; ++i){
    steps[i] = (steps[i-1] + steps[i-2])%mod;
    if(a[i])
      steps[i] = 0;
 }
 //for(int i=1; i<=N; ++i)
   //cout << "i: " << i << " steps[i]: " << steps[i] << "\n";
 cout << steps[N] << "\n";
 return 0; 
}


Measured memory_bytes: 1024
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <cassert>
#include <cfloat>
#include <complex>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define rep(i, n) for (ll i = 0; i < (n); ++i)
#define Sort(v) sort(v.begin(), v.end())
#define Reverse(v) reverse(v.begin(), v.end())
#define Lower_bound(v, x) \
  distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) \
  distance(v.begin(), upper_bound(v.begin(), v.end(), x))

using ll = long long;
using ull = unsigned long long;
using P = pair<ll, ll>;
using T = tuple<ll, ll, ll>;
using vll = vector<ll>;
using vP = vector<P>;
using vT = vector<T>;
using vvll = vector<vector<ll>>;
using vvP = vector<vector<P>>;
using dqll = deque<ll>;

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

const ll INF = 1LL << 50;

const ll mod = 1e9 + 7;

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

  ll n = s.size();
  ll ans = 0;
  for (ll i = 0; i < n; i++) {
    for (ll j = i; j < n; j++) {
      ll res = j - i + 1;
      for (ll k = i; k <= j; k++) {
        if (s[k] != 'A' && s[k] != 'G' && s[k] != 'C' && s[k] != 'T') res = 0;
      }
      chmax(ans, res);
    }
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
long n,a[3][1<<18],b,c,x,y,N[1<<18],M[1<<18],i,j;main(){scanf("%d",&n);for(i=0;i<3;++i)for(j=0;j<n;++j){scanf("%d",&a[i][j]);--a[i][j];}for(i=0;i<n;++i){if(a[0][i]/3!=a[1][i]/3||a[1][i]/3!=a[2][i]/3||a[2][i]/3!=a[0][i]/3||a[1][i]%3!=1||(a[1][i]/3-i)%2){puts("No");return 0;}x=a[1][i]/3+1;while(x){if(i&1)c-=M[x];else b-=N[x];x-=x&-x;}if(i&1)c+=i/2;else b+=i/2;y=a[2][i]/3+1;while(y<1<<18){if(i&1)++M[y];else++N[y];y+=y&-y;}if(a[0][i]%3){if(i&1)++b;else++c;}}puts((b&1)||(c&1)?"No":"Yes");}

Measured memory_bytes: 5600
#include <iostream>
#include <fstream>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <algorithm>
#include <random>
#include <chrono>
#include <iomanip>
#define lint long long int
#define FOR(x, to) for(int x=0; x<(int)(to); x++) // for簡略表記
#define DUMP(ar) for(int loop_dump=0; loop_dump<(int)ar.size(); loop_dump++) cout << "[" << loop_dump << "]:" << ar[loop_dump] << endl // 配列一覧表示
#define DUMPL(ar) for(int loop_dump=0; loop_dump<(int)ar.size(); loop_dump++) { cout << ar[loop_dump]; if(loop_dump<(int)ar.size()-1) cout << ' '; } cout << endl; // 配列一行一覧表示
#define COUT(x) cout << x << endl // 単要素出力
#define ALL(ar) ar.begin(), ar.end() // コンテナの全要素
#define LOOPD(i) cout << "ループ[" << i << "]回目---------------" << endl // ループ回数デバグ
using namespace std;
// cout << fixed << setprecision(4) で小数点以下4桁の桁そろえ
// cout << setw(5) << ... で表示形式を5桁に設定 5桁未満なら頭に空白がつく 5桁越なら先頭から5桁まで
// cout << setw(5) << setfill('0') << ... で空白部分の埋め文字に5を使う
// getline(cin, [変数]); で空白などを含む入力の受け取り(行ごとの受け取り)
// cin >> ws; でそこまでにストリームに残されたホワイトスペースを取り除く(=以降のgetlineの有効化)

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

    int n, m;
    cin >> n >> m;
    vector<int> k(m);
    vector<vector<int>> s(m, vector<int>(10, -1));
    vector<int> p(m);
    for(int i=0; i<m; i++){
        cin >> k[i];
        for(int j=0; j<k[i]; j++){
            cin >> s[i][j];
        }
    }
    for(int i=0; i<m; i++){
        cin >> p[i];
    }

    int length = pow(2, n);
    int ans = 0;
    for(int bit=0; bit<length; bit++){
        bool flag = true;

        for(int i=0; i<m; i++){ // light
            int tmp = 0;
            for(int j=0; j<k[i]; j++){ // light to switch
                // cout << "bit:" << bit << " i:" << i << " j:" << j << endl;
                if( ((1 << (s[i][j]-1)) & bit ) ){
                    tmp = (tmp + 1) % 2;
                }
            }
            if(p[i] != tmp){
                flag = false;
                break;
            }
        }

        if(flag) ans++;
    }

    COUT(ans);
    return 0;
}

Measured memory_bytes: 256
package main

import (
    "bufio"
    "fmt"
    "io"
    "os"
)

type BufferedWriter interface {
    Printf(format string, a ...interface{})
    Flush()
}

type writerImpl struct {
    *bufio.Writer
}

func NewBufferedWriter(writer io.Writer) BufferedWriter {
    return &writerImpl{Writer: bufio.NewWriter(writer)}
}

func (impl *writerImpl) Printf(f string, a ...interface{}) {
    fmt.Fprintf(impl.Writer, f, a...)
}

func (impl *writerImpl) Flush() {
    impl.Writer.Flush()
}

type WordScanner interface {
    NextInt() int
    NextInt64() int64
    NextString() string
}

type wordScannerImpl struct {
    *bufio.Scanner
}

func NewWordScanner(reader io.Reader) WordScanner {
    s := bufio.NewScanner(reader)
    s.Split(bufio.ScanWords)
    return &wordScannerImpl{Scanner: s}
}

func (impl *wordScannerImpl) NextInt() int {
    impl.Scan()
    bb := impl.Bytes()
    i := 0
    for _, b := range bb {
        i *= 10
        i += int(b - '0')
    }
    return i
}

func (impl *wordScannerImpl) NextInt64() int64 {
    impl.Scan()
    bb := impl.Bytes()
    i := int64(0)
    for _, b := range bb {
        i *= 10
        i += int64(b - '0')
    }
    return i
}

func (impl *wordScannerImpl) NextString() string {
    impl.Scan()
    return impl.Text()
}

var reader = NewWordScanner(os.Stdin)
var writer = NewBufferedWriter(os.Stdout)

func main() {
    defer writer.Flush()
    n, x, y := reader.NextInt64(), reader.NextInt64(), reader.NextInt64()
    res := make([]int64, n-1)
    for i := int64(1); i <= n; i++ {
        for j := i+1; j <= n; j++ {
            orig := j-i
            alt := abs(x-i) + 1 + abs(j-y)
            res[min(orig,alt)-1]++
        }
    }

    for _, v := range res {
        writer.Printf("%d\n", v)
    }
}

func abs(a int64) int64 {
    if a < 0 {
        a *= -1
    }
    return a
}

func min(a, b int64) int64 {
    if a < b {
        return a
    }
    return b
}


Measured memory_bytes: 640
#include <map>
#include <set>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <complex>
#include <cstring>
#include <iomanip>
#include <utility>
#include <iostream>
#include <algorithm>

using namespace std;
const int N = 505;
const int INF = 2 * N;

int n, fullCol;
int numBlack[N]; // each row
bool isBlack[N][N];
bool hasBlack[N]; // each column
bool black;

int main() {

	ios_base::sync_with_stdio(0);
	cin.tie(NULL);

	cin >> n;

	char c;
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= n; j++) {
			cin >> c;
			isBlack[i][j] = (c == '#');
		}
	}

	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= n; j++) {
			numBlack[i] += isBlack[i][j];
			hasBlack[j] |= isBlack[i][j];
			black |= isBlack[i][j];
		}
	}

	if (!black) {
		cout << -1 << endl;
		return 0;
	}

	for (int j = 1; j <= n; j++) {
		bool ok = true;
		for (int i = 1; i <= n; i++) {
			ok &= isBlack[i][j];
		}
		fullCol += ok;
	}

	int ans = INF;

	for (int i = 1; i <= n; i++) {
		ans = min(ans, 2 * n - numBlack[i] - fullCol + !hasBlack[i]);
	}

	if (ans == INF) ans = -1;
	cout << ans << endl;

	system("pause");
	return 0;
}

Measured memory_bytes: 760
N_s,M_s=input().split()
M=int(M_s)
N=int(N_s)
A=list(map(int,input().split()))


th=sum(A)/(4*M)
#print('th='+ str(th))

A_th=[A_t for A_t in A if A_t>=th]

if len(A_th)>=M:
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
 
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()
#define endl '\n'
 
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, int> pdi;
 
const int MAXN = 2e5 + 5;
 
int main() {
	ios::sync_with_stdio(0); cin.tie(0);
	int a, b, c; cin >> a >> b >> c;
	if(a != b) swap(b, c);
	if(a == b && b != c) cout << "Yes";
	else if(b == c && b != a) cout << "Yes";
	else cout << "No";
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=1e5+10,mod=1e9+7;
int n,a[N],num[3];
ll ans,nex; 
int main()
{
	scanf("%d",&n);
	ans=1;
	for(int i=1;i<=n;++i)
	{
		scanf("%d",&a[i]);
		nex=0;
		for(int j=0;j<3;++j)
		if(num[j]==a[i])nex++;
		ans=ans*nex%mod;
		for(int j=0;j<3;++j)
		if(num[j]==a[i])
		{
			num[j]++;
			break;
		}
	}
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 640
N, M = map(int, input().split())
mat = list()
for _ in range(M):
    mat.append(list(map(lambda x: int(x)-1, input().split()[1:])))
p = list(map(int, input().split()))

from itertools import product

bit = product([1, 0], repeat=N)

total = 0
for switch in bit:
    for i, m in enumerate(mat):
        ison = 0
        for j in m:
            ison += switch[j] 
        match = ison % 2 == p[i]
        if not match:
            break
    else:
        total += 1
print(total)

Measured memory_bytes: 41136
_num_of_cases = int(input())
_AC = 0
_WA = 0
_TLE = 0
_RE = 0
for _i in range(_num_of_cases):
  _result = input()
  if _result == "AC":
    _AC += 1
  elif _result == "WA":
    _WA += 1
  elif _result == "TLE":
    _TLE += 1
  else:
    _RE += 1

print("AC x " + str(_AC))
print("WA x " + str(_WA))
print("TLE x " + str(_TLE))
print("RE x " + str(_RE))

Measured memory_bytes: 9184
/**
 *    author:  otera    
**/
#include<iostream>
#include<string>
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<deque>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

//#define int long long
typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
typedef long double ld;
const int inf=1e9+7;
const ll INF=1LL<<60 ;
const ll mod=1e9+7 ;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<int, int> P;
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back
#define debug(x)  cerr << #x << " = " << (x) << endl;
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; }

void solve() {
	vector<int> x(3);
    rep(i, 3) {
        cin >> x[i];
    }
    sort(all(x));
    if(x[0] == x[1] && x[1] != x[2]) {
        cout << "Yes" << endl;
    } else if(x[0] != x[1] && x[1] == x[2]) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	//int t; cin >> t; rep(i, t)solve();
	solve();
    return 0;
}

Measured memory_bytes: 256
S = input()

cs = [0]
r = 1
for c in S[::-1]:
    cs.append((cs[-1] + r*int(c)) % 2019)
    r *= 10
    r %= 2019

from collections import Counter
ctr = Counter(cs)
ans = 0
for v in ctr.values():
    ans += v*(v-1)//2
print(ans)

Measured memory_bytes: 16732
#include <bits/stdc++.h>
#define LL long long
#define LD long double
#define pb push_back
#define mp make_pair
#define ss(x) (int) x.size()
#define fi first
#define se second
#define cat(x) cerr << #x << " = " << x << endl
#define rep(i, j, n) for (int i = j; i <= n; ++i)
#define per(i, j, n) for (int i = n; j <= i; --i)
#define all(x) x.begin(), x.end()
#define ull unsigned long long

using namespace std;

const int N = 1e5 + 100;
const int pod = (1 << 17);
const int MOD = 1e9 + 7;

struct seg {
	int t[2 * pod];
	int w = 0;
	
	void init() {
		rep(i, 1, 2 * pod - 1)
			t[i] = 0;
	}
	
	void add(int v, int c) {
		if (c < 0) c += MOD;
		v += pod;
		while (v) {
			t[v] = (t[v] + c) % MOD;
			v /= 2;
		}
	}
	
	int query(int l, int r) {
		r++;
		int res = 0;
		for (l += pod, r += pod; l < r; l /= 2, r /= 2) {
			if (l & 1) res = (res + t[l++]) % MOD;
			if (r & 1) res = (res + t[--r]) % MOD;
		}
		return res;
	}
	
	void clear(int r) {
		//cat("czysc");
		while (w <= r) {
			add(w, -t[pod + w]);
			w++;
		}
		w = r + 1;
	}
} x[2];
	

int n;
LL A[2];
LL S[N];

int main() {
	x[0].init(); x[1].init();
	scanf ("%d%lld%lld", &n, &A[0], &A[1]);
	rep(i, 1, n) scanf ("%lld", S + i);
	x[0].add(0, 1);
	x[1].add(0, 1);
	rep(i, 2, n) {
		int b1 = upper_bound(S + 1, S + n + 1, S[i] - A[0]) - S - 1;
		int c1 = x[1].query(0, b1);
		
		int b2 = upper_bound(S + 1, S + n + 1, S[i] - A[1]) - S - 1;
		int c2 = x[0].query(0, b2);
		
		x[0].add(i - 1, c1);
		x[1].add(i - 1, c2);
		
		if (S[i] - S[i - 1] < A[0]) x[0].clear(i - 2);
		if (S[i] - S[i - 1] < A[1]) x[1].clear(i - 2);
	}
	//cat(x[0].query(0, pod - 1));
	//cat(x[1].query(0, pod - 1));
	printf ("%d\n", (x[0].query(0, pod - 1) + x[1].query(0, pod - 1)) % MOD);

    return 0;
}


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

using ll =  long long;
using pint =  pair<int,int>;
using vint = vector<int>;
using vvint = vector<vint>;
using vpint = vector<pint>;

#define repi(i,start,end) for(int (i)=(start),TemPNuM=(int)(end);(i)<TemPNuM;++(i))
#define rep(i,end) repi((i),0,(end))
#define rfor(x,v) for(auto& (x) : (v))
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define fsort(v,lambda) sort(all((v)),(lambda))
#define vin(v) rep(i,(v).size())cin >> (v)[i];
#define vpin(v) rep(i,(v).size())cin>>v[i].first>>v[i].second
//最終奥義 #define int long long
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; }
void put_double(double obj){printf("%.12f\n",obj);};
//lambda: [](int x, int y){return x<y;}

signed main(void){
    string s;cin >> s;
    if(s=="AAA"||s=="BBB"){
        cout << "No" << endl;
    }else{
        cout << "Yes" << endl;
    }

    return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<map>
#include<set>
#include<queue>
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pb push_back
#define rep(i,n) for(ll i=0;i<n;i++)
#define INF 1e9+7
#define LLINF 1e18
using namespace std;
const ll MOD = 1e9 +7;

int main(){
    int n,h[110],ans=0;
    cin>>n;
    rep(i,n) cin>>h[i];
    rep(i,n){
        bool can=true;
        rep(j,i){
            if(h[j]>h[i]) can=false;
        }
        if(can) ans++;
    }
    cout <<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
import sys, re
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians, atan, degrees
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from fractions import gcd
from bisect import bisect
import heapq
import numpy as np

def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

N, K = MAP()
A = LIST()

A_acc = list(accumulate(A))
S = [0] + A_acc
S = [(S[i]-i)%K for i in range(N+1)]

ans = 0
dic = defaultdict(int)

for i, x in enumerate(S):
	ans += dic[x]  # 範囲内かつ今まで出てきたxの個数を探す
	dic[x] += 1
	if i >= K-1:  # 範囲外のものを捨てる
		dic[S[i-K+1]] -= 1

print(ans)


Measured memory_bytes: 60416
#include <iostream>
#include <vector>
#include <algorithm>
#define rep(i, a, n) for(int i = a; i < n; i++)
using namespace std;
using ll = long long;
using P = pair<int, int>;

int main()
{
    string s;
    cin >> s;
    rep(i, 0, 3){
        if(s[i] == '7'){
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 3628
#include<bits/stdc++.h>
using namespace std;
int main(){
	long long int n;
	cin >> n;
	long long int a[n];
	map<long long int,long long int> cnt;
	for(int i =0;i<n;i++){
		cin >> a[i];
		cnt[a[i]]++;
	}
	long long int t = 0;
	for(auto e:cnt){
		t+= e.second*(e.second-1)/2;
	}

	for(int i =0;i<n;i++){
		long long int val = a[i];
		long long int tosub = cnt[val];
		long long int ans = t - (tosub*(tosub-1)/2);
		long long int add = (cnt[val]-1)*(cnt[val]-2)/2;
		ans+=add;
		cout << ans << endl;
	}
		// cout << endl;
}

Measured memory_bytes: 11008
N = int(input())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
C = list(map(int, input().split()))

ret = 0
last_i = N
for n in range(N):
    i = A[n]-1
    ret += B[i]
    if n > 0 and i - last_i == 1:
        ret += C[last_i]
    last_i = i
print(ret)

Measured memory_bytes: 38384
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main()
{
	ll l,r,ans=0;
	int n;
	scanf("%lld%d",&l,&n);
	for(int i=1;i<=n;i++){
		ll p;
		scanf("%lld",&p);
		ans+=p;
	}
	if(ans>=l)puts("Yes");
	else puts("No");
}

Measured memory_bytes: 256
#include<algorithm>
#include<complex>
#include<ctype.h>
#include<iomanip>
#include<iostream>
#include<fstream>
#include<map>
#include<math.h>
#include<numeric>
#include<queue>
#include<set>
#include<stack>
#include<stdio.h>
#include<string>
#include<string>
#include<vector>

using namespace std;
typedef long long ll;

#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define ALL(v) (v).begin(), (v).end()
#define p(s) cout<<(s)<<endl
#define p2(s, t) cout << (s) << " " << (t) << endl
#define br() p("")
#define pn(s) cout << (#s) << " " << (s) << endl
#define p_yes() p("Yes")
#define p_no() p("No")

const ll mod = 1e9 + 7;
const ll inf = 1e18;

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

    // input
    char c;
    cin >> c;
    
    if(c=='A'){
        p('T');
    }else if(c=='T'){
        p('A');
    }else if(c=='C'){
        p('G');
    }else{
        p('C');
    }
    
    return 0;
}

Measured memory_bytes: 256