akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder_Cs
{
    public class Program
    {
        public static void Main()
        {
            var N = int.Parse(Console.ReadLine());
            string ret = "No";

            if (IsHitPattern(N))
            {
                ret = "Yes";
            }
            Console.WriteLine($"{ret}");
        }

        private static bool IsHitPattern(int N)
        {
            var num = new int[] { 1, 2, 3, 4, 5, 6, 7, 8, 9 };
            var lst = new HashSet<int>();

            foreach (int i in num)
            {
                foreach (int j in num)
                {
                    lst.Add(i * j);
                }

            }

            return lst.Contains(N);
        }
    }
}


Measured memory_bytes: 13396
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#include <iostream>
#include <complex>
#include <string>
#include <algorithm>
#include <numeric>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#define debug(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl;

#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 1000010

int main(){
  int n;
  char s[SIZE];

  scanf("%d%s", &n, s);

  int count_m = 0;
  int p[SIZE] = {};
  for(int i=0;i<n;i++){
    if(s[i] == 'M') count_m++;
    p[i] = count_m;
  }

  int Q;
  scanf("%d", &Q);

  for(int i=0;i<Q;i++){
    ll ans = 0;
    int k;
    scanf("%d", &k);
    k--;
    
    int q = 0;
    ll summ = 0;
    for(int j=0;j<k;j++){
      if(s[j] == 'C'){
        q++; summ += p[j];
      }
    }

    for(int j=0;j<n;j++){
      if(j+k < n && s[j+k] == 'C'){
        q++; summ += p[j+k];
      }
      if(s[j] == 'D'){
        ans += summ - (ll)q * p[j]; 
      }
      if(s[j] == 'C'){
        q--; summ -= p[j];
      }
    }

    cout << ans << endl;
  }

  
  
  return 0;
}


Measured memory_bytes: 5120
#include<bits/stdc++.h>
using namespace std;
#define LL long long
const int mod = 1000000007;
int N, M;
LL f[100010];
bool mark[100010];
int main(){
	cin>>N>>M;
	int x;
	for(int i = 1;i <= M; i++){
		scanf("%d", &x);
		mark[x] = true;
	}
	f[0] = 1;f[1] = !mark[1];
	for(int i = 2;i <= N; i++){
		if(mark[i])continue;
		f[i] = 1LL * (f[i-1] + f[i-2]) % mod;
//		printf("f[%d]=%d\n", i ,f[i]);
	}
	cout<<f[N];
	return 0;
}

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

#define debug(a) cout << #a << " " << a << endl;
#define _debug(a, i) cout << #a << "[" << i << "]" << " = " << a[i] << endl;
#define fastio ios_base::sync_with_stdio(false); \
		cin.tie(0);							     \
		cout.tie(0);
#define sz(arr) (ll)arr.size()

using namespace std;

using ll = long long;
const ll MOD = 1e9 + 7;
const ll INF = 1e18 + 9;
const double PI = 4.0 * atan(1.0);

ll powmod(ll a, ll b, const ll MOD) { ll res = 1; a %= MOD; assert(b >= 0); for (; b; b >>= 1) { if (b & 1)res = res * a % MOD; a = a * a % MOD; } return res; }
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll lcm(ll a, ll b) { return (a * b) / gcd(a, b); }
ll modInverse(ll n, const ll p) { return powmod(n, p - 2, p); }

ll div_floor(ll a, ll b) {
	return a / b - (((a ^ b) < 0) and a % b);
}
ll div_ceil(ll a, ll b) {
	return a / b + (((a ^ b) >= 0) and a % b);
}

//ll f[200005];
//ll kCn(ll k, ll n) { return (f[n] * modInverse((f[n - k] * f[k]) % MOD, MOD)) % MOD; }

ll N, K;
vector<ll> A;

ll f(ll mid) {
	ll count = 0;
	for (int i = 0; i < N; ++i) {
		if (A[i] == 0) {
			if (mid >= 0)
				count += N - 1;
		}
		else if (A[i] > 0) {
			ll x = div_floor(mid, A[i]);
			ll idx = ll(upper_bound(A.begin(), A.end(), x) - A.begin());
			if (idx > i)
				count += idx - 1;
			else
				count += idx;
		}
		else { // A[i] < 0
			ll x = div_ceil(mid , A[i]);
			ll idx = ll(lower_bound(A.begin(), A.end(), x) - A.begin());
			if (idx > i)
				count += N - idx;
			else
				count += N - idx - 1;

		}
	}
	
	count /= 2;
	return count;
}

int main() {
	//#ifndef ONLINE_JUDGE
	//	(void)freopen("input.txt", "r", stdin);
	//	(void)freopen("output.txt", "w", stdout);
	//#endif // !ONLINE_JUDGE
	fastio;
	
	cin >> N >> K;
	A.resize(N);
	for (int i = 0; i < N; ++i) {
		cin >> A[i];
	}
	sort(A.begin(), A.end());
	ll lo = -1e18;
	ll hi = 1e18;
	ll ans = 0;
	while (lo <= hi) {
		ll mid = (lo + hi) / 2;
		if (f(mid) >= K)
			ans = mid, hi = mid - 1;
		else
			lo = mid + 1;

	}
	cout << ans;
	return 0;
}


Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
const int INF = 1001001001;
using ll = long long;


