akhauriyash/Code-Regression huggingface dataset:
// #define _GLIBCXX_DEBUG
#include <bits/stdc++.h>

#define FOR(i, a, b) for (int i = (a); i < int(b); ++i)
#define RFOR(i, a, b) for (int i = (b)-1; i >= int(a); --i)
#define REP(i, n) FOR(i, 0, n)
#define REP1(i, n) FOR(i, 1, int(n) + 1)
#define RREP(i, n) RFOR(i, 0, n)
#define RREP1(i, n) RFOR(i, 1, int(n) + 1)
#define ALL(c) begin(c), end(c)

int _ = (
#ifndef LOCAL
    std::cin.tie(nullptr), std::ios::sync_with_stdio(false),
#endif
    std::cout.precision(10), std::cout.setf(std::ios::fixed));

using ll = long long;
using ld = long double;
// constexpr auto mod = 1000000007;
using namespace std;

int main() {
  ll N;
  cin >> N;
  vector<ll> A(N);
  REP(i, N) { cin >> A[i]; }

  vector<ll> cs(N + 1, 0);
  cs[0] = 0;
  for (int i = 1; i <= N; i++) {
    cs[i] = cs[i - 1] + A[i - 1];
  }
  map<ll, ll> m;
  for (int i = 0; i <= N; i++) {
    m[cs[i]] = m[cs[i]] + 1;
  }
  ll answer = 0;
  for (const auto &kv : m) {
    const auto v = kv.second;
    answer += v * (v - 1) / 2;
  }
  cout << answer << endl;
  return 0;
}


Measured memory_bytes: 15872
#include <iostream>
#include <algorithm>
#include <functional>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <string>
#include <numeric>
#include <cmath>

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

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 = 1000000007;
const int INF = 1<<30;
//const ll INF = (ll)1e18 + 1;

vector<ll> enum_divisors(ll N){
  vector<ll> res;
  for (ll i = 1; i * i <= N; ++i){
    if (N % i == 0) {
      res.push_back(i);
      //重複しない時
      if (N / i != i) res.push_back(N / i);
    }
  }
  sort(res.begin(), res.end());
  return res;
}

int main(){
  int A, B, K; cin >> A >> B >> K;
  int now = 0;
  for (int i = 100; i >= 0; --i){
    if (A % i == 0 && B % i == 0){
      now++;
    }
    if (now == K){cout << i << endl; return 0;}
  }
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<map>
#include<stack>
#include<cmath>
#include<iomanip>
#include<set>
#include<numeric>
#include<sstream>
#include<random>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < n; ++i)
#define rrep(i, st, n) for (int i = st; i < n; ++i)
using pii = pair<int, int>;
const int inf = 1e9 + 7;
int dy[] = {0, 0, -1, 1, -1, 1, -1, 1};
int dx[] = {1, -1, 0, 0, -1, 1, 1, -1};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    //1 <= k <= 5かよ!!
    string s; cin >> s;
    int k; cin >> k;
    set<string> se;
    rep(i, s.size()) {
        string tmp;
        rep(j, 5) {
            if (i + j < s.size()) tmp += s[i + j];
            else break;
            se.insert(tmp);
        }
    }
    auto it = se.begin();
    
    rep(i, k - 1) {++it; /*cout << *it << endl;*/}
    cout << *it << endl;
}


Measured memory_bytes: 1664
# AGC026A - Colorful Slimes 2
def main():
    N, *A = map(int, open(0).read().split())
    ans, flg = 0, 0  # flg: change j (i in next pair) or not
    for i, j in zip(A, A[1:]):
        if flg:
            flg ^= 1
        else:
            if i == j:
                ans += 1
                flg ^= 1
    print(ans)


if __name__ == "__main__":
    main()

Measured memory_bytes: 3060
A,B,K = map(int, input().split())
list1 = []
list2 = []
for i in range(K):
    if A+i>B:
        break
    list1.append(A+i)
    list2.append(B-i)
ans_list = sorted(list(set(list1+list2)))
for i in range(len(ans_list)):
    print(ans_list[i])


Measured memory_bytes: 3060
#include<algorithm>
#include<cmath>
#include<iostream>
#include<vector>
#include<string>
using namespace std;
typedef long long ll;

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

int main(){
    ll a, b, c, d;
    ll A, B, C, D;
    cin >> a >> b >> c >> d;
    A = a * c;
    B = a * d;
    C = b * c;
    D = b * d;
    
    ll ans;
    ans = A;
    if(ans < B){ans = B;}
    if(ans < C){ans = C;}
    if(ans < D){ans = D;}
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 3188
#include <bits/stdc++.h>
#define REP(i, a, n) for(ll i=a; i<n; i++)
#define RREP(i, a, n) for(ll i=n-1; i>=a; i--)
typedef long long ll;
const ll mod =1e9+7;
const ll inf =1e18;
using namespace std;

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

    ll mx=1;
    for(ll i=2; i*i<=n; i++){
        if(n%i==0){
            mx=i;
        }
    }

    cout<<mx+(n/mx)-2<<endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
/*#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
/*template <typename T>
using ordered_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
*/typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll,ll> pl;
typedef pair<int,int> pii;

#define int ll
#define LOCAL 0
#define dbg(x) cout << #x << " is " << x << "\n"
#define gll(x) scanf("%d",&x)
#define gll2(x,y) scanf("%d%d",&x,&y)
#define gll3(x,y,z) scanf("%d%d%d",&x,&y,&z)
#define gllarr(arr,n) f(i,n) gll(arr[i]);
#define sz(x) ((int)x.size())
#define s(x) sort(x.begin(),x.end())
#define all(v) v.begin(),v.end()
#define rs(v) { s(v) ; r(v) ; }
#define r(v) {reverse(all(v));}
#define pb push_back
#define f(i,n) for(int i=0;i<n;i++)
#define fr(i,n) for(int i=n-1;i>=0;i--)
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define repr(i,a,b) for(int i=a;i>=b;i--)

const ll mod = (ll)1e9 + 7;
const ll inf = (ll)1e16;
const ld eps = 1e-12;
const ll N = (int)1e5 + 5;
const ll LOGN = 19;
const ld PI = 3.14159265358979323846;
inline ll mul(ll a, ll b, ll m = mod) { return (ll)(a * b) % m;}
inline ll add(ll a, ll b, ll m = mod) { a += b; if(a >= m) a -= m; if(a < 0) a += m; return a;}
inline ll power(ll a, ll b, ll m = mod) { if(b == 0) return 1; if(b == 1) return (a % m); ll x = power(a, b / 2, m); x = mul(x, x, m); if(b % 2) x = mul(x, a, m); return x;}

int n, h;
pair<int, int> a[N];
int dp[(int)1e4 + 5];

int rec(int curr) {
    if(curr <= 0) {
        return 0;
    }
    int &ans = dp[curr];
    if(ans != -1) return ans;
    ans = LLONG_MAX;
    f(i, n) {
        ans = min(ans, rec(curr - a[i].first) + a[i].second);
    }
    return ans;
}

int32_t main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    if (LOCAL) {
        freopen("C:\\Users\\Dishant\\Desktop\\Collection-DEV c++\\input.txt", "r", stdin);
        freopen("C:\\Users\\Dishant\\Desktop\\Collection-DEV c++\\output.txt", "w", stdout);
    }
    cin>>h>>n;
    f(i, n) cin>>a[i].first>>a[i].second;
    f(i, (int)1e4 + 5) dp[i] = -1;
    cout<<rec(h);
    return 0;
}


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

