akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <queue>
#include <stack>
#include <cstdlib>
#include <map>
#include <iomanip>
#include <set>
#include <functional>
#include <stdio.h>
#include <ctype.h>
#include <random>
#include <string.h>
#include <unordered_map>
#include <cstdio>
using namespace std;
#define all(vec) vec.begin(),vec.end()
typedef long long ll;

ll gcd(ll x, ll y) {
	if (y == 0)return x;
	return gcd(y, x%y);
}
ll lcm(ll x, ll y) {
	return x / gcd(x, y)*y;
}
ll kai(ll x, ll y, ll m) {
	ll res = 1;
	for (ll i = x - y + 1; i <= x; i++) {
		res *= i; res %= m;
	}
	return res;
}
ll mod_pow(ll x, ll y, ll m) {
	ll res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}

ll comb(ll x, ll y, ll m) {
	if (y > x)return 0;
	return kai(x, y, m) * mod_pow(kai(y, y, m), m - 2, m) % m;
}

ll a, b, c, d;

signed main() {
	std::random_device rnd;
	std::mt19937_64 mt(rnd());
	cin >> a >> b >> c >> d;
	cout << max({ a*c, a*d, b*c, b*d }) << endl;
}


Measured memory_bytes: 3632
#include <iostream>
#include <math.h>
#include <vector>
#include <stack>
#include <cstdio>
#include <string>
#include <bitset>
#include <list>
#include <set>
#include <algorithm>
#include <numeric>
#include <unordered_map>

using namespace std;
//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
using ll = long long;

ll get2factor(ll n) {
	ll x=0;
	while (n % 2 == 0) {
		n /= 2;
		x++;
	}
	return x;
}

int main() {
	ll N,M,t;
	vector<ll> x,y,z;
	cin>> N>>M;
	for (int i = 0; i < N; i++) {
		cin >> t;
		x.push_back(t);
		cin >> t;
		y.push_back(t);
		cin >> t;
		z.push_back(t);

	}

	vector<vector<ll>> coef;
	coef.push_back({ 1,1,1 });
	coef.push_back({ 1,1,-1 });
	coef.push_back({ 1,-1,1 });
	coef.push_back({ 1,-1,-1 });
	coef.push_back({ -1,1,1 });
	coef.push_back({ -1,1,-1 });
	coef.push_back({ -1,-1,1 });
	coef.push_back({ -1,-1,-1 });
	
	vector<ll> res;
	for (int coef_num = 0; coef_num < 8; coef_num++) {

		vector<ll> eval;
		for (int i = 0; i < N; i++) {
			eval.push_back( x[i] * coef[coef_num][0] + y[i] * coef[coef_num][1] + z[i] * coef[coef_num][2]);
		}
		sort(eval.rbegin(), eval.rend());

		res.push_back(accumulate(eval.begin(), eval.begin()+M, (ll)0));

	}
	cout << *max_element(res.begin(),res.end()) <<endl;
	return 0;
}



Measured memory_bytes: 256
//#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <ctime>
#include <iomanip>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <climits>
#include <set>
#include <cassert>

using namespace std;

const int SIZE = 1 << 10;
int pointer = SIZE;
char buffer[SIZE];

char Advance() {
    if (pointer == SIZE) {
        fread(buffer, 1, SIZE, stdin);
        pointer = 0;
    }
    return buffer[pointer++];
}

int Read() {
    int answer = 0, sign = 1;
    char ch = Advance();
    while (!isdigit(ch) && ch != '-')
        ch = Advance();
    if (ch == '-') {
        ch = Advance();
        sign = -1;
    }
    while (isdigit(ch)) {
        answer = answer * 10 + ch - '0';
        ch = Advance();
    }
    return answer * sign;
}

const int BASE = 10;

int cost[BASE][BASE];

void RoyFloyd() {
    for (int i = 0; i < BASE; i++)
        for (int j = 0; j < BASE; j++)
            scanf("%d", &cost[i][j]);
    for (int k = 0; k < BASE; k++)
        for (int i = 0; i < BASE; i++)
            for (int j = 0; j < BASE; j++)
                cost[i][j] = min(cost[i][j], cost[i][k] + cost[k][j]);
}

char v[4];

int main() {
    //freopen("tema.in", "r", stdin);
    //freopen("tema.out", "w", stdout);
    for (int i = 0; i < 4; i++) {
        scanf("%c", &v[i]);
        v[i] -= '0';
    }
    for (int i = 0; i < 8; i++) {
        int sum = v[0];
        for (int j = 0; j < 3; j++)
            if (i & (1 << j))
                sum += v[j + 1];
            else
                sum -= v[j + 1];
        if (sum == 7) {
            printf("%d", v[0]);
            if (i & (1 << 0))
                printf("+");
            else
                printf("-");
            printf("%d", v[1]);
            if (i & (1 << 1))
                printf("+");
            else
                printf("-");
            printf("%d", v[2]);
            if (i & (1 << 2))
                printf("+");
            else
                printf("-");
            printf("%d", v[3]);
            printf("=7\n");
            return 0;
        }
    }
    return 0;
}


Measured memory_bytes: 128
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Set;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		//A
		int A = sc.nextInt();
		//B
		int B = sc.nextInt();
		//C
		int C = sc.nextInt();

		ArrayList<Integer> list = new ArrayList<Integer>();

		list.add(A);
		list.add(B);
		list.add(C);

		int v = 1;

		Set<Integer> checkHash = new HashSet<Integer>();

		for (int value : list) {
			if (checkHash.contains(value)) {
				// 重複があれば値を加算
				v = v + 1;
			} else {
				// 重複しなければハッシュセットへ追加
				checkHash.add(value);
			}
		}

		if (v == 2) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}

	}
}


Measured memory_bytes: 23380
#include <bits/stdc++.h>
#define ll long long

using namespace std;

const int lb = 9, ub = 44;
int v[lb+ub+5][lb+ub+5];

int main () {
  ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
  int n; cin >> n;
  int i, j, z, e, pin, p2, p5;
  ll m, ans = 0;
  string s;
  for (i = 1; i <= n; i++) {
    cin >> s;
    m = e = pin = 0;
    for (char ch: s) {
      if (pin) e++;
      if (ch == '.') pin = 1;
      else m = m*10 + ch - '0';
    }
    p2 = -e;
    while (m % 2 == 0) {
      p2++;
      m /= 2;
    }
    p5 = -e;
    while (m % 5 == 0) {
      p5++;
      m /= 5;
    }
    for (int i2 = -lb; i2 <= ub; i2++)
      for (int i5 = -lb; i5 <= ub; i5++)
        if (i2+p2 >= 0 && i5+p5 >= 0) ans += 1LL*v[lb+i2][lb+i5];
    v[lb+p2][lb+p5]++;
  }
  cout << ans;
  return 0;
}

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