int main() {
  int x,y;
  cin >> x >> y;
  if(2*x<=y && y<=4*x && y%2==0){
    cout << "Yes" << endl;
  }
  else{
    cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n;
  string s;
  cin >> n >> s;
  int ans = 0;
  for(int i = 1; i < n; i++){
    bool f[128] = {}, b[128] = {};
    for(int j = 0; j < i; j++){
      f[(int)s[j]] = true;
    }
    for(int j = i; j < n; j++){
      b[(int)s[j]] = true;
    }
    int sum = 0;
    for(int j = 'a'; j < 'z' + 1; j++){
      if(f[j] && b[j])sum++;
    }
    if(sum > ans)ans = sum;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include<stdio.h>

int main() {
	int a,b,c,cnt=0;
	scanf("%d %d %d", &a, &b, &c);

	for (int i = 1; i <= c; i++)
		if (c%i == 0)
			if (a <= i&&i <= b)
				cnt++;
	printf("%d\n", cnt);
	return 0;
}

Measured memory_bytes: 2752
#include <bits/stdc++.h>
using namespace std;
 
#define ll long long
#define ld long double
 
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
 
template <typename T> using oset = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
 
string to_string(char c) {
	return string(1, c);
}
string to_string(bool b) {
	return b ? "true" : "false";
}
string to_string(const char* s) {
	return string(s);
}
string to_string(string s) {
	return s;
}
string to_string(vector<bool> v) {
	string res;
	for(int i = 0; i < (int) v.size(); i++)
		res += char('0' + v[i]);
	return res;
}
 
template<size_t S> string to_string(bitset<S> b) {
	string res;
	for(int i = 0; i < S; i++)
		res += char('0' + b[i]);
	return res;
}

template<class T> string to_string(T v) {
    bool f = 1;
    string res;
    for(auto& x : v) {
		if(!f)
			res += ' ';
		f = 0;
		res += to_string(x);
	}
    return res;
}
 
void DBG() {
	cerr << "]" << endl;
}

template<class H, class... T> void DBG(H h, T... t) {
	cerr << to_string(h);
	if(sizeof...(t))
		cerr << ", ";
	DBG(t...);
}

#ifdef _DEBUG
#define dbg(...) cerr << "LINE(" << __LINE__ << ") -> [" << #__VA_ARGS__ << "]: [", DBG(__VA_ARGS__)
#else
#define dbg(...) 0
#endif

const int d4i[4] = {-1, 0, 1, 0}, d4j[4] = {0, 1, 0, -1};
const int d8i[8] = {-1, -1, 0, 1, 1, 1, 0, -1}, d8j[8] = {0, 1, 1, 1, 0, -1, -1, -1};

void solve() {                          
	int n;
	cin >> n;
	string a;
	for(int i = 0; i < n; i++){
		int x, y;
		cin >> x >> y;
		if(x == y)
			a.push_back('1');
		else a.push_back('0');
	}
	cout << (a.find("111") != string::npos ? "Yes":"No");
}	
 
int main() {
	
	ios::sync_with_stdio(0);
	cin.tie(0);
 	
	int t = 1;
	//cin >> t;
	for(int i = 1; i <= t; i++) {
		//cout << "Case #" << i << ": ";
		solve();
	}
}

Measured memory_bytes: 3656
#include <iostream>
using namespace std;
int n, x, a, light = 1000, sum = 0;
int main(void){
    // Your code here!
    cin >> n >> x;
    for (int i = 0; i < n; i++) {
        cin >> a;
        if (light > a) light = a;
        sum += a;
    }
    cout << n + (x - sum) / light << endl;
}


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

#define int long long
#define fi first
#define se second
#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 repo(i,o,n) for(int i=o;i<(int)(n);++i)
#define repm(i,n) for(int i=(int)(n)-1;i>=0;--i)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define sperase(v,n) (v).erase(remove(all(v), n), (v).end());
#define vdelete(v) (v).erase(unique(all(v)), (v).end());
#define pb(n) push_back(n);
#define mp make_pair
#define MOD 1000000007
#define INF 9223372036854775807

int N,C,s,t,c,ans[100001],answer;
vector<pair<int,int>> v[30];

signed main() {
    cin >> N >> C;
    rep(i,N) {
        cin >> s >> t >> c;
        s--;c--;
        v[c].pb(mp(s,t))
    }
    rep(i,C) {
        int memo[100001] = {};
        rep(j,v[i].size()) memo[v[i][j].fi]++,memo[v[i][j].se]--;
        rep1(j,100000) memo[j] += memo[j-1];
        rep(j,100000) if (memo[j]) ans[j]++;
    }
    rep(i,100000) answer = max(answer,ans[i]);
    cout << answer << endl;
}

Measured memory_bytes: 4352
/** 与えられた数列を逆順に出力するプログラムを作成して下さい。  */

/*sucannerクラス使うためにインポート*/
import java.util.Scanner;

class Main {
	// プログラムのエントリポイント
	public static void main(String[] args) {
		// 入力ストリームの生成
		Scanner sc = new Scanner(System.in);
		// 処理を繰り返す
		// 数字を受け取る
		int inti = sc.nextInt();
		//配列の宣言
		int[] array;
		//変数の宣言
		int i = 0;
		//受け取った数字の数配列をつくる
		array = new int[inti];
		//受け取った数だけ動作を繰り返す
		for (i = 0; i < inti; i++) {
			//受け取った数字を配列に入れる
			array[i] = sc.nextInt();
			// test System.out.print(array[i]);
		}
		//配列の数が0番になるまで繰り返す
		for (; i > 0; i--) {
			//結果表示
			System.out.print(array[i - 1]);
			if (i - 1 != 0){
				System.out.print(" ");
			}
		}
		System.out.println();
	}
}

Measured memory_bytes: 19640
#include <bits/stdc++.h>
#define all(x) x.begin(),x.end()
#define ll long long int
#define N 3005
using namespace std;
ll a[N][N],dp[4][N][N];
void solveE(){
    int r,c,k;
    cin>>r>>c>>k;
    for(int i=0;i<k;i++){
        ll x,y,z;
        cin>>x>>y>>z;
        a[x][y]=z;
    }
    for(int i=1;i<=r;i++){
        for(int j=1;j<=c;j++){
            for(int k=0;k<4;k++){
                for(int l=0;l<4;l++) dp[k][i][j]=max(dp[k][i][j],dp[l][i-1][j]);
                if(k==0) dp[k][i][j]=max(dp[k][i][j],dp[0][i][j-1]);
                else if(k==1) dp[k][i][j]=max(dp[k][i][j]+a[i][j],max(dp[k-1][i][j-1]+a[i][j],dp[k][i][j-1]));
                else dp[k][i][j]=max(dp[k-1][i][j-1]+a[i][j],dp[k][i][j-1]);
            }
        }
    }
    ll ans=0ll;
    for(int i=0;i<4;i++) ans=max(ans,dp[i][r][c]);
    cout<<ans;
}
int main()
{
    solveE();
    return 0;
}


Measured memory_bytes: 355728
//#include <bits/stdc++.h>
 
#include <iostream>
#include <algorithm>
 
#include <bitset>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <stack>
#include <queue>
#include <deque>
#include <cstring>
#include <string>
#include <utility>
#include <array>
#include <complex>
#include <valarray>
 
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <chrono>
#include <random>
#include <numeric>
 
 
using namespace std;
#define int long long
 
typedef long long ll;
typedef unsigned long long ull;
//typedef unsigned __int128 HASH;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pullull;
typedef pair<ll,int> plli;
typedef pair<double, int> pdbi;
typedef pair<int,pii> pipii;
typedef pair<ll,pll> plpll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<pii> vpii;
typedef vector<vector<int>> mat;
 
#define rep(i,n) for (int i=0;i<(n);i++)
#define rep2(i,a,b) for (int i=(a);i<(b);i++)
#define rrep(i,n) for (int i=(n);i>0;i--)
#define rrep2(i,a,b) for (int i=(a);i>b;i--)
#define pb push_back
#define fi first
#define se second
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
 
const ll hmod1 = 999999937;
const ll hmod2 = 1000000000 + 9;
const int INF = 1<<30;
const ll INFLL = 1LL<<62;
const double EPS = 1e-12;
const ll mod = 1000000000 + 7;
const int dx4[4] = {1, 0, -1, 0};
const int dy4[4] = {0, 1, 0, -1};
const int dx8[8] = {1, 1, 1, 0, 0, -1, -1, -1};
const int dy8[8] = {0, 1, -1, 1, -1, 0, 1, -1};
const double pi = 3.141592653589793;
 
#define addm(X, Y) (X) = ((X) + ((Y) % mod) + mod) % mod
#define inside(y, x, h, w) (0 <= (y) && (y) < (h) && 0 <= (x) && (x) < (w)) ? true : false

int n, m;

signed main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n >> m;
    cout << (n - 1) * (m - 1) << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using Int = long long;
typedef pair<int,int> P;
typedef vector<int> Vi;
int const MOD = 1000000007;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { return a = b; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { return a = b; } return false; }

int d[100001];

int main(){
  cin.tie(0); ios::sync_with_stdio(false);
    
  Int n,x,ans=0; cin>>n>>x; Int a[n];
  for (int i = 0; i < n; i++)cin>>a[i];
  for (int i = 0; i < n-1; i++){
    if(a[i]+a[i+1]>x){
      if(a[i]>x){
        ans+=a[i]+a[i+1]-x;
        a[i]-=x-a[i+1]; a[i+1]=0; 
      }else{
        ans+=a[i]+a[i+1]-x;
        a[i+1]-=a[i]+a[i+1]-x;
      }
    }
  }
  cout<<ans<<'\n';
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
#define ARRAY_LENGTH(array) (sizeof(array) / sizeof(array[0]))
#define SORT(arr) sort(arr, arr + ARRAY_LENGTH(arr))

int A,B,C;
int X;
int main(){
	cin >> A >> B >> C >> X;
	int ans=0, rest;
	for(int i=0;i<=A;i++){
		for(int j=0;j<=B;j++){
			rest = X - i*500 - j*100;
			if(rest <= C*50 && rest >= 0)ans ++;
		}
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
int main(void){
int count;
int n;
scanf("%d",&n);
count=0;
for(;;count++){
if((int)(count*1.08)==n){printf("%d\n",count);break;}
else if((int)(count*1.08)>n){printf(":(\n");break;}
}
return 0;
}

Measured memory_bytes: 128
from math import sqrt
q3 = sqrt(3)
fmt = "%.8f %.8f"
def koch(x0, y0, x1, y1, c):
    if c == n:
        return (fmt % (x0, y0),)
    xp = (x0*2 + x1) / 3
    yp = (y0*2 + y1) / 3

    xq = (x0 + x1*2) / 3
    yq = (y0 + y1*2) / 3

    dx = (x1 - x0) / 6
    dy = (y1 - y0) / 6

    xr = xp + (dx - dy * q3)
    yr = yp + (dx * q3 + dy)

    return koch(x0, y0, xp, yp, c+1) + koch(xp, yp, xr, yr, c+1) + koch(xr, yr, xq, yq, c+1) + koch(xq, yq, x1, y1, c+1)
n = int(input())
print(*koch(0, 0, 100, 0, 0)+(fmt % (100, 0),), sep='\n')


Measured memory_bytes: 6032
#include<cstdio>
main(){for(char t[11];scanf("%s",t)!=EOF;){int i,s,p[10]={1,9,6,4,6,6,4,6,9,1};for(i=s=0;i<10;i++)s+=(t[i]-'0')*p[i];printf("%d\n",s%10);}}

Measured memory_bytes: 0
//............Created by:- Arth Raj...........................//
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long int
#define pii pair<int,int>
#define pll pair<long long int,long long int>
#define pb push_back
#define mp make_pair
#define vi vector<int>
#define vii vector<pair<int,int>>
#define tez ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define lp(i,a,b) for(int i=a;i<b;i++)
#define rlp(i,a,b) for(int i=b;i>=a;i--)
#define ld long double
#define tl tuple<ll,ll,ll>
#define all(x) (x).begin(),(x).end()
#define bs(x,b) binary_search(all(x),b)
#define vip vector<pair<int,pair<int,int>>>
#define pip pair<int,pair<int,int>>
#define INF 1e18
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> pbds;
ll abm(ll a, ll b, ll m) {ll ans = 1; a = a % m; while (b > 0) {if (b & 1)ans = (ans * a) % m; a = (a * a) % m; b = b / 2;} return ans % m;}
ll ncr(ll n, ll r, ll m) {if (r == 0)return 1; ll fac[n + 5]; fac[0] = 1; lp(i, 1, n + 1) {fac[i] = fac[i - 1] * i % m;} return (((fac[n] * abm(fac[r], m - 2, m)) % m) * (abm(fac[n - r], m - 2, m))) % m;}
int main()
{
	string s, t;
	cin >> s >> t;
	// s = " " + s;
	// t = t;
	int dp[s.length() + 1][t.length() + 1];
	lp(i, 0, s.length() + 1)
	{
		dp[i][0] = 0;
	}
	lp(i, 0, t.length() + 1)
	{
		dp[0][i] = 0;
	}
	lp(i, 1, s.length() + 1)
	{
		lp(j, 1, t.length() + 1)
		{
			if (s[i - 1] == t[j - 1])
				dp[i][j] = dp[i - 1][j - 1] + 1;
			else
				dp[i][j] = max(dp[i - 1][j], dp[i][j - 1]);
		}
	}
	int x = s.length(), y = t.length();
	int prev = dp[x][y];
	string ans = "";
	while ((x > 0) and (y > 0))
	{
		if (dp[x - 1][y] != prev and dp[x][y - 1] != prev)
		{
			ans = s[x - 1] + ans;
			x--;
			y--;
			prev = dp[x][y];
		}
		else
		{
			if (dp[x - 1][y] == prev)
				x--;
			else if (dp[x][y - 1] == prev)
				y--;
		}
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 38752
#include <bits/stdc++.h>
#include <numeric>
using namespace std;
#define ll long long
#define mod 100000007
#define rep(i, n) for (int i = 0; i < n; ++i)
using Graph = vector<vector<int>>;
ll lcm(ll a, ll b)
{
    return a * b / __gcd(a, b);
}

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    //cout << fixed << setprecision(15);
    int N;
    cin >> N;
    int div = N / 15;
    ll ans = 800 * N - div * 200;
    cout << ans << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void)
{
	int s,m,h;
	scanf("%d",&s);
	h=s/3600;
	m=s%3600/60;
	s=s%3600%60%60;
	printf("%d:%d:%d\n",h,m,s);
	return 0;
}


Measured memory_bytes: 2000
/**
*    Username : adhoc_king
*    Name : adhoc_king
*    Institute : IIT Bombay
*/

#include <bits/stdc++.h>
#include <algorithm>
#include <iostream>
#include <cstring>
#include <vector>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <string>
// #include <deque>
// #include <queue>
// #include <array>
// #include <ctime>
// #include <list>
// #include <map>
// #include <set>
// #include <cassert>
// #include <complex>
// #include <sstream>
// #include <forward_list>
// #include <unordered_set>
// #include <unordered_map>

using namespace std;

#define int long long
#define pb push_back
#define mp make_pair
#define scani(n) scanf("%d",&n);
#define EPS 1e-9
#define FOR(i,n) for(int i=0; i<n; i++)
#define X first
#define Y second
#define arrinput for(int i=0; i<n; i++) cin>>arr[i];
#define arrsum for(int i=0; i<n; i++) sum+=arr[i];
#define for0(i,n) for(int i=0; i<n; i++)
#define for1(i,n) for(int i=1; i<=n; i++)
#define forr(i,n) for(int i=n-1; i>=0; i--)
#define all(v) v.begin(), v.end()

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

const int MOD = 1e9+7;
const int n_ = 1e5+1000;
const long double PI = acos(-1.0);

ll gcd (ll a, ll b) {return ( a ? gcd(b%a, a) : b );}
ll power(ll a, ll n) {ll p = 1;while (n > 0) {if(n%2) {p = p * a;} n >>= 1; a *= a;} return p;}
ll power(ll a, ll n, ll mod) {ll p = 1;while (n > 0) {if(n%2) {p = p * a; p %= mod;} n >>= 1; a *= a; a %= mod;} return p % mod;}

bool vowel(char ch) {
    if(ch=='a' || ch=='e' || ch=='i' || ch=='o' || ch=='u') return true;
    else return false;
}

// Union-Find Disjoint Sets Library written in OOP manner, using both path compression and union by rank heuristics
class UnionFind {                                              // OOP style
private:
    vi p, rank, setSize;                       // remember: vi is vector<int>
    int numSets;
public:
    UnionFind(int N) {
        setSize.assign(N, 1); numSets = N; rank.assign(N, 0);
        p.assign(N, 0); for (int i = 0; i < N; i++) p[i] = i; }
    int findSet(int i) { return (p[i] == i) ? i : (p[i] = findSet(p[i])); }
    bool isSameSet(int i, int j) { return findSet(i) == findSet(j); }
    void unionSet(int i, int j) { 
        if (!isSameSet(i, j)) { numSets--; 
        int x = findSet(i), y = findSet(j);
        // rank is used to keep the tree short
        if (rank[x] > rank[y]) { p[y] = x; setSize[x] += setSize[y]; }
        else                   { p[x] = y; setSize[y] += setSize[x];
                                 if (rank[x] == rank[y]) rank[y]++; } } }
    int numDisjointSets() { return numSets; }
    int sizeOfSet(int i) { return setSize[findSet(i)]; }
};

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

    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);

    int n;
    cin>>n;
    int arr[n], brr[n];
    for0(i,n) cin>>arr[i];
    for0(i,n) cin>>brr[i];
    int sum = 0;
    for0(i,n) if(arr[i] > brr[i]) sum += (arr[i] - brr[i]);
    cout<<sum;

    return 0;
}

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

int main() {
	string S;
  cin >> S;
  int count = 0;
  	for(int i = 0; i < S.size()/2; i++){
    	if(S[i] != S[S.size()-i-1]){
        	count++;
        }
    }
    	cout << count << endl;
                 
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#ifdef _DEBUG
#include "dump.hpp"
#else
#define dump(...)
#endif

//#define int long long
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)
const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)(1e9) + 7;
template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; }

signed main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	int cnt[26] = {};
	int N; cin >> N;
	memset(cnt, 0x3f, sizeof(cnt));
	rep(i, 0, N) {
		string s; cin >> s;
		int cnt2[26] = {};
		rep(j, 0, s.size()) {
			cnt2[s[j] - 'a']++;
		}
		rep(j, 0, 26) {
			chmin(cnt[j], cnt2[j]);
		}
	}
	rep(i, 0, 26) {
		while (cnt[i]--) {
			cout << (char)(i + 'a');
		}
	}
	cout << endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.PriorityQueue;
import java.util.Comparator;
import java.util.Scanner;

public class Main {
	// arc074 D
	private class SumedQueue {
		private int maxSize = 0;
		private long sum = 0;
		private PriorityQueue<Integer> queue = null;
		
		public SumedQueue(int maxSize, boolean isReversed) {
			this.maxSize = maxSize;
			if (isReversed) {
				queue = new PriorityQueue<Integer>(new Comparator<Integer>() {
					@Override
					public int compare(Integer o1, Integer o2) {
						return o2 - o1;
					}
				});
			} else {
				queue = new PriorityQueue<Integer>();
			}
		}
		
		public void add(int n) {
			queue.add(n);
			sum += n;
			if (queue.size() > maxSize) {
				int out = queue.poll();
				sum -= out;
			}
		}
		
		public long total() {
			return sum;
		}
	}
	
	public void solve() {
		Scanner in = new Scanner(System.in);
		int N = in.nextInt();

		SumedQueue left = new SumedQueue(N, false);
		SumedQueue right = new SumedQueue(N, true);
		
		int[] middle = new int[N];
		for (int i=0; i<N; i++) {
			left.add(in.nextInt());
		}
		for (int i=0; i<N; i++) {
			middle[i] = in.nextInt();
		}
		for (int i=0; i<N; i++) {
			right.add(in.nextInt());
		}
		in.close();

		// sums[i] : middle[i-1] is left(plus), middle[i] is right(minus)
		long sums[] = new long[N+1];
		sums[0] = left.total();
		for (int i=0; i<N; i++) {
			left.add(middle[i]);
			sums[i+1] = left.total();
		}

		sums[N] -= right.total();
		for (int i=N-1; i>=0; i--) {
			right.add(middle[i]);
			sums[i] -= right.total();
		}

		long max = Long.MIN_VALUE;
		for (int i=0; i<sums.length; i++) {
			if (sums[i] > max) {
				max = sums[i];
			}
		}
		
		System.out.println(max);
	}

	public static void main(String[] args) {
		Main main = new Main();
		main.solve();
	}
}


Measured memory_bytes: 100452
#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,n,s) for(int i=(s);i<(n);i++)
typedef long long int ll;
using namespace std;
using Graph = vector<vector<int> >;

int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int a,b;
cin>>a>>b;
cout<<(a+b)%24<<endl;
//system("pause");
return 0;
}

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

using namespace std;
using ll = long long;

const int N = 400 + 5;

ll dp[N][N];
// dp[i][j] - solve for range [i, j];

int main() { 
    ios_base::sync_with_stdio(false); 
    cin.tie(0);
    int n;
    cin >> n;
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
    }
    auto f = [&](int l, int r) {
        ll sum = 0;
        for (int i = l; i <= r; i++) {
            sum += 1LL * a[i];
        }
        return sum;
    };
    for (int l = n - 1; l >= 0; l--) {
        for (int r = 0; r < n; r++) {
            if (l == r) {
                dp[l][r] = 0;
                continue;
            }
            dp[l][r] = LLONG_MAX;
            ll sum = f(l, r);
            for (int i = l; i <= r - 1; i++) {
                dp[l][r] = min(dp[l][r], dp[l][i] + dp[i + 1][r] + sum);
            }
        }
    }
    cout << dp[0][n - 1] << '\n';
}


Measured memory_bytes: 1536
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

def main():
    N, *A = map(int, read().split())
    money = 1000
    kabu_no = 0
    status = 0
    for i in range(len(A)-1):
        if A[i]<A[i+1]:
            if status == 1:
                continue
            elif status == 0:
                kabu_no = money // A[i]
                money %= A[i]
                status = 1
        elif A[i]==A[i+1]:
            continue
        else:
            if status == 1:
                money += kabu_no * A[i]
                kabu_no = 0
                status = 0
            elif status == 0:
                continue
    money += kabu_no * A[N-1]
    print(money)
    return

if __name__ == '__main__':
    main()


Measured memory_bytes: 9172
s = input()
n = len(s)
for i in range(n-1,0,-1):
    s = s[0:i]
    n = len(s) 
    if n%2 != 0:
        pass
    else:
        if s[0:i//2] == s[i//2:n]:
            print(n)
            exit()

Measured memory_bytes: 9116
#include<bits/stdc++.h>
using namespace std;
string s;
int n;
int main()
{
	cin>>n>>s;
	for(int i=0;i<s.length();i++)
	{
		int delta=s[i]-'A';
		delta+=n;
		delta%=26;
		s[i]=(char)('A'+delta);
	}
	cout<<s<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i,x,n) for(int i=x;i<(int)n;i++)
#define rep(i,n) REP(i,0,n)
#define sp(p) cout<<setprecision(16)<<fixed<<p<<endl;
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define SORT(a) sort(all(a))
#define RSORT(a) sort(rall(a))
#define UNIQ(a) unique(all(a))
#define UNIQNUM(a) UNIQ(a)-a.begin()
#define UNIQIT(a) a.erase(UNIQ(a), a.end());
#define VOUT(v,i) rep(i,v.size())cout<<v[i]<<(i==v.size()-1?"\n":" ");
#define vout(v) VOUT(v,z);
#define vdbg(v,i) cout<<#v<<": ";for(int i=0;i<(int)v.size();i++){cout<<v[i]<<" ";}cout<<"\n";
#define vmin(v) *min_element(all(v))
#define vmax(v) *max_element(all(v))
#define vsum(v) accumulate(all(v), 0LL)
#define MOUT(m,r,c) rep(i,r){rep(j,c){cout<<m[i][j]<<" ";}cout<<endl;}
#define mout(m) MOUT(m,m.size(),m[0].size())
#define debg(a) cout<<#a<<": "<<a<<endl;
#define show(a) for(cont &y:a){for(cont &x:y){cout<<x<<" ";}cout<<endl;}
#define digit(a) to_string(a).length();
template<class T>inline int out(const T &t){ print(t); putchar('\n'); return 0; }
// template<class T>inline T gcd(T a,T b){if(b==0)return a; return(gcd(b,a%b));}
// template<class T>inline T lcm(T a,T b){return a/gcd(a,b)*b;}
bool is_palindrome(string s){return s == string(s.rbegin(),s.rend());}
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef vector<ll> V;
typedef vector<vector<ll>> VV;
// const long long MOD=1000000007;
const long long INF = 1e18;
#define EPS (1e-7)
#define PI (acos(-1))
template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) { a = b; return true; }
    return false;
}
template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) { a = b; return true; }
    return false;
}