using namespace std;

typedef long long int ll;
typedef pair<ll, ll> pll;

#define FOR(i, n, m) for(ll (i)=(m);(i)<(n);++(i))
#define REP(i, n) FOR(i,n,0)
#define OF64 std::setprecision(10)

const ll MOD = 2019;
const ll INF = (ll) 1e15;

ll P[200005];

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    string S;
    cin >> S;
    ll N = S.length();
    P[N - 1] = 1;
    FOR(i, N, 1) {
        P[N - i - 1] = (P[N - i] * 10LL) % MOD;
    }

    map<ll, ll> M;
    M[0]++;
    ll ans = 0;
    ll s = 0;
    REP(i, N) {
        s = (s * 10 + S[i] - '0') % MOD;
        ll m = s * P[i] % MOD;

        ans += M[m];
        M[m]++;
    }

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

Measured memory_bytes: 5340
#include<bits/stdc++.h>
#include<stdio.h>
using namespace std;
#define ll long long 
int ctoi(char c) {return c-'0';}/*char to int*/
int gcd(ll a,ll b){return b?gcd(b,a%b):a;}/*MAX*/
int lcm(ll a,ll b){return a*b/gcd(a,b);}/*MIN*/
bool primecheck(ll n){/*sosuu*/if(n < 2) return false;else{for(int i = 2; i * i <= n; i++){if(n % i == 0) return false;}return true;}}
string  reverserange(string s,ll a,ll b){reverse(s.begin()+a-1,s.begin()+b); return s;}
int  main(){
    int n;
    cin >> n;
    map<int,int>add,even;
    vector<int>a(n/2),e(n/2);
    for(int i=0;i<n;i++){
        int z;
        cin >> z;
        if(i%2==1){
            a.at(i/2)=z;
            if(add.count(z))add.at(z)++;
            else add[z]=1;
        }
        else {
            e.at(i/2)=z;
            if(even.count(z))even.at(z)++;
            else even[z]=1;
        }
    }
    
  int addn=0,evenn=0,addi=-1,eveni=-1;
  for (int x : a) {
    if (addn<add.at(x)) {
      addn = add.at(x);
      addi=x;
    }
  }
    for(int z:e){
        if(evenn<even.at(z)){
            evenn=even.at(z);
            eveni=z;
        }
    }
    if(addi==eveni){
        int addii,evenii,addd = 0,evee=0;
        for(int z:a){
            if(addd<add.at(z)&&z!=addi){
                addd=add.at(z);
                addii=z;
            }
        }
        for(int z:e){
            if(evee<even.at(z)&&z!=eveni){
                evee=even.at(z);
                evenii=z;
            }
        }
        ll che = n-evenn-addd,ans=n-evee-addn;
        if(che==0)che=10e10;
        if(ans==0)ans=10e10;
        cout << min(che,ans)<<endl;
        return 0;
    }
    ll ans = n/2-addn + n/2 -evenn;
    cout << ans << endl;

}







Measured memory_bytes: 5376
#!/usr/bin/env python3
from collections import Counter
import sys
try:
    from typing import List
except ImportError:
    pass


def solve(N: int, K: int, A: "List[int]"):
    ctr = Counter(A)
    print(sum(sorted(ctr.values())[:-K]))


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, K, A)


if __name__ == '__main__':
    main()


Measured memory_bytes: 43748
#include <fstream>
#include <iostream>
#include <vector>
#include <cstring>
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define Nmax 1000005
#define INF 1000000000
#define MOD 1000000007
 
using namespace std;

 ll mod=998244353;
 
ll expo(ll base,ll exponent,ll mod){
    ll ans=1;
    while(exponent!=0){
        if(exponent&1) ans=(1LL*ans*base)%mod;
        base=(1LL*base*base)%mod;
        exponent>>=1;
    }
    return ans%mod;
}

int main()
{
    
    // #ifndef ONLINE_JUDGE
    //     freopen ("data.in","r",stdin);
    //     freopen ("E.out","w",stdout);
    // #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int tests=1;
    // cin>>tests;
    while(tests--)
    {
   		ll i,j,n,ans=-9000000000000000;
   		cin>>n;
   		vector<ll>a(n);
   		for(i=0;i<n;i++) cin>>a[i];
   		// if(n%2==0)
   		// {
   		// 	ll cur=0;
   		// 	for(i=0;i<n;i+=2) cur+=a[i];
   		// 	ans=cur;
   		// 	cur=0;
   		// 	for(i=1;i<n;i+=2) cur+=a[i];
   		// 	ans=max(ans,cur);
   		// 	cout<<ans;
   		// 	return 0;
   		// }
   		
   		ll dp[n+5][3]={0};
   		for(i=0;i<=n;i++)
		{dp[i][0]=dp[i][1]=dp[i][2]=-1e15;}
   		dp[1][0]=a[0];
   		dp[2][1]=a[1];
   		dp[3][0]=a[0]+a[2];
   		dp[3][2]=a[2];
   		for(i=4;i<=n;i++)
   		{
   			// without jump
   			dp[i][0]=max(dp[i][0],dp[i-2][0]+a[i-1]);
   			dp[i][1]=max(dp[i][1],dp[i-2][1]+a[i-1]);
   			dp[i][2]=max(dp[i][2],dp[i-2][2]+a[i-1]);
   			// with jump
   			dp[i][1]=max(dp[i][1],dp[i-3][0]+a[i-1]);
   			dp[i][2]=max(dp[i][2],dp[i-3][1]+a[i-1]);
   			dp[i][2]=max(dp[i][2],dp[i-4][0]+a[i-1]);
   		}
   		if(n%2==1)
   		ans=max(dp[n][2],max(dp[n-1][1],dp[n-2][0]));
   		else
   			ans=max(dp[n][1],dp[n-1][0]);

   		cout<<ans;


   	}
    	return 0;
    
}