int main(){
	int a[5];
	char t;
	while(cin >> a[0] >> t >> a[1] >> t >> a[2] >> t >> a[3] >> t >> a[4]){
		sort(a,a+5);
		if(a[0] == a[3] || a[1] == a[4]){
			cout << "four card" << endl;
		}
		else if((a[0] == a[1] && a[2] == a[4]) || (a[0] == a[2] && a[3] == a[4])){
			cout << "full house" << endl;
		}
		else if((a[0]+1==a[1]&&a[1]+1==a[2]&&a[2]+1==a[3]&&a[3]+1==a[4]) || (a[0]==1&&a[1]==10&&a[2]==11&&a[3]==12&&a[4]==13)){
			cout << "straight" << endl;
		}
		else if(a[0] == a[2] || a[1] == a[3] || a[2] == a[4]){
			cout << "three card" << endl;
		}
		else if((a[0]==a[1]&&(a[2]==a[3]||a[3]==a[4]))||(a[1]==a[2]&&a[3]==a[4])){
			cout << "two pair" << endl;
		}
		else if((a[0]==a[1])||(a[1]==a[2])||(a[2]==a[3])||(a[3]==a[4])){
			cout << "one pair" << endl;
		}
		else{
			cout << "null" << endl;
		}
	}
}

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

using namespace std;

#define SZ(x) (int)(x.size())
#define REP(i, n) for(int i=0;i<(n);++i)
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define RREP(i, n) for(int i=(int)(n);i>=0;--i)
#define RFOR(i, a, b) for(int i=(int)(a);i>=(int)(b);--i)
#define ALL(a) (a).begin(),(a).end()
#define DUMP(x) cerr<<#x<<" = "<<(x)<<endl
#define DEBUG(x) cerr<<#x<<" = "<<(x)<<" (L"<<__LINE__<<")"<< endl;

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using P = pair<int, int>;

const double eps = 1e-8;
const ll MOD = 1000000007;
const int INF = INT_MAX / 2;
const ll LINF = LLONG_MAX / 2;

template <typename T1, typename T2>
bool chmax(T1 &a, const T2 &b) {
  if(a < b) {a = b; return true;}
  return false;
}

template <typename T1, typename T2>
bool chmin(T1 &a, const T2 &b) {
  if(a > b) {a = b; return true;}
  return false;
}

template<typename T1, typename T2>
ostream& operator<<(ostream &os, const pair<T1, T2> p) {
  os << p.first << ":" << p.second;
  return os;
}

template<class T>
ostream &operator<<(ostream &os, const vector<T> &v) {
  REP(i, SZ(v)) {
    if(i) os << " ";
    os << v[i];
  }
  return os;
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);

  int a, b; cin >> a >> b;
  int h, m; cin >> h >> m;
  m += h * 60;

  double ta = 2 * acos(-1) * (m % (12 * 60)) / (12 * 60);
  double tb = 2 * acos(-1) * (m % 60) / 60;

  double theta = min(abs(ta - tb), 2 * acos(-1) - abs(ta - tb));

  cout << sqrt(a * a + b * b - 2 * a * b * cos(theta)) << endl;


}
























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

public class AtCoderD
{
    static void Main()
    {
        int n;
        int m;
        int k;
        {
            var line = Console.ReadLine();
            var words = line.Split(' ');
            n = int.Parse(words[0]);
            m = int.Parse(words[1]);
            k = int.Parse(words[2]);
        }

        UnionFind friendGroups = new UnionFind(n);
        int[] friendCount = new int[n];
        for (int i = 0; i < m; i++)
        {
            var line = Console.ReadLine();
            var words = line.Split(' ');
            int a = int.Parse(words[0]);
            int b = int.Parse(words[1]);
            friendGroups.Unite(a, b);
            friendCount[a - 1]++;
            friendCount[b - 1]++;
        }

        int[] suggestions = new int[n];
        for (int i = 0; i < n; i++)
        {
            suggestions[i] = friendGroups.RootCount(i + 1) - friendCount[i] - 1;
        }

        for (int i = 0; i < k; i++)
        {
            var line = Console.ReadLine();
            var words = line.Split(' ');
            int a = int.Parse(words[0]);
            int b = int.Parse(words[1]);
            if (friendGroups.SameRoot(a, b))
            {
                suggestions[a - 1]--;
                suggestions[b - 1]--;
            }
        }

        Console.WriteLine(string.Join(" ", suggestions));
    }

    private class UnionFind
    {
        private int[] parents;

        // 同じ根に属する枝の数を格納する
        private int[] rootCount;

        public int RootCount(int branch)
        {
            return rootCount[root(branch)];
        }

        public UnionFind(int count)
        {
            parents = new int[count + 1];
            rootCount = new int[count + 1];
            for (int i = 0; i < count + 1; i++)
            {
                parents[i] = i;
                rootCount[i] = 1;
            }
        }

        private int root(int N)
        {
            if (parents[N] == N) return N;
            return parents[N] = root(parents[N]);
        }

        //木を併合する際に、枝の数も合算する
        public void Unite(int X, int Y)
        {
            int rootX = root(X);
            int rootY = root(Y);
            if (rootX == rootY) return;
            rootCount[rootX] += rootCount[rootY];
            parents[rootY] = rootX;
        }

        public bool SameRoot(int X, int Y)
        {
            return root(X) == root(Y);
        }
    }
}

Measured memory_bytes: 20776
#include<iostream>
#include<vector>
#include<algorithm>
#include<cstdio>

#define INF 1<<29
#define pb push_back

using namespace std;