int main(){
    long long R;
    scanf("%lld",&R);
    // long long M;
    // scanf("%lld",&M);
    // std::vector<long long> A(M);
    // for(int i = 0 ; i < M ; i++){
    //     scanf("%lld",&A[i]);
    // }
    //solve(N, M, std::move(A));
    cout << 2*R*PI << endl;
    return 0;
}


Measured memory_bytes: 3848
#include<stdio.h>
int N,c,a,n,r;
int main()
{
	scanf("%d",&N);
	for(;N--;)
	{
		r=0;
		scanf("%d%d%d",&c,&a,&n);
		for(;c>0&&a>0&&n>0;r++,c--,a--,n--);
		for(;c>1&&a>0;r++,c-=2,a--);
		for(;c>2;r++,c-=3);
		printf("%d\n",r);
	}
	return 0;
}

Measured memory_bytes: 600
#include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <cstring>
#include <queue>

#define rep(i,n) for(int i = 0; i < (n); i++)
#define all(v) (v).begin(), (v).end()
#define MP make_pair
using namespace std;

typedef vector<int> vi;
typedef pair<int, int> P;
typedef long long ll;

int dp[20000][256];

int main(){
	//freopen("test.txt", "r", stdin);
	int n, m;
	while(cin >> n >> m, n|m){
		vector<int> C(m);
		rep(i, m) cin >> C[i];
		vector<int> x(n);
		rep(i, n) cin >> x[i];

		rep(i, 20000) rep(j, 256) dp[i][j] = 2<<29;

		rep(i, m){
			int val = 128+C[i];
			if(val < 0) val = 0;
			if(val > 255) val = 255;
			dp[0][val] = (x[0]-val)*(x[0]-val);
		}
		rep(i, n-1){
			rep(j, 256){
				if(dp[i][j] == 2<<29) continue;
				rep(k, m){
					int val = j+C[k];
					if(val < 0) val = 0;
					if(val > 255) val = 255;
					int d = (x[i+1]-val)*(x[i+1]-val);
					dp[i+1][val] = min(dp[i+1][val], dp[i][j]+d);
				}
			}
		}
		int ans = 2<<29;
		rep(i, 256){
			ans = min(ans, dp[n-1][i]);
		}
		cout << ans << endl;
	}

	return 0;
}