Measured memory_bytes: 9528
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int N;
  cin >> N;
  vector<int> B(N-1);
  for(auto& b : B) cin >> b;
  int ans = B[0] + B[N-2];
  for(int ii=1; ii<N-1; ii++){
    ans += min(B[ii-1], B[ii]);
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#inserting X
s=input()
length=len(s)
string=""
for i in range(length):
    if s[i]!="x":
        string=string+s[i]
    else:
        continue


flag=True
length2=len(string)
if length2>=2:
    for i in range(length2//2):
        if string[i]!=string[-(i+1)]:
            flag=False
            break
if flag:
    s="x"+s+"X"
    length=len(s)
    checklist=[]
    count=0
    for i in range(length):
        if s[i]=="x":
            count+=1
        else:
            checklist.append(count)
            count=0
    checklist[0]-=1
    ans=0
    for i in range(len(checklist)//2):
        ans+=abs(checklist[i]-checklist[-(i+1)])
    print(ans)
    
else:
    print("-1")
    

Measured memory_bytes: 4212
import java.util.Arrays;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int[] ab = new int[2];
		
		for(int i = 0; i < 2; i++) {
			ab[i] = sc.nextInt();
		}
		
		Arrays.sort(ab);
		
		int sum = 0;
		
		for(int i = 0; i < 2; i++) {
			sum+=ab[1];
			ab[1]--;
			Arrays.sort(ab);
		}
		
		System.out.println(sum);
	}
}


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

int main (){
    int n;
    cin >>n;
    vector <int> sinon(n);
    double aa = 0.0;
    for (int i=0 ; i<n; i++){
        cin >> sinon.at(i);
        aa += 1.0/sinon.at(i);
    }
    cout << setprecision(16) << 1.0/aa << endl;

}


Measured memory_bytes: 256
#include<stdio.h>

int O[10][10000],R,C,i,j,f,r,t,o;

int main()
{
	for(;scanf("%d%d",&R,&C),R;)
	{
		for(i=0;i<R;i++)
			for(j=0;j<C;j++)
				scanf("%d",&O[i][j]);
		for(f=r=0;f<=(1<<R);f++)
		{
			for(j=o=0;j<C;j++)
			{
				for(i=t=0;i<R;i++)
					if(!((O[i][j]+((f>>i)&1))%2))
						t++;
				o+=(t>R/2?t:R-t);
			}
			r=r<o?o:r;
		}
		printf("%d\n",r);
	}
	return 0;
}

Measured memory_bytes: 988
#include <iostream>
#include <queue>
#include <cstring>
#include <cmath>
#include <complex>
#include <vector>
#include <iomanip>
using namespace std;

double x[2][1001], y[2][1001];
double dist[1001];
int seen[1001];

double d(int idx, int s, int t) {
  return sqrt((x[idx][s] - x[idx][t])*(x[idx][s] - x[idx][t])
              + (y[idx][s] - y[idx][t])*(y[idx][s] - y[idx][t]));
}

typedef complex<double> P; // point
struct L : public vector<P> { // line
    L (P a, P b) {
        push_back(a);
        push_back(b);
    }
};
double cross(const P& a, const P& b) {
  return imag(conj(a)*b);
}
double dot(const P& a, const P& b) {
  return real(conj(a)*b);
}
int ccw(P a, P b, P c) {
  b -= a; c -= a;
  if (cross(b, c) > 0)   return +1;       // counter clockwise
  if (cross(b, c) < 0)   return -1;       // clockwise
  if (dot(b, c) < 0)     return +2;       // c--a--b on line
  if (norm(b) < norm(c)) return -2;       // a--b--c on line
  return 0;
}

bool intersectSS(const L &s, const L &t) {
  return ccw(s[0],s[1],t[0])*ccw(s[0],s[1],t[1]) <= 0 &&
      ccw(t[0],t[1],s[0])*ccw(t[0],t[1],s[1]) <= 0;
}

bool ok(int idx, int p, int q) {
  L l1 = L(P(x[idx][p], y[idx][p]), P(x[idx][q], y[idx][q]));
  L l2 = L(P(x[idx^1][0], y[idx^1][0]), P(x[idx^1][1], y[idx^1][1]));
  return !intersectSS(l1, l2);
}

int n[2];

double shortest_path(int idx, int s, int t) {
  memset(seen, 0, sizeof(seen));
  for (int i = 0; i < 1001; ++i) dist[i] = -1;
  dist[s] = 0;

  while(true) {
    int p = -1;
    double td = 1e13;
    for (int i = 0; i < n[idx]; ++i) {
      if (dist[i] != -1 && seen[i] == 0 && dist[i] < td) {
        p = i;
        td = dist[i];
      }
    }
    if (p == -1) break;
    if (p == t) return dist[t];
    seen[p] = 1;
    for (int next = 0; next < n[idx]; ++next) {
      if (seen[next] != 0) continue;
      if (!ok(idx, p, next)) continue;
      if (dist[next] == -1 || dist[p] + d(idx, p, next) < dist[next]) {
        dist[next] = dist[p] + d(idx, p, next);
      }
    }
  }

  return dist[t];
}

int main() {
  for (int i = 0; i < 1001; ++i) {
    x[0][i] = x[1][i] = y[0][i] = y[1][i] = -1;
  }
  cin>>n[0]>>n[1];
  for (int k = 0; k < 2; ++k)
    for (int i = 0; i < n[k]; ++i)
      cin>>x[k][i]>>y[k][i];

  // A
  double ans = d(0, 0, 1);
  double d1 = shortest_path(1, 0, 1);

  // B
  double ans2 = d(1, 0, 1);
  double d2 = shortest_path(0, 0, 1);

  cout << setprecision(15);
  if (d1 == -1 && d2 == -1) cout << -1 << endl;
  else if (d1 == -1) cout << ans2 + d2 << endl;
  else if (d2 == -1) cout << ans + d1 << endl;
  else cout << min(ans2 + d2, ans + d1) << endl;
}

Measured memory_bytes: 1344
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ull usigned long long
#define two(n) 1<<n
#define l(v) (int)v.size()
#define p_b push_back
#define m_p make_pair
const int pi=acos(-1.0);
const int int_max=1e9;
const long long ll_max=1e18;
int dp[100005];
int n,a[100005];
int main()
{
	cin>>n;
	for(int i=0;i<n;i++)
		cin>>a[i];
	dp[0]=0;
	int ans=0;
	for(int i=1;i<n;i++)
	{
		if(a[i]<=a[i-1])
			dp[i]=dp[i-1]+1;
		else
			dp[i]=0;
		ans=max(ans,dp[i]);
	}
	cout<<ans;
	return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define PI 3.14159265359
#define NIL (-1)
#define LL long long
using namespace std;
const int64_t MOD = 1e9 + 7;
const int INF = INT_MAX;

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

	double yen = 0, btc = 0;

	for (int i = 0; i < N; i++) {
		double x;
		string u;
		cin >> x >> u;
		if (u == "JPY") yen += x;
		else btc += x;
	}

	double ans = yen + (btc * 380000.0);

	cout << fixed << setprecision(10) << ans << endl;
}

Measured memory_bytes: 3720
#include<stdio.h>
int main(void){
	int a,b;
	scanf("%d %d",&a,&b);
	if(a<b){
		printf("a < b\n");
	}
	else if(a>b){
		printf("a > b\n");
	}
	else {
		printf("a == b\n");
	}

	return 0;
}

Measured memory_bytes: 580
#include <bits/stdc++.h>
  using namespace std;
  typedef long long ll;
  int main()
  {
    std::ios::sync_with_stdio(false);
    cin.tie(NULL);

    int a,b;
    cin>>a>>b;
    int x,y,i=0,flag=1;
    while(i<=a)
    {
        x=(a-i)*4;
        y=i*2;
        if(x+y==b)
        {cout<<"Yes\n";
        flag=0;
        break;
        }
        i++;
    }
    if(flag)
        cout<<"No\n";

    return 0;
  }


Measured memory_bytes: 3584
# https://qiita.com/_-_-_-_-_/items/34f933adc7be875e61d0
# abcde	s=input()	s='abcde'
# abcde	s=list(input())	s=['a', 'b', 'c', 'd', 'e']
# 5(1つだけ)	a=int(input())	a=5
# 1 2	| x,y = s_inpl()   |	x=1,y=2
# 1 2 3 4 5 ... n 　	li = input().split()	li=['1','2','3',...,'n']
# 1 2 3 4 5 ... n 　	li = inpl()	li=[1,2,3,4,5,...,n]
# FFFTFTTFF 　	li = input().split('T')	li=['FFF', 'F', '', 'FF']

# INPUT
# 3
# hoge
# foo
# bar
# ANSWER
# n=int(input())
# string_list=[input() for i in range(n)]

import math
import copy
from collections import defaultdict
from collections import Counter
from collections import deque
# 直積 A={a, b, c}, B={d, e}:のとき，A×B={(a,d),(a,e),(b,d),(b,e),(c,d),(c,e)}: product(A, B)
from itertools import product
# 階乗 P!: permutations(seq), 順列 {}_len(seq) P_n: permutations(seq, n)
from itertools import permutations
# 組み合わせ {}_len(seq) C_n: combinations(seq, n)
from itertools import combinations
from bisect import bisect_left, bisect_right
# import numpy as np

# 四方向
dy = [0, 0, 1, -1]
dx = [1, -1, 0, 0]
INF = float("inf")

def i_inpl(): return int(input())
def s_inpl(): return map(int,input().split())
def l_inpl(): return list(map(int, input().split()))

a, b, c = s_inpl()

if a < c < b:
    print("Yes")
elif b < c < a:
    print("Yes")
else:
    print("No")

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

int main()
{
	int n, i, p = 0, w = 0, g = 0, y =0;
	char A;

	cin >> n;

	for (i = 0; i < n; i++) {

		cin >> A;

		if (A == 'P' && p == 0) {
			p++;
		}

		if (A == 'W' && w == 0) {
			w++;
		}

		if (A == 'G' && g == 0) {
			g++;
		}

		if (A == 'Y' && y == 0) {
			y++;
		}

	}

		int ans = p + w + g + y;

		if (ans < 4)
			cout << "Three" << endl;

		else
			cout << "Four" << endl;
	


}


Measured memory_bytes: 3620
fn main() {
    let v = read_vec::<u32>();
    let a = v[0];
    let b = v[1];
    yn(a % 3 == 0 || b % 3 == 0 || (a + b) % 3 == 0);
}

#[allow(dead_code)]
fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}
#[allow(dead_code)]
fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    read::<String>()
        .split_whitespace()
        .map(|e| e.parse().ok().unwrap())
        .collect()
}
#[allow(dead_code)]
fn read_vec2<T: std::str::FromStr>(n: u32) -> Vec<Vec<T>> {
    (0..n).map(|_| read_vec()).collect()
}
#[allow(dead_code)]
fn yn(result: bool) {
    if result {
        println!("Possible");
    } else {
        println!("Impossible");
    }
}