int main(void){

  int n,m,p,a,b,d[31][31],x,y,z;
  double dp[1<<9][31];
  vector<int>t;

  while(cin >> n >> m >> p >> a >> b,n|m|p|a|b){
    t.clear();

    for(int i=0;i<31;i++)
      for(int j=0;j<31;j++)d[i][j]=-1;

    for(int i=0;i<n;i++){
      int in;
      cin >> in;
      t.push_back(in);
      d[i][i]=0;
    }

    for(int i=0;i<p;i++){
      cin >> x >> y >> z;
      d[x-1][y-1]=d[y-1][x-1]=z;
    }

    for(int i=0;i<(1<<9);i++)
      for(int j=0;j<31;j++)dp[i][j]=INF;

    dp[(1<<n)-1][a-1]=0;
    double res=INF;

    for(int S=(1<<n)-1;S>=0;S--){
      res=min(res,dp[S][b-1]);
      for(int v=0;v<m;v++){
	for(int i=0;i<n;i++){
	  if(S>>i & 1){
	    for(int u=0;u<m;u++){
	      if(d[v][u]>=0){
		dp[S & ~(1<<i)][u]=min(dp[S & ~(1<<i)][u],dp[S][v]+(double)d[v][u]/t[i]);
	      }
	    }
	  }
	}
      }
    }
    if(res==INF)printf("Impossible\n");
    else printf("%.3f\n",res);
  }
  return 0;
}

Measured memory_bytes: 1372
#include <bits/stdc++.h>
using namespace std;
struct cww{cww(){ios::sync_with_stdio(false);cin.tie(0);}}star;
#define P(x) cout << (x) << "\n"
#define p(x) cout << (x)
#define all(c) (c).begin(), (c).end()
#define rall(c) (c).rbegin(), (c).rend()
#define vv(type, c, m, n, i) vector<vector<type>> c(m, vector<type>(n, i));
#define rep(i,a,n) for(int i=(a), i##_len=(n); i<i##_len; ++i)
#define rrep(i,a,n) for(int i=(a), i##_len=(n); i>i##_len; --i)
#define len(x) ((int)(x).size())
#define mp make_pair
#define eb emplace_back
#define fi first
#define se second
#define chmax(a,b) if(a<b)a=b;
#define chmin(a,b) if(b<a)a=b;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef vector<double> vd;
typedef vector<long long> vll;
typedef vector<string> vs;
typedef vector<bool> vb;
constexpr int MAX = 1400;
struct Rectangle { int height, pos; };
int getLargestRectangle(int size, vi buffer) {
	vector<Rectangle> S;
	int maxv = 0;
	buffer[size] = 0;
	int target, area;
	rep(i, 0, size + 1) {
		Rectangle rect;
		rect.height = buffer[i];
		rect.pos = i;
		if(S.empty()) S.eb(rect);
		else {
			if(S.back().height < rect.height) S.eb(rect);
			else if(S.back().height > rect.height) {
				target = i;
				while(!S.empty() && S.back().height >= rect.height) {
					Rectangle pre = S.back(); S.pop_back();
					area = pre.height * (i - pre.pos);
					chmax(maxv, area);
					target = pre.pos;
				}
				rect.pos = target;
				S.eb(rect);
			}
		}
	}
	return maxv;
}
int H, W;
vv(int, buffer, MAX, MAX, 0);
vv(int, T, MAX, MAX, 0);
int getLargestRectangle() {
	rep(j, 0, W) {
		rep(i, 0, H) {
			if(buffer[i][j]) T[i][j] = 0;
			else T[i][j] = (i > 0) ? T[i - 1][j] + 1 : 1;
		}
	}
	int maxv = 0;
	rep(i, 0, H) chmax(maxv, getLargestRectangle(W, T[i]));
	return maxv;
}
int main() {
	cin >> H >> W;
	rep(i, 0, H) rep(j, 0, W) cin >> buffer[i][j];
	P(getLargestRectangle());
	return 0;
}

Measured memory_bytes: 18388
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n = ni()

if n == 0:
    print(0)
else:
    s = ""
    while n != 0:
        if n % 2 != 0:
            n -= 1
            s = "1" + s
        else:
            s = "0" + s
        n //= -2
    print(s)


Measured memory_bytes: 38384
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
// change the problem to matching from A : (1 ~ n) to B : (1 ~ n), and its distance
int n, k;
/*
 * dp[i][j][k]
 * considering points 1 ~ i, j of them are not yet matched with total k oddness
 * we increment oddness when i proceeds,
 * since unmatched points increase oddness regardless of the resulting matching
 * we calculate dp by sweeping(?)
 */
ll dp[51][51][2505];
const ll mod = 1'000'000'007;
using ll = long long;
ll f(int i, int j, int k)
{
    if(i < 0 || j < 0 || k < 0) return 0;
    return dp[i][j][k];
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    cin >> n >> k;
    dp[0][0][0] = 1;
    for(int i=1;i<=n;i++)
    {
        for(int j=0;j<=i;j++)
        {
            for(int l=0;l<=k;l++)
            {
                // how dp[i][j][l] is constructed?
                // we encountered i-th points here (A_i, B_i)
                ll& cur = dp[i][j][l];
                // Case 1. matching between A_i and B_i
                // 2*j oddness is added
                // since 2*j of them are still not matched
                cur += f(i-1, j, l-2*j);
                // Case 2. A_i and B_i are both matched with unmatched ones
                // from i-1 points, j+1 unmatched items are needed
                // since there are still 2*j unmatched points after matching,
                // 2*j oddness is added
                // also, there are (j+1)*(j+1) cases for new matchings
                cur += (j+1) * (j+1) * f(i-1, j+1, l-2*j);
                // Case 3. one to the previously unmatched ones
                // from i-1 points, j unmatched items are needed
                // since there are still 2*j unmatched points after matching,
                // 2*j oddness is added
                // also, there are 2*j cases for new matchings
                cur += 2 * j * f(i-1, j, l-2*j);
                // Case 4. both points are left unmatched
                // from i-1 points, j-1 unmatched items are needed
                // since there are still 2*j unmatched points after matching,
                // 2*j oddness is added
                cur += f(i-1, j-1, l-2*j);
                cur = cur % mod;
            }
        }
    }
    cout << f(n, 0, k);
}


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

void make(const int &N, const int &p) {
  int v = p;
  int cnt = 1;
  for(int x = 1; ; ++x) {
    for(int d = 1; d >= -1; d -= 2) {
      int nv =( p + x*d + N) % N;
      printf("%d %d\n", v+1, nv+1);
      v = nv;
      if(++cnt >= N) return;
    }
  }
}

int main() {
  int N, K;
  scanf("%d %d", &N, &K);
  if(K > N/2) {
    printf("-1\n");
    return 0;
  }
  for(int p = 0; p < K; ++p) {
    if(p) puts("");
    make(N, p);
  }
  return 0;
}

Measured memory_bytes: 1036
import java.io.*;