Measured memory_bytes: 21272
#include<bits/stdc++.h>
#define rep(i,l,r) for (int i=l;i<=r;i++)
using namespace std;
int n,m,ans,k;
vector<int>g[100500];
int mx[100500],dep[100500],a[100500];
void dfs(int u,int fa){
    mx[u]=max(mx[u],dep[u]);
    for (auto v:g[u]){
        if (v==fa) continue;
        dep[v]=dep[u]+1;
        dfs(v,u);
        mx[u]=max(mx[u],mx[v]); 
    }
    if (mx[u]-dep[u]>=k-1&&u!=1&&a[u]!=1) mx[u]=0,ans++; 
}
int main(){
    scanf("%d%d",&n,&k);
    rep(i,1,n) scanf("%d",&a[i]);
    if (a[1]!=1) ans++,a[1]=1;
    rep(i,2,n) g[a[i]].push_back(i);
    dfs(1,0);
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 13184
#include<stdio.h>

int main(){
  int y[7];
  int i,n,d;

  for(;;){
    scanf("%d",&n);
    if(n==0)
      break;
    for(i=0;i<7;i++)
      y[i]=0;

    for(i=0;i<n;i++){
      scanf("%d",&d);
      
      d=d/10;
      if(d>=7)
	y[6]++;
      else
	y[d]++;
    }
    for(i=0;i<7;i++)
      printf("%d\n",y[i]);
  }
  return 0;
}

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

using namespace std;

#define int long long
#define endl '\n'
#define maxn 100010
const int MOD = 1000000007;

long long C(int n, int r) {
    if (n < r)
        return 0;
    if (r > n - r) r = n - r; // because C(n, r) == C(n, n - r)
    long long ans = 1;
    int i;

    for (i = 1; i <= r; i++) {
        ans *= n - r + i;
        ans /= i;
    }

    return ans;
}

void solve() {
    int n;
    cin >> n;

    vector<int> v(n);
    map<int, int> mp;
    for (int i = 0; i < n; ++i) {
        cin >> v[i];
        mp[v[i]]++;
    }
    int ans = 0;
    for (auto x: mp)
        ans += C(x.second, 2);
    for (int i = 0; i < n; i++) {
        int pans = ans - C(mp[v[i]], 2);
        pans += C(mp[v[i]] - 1, 2);
        cout << pans << endl;
    }
}

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

    int t = 1;
//    cin >> t;

    while (t--)
        solve();
    return 0;
}

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