Measured memory_bytes: 4352
L=[]
for a in range(3):
    L1=list(map(int,input().split()))
    L.append(L1)
#print(L)

for i in range(2):
    for j in range(2):
        if L[i][j]-L[i][j+1]==L[i+1][j]-L[i+1][j+1]:
            pass
        else:
            print("No")
            exit()
for k in range(2):
    for l in range(2):
        if L[k][l]-L[k][l+1]==L[k+1][l]-L[k+1][l+1]:
            pass
        else:
            print("No")
            exit()
print("Yes")


Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
#include <math.h>
#include <iomanip>
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int INF=1001001001;
vector<pair<int64_t,int64_t>>prime_factorize(int64_t x){
  vector<pair<int64_t,int64_t>>p;
  for(int64_t i=2;i*i<=x;i++){
    int cnt=0;
    if(x%i==0){
    while(x%i==0){cnt++;x/=i;}
    p.push_back(make_pair(i,cnt));
    }
  }
  if(x!=1){p.push_back(make_pair(x,1));}
  return p; 
}

int main() {
  int X,N;
  cin>>X>>N;
  vector<int>p(N);
  vector<bool>ok(200,true);
  for(int i=0;i<N;i++){
    cin>>p[i];
    ok[p[i]]=false;
  }
  int MIN=999;
  for(int i=0;i<=101;i++){
    if(ok[i]){
      MIN=min(MIN,abs(X-i));
    }
  }
  for(int i=0;i<=101;i++){
    if(ok[i]&&abs(X-i)==MIN){cout<<i<<endl;return 0;}
  }
  return 0;
}

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