public class Main
{
	public static void main(String[] args)throws IOException
	{
		int N,f=0,sum=0;
		double M;
		BufferedReader br=
		new BufferedReader(new InputStreamReader(System.in));
		
		String str1=br.readLine();
		String str2=br.readLine();
		String[] strs1=str1.split(" ",2);
		N=Integer.parseInt(strs1[0]);
		M = Integer.parseInt(strs1[1]);
		String[] strs2=str2.split(" ",N);
		int[] nums= new int[N];
		for(int i=0;i<N;i++){
			nums[i]=Integer.parseInt(strs2[i]);
			sum+=nums[i];
		}
		for(int i=0;i<N;i++){
			if(nums[i]>=(sum/(4*M))){
				f++;
			}
		}
		if(f>=M){
			System.out.println("Yes");
		}else{
			System.out.println("No");
		}
	}
}

Measured memory_bytes: 22612
#include <algorithm>
#include <climits>
#include <iostream>
#include <string>
#include <utility>
#include <vector>
#include <set>
#include <map>
#include <queue>


using namespace std;
using ll = long long int;

template <class T> ostream &operator<<(ostream &os, vector<T> &v) {
  for (auto i = v.begin(); i != v.end(); i++) {
    os << *i << " ";
  }
  return os;
}


void solve(std::string S){
  string a = "Sunny";
  string b = "Cloudy";
  string c = "Rainy";
  if(S==a)
    std::cout << b << std::endl;
  else if(S==b)
    std::cout << c << std::endl;
  else
    std::cout << a << std::endl;
}

int main(){
  std::string S;
  std::cin >> S;
  solve(S);
  return 0;
}



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

#define FOR(i,a,b) for (int i = a; i < b; ++i)
#define REP(i,n) FOR(i,0,n)

int A, B, K;

int main() {
  scanf("%d%d%d", &A, &B, &K);
  int AK = A + K, BK = B - K + 1;

  if (AK >= BK) {
    FOR(i,A,B+1) printf("%d\n", i);
  }
  else {
    FOR(i,A,AK) printf("%d\n", i);
    FOR(i,BK,B+1) printf("%d\n", i);
  }

  return 0;
}

Measured memory_bytes: 256
import java.util.Collections;
import java.util.PriorityQueue;
import java.util.Queue;
import java.util.Scanner;

public class Main {
	
	private static Scanner sc;
	
	public static void main (String args[]) {
		sc = new Scanner(System.in);
		//購入する品物数
		int nNum = Integer.parseInt(sc.next());
		//割引券の所持数
		int mNum = Integer.parseInt(sc.next());
		//品物の価格
		Queue<Integer> q = new PriorityQueue<Integer>(Collections.reverseOrder());
		for (int i = 0; i<nNum; i++) {
    	   q.add(Integer.parseInt(sc.next()));
		}
		//降順ソート　高い順
		for(int i = 0; i<mNum; i++) {
			q.add(q.poll() / 2);
		}
		long sum = 0;
		for (Integer price : q) {
			sum+=price;
		}
		System.out.println(sum);
	}	
}


Measured memory_bytes: 61040
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll P = 1e9 + 7;


int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  int n, m, sum = 0;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int x;
    cin >> x;
    sum += x;
  }
  n -= sum;
  cout << (n >= 0 ? n : -1);
  return 0;
}


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

using namespace std;

typedef long long ll;

const int INF = 1e9 + 5, M = 1e9 + 7;

ll binPow(int a, int b) {
    if (b == 0) return 1 % M;
    if (b == 1) return a % M;
    ll ans = binPow(a, b / 2);
    ans = ((ans % M) * (ans % M)) % M;
    if (b % 2) ans = ((ans % M) * (a % M)) % M;
    return ans;
}

ll nCr(int n, int r) {
    ll ans = 1;
    for (int i = 1; i <= r; ++i) {
        ans = ((ans % M) * ((n - i + 1) % M)) % M;
        ans = ((ans % M) * (binPow(i, M - 2) % M)) % M;
    }    
    return ans;
}

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n, a, b;
    cin >> n >> a >> b;
    ll ans = binPow(2, n);
    ans = ((ans % M) - (nCr(n, a) % M)) % M;
    ans = ((ans % M) - (nCr(n, b) % M)) % M;
    ans = (ans - 1) % M;
    if (ans < 0) ans += M;
    cout << ans << "\n";
    return 0;
}

Measured memory_bytes: 256
n,m = map(int,input().split())
s = [0]*m
c = [0]*m

for i in range(m):
    s[i],c[i] = map(int,input().split())

if n == 3:
    for i in range (100,1000):
        tmp = -1
        a = [0]*4
        a[1] = i // 100
        a[2] = (i - a[1]*100) // 10
        a[3] = (i - a[1]*100 - a[2]*10)
        for j in range(m):
            if a[s[j]] != c[j]:
                break
        else:
            tmp = i
            break

elif n == 2:
    for i in range (10,100):
        tmp = -1
        a = [0]*3
        a[1] = i // 10
        a[2] = i - a[1]*10
        for j in range(m):
            if a[s[j]] != c[j]:
                break
        else:
            tmp = i
            break

else:
    for i in range (0,10):
        tmp = -1
        a = [0]*2
        a[1] = i
        for j in range(m):
            if a[s[j]] != c[j]:
                break
        else:
            tmp = i
            break

print(tmp)