#define rep(i , j , n) for(long long i = j ; i <= n ; i++)
#define per(i , j , n) for(long long i = j ; i >= n ; i--)
 
const ll N = 123456;
const ll mod = 1e9 + 7;
const ld eps = 1e-6;
const ld pi = 3.1415926535;

int a[N];
int vis[N];
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
 
    cout << fixed << setprecision(12);

    int n;

    int k;

    cin >> n >> k;

    string s;
    cin >> s;

    rep(i , 1 , n) {
      if(s[i - 1] == 'L') {
        a[i] = 1;
      }
      else {
        a[i] = -1;
      }
    }

    // rep(i , 1 , n) {
    //   a[i] += a[i - 1];
    // }

    // rep(i , 1 , n) {
    //   cout << a[i] << " ";
    // }

    // cout << endl;

    int sum = 0;

    int cur = 1;
    if(n == 1) {
      cout << 0 << endl;
      return 0;
    }

    vector < int > res;

    // rep(i , 1 , n) {
    //     cout << a[i] << endl;
    // }
    rep(i , 2 , n) {
        if(a[i] == a[i - 1]) {
            //cout << a[i - 1] << " " << a[i] << endl;
            cur++;
        }
        else {
            res.push_back(cur);
            cur = 1;
        }
    }

    res.push_back(cur);

    for(auto j : res) {
        sum += j - 1;
    }

    while(k--) {
        sum += 2;
    }
    cout << min(sum , n - 1) << endl;
    return 0;

}