#define  SZ(items) (int)items.size()
#define  CLR(a)  memset(a,0,sizeof(a))
#define  SET(a)  memset(a,-1,sizeof(a))

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

template <class T> inline T gcd(T a, T b) { while (b) { a = a%b; swap(a, b); } return a; }



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


	int n, m, c;
	cin >> n >> m >> c;

	vector<int> b;

	for (int i = 0; i < m; i++)
	{
		int it;
		cin >> it;
		b.push_back(it);
	}

	int res = 0;

	for (int i = 0; i < n; i++)
	{
		long long sum = 0;

		for (int i = 0; i < m; i++)
		{
			int it;
			cin >> it;
			sum += it*b[i];
		}

		sum += c;

		if (sum > 0)
			res++;
	}

	cout << res << endl;

	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <utility>
#include <cmath>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <deque>
#include <numeric>


using namespace std;

using ll = long long;
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define mkp(a, b) make_pair(a, b)


using namespace std;

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

	int a[n];
	int d_max = 0;


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

	}

	for (int i = 0; i < n - 1; i++) {
		int d = a[i + 1] - a[i];
		if (d > d_max) {
			d_max = d;
		}
	}

	int last_d = k - a[n -1] + a[0];
	if (last_d > d_max) {
		d_max = last_d; 
	} 

	cout << k - d_max << endl;




	return 0;

}

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

int main(){
  int a,b,c;
  cin >> a >> b >> c;
  if(a+b+c>=22) puts("bust");
  else puts("win");
  return 0;
}


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

int main(void) {
    int n,x;
    int S=0;

    cin >> n >> x;
    int m[n];

    for(int i=0; i<n; i++){
        cin >> m[i];
    }
    for(int i=0; i<n; i++){
        S += m[i];
    }

    int Min = m[0];
    for(int i=1; i<n; i++){
        if(Min>m[i]) Min=m[i];
    }
   
    cout << (int) (n+(x-S)/Min) << endl;
    return 0;
}

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

#define pb push_back
#define mp make_pair
#define pf push_front
#define ff first
#define ss second
#define vll vector < ll >
#define vvll vector < vll >
#define vld vector < ld >
#define pll pair < ll,ll > 
#define pld pair < ld,ld > 
#define vpll vector < pll >
#define vpld vector < pld >
#define all(X) X.begin(),X.end()
#define endl "\n"
#define sz(x) ((ll)((x).size()))
vll emptyVector;
const ll MAX = 1e6 + 5;
const ll INF = 1e18;
const ll MOD = 1e9 + 7;
const ld pi = 3.141592653589793238462643383279502884197169399375105;

ll binaryExpo(ll x, ll n)
{
	if(n == 0)
		return 1;
	if(n % 2 == 0)
		return binaryExpo((x*x) % MOD, n/2);
	return (x*binaryExpo((x*x) % MOD, n/2)) % MOD;
}

ll gcd(ll a, ll b)
{
	if(b == 0)
		return a;
	return gcd(b, a % b);
}
/*-------------------------------------------		CODE STARTS FROM HERE		------------------------------------------*/

void solve(void)
{
	ll n, a, b;
	cin >> n >> a >> b;

	if(((b - a) & 1) == 0)
	{
		cout << (b - a) / 2 << endl;
		return ;
	}

	if(n - b >= a - 1)
	{
		ll ans  = a - 1;
		b -= (a - 1);	b--;
		ans++;
		cout << ans + (b - 1)/2 << endl;
		return ;
	}

	ll ans = n - b;
	a += (n - b);
	a++;	ans++;
	cout << ans + (n - a)/2 << endl;




}


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

	// int t;
	// cin >> t;
	// while(t--)
	{	
		solve();
	}




	return 0;
}

Measured memory_bytes: 256
package main

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

func main() {
	N, K := ReadInt(), ReadInt()
	a := ReadInts(N)
	ans := 1 << 60
	for S := 0; S < 1<<N; S++ {
		cost := 0
		k := 0
		last := 0
		for i := 0; i < N; i++ {
			if S>>i&1 == 1 {
				if last >= a[i] {
					cost += last - a[i] + 1
					last += 1
				} else {
					last = a[i]
				}
				k++
			} else {
				if last < a[i] {
					k++
					last = a[i]
				}
			}
		}
		if k >= K && ans > cost {
			ans = cost
		}
	}
	fmt.Println(ans)
}

var reader = bufio.NewReader(os.Stdin)

func Scan(a ...interface{}) {
	if _, err := fmt.Fscan(reader, a...); err != nil {
		panic(err)
	}
}
func ReadInt() (i int)       { Scan(&i); return }
func ReadString() (s string) { Scan(&s); return }
func ReadInts(n int) (a []int) {
	for i := 0; i < n; i++ {
		a = append(a, ReadInt())
	}
	return
}


Measured memory_bytes: 1844
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
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; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧  
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     
　　　　／　　　＼　 　 |　|     
　　　 /　　 /￣￣￣￣/　　|  
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿  
　 　　　＼/＿＿＿＿/　（u　⊃  
---------------------------------------------------------------------------------------------------*/





int N, A[301010], B[301010], Q;
//---------------------------------------------------------------------------------------------------
void _main() {
    cin >> N;
    rep(i, 0, N) cin >> A[i];
    cin >> Q;

    rep(i, 0, N) B[i] = A[i];
    sort(B, B + N);

    int cnt = 0;
    rep(i, 0, N) if (A[i] == B[i]) cnt++;

    if (cnt == N) {
        printf("0\n");
        return;
    }

    rep(q, 0, Q) {
        int x, y; cin >> x >> y;
        x--; y--;

        if (A[x] == B[x]) cnt--;
        if (A[y] == B[y]) cnt--;

        swap(A[x], A[y]);

        if (A[x] == B[x]) cnt++;
        if (A[y] == B[y]) cnt++;

        if (cnt == N) {
            printf("%d\n", q + 1);
            return;
        }
    }

    printf("-1\n");
}