Measured memory_bytes: 38384
#include<bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < int(n); ++i)
#define rrep(i,n) for (int i = int(n)-1; i >= 0; i--)
#define rep2(i,s,n) for (int i = int(s); i < int(n); ++i)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define pb push_back
#define eb emplace_back
#define vi vector<int>
#define vvi vector<vector<int>>
#define vl vector<ll>
#define vvl vector<vector<ll>>
#define vd vector<double>
#define vs vector<string>
#define vc vector<char>
#define vb vector<bool>
#define vp vector<P>
using namespace std;
using ll = long long;
using P = pair<int,int>;
using LP = pair<ll,ll>;
template<class S,class T> istream& operator>>(istream &is,pair<S,T> &p) { return is >> p.first >> p.second; }
template<class S,class T> ostream& operator<<(ostream &os,const pair<S,T> &p) { return os<<'{'<<p.first<<","<<p.second<<'}'; }
template<class T> istream& operator>>(istream &is,vector<T> &v) { for(T &t:v){is>>t;} return is; }
template<class T> ostream& operator<<(ostream &os,const vector<T> &v) { os<<'[';rep(i,v.size())os<<v[i]<<(i==int(v.size()-1)?']':','); return os; }
void Yes(bool b) { cout << (b ? "Yes" : "No") << '\n'; }
void YES(bool b) { cout << (b ? "YES" : "NO") << '\n'; }
template<class T> bool chmin(T& a,T b) {if(a > b){a = b; return true;} return false;}
template<class T> bool chmax(T& a,T b) {if(a < b){a = b; return true;} return false;}
const int inf = 1001001001;
const ll linf = 1001001001001001001;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr); cout.tie(nullptr);
    string s,t;
    int q;
    cin >> s >> t >> q;
    int sn = s.size(),tn = t.size();
    vi sa(sn+1),sb(sn+1);
    rep(i,sn) sa[i+1] = sa[i]+(s[i] == 'A');
    rep(i,sn) sb[i+1] = sb[i]+(s[i] == 'B');
    vi ta(tn+1),tb(tn+1);
    rep(i,tn) ta[i+1] = ta[i]+(t[i] == 'A');
    rep(i,tn) tb[i+1] = tb[i]+(t[i] == 'B');
    while(q--) {
        int a,b,c,d;
        cin >> a >> b >> c >> d;
        tie(a,b,c,d) = make_tuple(sa[b]-sa[a-1],sb[b]-sb[a-1],ta[d]-ta[c-1],tb[d]-tb[c-1]);
        int l = ((a-b)%3+3)%3;
        int r = ((c-d)%3+3)%3;
        YES(l == r);
    }
}


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


int main() {
  int n ; 
  cin >> n ; 
  vector<int> p(n) ; 
  int cnt = 0 ; 
  
  for(int i = 0 ; i<n ; i++){
    cin >> p.at(i) ; 
  }
  
  for(int i = 1 ;   i < n-1 ; i++){
    if( p.at(i-1) < p.at(i) && p.at(i) < p.at(i+1)){
      cnt++ ; 
    }
    else if( p.at(i-1)> p.at(i) && p.at(i) > p.at(i+1)){
      cnt++ ; 
    }
  }
  
  cout << cnt << endl ; 
  
  
}


Measured memory_bytes: 3632
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn solve(ts: Vec<i64>, pxs: Vec<(usize, i64)>) -> Vec<i64> {
    let total = ts.iter().fold(0, |acc, x| acc + x);
    let mut res = Vec::with_capacity(pxs.len());
    for (p, x) in pxs {
        let sum = total - ts[p-1] + x;
        res.push(sum)
    }
    res
}

fn main() {
    input!{
        n: usize,
        ts: [i64; n],
        m: usize,
        pxs: [(usize, i64); m]
    };

    for sum in solve(ts, pxs) {
        println!("{}", sum);
    }

}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
#include <iostream>
//#include <algorithm>
// #include <iomanip>
#define ll long long

using namespace std;

int main() {
  int n;
  scanf("%d", &n);

  bool r = false;
  for (int i = 0; i < 10; i++) {
    for (int j = 0; j < 10; j++) {
      if (i * j == n) {
        r = true;
        break;
      }
    }
  }

  cout << (r ? "Yes" : "No") << endl;
}


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

Measured memory_bytes: 640
#include<bits/stdc++.h>
// #include <ext/pb_ds/assoc_container.hpp>
// #include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define ld long double
#define mk make_pair
#define fi first
#define se second
#define vll vector<ll>
#define pii pair<ll,ll>
#define vvll vector< vector<ll> >
#define pb push_back
#define sz(v) (v).size()
#define inf 1e18
#define md 1000000007
#define all(v) (v).begin(),(v).end()
#define rep(i,a,b) for(ll i=a;i<b;++i)
#define repi(i,a,b) for(ll i=a;i>=b;--i)
#define tel(a){cout<<a<<"\n";}
#define tell(a,b){cout<<a<<" | "<<b<<"\n";}
#define telll(a,b,c){cout<<a<<" | "<<b<<" | "<<c<<"\n";}
#define teln(v,n){cout<<"v- ";rep(i,0,n)cout<<v[i]<<" ";cout<<"\n";}
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
#define TRACE
 
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
    cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
    const char* comma = strchr(names + 1, ',');cerr.write(names, comma - names) << " : " << arg1<<" | ";__f(comma+1, args...);
}
#else
#define trace(...)
#endif
 

#define M 110
#define N 3010
ll n;
ld dp[N][N];
ld p[N];
ld f(ll pos,ll heads) {
	if(heads < 0) return 0.00;
	if(pos < 0){
		if(!heads) return (ld)1.00;
		return 0.00;
	} 
	if(dp[pos][heads]!=-1.00) return dp[pos][heads];
	ld other = (ld)1.00;
	other -= p[pos];
	ld ans = f(pos-1,heads-1)*(p[pos]) + f(pos-1,heads)*other;
	// trace(pos,heads);
	return dp[pos][heads]=ans;
}
int main(){
	IOS;
	if(fopen("input.txt","r"))
	freopen("inp.txt", "r", stdin),
	freopen("out.txt", "w", stdout);
	
	rep(i,0,N)rep(j,0,N)dp[i][j]=-1.00;
	cin>>n;
	rep(i,0,n)cin>>p[i];
	ld ans = (ld)0.00;
	rep(i,n/2+1,n+1)ans+=f(n-1,i);
	cout<<setprecision(50)<<ans;






	return 0;
}

Measured memory_bytes: 142080
#include <stdio.h>
int f(int);

int A[50];

int main(){
  int n,i;
  
  for(i=0; i<50;i++){
    A[i]=-1;
  }
  
  scanf("%d",&n);
  
  printf("%d\n",f(n));
	 
  return 0;
}

int f(int n){
  
  if(n==0||n==1){
    return A[n]=1;
  }
  if(A[n]!=-1){return A[n];}
  return A[n]=f(n-2)+f(n-1);
}



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

using namespace std;
typedef pair<int,int> pii;
typedef long long int ll;

#define INF 1 << 29
#define REP(i,n) for(ll i=0; i<(int)(n); i++)
#define FOR(i,k,n) for(ll i=(k);i<(int)(n);i++)



vector<bool> gen_sosuu(vector<bool> sosuu){
  int size = sosuu.size();
  REP(i,size){
    sosuu[i] = true;
  }
  sosuu[0] = false;
  sosuu[1] = false;
  sosuu[2] = true;
  FOR(i,2,sqrt(size)+1){
    if(sosuu[i] == false) continue;
    for(int j = 2; i*j<size;j++){
      sosuu[i*j] =false;
    }
  }
  return sosuu;
}