Measured memory_bytes: 1356
n,m,k=map(int,input().split())
wari=998244353


basum=0
for i in range(k+1):
	if i == 0:
		kumiawase=1
	else:
		kumiawase = kumiawase*(n-i)*pow(i,wari-2,wari)
		kumiawase %= wari
	basum += m * pow(m-1,n-i-1,wari) * kumiawase
	basum %= wari

print(basum)


Measured memory_bytes: 9156
import sys
from collections import deque
import copy
import heapq

from math import *

def get_read_func(fileobject):
    if fileobject == None :
        return raw_input
    else:
        return fileobject.readline


def main():
    if len(sys.argv) > 1:
        f = open(sys.argv[1])
    else:
        f = None
    read_func = get_read_func(f);
    input_raw = read_func().strip().split()
    [N, M] =  [int(input_raw[0]), int(input_raw[1])]
    graph = {}
    for i in range(M):
        input_raw = read_func().strip().split()
        [a, b, c] =  [int(input_raw[0]), int(input_raw[1]), int(input_raw[2])]
        if a not in graph:
            graph[a] = [(b, -long(c))]
        else:
            graph[a].append((b, -long(c)))

    dummy_inf = long(sys.maxint) * long(sys.maxint)
    dist_list =[dummy_inf for i in range(N + 1)]
    dist_list[1] = 0L

    for i in range(0, 2 * N):
        for j in range(1, N + 1):
            if j not in graph:
                continue
            for edge in graph[j]:
                if dist_list[j] < dummy_inf:
                    new_cost = dist_list[j] + edge[1]
                    if new_cost < dist_list[edge[0]]:
                        dist_list[edge[0]] = new_cost
                        if (i >= N - 1 and edge[0] == N):
                            print "inf"
                            return
    print -dist_list[N]


if __name__ == '__main__':
    main()

Measured memory_bytes: 3400
#include <bits/stdc++.h>
using namespace std;
int h,w,cnt[55][55];
char chart[55][55];
int main()
{
    cin>>h>>w;
   for(int i=1;i<h+1;i++)
   {
       for(int j=1;j<w+1;j++)
       {
           scanf(" %c",&chart[i][j]);
       }
   }
   for(int i=1;i<h+1;i++)
   {
       for(int j=1;j<w+1;j++)
       {
           if(chart[i-1][j]=='#')
           {
               cnt[i][j]++;
           }
           if(chart[i+1][j]=='#')
           {
               cnt[i][j]++;
           }
           if(chart[i][j+1]=='#')
           {
               cnt[i][j]++;
           }
           if(chart[i][j-1]=='#')
           {
               cnt[i][j]++;
           }
           if(chart[i+1][j+1]=='#')
           {
               cnt[i][j]++;
           }
           if(chart[i+1][j-1]=='#')
           {
               cnt[i][j]++;
           }
           if(chart[i-1][j+1]=='#')
           {
               cnt[i][j]++;
           }
           if(chart[i-1][j-1]=='#')
           {
               cnt[i][j]++;
           }
       }
   }
   
   
   for(int i=1;i<h+1;i++)
   {
       for(int j=1;j<w+1;j++)
       {
           if(chart[i][j]!='#')
           {
           chart[i][j]=cnt[i][j]+'0';
           }
       }
   }
   for(int i=1;i<h+1;i++)
   {
       for(int j=1;j<w+1;j++)
       {
           cout<<chart[i][j];
       }
       printf("\n");
   }
   
    
  
   
    
}



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

#define ll long long int
#define mp make_pair
#define ff first
#define ss second
#define fr(i,l,r) for (long long int i = l; i < r; ++i)
#define frr(i,l,r) for (long long int i = r; i >= l; --i) 
#define sortarr sort(arr,arr+n) //sorts array in asc order
#define sortarr_r sort(arr, arr+n, greater<long long int>()) //sorts array in desc order
#define make_set set<long long int>s //Set arranges in asc order
#define make_set_r set<long long int, greater <long long int>>s ////Set arranges in desc order
#define make_vector vector<long long int>v; 
#define pb push_back