Measured memory_bytes: 5560
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
  int N = sc.nextInt();
  int[] a = new int[N];
  int[] b = new int[N];
  int[] c = new int[N];
  for(int i=0; i<N; i++) a[i] = sc.nextInt();
  for(int i=0; i<N; i++) b[i] = sc.nextInt();
  for(int i=0; i<N; i++) c[i] = sc.nextInt();	
  Arrays.sort(a);
  Arrays.sort(b);
  Arrays.sort(c);
  long[] dpb = new long[N];
  int ci = 0;
  for(int i=0; i<N; i++){
    while(ci<N && b[i]>=c[ci]) ci++;
    dpb[i] = N-ci;
  }
  for(int i=N-2; i>=0; i--){
    dpb[i] = dpb[i]+dpb[i+1];
  }
  int bi = 0;
  long ans = 0;
  for(int i=0; i<N; i++){
    while(bi<N && a[i]>=b[bi]) bi++;
    if(bi>=N) break;
    ans += dpb[bi];
  }
  System.out.println(ans);
}}

Measured memory_bytes: 93896
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<=(int)(n);i++)
#define all(c) c.begin(),c.end()
#define pb push_back
#define fs first
#define sc second
#define show(x) cout << #x << " = " << x << endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
using namespace std;
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){return o<<"("<<p.fs<<","<<p.sc<<")";}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){o<<"sz = "<<vc.size()<<endl<<"[";for(const T& v:vc) o<<v<<",";o<<"]";return o;}
typedef long long ll;
int N;
ll L,a[100000];
int main(){
	cin>>N>>L;
	rep(i,N) cin>>a[i];
	rep(i,N-1) if(a[i]+a[i+1]>=L){
		puts("Possible");
		rep(j,i) cout<<j+1<<endl;
		for(int k=N-2;k>=i;k--) cout<<k+1<<endl;
		return 0;
	}
	puts("Impossible");
}


Measured memory_bytes: 1536
#include <bits/stdc++.h>
using namespace std;
int main()
{
	int n,k,c;
	string s;
	cin>>n>>k>>c;
	cin>>s;
	vector<int> v1,v2;
	int last=-1e9,kk=k;
	for(int i=0;i<s.size();i++)
	{
		
		if(s[i]=='o'&&i>last+c){
			v1.push_back(i);
			kk--;
			last=i;
		}
		if(kk==0)break;
	}
	int up=-1e9;
	kk=k;
	reverse(s.begin(),s.end());
	for(int i=0;i<s.size();i++)
	{
		if(s[i]=='o'&&i>up+c){
			v2.push_back(s.size()-i-1);
			kk--;
			up=i;
		}
		if(kk==0)break;
	}
	reverse(v2.begin(),v2.end());
	for(int i=0;i<k;i++)
	{
		if(v1[i]==v2[i])cout<<v1[i]+1<<endl;
	}
	return 0;
}

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

int main() {
    string s, t;
    cin >> s >> t;
    int cnt = 0;
    for (int i = 0; i < s.size(); i++) {
        if (s[i] != t[i]) cnt++;
    }
    cout << cnt << endl;
}


Measured memory_bytes: 3856
fun main(args: Array<String>) {
        val sc = if (args.size > 1) java.util.Scanner(java.io.File(args[1])) else java.util.Scanner(System.`in`)
        solve(sc)
    }

    fun solve(sc: java.util.Scanner) {
        val c = arrayOf("dream", "dreamer", "erase", "eraser")
        var S = sc.next()

        do {
            val found = c.filter { S.endsWith(it) }
            found.forEach { S = S.dropLast(it.length) }
        } while (found.count() > 0)
        println(if (S.isEmpty()) "YES"  else "NO")
    }


Measured memory_bytes: 118672
import fractions
n,x = map(int,input().split())
lst = [int(i) for i in input().split()]
distance = [x-lst[0]]
for i in range(1,n):
    distance.append(lst[i]-lst[i-1])
d = distance[0]
for i in range(n):
    d = fractions.gcd(d,distance[i])
print(abs(d))

Measured memory_bytes: 16280
if __name__ == '__main__':
    hidden_key = input()
    flag_string = input()

    key_length = len(hidden_key)
    flag_length = len(flag_string)

    if key_length < flag_length:
        print('UNRESTORABLE')
        exit()

    key_list = list(hidden_key.replace('?', 'a'))

    for i in reversed(range(key_length - flag_length + 1)):
        part_key = hidden_key[i:i + flag_length]
        is_match = True

        for j in range(flag_length):
            if part_key[j] != '?' and part_key[j] != flag_string[j]:
                is_match = False
                break
            
        if is_match:
            for k in range(flag_length):
                key_list[i + k] = flag_string[k]
            print(''.join(key_list))
            break

    if not is_match:
        print('UNRESTORABLE')


Measured memory_bytes: 3064
#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())
#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);
    string S; cin >> S;
    int len = S.length();
    int ans = 0;
    REP(i,len-1){
        if(S[i] != S[i+1]) ans++;
    }
    cout << ans << endl;

}

Measured memory_bytes: 512
/*|In The Name Of Allah|*/

#include <bits/stdc++.h>

using namespace std;

const int N = 1e5+5;

int n;
int a[N];
vector < int > idx;

bool cmp(int x , int y){
    if(a[x] < a[y])
        return 1;
    return 0;
}

int main(){
    cin >> n;
    for(int i = 1; i <= n; i++){
        cin >> a[i];
        idx.push_back(i);
    }
    sort(idx.begin() , idx.end() , cmp);
    for(auto v : idx){
        cout << v << " ";
    }

}


Measured memory_bytes: 1656
#!/usr/bin/env python3

import sys
import math
from bisect import bisect_right as br
from bisect import bisect_left as bl
sys.setrecursionlimit(2147483647)
from heapq import heappush, heappop,heappushpop
from collections import defaultdict
from itertools import accumulate
from collections import Counter
from collections import deque
from operator import itemgetter
from itertools import permutations
mod = 10**9 + 7
inf = float('inf')
def I(): return int(sys.stdin.readline())
def LI(): return list(map(int,sys.stdin.readline().split()))

"""
参考にしました(写経)
https://atcoder.jp/contests/abc163/submissions/12137623
"""
n = I()
a = LI()
b = [[a[i],i] for i in range(n)]
b.sort(reverse=1)
dp = [[0]*(n+1) for _ in range(n+1)]
for i in range(n):
    a,j = b[i]
    for k in range(i+1):
        dp[k][i+1-k] = max(dp[k][i+1-k], dp[k][i-k] + a*abs(j-((n-1)-(i-k)))) #右側に追加
        dp[k+1][i-k] = max(dp[k+1][i-k], dp[k][i-k] + a*abs(j-k)) #左側に追加