int n,l;
vector<string> s;



int main(){
  cin >> n >> l;
  REP(i,n){
    string a;
    cin >> a;
    s.push_back(a);
  }
  sort(s.begin(),s.end());
  REP(i,s.size()){
    cout << s[i];
  }
  cout << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N,M,C;
  cin >> N >> M >> C;
  
  vector<int> B(M);
  for (int i=0;i<M;i++){
    cin >> B.at(i);
  }
  
  int count=0;
  
  for (int i=0;i<N;i++){
    vector<int> Ai(M);
    int S=C;
    for (int j=0;j<M;j++){
      cin >> Ai.at(j);
      S+=Ai.at(j)*B.at(j);
    }
    if (S>0){
      count+=1;
    }
    else{
      count=count;
    }
  }
  cout << count << endl;
}

    


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


int main(){

	double r,l,s;
	cin >> r;

	l = 2*r*3.1415926535897932384626;
	s = r*r*3.1415926535897932384626;

	printf("%.6lf %.6lf\n", s,l);
	
	return 0;
}


Measured memory_bytes: 3196
#include<stdio.h>
int main()
{
  char s[200000];
  int max=0,flag=0,start,i=0;
  
  scanf("%s",s);
  
  while(s[i]!='\0'){
    if(s[i]=='A'&&flag!=1){
      start=i;
      flag=1;
    }
    if(s[i]=='Z') 
      max=i;
    i++;
  }
  printf("%d",max-start+1);
  
  return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vl = vector<ll>;
using vvl = vector<vector<ll>>;
using pi = pair<int, int>;
using pl = pair<ll, ll>;
#define all(x) x.begin(),x.end()
#define rep(i,j,n) for (int i = j; i < (int)(n); i++)
#define _GLIBCXX_DEBUG
#define n_p(v) next_permutation(v.begin(),v.end())
#define to_ll(b) stoll(b)
#define MOD 1000000007
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; }
//name[i][j]-> vvl name(i,vl(j))
//map<int,int>mp
//余りを切り上げる =>  (a + b - 1) / b 

signed main(){
	int a,b; cin>>a>>b;
	cout<<(a+b)%24;
	return 0;
}

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

char maze[51][51];
int dx[] = {0,0,1,-1};
int dy[] = {1,-1,0,0};
 
int main(){
  int h,w;
  cin >> h >> w;
  rep(i,h) rep(j,w) cin >> maze[i][j];
  for (int i = 0;i < h;i++){
    for (int j = 0; j < w;j++){
      bool can = false;
      if (maze[i][j] == '.') continue;
      for (int e = 0;e < 4;e++){
        int nx = i+dx[e], ny = j+dy[e];
        if (0 <= nx && nx < h && 0 <= ny && ny < w){
          if (maze[nx][ny] == '#') {
            can = true;
            break;
          }
        }
      }
      if (!can){
        cout << "No" << endl;
        return 0;
      }
    }
  }

  cout << "Yes" << endl;
  
  
  return 0; 
}



Measured memory_bytes: 256
"use strict";

const Main = args => {
  const input = args.trim().split("\n").map(e => e.split(' ').map(e => e - 0));
  const paints = input.slice(1);

  let xMin = 0;
  let xMax = input[0][0];
  let yMin = 0;
  let yMax = input[0][1];

  paints.forEach(e => {
    let xi = e[0];
    let yi = e[1];
    let ai = e[2];

    if (ai === 1) {
      if (xMin < xi) xMin = xi;
    } else if (ai === 2) {
      if (xMax > xi) xMax = xi;
    } else if (ai === 3) {
      if (yMin < yi) yMin = yi;
    } else if (ai === 4) {
      if (yMax > yi) yMax = yi;
    }
  });

  let x = xMax - xMin;
  let y = yMax - yMin;
  console.log((x > 0 && y > 0) ? x * y : 0);
}

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

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

int main(){

  int a=0;
  int b=0;
  
  cin>>a;
  cin>>b;
  
  cout<<6-a-b<<endl;

}




Measured memory_bytes: 256
n = int(input())
tp = 0
xp = 0
yp = 0
for i in range(n):
  t,x,y = map(int, input().split())
  if abs(x-xp) + abs(y-yp) > t - tp:
    print('No')
    exit()
  if (abs(x-xp) + abs(y-yp)) % 2 != (t-tp) % 2:
    print('No')
    exit()
  tp = t
  xp = x
  yp = y
print('Yes')

Measured memory_bytes: 3064
import random


def is_prime(q, k=50):
    q = abs(q)
    #計算するまでもなく判定できるものははじく
    if q == 2:
        return True
    if q < 2 or q & 1 == 0:
        return False

    #n-1=2^s*dとし（但しaは整数、dは奇数)、dを求める
    d = (q-1) >> 1
    while d & 1 == 0:
        d >>= 1

    #判定をk回繰り返す
    for i in range(k):
        a = random.randint(1, q-1)
        t = d
        y = pow(a, t, q)
        #[0,s-1]の範囲すべてをチェック
        while t != q-1 and y != 1 and y != q-1:
            y = pow(y, 2, q)
            t <<= 1
        if y != q-1 and t & 1 == 0:
            return False
    return True

X = int(input())

while True:
    if is_prime(X):
        break
    X += 1
print(X)





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

using namespace std;
#define int long long
#define double long double
#define rep(i, n) for(int i=0;i<(n);++i)
#define RREP(i, n) for(int i=(n)-1;i>=0;--i)
#define INF (1ll<<60)
#define FI first
#define SE second
typedef pair<int, int> pii;
#define l_b lower_bound
#define u_b upper_bound

int N, A;
int dp[51][3000];

signed main() {
    cin >> N >> A;
    dp[0][0] = 1;
    rep(i, N) {
        int x;
        cin >> x;
        RREP(j, 50) {
            rep(k, 3000 - x) {
                dp[j + 1][k + x] += dp[j][k];
            }
        }
    }
    int ans = 0;
    for (int i = 1; i <= N; ++i) {
        ans += dp[i][A * i];
    }
    cout << ans << endl;
}

Measured memory_bytes: 1536
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Math;

namespace CSharp
{
    static class Program
    {
        static void Main(string[] args)
        {
            int a, b;
            ReadInt(out a, out b);
            int ans = new[] { a + b, a - b, a * b }.Max();
            Console.WriteLine(ans);
        }