// string size = str.size()

// stack <int> s; 
// queue <int> gquiz; 
// __gcd(m, n) 

// ll arr[10e5 + 5];
// char arr[10e5 + 5];


bool compare(string &s1,string &s2) 
{ 
    return s1.size() < s2.size(); 
} 
void yes()
{
    cout << "YES" << endl;
}
void no()
{
    cout << "NO" << endl;
}


int main(void)
{
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    ll n,a = 0,b = 0;
    cin >> n;
    for(ll i = -1000; i<=1000; i++)
    {
        for(ll j = -1000; j<=1000; j++)
        {
            if( ((i*i*i*i*i) - (j*j*j*j*j)) == n ) 
            {
                a = i;
                b = j;
                break;
            }
            else if( ((j*j*j*j*j) - (i*i*i*i*i) ) == n )
            {
                a = j;
                b = i;
                break;
            }
            
        }
    }
    cout << a << " " << b << endl;
    return 0;
}   

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

int main(){
  string c = "Yes";
  int n,t1=0,x1=0,y1=0;
  cin >> n;
  for(int i=0;i<n;i++){
    int t,x,y;
    cin >> t >> x >> y;
    int time = t-t1;
    int dis = abs(x-x1)+abs(y-y1);
    if(time-dis<0||(time-dis)%2==1){
      c = "No";
      break;
    }
    t1 = t;
    x1 = x;
    y1 = y;          
  }
  cout << c << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cctype>

std::string to_lower(std::string t){
    for(int i = 0; i < t.size(); i++){
        t[i] = (char)tolower(t[i]);
    }
    return t;
}

int main(){
    std::string w;
    std::cin >> w;
    w = to_lower(w);
    long long count = 0;
    
    while(1){
        std::string t;
        std::cin >> t;
        
        if(t == "END_OF_TEXT") break;
        t = to_lower(t);
        
        if(w == t) count++;
    }
    std::cout << count << std::endl;
    return 0;
}


Measured memory_bytes: 3176
n,a,b,c,d=map(int,input().split())
if n%a!=0:
    s=n//a+1
else:
    if n//a==0:
        s=n//a+1
    else:
        s=n//a
if n%c!=0:
    t=n//c+1
else:
    if n//c==0:
        t=n//c+1
    else:
        t=n//c
if b*s>d*t:
    print(d*t)
else:
    print(b*s)


Measured memory_bytes: 5596
n, k = map(int, input().split())
num =  [0] * 10**5
for i in range(n):
  a, b = map(int, input().split())
  num[a-1] += b
wa =  0
wa_b = 0
for i in range(len(num)):
  if num[i] == 0:
    pass
  else:
    wa += num[i]
    if wa_b < k and k <= wa:
      print(i+1)
      wa_b = wa
    else:
      wa_b = wa

Measured memory_bytes: 5744
#include<bits/stdc++.h>
using namespace std;
#define inf 100000000000000000
#define ll long long int
#define pb push_back
#define f first
#define s second
#define mod 1000000007
#define fast ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
void mahakal(){
	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	freopen("error.txt","w",stderr);
	#endif
}

int main(){
//	mahakal();
  fast;

	ll arr[3];
	cin>>arr[0]>>arr[1]>>arr[2];
	sort(arr,arr+3);
	if((arr[0]== arr[1] && arr[1]!=arr[2] ) || (arr[1]==arr[2] && arr[1]!=arr[0]) ){
		cout<<"Yes"<<endl;
	}
	else{
		cout<<"No"<<endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#define SF scanf
#define PF printf
#define MAXN 200010
using namespace std;
int n;
int p[MAXN],q[MAXN],ans[MAXN],f[MAXN];
bool ord(int x,int y,int z){
	if(x<y&&y<z)
		return 1;
	if(y<z&&z<x)
		return 1;
	if(z<x&&x<y)
		return 1;
	return 0;	
}
int main(){
	SF("%d",&n);	
	for(int i=1;i<=n;i++){
		SF("%d",&p[i]);
		q[p[i]]=i;
	}
	for(int i=n-1;i>=1;i--){
		if(ans[i+1]==0){
			if(q[i]>q[i+1]){
				ans[i]=1;
				f[i]=i+1;
			}
		}
		else{
			if(ord(q[i],q[i+1],q[f[i+1]])){
				ans[i]=ans[i+1];
				f[i]=f[i+1];
			}
			else{
				ans[i]=ans[i+1]+1;
				f[i]=i+1;	
			}
		}
	}
	PF("%d",ans[1]);
}

Measured memory_bytes: 3328
#include <bits/stdc++.h>
#define Roc ios_base::sync_with_stdio(false), cin.tie(NULL)
#define ll long long
#define NMAX 100009

using namespace std;
const int inf = 1e9 + 5;
int v[NMAX], pd[NMAX], k,n;
int main()
{
    Roc;
    cin >> n >> k;
    for(int i = 1; i <= n; ++i)
        cin >> v[i];
    pd[1] = 0;
    for(int i = 2; i <= n; ++i)
    {
        pd[i] = inf;
        for(int j = 1; j <= k && i - j >= 1; ++j)
        pd[i] = min(pd[i], pd[i - j] +  abs(v[i - j] - v[i]));
    }
    cout << pd[n];
    return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>


#define int  long long
#define rep(i,begin,end) for(__typeof(end)i=(begin)-((begin)>(end));i!=(end)-((begin)>(end));i+=1-2*((begin)>(end)))
// rep(i,1,10) is from 1 to 9 and rep(I,10,1) is from 9 to 1
#define F first
#define S second
#define sz(x) ((int)x.size())
#define pii pair<int,int>
#define vi vector<int>
#define vii vector<pii>
#define pb push_back
#define pf push_front
#define eb emplace_back 
#define all(v) (v).begin(), (v).end()
#define mod 1000000007
#define mi multiset<int>
#define mii multiset<pii>
#define what_is(x) cerr << #x << " is " << x <<"\n";
#define sortA(v) sort(v.begin(), v.end())
#define sortD(v) sort(v.rbegin(), v.rend())
#define PI 3.14159265358979323846
#define vout(a) for(auto x:a) cout<<x<<" ";

// #define ordered_set tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update>


// using namespace __gnu_pbds;
using namespace std;

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

int modp(int a,int n)
{
    n=n%(mod-1);
    a=a%mod;
    int res=1;
    while(n>0)
    {
        if(n&1) res=(res*a)%mod;
        a=(a*a)%mod;
        n>>=1;
    }
    return res;
}


vi adj[100005],color(100005);
vector<bool> vis(100005,false);
int cnt=0;

void dfs(int s)
{
    vis[s]=true;
    cnt++;
    // color[s]=clr;
    for(int u:adj[s])
    {
        if(!vis[u])
        {
            vis[u]=true;
            dfs(u);
        }
    }
    // order.pb(s);
}


void solve()
{
    int t,n,m,i,k,l,r,u,v,w,j,s,sum=0,flag=0,count=0;
    string S,T,U;
    int a,b,h;
    cin>>a>>b>>h>>m;
    // m%=60*12;
    h%=12;
    double hr,min;
    // m=m*60;l
    // h=h*60*60;
    // m=h+m;
    // cout<<m<<" "<<h<<" ";
    hr=(60*h+m)/(2.0);
    min=m*6;

    // cout<<hr<<" "<<min<<" ";
    double diff=abs(hr-min);
    // while(diff>360) diff-=360;
    // if(diff>180) diff-=180;
    // cout<<diff<<" ";
    diff=diff*PI/(180.0);
    double ans=sqrt(a*a+b*b-2*a*b*cos(diff));
    cout<<fixed<<setprecision(10)<<ans;
}




signed main()
{
    #ifndef ONLINE_JUDGE 
       freopen("input.txt","r",stdin);
       freopen("output.txt","w",stdout);
    #endif
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    int t=1;
    // cin>>t;
    while(t--)
    {
        solve();
        cout<<"\n";
    }
    return 0;
}


Measured memory_bytes: 6568
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int m = sc.nextInt();
		int[] x = new int[m];
		for(int i = 0; i < m; i++) {
			x[i] = sc.nextInt();
		}
		Arrays.sort(x);
		int[] distance = new int[m-1];
		for(int i = 0; i < m-1; i++) {
			distance[i] = x[i+1] - x[i];
		}
		Arrays.sort(distance);
		int answer = 0;
		for(int i = 0; i < m-n; i++) {
			answer += distance[i];
		}
		if(n >= m) System.out.println("0");
		else System.out.println(answer);
	}

}


Measured memory_bytes: 50264
import heapq

n, k = map(int,input().split())

q = []
for i in range(n):
    q.append(list(map(int, input().split())))

heapq.heapify(q)

cnt = 0
while cnt < k:
    a, b = heapq.heappop(q)
    cnt += b
    
print(a)

Measured memory_bytes: 27080
use std::io::Read;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();

    let answer = solve(&buf);

    println!("{}", answer);
}

fn solve(input: &str) -> String {
    let mut iterator = input.split_whitespace();

    let n: usize = iterator.next().unwrap().parse().unwrap();

    let mut approved = true;
    for _i in 0..n {
        let a: usize = iterator.next().unwrap().parse().unwrap();
        if a % 2 == 0 && !(a % 3 == 0 || a % 5 == 0) {
            approved = false;
            break;
        }
    }

    return if approved {
        String::from("APPROVED")
    } else {
        String::from("DENIED")
    }
}

#[test]
fn test() {
    let cases: Vec<(&str, &str)> = vec![
        (
            r"5
6 7 9 10 31",
            "APPROVED"
        ),
        (
            r"3
28 27 24",
            "DENIED"
        ),
    ];

    let mut all_ok = true;
    for (i, case) in cases.iter().enumerate() {
        print!("case {} : ", i);

        let expected = case.1;
        let actual = solve(case.0);

        if expected == actual {
            println!("OK");
        } else {
            println!("NG");
            println!("    Expected: {}", expected);
            println!("    Actual  : {}", actual);

            all_ok = false;
        }
    }

    assert_eq!(all_ok, true);
}


Measured memory_bytes: 4352
#include<bits/stdc++.h>
using namespace std;
int main(){
    long long N;
    cin >> N;

    long long ans = 10000000000000;

    for(long long i=1;i<=sqrt(N)+1;i++){
        if(N%i == 0){
            if(i + N/i - 2 <= ans) ans = i + N/i - 2 ;
        }
    }


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

Measured memory_bytes: 256
#include <cmath>
#include <cstdio>
#include <iostream>

using namespace std;

#define EPS (1e-10)
#define equals(a,b) (fabs((a)-(b))<EPS)

class Point {
public:
	int x, y;
	Point(int x, int y) :
			x(x), y(y) {
	}

	Point operator +(const Point p) const {
		return Point(x + p.x, y + p.y);
	}
	Point operator -(const Point p) const {
		return Point(x - p.x, y - p.y);
	}

};

class Segment {
public:
	Point p1, p2;
	Segment(Point p1, Point p2) :
			p1(p1), p2(p2) {
	}
};

double dot(Point a, Point b) {
	return a.x * b.x + a.y * b.y;
}

double cross(Point a, Point b) {
	return a.x * b.y - a.y * b.x;
}

bool isOrthogonal(Segment s1, Segment s2) {
	return equals(dot(s1.p2 - s1.p1, s2.p2 - s2.p1), 0.0);
}

bool isParallel(Segment s1, Segment s2) {
	return equals(cross(s1.p2 - s1.p1, s2.p2 - s2.p1), 0.0);
}

int main() {

	int q;
	scanf("%d", &q);

	for (int i = 0; i < q; ++i) {
		int p0x, p0y, p1x, p1y, p2x, p2y, p3x, p3y;
		scanf("%d %d %d %d %d %d %d %d", &p0x, &p0y, &p1x, &p1y, &p2x, &p2y, &p3x, &p3y);
		Point p1(p0x, p0y);
		Point p2(p1x, p1y);
		Point p3(p2x, p2y);
		Point p4(p3x, p3y);
		Segment s1(p1, p2);
		Segment s2(p3, p4);

		if (isOrthogonal(s1, s2)) {
			cout << 1 << endl;
		} else if (isParallel(s1, s2)) {
			cout << 2 << endl;
		} else {
			cout << 0 << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 3236
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
using pint = pair<int,  int>;
using pll = pair<ll, ll>;
using edge = pair<int, ll>;
using Graph = vector<vector<int>>; 
using WeightedGraph = vector<vector<edge>>;
const ll INF = 1LL << 60;
const int INF32 = 1 << 29;
const ll MOD = 1000000007;

int n,k,q;

void func(vector<ll>& dst, vector<ll>& src){
  int m = src.size();
  sort(src.begin(), src.end());
  for(int i = 0; i+k-1 < m; ++i){
    dst.push_back(src[i]);
  }
}

int main(){
  cin >> n >> k >> q;
  vector<ll> a(n);
  for(int i = 0; i < n; ++i)cin >> a[i];
  
  ll ans = INF;
  for(int i = 0; i < n; ++i){
    vector<ll> tmp, vec;
    for(int j = 0; j < n; ++j){
      if(a[j]<a[i]){
        func(vec,tmp);
        tmp.clear();
      }
      else {
        tmp.push_back(a[j]);
      }
    }
    func(vec,tmp);
    if(vec.size()<q)continue;
    sort(vec.begin(), vec.end());
    ans = min(ans, vec[q-1]-vec[0]);
  }
  cout << ans << endl;
}


Measured memory_bytes: 384