ans = 0
for i in range(n):
    ans = max(ans, dp[i][n-i])
print(ans)

Measured memory_bytes: 106540
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
 
using namespace __gnu_pbds;
using namespace std;
 
typedef long long int ll;
typedef unsigned long long int sll;
typedef  double ld;
#define A 1000000007ll
#define D 100000000000000ll
#define B 998244353ll
#define C 1000000000000000000ll
#define FAST ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define oset tree<ll, null_type,less_equal<ll>, rb_tree_tag,tree_order_statistics_node_update> 
#define pb push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define mxe(v) *max_element(v.begin(),v.end())
#define mne(v) *min_element(v.begin(),v.end())
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define ve vector
#define br break
#define PI acos(-1)
#define subt cerr << "Time : " << 1000 * ((double)clock()) / (double)CLOCKS_PER_SEC << "ms\n" 

int main() 
{
    FAST;
    ll a,b;
    cin>>a>>b;
    cout<<a*b;
    subt;
    return 0;
}

Measured memory_bytes: 3776
n = int(input())
li = [list(map(int,input().split())) for i in range(n)]

li.sort(key=lambda x: x[2])
a,b,c = li[-1]
for x in range(101):
    for y in range(101):
        h = abs(x-a) + abs(y-b) + c
        if all(k == max(h-abs(x-i)-abs(y-j),0) for i,j,k in li):
            print(x,y,h)
            exit()


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

class Dice
{
private:
  vector<int> dice;

public:
  Dice(vector<int> num) {
    for (int i = 0; i < (int)num.size(); ++i) {
      dice.push_back(num.at(i));
    }
  }
  int at(int i) {
    return dice.at(i);
  }

  void roll(char c) {
    int tmp;
    if(c == 'S'){
      tmp = dice.at(0);
      dice.at(0) = dice.at(4);
      dice.at(4) = dice.at(5);
      dice.at(5) = dice.at(1);
      dice.at(1) = tmp;
    } else if (c == 'E') {
      tmp = dice.at(0);
      dice.at(0) = dice.at(3);
      dice.at(3) = dice.at(5);
      dice.at(5) = dice.at(2);
      dice.at(2) = tmp;
    } else if (c == 'N') {
      tmp = dice.at(0);
      dice.at(0) = dice.at(1);
      dice.at(1) = dice.at(5);
      dice.at(5) = dice.at(4);
      dice.at(4) = tmp;
    } else if (c == 'W'){
      tmp = dice.at(0);
      dice.at(0) = dice.at(2);
      dice.at(2) = dice.at(5);
      dice.at(5) = dice.at(3);
      dice.at(3) = tmp;
      // 回転p
    } else  {
      tmp = dice.at(1);
      dice.at(1) = dice.at(3);
      dice.at(3) = dice.at(4);
      dice.at(4) = dice.at(2);
      dice.at(2) = tmp;
    }
  }

  bool isSame(Dice inDice) {
    bool isSameTop = false, areSameDice = true;
    for(int i = 0; i < dice.size(); ++i) {
      if (dice.at(0) == inDice.at(0)) {
        isSameTop = true;
        break;
      }
    }

    for(int i = 0;i<dice.size()-1;++i){
      inDice.roll('N');
      if (dice.at(0) == inDice.at(0)) {
        isSameTop = true;
        break;
      }
    }
    if (isSameTop == false) {
      for(int i = 0;i<dice.size()-1;++i){
        inDice.roll('W');
        if(dice.at(0) == inDice.at(0)) break;
      }
    }

    for(int i = 0;i<dice.size()-1;++i){
      inDice.roll('p');
      if (dice.at(1) == inDice.at(1)) {
        break;
      }

    }

    for (int i = 0; i < dice.size(); ++i) {
      if (dice.at(i) != inDice.at(i)) {
        areSameDice = false;
        break;
      }
    }
    return areSameDice;
  }
};

int main(int argc, char *argv[])
{
  int n;
  cin >> n;
  vector<int> num(6);
  for(int i = 0; i < 6; ++i){
    cin >> num.at(i);
  }
  Dice firstDice(num);
  for(int i=1;i<n;++i){
    for(int i = 0; i < 6; ++i){
      cin >> num.at(i);
    }
    Dice otherDice(num);
    if (firstDice.isSame(otherDice)) {
      cout << "No" << endl;
      return 0;
    }
  }
  cout << "Yes" << endl;
  return 0;
}



Measured memory_bytes: 3136
class UnionFind:

    def __init__(self, n):
        self.n = n
        self.parents = [i for i in range(n)]
        self.ranks = [0 for _ in range(n)]

    def root(self, node):
        parent_node = self.parents[node]
        if parent_node == node:
            return node
        root_node = self.root(parent_node)
        self.parents[node] = root_node  # reduction
        return root_node

    def union(self, one_node, other_node):
        one_root = self.root(one_node)
        other_root = self.root(other_node)
        if one_root == other_root:
            return
        if self.ranks[one_root] < self.ranks[other_root]:
            self.parents[one_root] = other_root
        else:
            self.parents[other_root] = one_root
            if self.ranks[one_root] == self.ranks[other_root]:
                self.ranks[one_root] += 1


def main():
    N, M = list(map(int, input().split(' ')))
    tree = UnionFind(N)
    for _ in range(M):
        x, y, _ = list(map(int, input().split(' ')))
        tree.union(x - 1, y - 1)
    roots = list(map(lambda n: tree.root(n), range(N)))
    print(len(set(roots)))


if __name__ == '__main__':
    main()

Measured memory_bytes: 17960
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from bisect import bisect_left, bisect_right


def main():
    N = int(input())
    A = list(map(int, input().split()))
    B = list(map(int, input().split()))
    C = list(map(int, input().split()))

    A.sort()
    B.sort()
    C.sort()

    result = 0
    for b in B:
        a = bisect_left(A, b)
        c = bisect_right(C, b)
        result += a * (N - c)

    print(result)


if __name__ == "__main__":
    main()


Measured memory_bytes: 22720
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef pair<int,ii> iii;
const int INF=(int)2e9;
const double EPS=(double)1e-9;
const double PI=(double)acos(-1.0);
const ll MOD=(ll)1e9+7;

#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define FOR(i,a,n) for(int i=a;i<n;i++)
#define MAX 100005
#define wa cout<<"wa"<<endl;