        #region Helpers

        static int[] ReadIntArray() => Console.ReadLine().Split().Select(s => int.Parse(s)).ToArray();
        static long[] ReadLongArray() => Console.ReadLine().Split().Select(s => long.Parse(s)).ToArray();

        static int[] ReadLineIntArray(int count) => Enumerable.Repeat(0, count).Select(_ => int.Parse(Console.ReadLine())).ToArray();
        static long[] ReadLineLongArray(int count) => Enumerable.Repeat(0, count).Select(_ => long.Parse(Console.ReadLine())).ToArray();

        static string ReadString() => Console.ReadLine();
        static int ReadInt() => int.Parse(Console.ReadLine());
        static long ReadLong() => long.Parse(Console.ReadLine());

        static void ReadInt(out int first)
        {
            var array = ReadIntArray();
            first = array[0];
        }

        static void ReadInt(out int first, out int second)
        {
            var array = ReadIntArray();
            first = array[0];
            second = array[1];
        }

        static void ReadInt(out int first, out int second, out int third)
        {
            var array = ReadIntArray();
            first = array[0];
            second = array[1];
            third = array[2];
        }

        static void ReadInt(out int first, out int second, out int third, out int fourth)
        {
            var array = ReadIntArray();
            first = array[0];
            second = array[1];
            third = array[2];
            fourth = array[3];
        }

        static void ReadLong(out long first)
        {
            var array = ReadLongArray();
            first = array[0];
        }

        static void ReadLong(out long first, out long second)
        {
            var array = ReadLongArray();
            first = array[0];
            second = array[1];
        }

        static void ReadLong(out long first, out long second, out long third)
        {
            var array = ReadLongArray();
            first = array[0];
            second = array[1];
            third = array[2];
        }

        static void ReadLong(out long first, out long second, out long third, out long fourth)
        {
            var array = ReadLongArray();
            first = array[0];
            second = array[1];
            third = array[2];
            fourth = array[3];
        }

        #endregion
    }
}

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

int n;
ll xx[1005],yy[1005];

ll x[1005],y[1005];
ll u[1005],v[1005];

ll labs(ll v){
	if(v<0LL)return -v;
	return v;
}
string ans[1005];
vector<ll> vec;

int main(void){
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%lld%lld",&x[i],&y[i]);
	}
	bool flag=false;
	for(int i=0;i<n;i++){
		u[i]=x[i]+y[i];
		v[i]=x[i]-y[i];
		for(int j=i+1;j<n;j++){
			if((labs(x[i]-x[j])+labs(y[i]-y[j]))%2==1){
				flag=true;
			}
		}
	}
	if(flag){
		printf("-1\n");
		return 0;
	}
	vector<ll> res;
	for(int i=31;i>=1;i--){
		res.push_back(1LL<<i);
	}
	res.push_back(1);
	res.push_back(1);
	if((labs(x[0])+labs(y[0]))%2==1)res.push_back(1);
	for(int i=0;i<res.size();i++){
		for(int j=0;j<n;j++){
			if(u[j]>=0 && v[j]>=0){
				ans[j]+='R';
				u[j]-=res[i];
				v[j]-=res[i];
			}else if(u[j]>=0 && v[j]<0){
				ans[j]+='U';
				u[j]-=res[i];
				v[j]+=res[i];
			}else if(u[j]<0 && v[j]>=0){
				ans[j]+='D';
				u[j]+=res[i];
				v[j]-=res[i];
			}else if(u[j]<0 && v[j]<0){
				ans[j]+='L';
				u[j]+=res[i];
				v[j]+=res[i];
			}
		}
	}
	printf("%d\n",(int)res.size());
	for(int i=0;i<res.size();i++){
		if(i>0)printf(" ");
		printf("%lld",res[i]);
	}
	printf("\n");
	for(int i=0;i<n;i++){
		cout << ans[i] << endl;
	}
	return 0;
} 

Measured memory_bytes: 384
#include <cstdio>
#include <vector>
using namespace std;

int main(){
    int r, c, sum, total_sum;
    total_sum = 0;
    scanf("%d %d\n", &r, &c);
    int sh[r+1][c+1];
    for(int i = 0; i < r+1; i++){
        for(int j = 0; i < c+1; i++){
           sh[i][j] = 0;
        }
    }
    for(int i = 0; i < r; i++){
        sum = 0;
        for(int j = 0; j < c; j++){
            scanf("%d", &sh[i][j]);
            sum += sh[i][j];
        }
        sh[i][c] = sum;
        total_sum += sum;
    }
    sh[r][c] = total_sum;
    for(int i = 0; i < c; i++){
        sum = 0;
        for(int j = 0; j < r; j++){
            sum += sh[j][i];
        }
        sh[r][i] = sum;
    }
    for(int i = 0; i < r+1; i++){
        for(int j = 0; j < c+1; j++){
            if(j == c) printf("%d\n", sh[i][j]);
            else printf("%d ", sh[i][j]);
        }
    }
    return 0;
}


Measured memory_bytes: 2752
#include <algorithm>
#include <iostream>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
typedef long long ll;

using namespace std;

int solve(string s) {
  int cnt = 0;
  int l = s.length();
  rep(i, l/2) {
    if (s[i] != s[l-i-1]) {
      cnt++;
    }
  }
  return cnt;
}

int main() {
  string s;
  cin >> s;
  cout << solve(s) << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <regex>
#include <locale>
#include <cmath>
using namespace std;
 
int main() {
  vector<int> vec;
  int a, b, c;
  cin >> a >> b >> c;
  if(a == b && b == c) {
    cout << "No";
    return 0;
  }
  if(a != b && b != c && a != c) {
    cout << "No";
    return 0;
  }
  cout << "Yes";
  return 0;
}

Measured memory_bytes: 256
import java.util.*;
 
public class Main {
 	public static void main(String[] args){
    	Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int T = sc.nextInt();
		int[] t = new int[N];
		int time = 0;
		int count = 0;
		int ans = 0;

		for(int i=0; i<N; i++){
			t[i] = sc.nextInt();
		}

		for(int i=1; i<N; i++){
			if(t[i]-t[i-1]>=T){
				time += T;
			}else{
				time += t[i]-t[i-1];
			}
		}
		time += T;
		System.out.println(time);
	}
}


Measured memory_bytes: 62884
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author champon
 */

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for(ll i=0; i<n; i++)
#define repr(i, s, e) for(ll i=s; i>=e; i--)
#define reps(i, s, e) for(ll i=s; i<=e; i++)
#define inf 1e18
#define all(v) v.begin(),v.end()
#define ceill(a, b) (a+b-1)/b
#define ok cout << "ok" << endl;
#define sp << " " <<
void ans(bool b){ cout << (b ? "Yes" : "No") << endl; }
void ans2(bool b){ cout << (b ? "YES" : "NO") << endl; }
template<typename T> inline bool chmax(T &a, T b){ if(a<b) a=b; return a<b; }
template<typename T> inline bool chmin(T &a, T b){ if(b<a) a=b; return b<a; }
template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    fill((T*)array, (T*)(array+N), val);
}
template<typename T> void vdeb(T v){
    cout << "#vector set debug" << endl;
    for(auto vv : v) cout << vv << " ";
    cout << endl;
}
template<typename T1, typename T2> void adeb(T1 arr[], T2 n){
    cout << "#adebug" << endl;
    for(int i=0; i<=n; i++) cout << arr[i] << " ";
    cout << endl;
}
template<typename T1> void mdeb(T1 mp){
    cout << "#map pair debug" << endl;
    for(auto const& m : mp) cout << m.first sp m.second << endl;
}
int dx[] = {1, 0, -1, 0, 1, -1, 1, -1};
int dy[] = {0, 1, 0, -1, 1, -1, -1, 1};


class CNextPrime {
public:
	void solve(std::istream& in, std::ostream& out) {
        int x;
        in >> x;

        int res = 0;
        reps(i, x, 2*x){
            bool flg = true;
            reps(j, 2, sqrt(i)){
                if(i % j == 0) flg = false;
            }
            if(flg) res = i;
            if(flg) break;
        }

        out << res << endl;
	}
};


int main() {
	CNextPrime solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		int a[] = new int[n + 2];
		long ans = 0;
		for (int i = 1; i < n+1; i++) {
			a[i] = sc.nextInt();

		}
		a[0] = 0;
		a[n + 1] = 0;
		ans = sum(a);


		for (int i = 1; i < n+1; i++) {

System.out.println(ans-Math.abs(a[i-1]-a[i])-Math.abs(a[i+1]-a[i])+Math.abs(a[i-1]-a[i+1]));
		}

	}

	static void show(int a[]) {
		for (int i = 0; i < a.length; i++) {
			System.out.print(a[i] + " ");
		}

		System.out.println();
	}

	static int sum(int a[]) {
		int n = a.length;
		int ans = 0;
		for (int i = 0; i < n - 1; i++) {
			ans += Math.abs(a[i + 1] - a[i]);
		}
		return ans;
	}

}

Measured memory_bytes: 71744
N = int(input().strip())
a = list(map(int, input().strip().split()))

flag = 0

for i in a:
  if i % 2:
    b = 1
  else:
    if not(i % 3) or not(i % 5):
      b = 1
    else:
      flag = 1
if flag:
  print("DENIED")
else:
  print("APPROVED")
  
      
    

Measured memory_bytes: 2940
(function(input) {
  var p = input.replace(/\n$/, '').split('\n');
  var bt = 0;
  var x = 0;
  var y = 0;
  while (true) {
    var l = p.shift().split(',').map(Number);
    var r = l[0];
    var t = l[1];
    if (r === 0 && t === 0) {
      break;
    }
    x += r * Math.cos(Math.PI * bt / 180);
    y += r * Math.sin(Math.PI * bt / 180);
    bt += t;
  }
  console.log(y > 0 ? Math.floor(y) : Math.ceil(y));
  console.log(x > 0 ? Math.floor(x) : Math.ceil(x));
})(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 7644
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(n);++i)
using namespace std;
using ll = long long;
using P = pair<int,int>;
int main(){
    int a,b,k;
    cin >> a >> b >> k;
    for (int i = a; i < a+k&&i<=b; ++i) cout << i << endl;
    for (int i = max(b - k + 1, a + k); i <= b; ++i) cout << i << endl;
    return 0;
}

Measured memory_bytes: 256
#!/usr/bin/env ruby

while line = gets
  num = line.chomp!.split('').map(&:to_i)

  while num.length != 1
    num_tmp = []
    (num.length-1).times do |i|
      num_tmp << (num[i] + num[i+1]) % 10
    end
    num = num_tmp
  end

  puts num[0]
end

Measured memory_bytes: 8664
#include<bits/stdc++.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define RREP(i,n) for(int i=n;i>=0;i--)
#define FOR(i,m,n) for(int i=m;i<n;i++)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
using namespace std;
typedef long long 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 INF = 1LL << 60;
//const int INF = 1001001001;

int main(void){
    int n,k;
    cin >> n >> k;
    int ans=0;
    while(n>0){
        n/=k;
        ans++;
    }
    cout << ans;

    return 0;
}

Measured memory_bytes: 3580
/*
　　　　　　 ＿＿
　　　　　／＞　　 フ
　　　　　|   _　 _l  
　 　　　／` ミ＿x ノ   Zzz..
　　 　 /　 　 　 |   コード見ちゃだめ！！
　　　 /　 ヽ　　  ﾉ
　 　 │　　|　|  |   
　／￣|　　 |　|  |
　| (￣ヽ＿_ヽ_)_ _)
　＼二つ
*/

#include <bits/stdc++.h>
using namespace std;
#define SORT(a) sort((a).begin(),(a).end())
#define RSORT(a) reverse((a).begin(),(a).end())
#define REP(i, n) for(int i = 0; i < n; i++)
const int MOD = 1e9+7;
typedef long long ll;

//最大公約数の計算
ll GCD(ll a, ll b) {
   if (b == 0) return a;
   return GCD(b, a%b);
}

int main() {
    ll a,b;
    cin>>a>>b;
    cout<<a*b/GCD(a,b)<<endl;
}


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

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

    string S;
    cin >> S;
    int prev = stoi(S.substr(0, 2));
    int second = stoi(S.substr(2, 2));
    if (1 <= prev && prev <= 12 && 1 <= second && second <= 12 ) {
        cout << "AMBIGUOUS" << '\n';
    } else if (1 <= prev && prev <= 12) {
        cout << "MMYY" << '\n';
    } else if (1 <= second && second <= 12) {
        cout << "YYMM" << '\n';
    } else {
        cout << "NA" << '\n';
    }

    return 0;
}


Measured memory_bytes: 256