void base(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
}

int main(){
	int n;
	cin>>n;
	if (n%10==9 || n/10==9) cout<<"Yes"<<endl;
	else cout<<"No"<<endl;
	return 0;
}



Measured memory_bytes: 256
import itertools
import math

d,g = map(int, input().split())
pc = [list(map(int, input().split())) for i in range(d)]

a = [i for i in range(d)]

b = itertools.permutations(a,d)

ans = float('inf')

for x in b:
    c = 0
    e = 0
    flag = False
    for i in x:
        if e+100*(i+1)*pc[i][0]<=g:
            c += pc[i][0]
            e+=100*(i+1)*pc[i][0]+pc[i][1]
            if e >= g:
                break
        else:
            c += math.ceil((g-e)/(100*(i+1)))
            break
    ans = min(ans, c)

print(ans)



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

namespace A
{
    class Program
    {
        public static void Main(string[] args)
        {
            var a = ReadLineStringSplit();

            var result = 0;

            if (a[1] == "-") {
                result = int.Parse(a[0]) - int.Parse(a[2]);
            }
            else {
                result = int.Parse(a[0]) + int.Parse(a[2]);
            }

            Console.WriteLine(result);
            ReadLine();
        }

        /// <summary>
        /// コンビネーション
        /// </summary>
        /// <param name="n"></param>
        /// <param name="m"></param>
        /// <returns></returns>
        static int nCm(int n, int m)
        {
            if (m == 0) return 1;
            if (n == 0) return 0;
            return n * nCm(n - 1, m - 1) / m;
        }

        /// <summary>
        /// stringを一文字ずつintにキャストして配列に変換します。
        /// </summary>
        /// <param name="str"></param>
        /// <returns></returns>
        public static int[] StringCharArrayIntArray(string str)
        {
            List<int> b = new List<int>();
            for (int i = 0; i < str.Length; i++) {
                b.Add( int.Parse(str[i].ToString()));
            }
            return b.ToArray();
        }

        public static string ReadLine()
        {
            return Console.ReadLine();
        }

        public static int ReadLineInt()
        {
            return int.Parse(Console.ReadLine());
        }

        public static string[] ReadLineStringSplit(char a = ' ')
        {
            return ReadLine().Split(a).ToArray();
        }

        public static int[] ReadLineIntSpilit(char a = ' ')
        {
            return ReadLine().Split(a).Select(x => int.Parse(x)).ToArray();
        }

        static string[] GetAplhaLowerArray() => new string[]{ "a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"};
        static string[] GetAplhaUpperArray() => new string[] { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" };
    }
}

Measured memory_bytes: 13268
#include <bits/stdc++.h>
#include <climits>
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define srep(i, begin, end) for (__typeof(end) i = begin; i != end; i++)
#define si(x) int x = scanInt();
#define sll(x) LL x = scanLong();
#define sci(x) int x; scanf("%d", &x);
#define scll(x) LL x; scanf("%lld", &x);
#define pi(x) printf("%d ", x)
#define pll(x) printf("%lld ", x)
#define nl printf("\n")
#define clr(a) memset(a, 0, sizeof(a))
#define PB push_back
#define MP make_pair
using namespace std;
typedef unsigned int UI; // 32 bit integer
typedef long int LI; // 32 bit integer
typedef unsigned long int ULI; // 32 bit unsigned integer
typedef long long int LL; // 64 bit integer
typedef unsigned long long int ULL; // 64 bit unsigned integer
typedef long double LD;
typedef vector<int> VI;
typedef vector<LL> VLL;
typedef deque<int> DI;
typedef deque<LL> DLL;
typedef pair<int, int> PII;
typedef pair<LL, LL> PLL;
const LL MOD = 1e9+7;

/* Fast I/O */
inline int scanInt() {
	int n = 0;
	char ch = getchar();
	int sign = 1;
	while(ch < '0' || ch > '9') {
		if(ch == '-')	sign = -1;
		ch = getchar();
	}
	while(ch >= '0' && ch <= '9') {
		n = (n<<1)+(n<<3)+(int)(ch-'0');
		ch = getchar();
	}
	return n*sign;
}

inline LL scanLong() {
	LL n = 0;
	char ch = getchar();
	LL sign = 1;
	while(ch < '0' || ch > '9') {
		if(ch == '-')	sign = -1;
		ch = getchar();
	}
	while(ch >= '0' && ch <= '9') {
		n = (n<<1)+(n<<3)+(LL)(ch-'0');
		ch = getchar();
	}
	return n*sign;
}

int main() {
	sll(a); sll(b); sll(c);
	if((a == b && b != c) || (b == c && c != a) || (c == a && a != b))
		puts("Yes");
	else	
		puts("No");
}


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

using namespace std;

typedef long long LL;
typedef pair<int, int> PII;


int main() {
    ios_base::sync_with_stdio(false);
    string a, b;
    cin >> a >> b;
    for (int i = 0; i < (int)b.length(); i++) {
        cout << a[i] << b[i];
    }
    if (a.length() > b.length()) {
        cout << a[a.length()-1] << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
long long a[4];
int main()
{
    while(scanf("%lld%lld%lld",&a[0],&a[1],&a[2])!=EOF)
    {
        sort(a,a+3);
        long long ans=a[0]*a[1];
        if(a[2]%2==0)
            printf("0\n");
        else
            printf("%lld\n",ans);
    }
    return 0;
}


Measured memory_bytes: 128
#!/usr/bin/env python3
import sys


def solve(H: int, N: int, A: "List[int]", B: "List[int]"):
    nodes = {0: 0}
    fixed = 0
    unfixed = set()
    while True:
        cost = nodes[fixed]
        for a, b in zip(A,B):
            new_node = fixed + a
            last = nodes.get(new_node, 999999999)
            new_cost = cost + b
            if last > new_cost:
                nodes[new_node] = new_cost
                unfixed.add(new_node)
        fixed = min(unfixed)
        if fixed >= H:
            break
        unfixed.remove(fixed)
    print(min([v for k, v in nodes.items() if k >= H]))

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    H = int(next(tokens))  # type: int
    N = int(next(tokens))  # type: int
    A = [int()] * (N)  # type: "List[int]"
    B = [int()] * (N)  # type: "List[int]"
    for i in range(N):
        A[i] = int(next(tokens))
        B[i] = int(next(tokens))
    solve(H, N, A, B)

if __name__ == '__main__':
    main()


Measured memory_bytes: 44636