akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define ALL(x) x.begin(),x.end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define debug(v) cout<<#v<<":";for(auto x:v){cout<<x<<' ';}cout<<endl;
#define mod 1000000007
using ll=long long;
const int INF=1000000000;
const ll LINF=1001002003004005006ll;
int dx[]={1,0,-1,0};
int dy[]={0,1,0,-1};
// ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
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;}

struct IOSetup{
    IOSetup(){
        cin.tie(0);
        ios::sync_with_stdio(0);
        cout<<fixed<<setprecision(12);
    }
} iosetup;

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

template<typename T>
ostream &operator<<(ostream &os,const vector<T>&v){
    for(int i=0;i<(int)v.size();i++) os<<v[i]<<(i+1==v.size()?"":" ");
    return os;
}


signed main(){
    ll n,d;cin>>n>>d;
    ll ans=0;
    rep(i,n){
        ll x,y;cin>>x>>y;
        if(x*x+y*y<=d*d) ans++;
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 3636
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

// c++11
#include <array>
#include <tuple>
#include <unordered_map>
#include <unordered_set>

#define mp make_pair
#define mt make_tuple
#define rep(i, n) for (int i = 0; i < (n); i++)

using namespace std;

using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;
template <class T>
using max_priority_queue = priority_queue<T>;
template <class T>
using min_priority_queue = priority_queue<T, std::vector<T>, std::greater<T>>;

const int INF = 1 << 29;
const ll LL_INF = 1LL << 60;
const double EPS = 1e-9;
const ll MOD = 1000000007;

const int dx[] = {1, 0, -1, 0}, dy[] = {0, -1, 0, 1};
int N, K;
vector<int> X;
int main()
{
  cin >> N >> K;
  X.resize(N);
  for (auto &val : X)
  {
    cin >> val;
  }
  vector<int> X1, X2;
  for (int i = 0; i < N; i++)
  {
    if (X[i] < 0)
    {
      X1.push_back(X[i]);
    }
    else
    {
      X2.push_back(X[i]);
    }
  }
  reverse(X1.begin(), X1.end());
  ll result = LL_INF;

  for (int i = 0; i < X1.size(); i++)
  {
    int cnt = i + 1;
    ll dist = 2LL * abs(X1[i]);
    if (cnt < K)
    {
      ll rest = K - cnt;
      if (rest > X2.size())
      {
        continue;
      }
      dist += X2[rest - 1];
      result = min(result, dist);
    }
    else
    {
      result = min(result, dist / 2);
    }
  }

  for (int i = 0; i < X2.size(); i++)
  {
    int cnt = i + 1;
    ll dist = 2LL * abs(X2[i]);
    if (cnt < K)
    {
      ll rest = K - cnt;
      if (rest > X1.size())
      {
        continue;
      }
      dist += abs(X1[rest - 1]);
      result = min(result, dist);
    }
    else
    {
      result = min(result, dist / 2);
    }
  }
  cout << result << endl;
  return 0;
}


Measured memory_bytes: 1404
import sys
sys.setrecursionlimit(10**7)

from functools import lru_cache

@lru_cache(None)
def dfs(p, remain):

    n = len(arr)

    if remain == 0 or p >= n:
        return 0

    if remain == 1:
        return max(arr[p:])
        
    len_remain = n - (p + 1)

    t = -float('inf')
    if (remain - 1) * 2 + 1 <= len_remain:
        t = dfs(p + 1, remain)

    t2 = arr[p] + dfs(p + 2, remain - 1)

    return max(t, t2)

    


n = int(input())

arr = list(map(int, input().split()))

ans = dfs(0, n // 2)

print (ans)



Measured memory_bytes: 438628
#include <bits/stdc++.h>
#define ll long long int
#define F first
#define S second
const ll mod = 1e9 + 7;
const ll INF = 10000000000000;
#define pb push_back
#define fastio ios_base::sync_with_stdio(0); cin.tie(0);
using namespace std;

// ll modexp(ll x, ll y, ll p)
// {
//    ll res = 1;      
//    x = x % p;   
//    while (y > 0)
//    {
//        if (y & 1)
//            res = (res * x) % p;
//        y = y >> 1; 
//        x = (x * x) % p;
//    }
//    return res;
// }

// ll sub_mod(ll a, ll b, ll m){
//    if (a >= b)
//        return a - b;
//    else
//        return m - b + a;
// }

// ll add_mod(ll a, ll b){
//    if (0 == b) 
//        return a;

//    b = mod - b;
//    if (a >= b)
//        return a - b;
//    else
//        return mod - b + a;
// }

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

int main()
{
// #ifndef ONLINE_JUDGE   
// 	freopen("input.txt", "r", stdin);
// 	freopen("output.txt", "w", stdout);
// #endif
	set<ll>s;
	ll n=0;
	cin>>n;
	ll a=0;
	for(ll i=0;i<n;++i)
	{
		cin>>a;
		s.insert(a);
	}
	if(n==s.size())
		cout<<"YES\n";
	else
		cout<<"NO\n";
	return 0;
}



Measured memory_bytes: 9600
#include <bits/stdc++.h>
using namespace std;
 
#define ll long long
#define vvi vector<vector<int>>
#define vec vector
#define pq priority_queue
#define all(v) (v).begin(), (v).end()
#define uniqueV(x) sort(x.begin(), x.end()); x.erase(unique(x.begin(), x.end()), x.end());
#define rep(i, n) for (int (i) = (0); (i) < (n); ++(i))
#define repp(i, m, n) for (int (i) = (m); (i) < (n); ++(i))
#define debug(x) cerr << #x << ": " << x << endl;
#define debug2(x, y) cerr<<"("<<#x<<", "<<#y<<") = "<<"("<<x<<", "<<y<<")"<<endl;
#define debug3(x, y, z) cerr<<"("<<#x<<", "<<#y<<", "<<#z<<") = "<<"("<<x<<", "<<y<<", "<<z<<")"<<endl;
#define debugB(x, y) cerr<<#x<<": "<<bitset<y>(x) << endl;
#define line() cerr << "---------------" << endl;
 
const int dx[] = {1, -1, 0, 0};
const int dy[] = {0, 0, -1, 1};
 
template<typename T>
void printA(vector<T> &printArray, char between = ' ') {
   int paSize = printArray.size();
   for (int i = 0; i < paSize; i++) { cerr << printArray[i] << between;}
   if (between != '\n') {cerr << endl;}
}
 
// ------------------------------------------------------------------------------------------

map<vector<int>, int> mp;

void init() {
   vector<int> v(8);
   iota(all(v), 0);
   mp[v] = 0;

   queue<vector<int>> que;
   que.push(v);
   while (que.size()) {
      vector<int> cur = que.front(); que.pop();
      int idx = find(all(cur), 0) - cur.begin();

      rep (i, 4) {
         int ny = idx / 4 + dy[i];
         int nx = idx % 4 + dx[i];
         if (ny < 0 || ny >= 2 || nx < 0 || nx >= 4) continue;
         int nc = 4 * ny + nx;
         vector<int> tmp = cur;
         swap(tmp[nc], tmp[idx]);
         if (mp.count(tmp)) continue;
         mp[tmp] = mp[cur] + 1;
         que.push(tmp);
      }
   }
}


int main() {
   init();
   vector<int> vs(8);
   while (cin >> vs[0]) {
      repp (i, 1, 8) cin >> vs[i];
      cout << mp[vs] << endl;
   }

   return 0;
}


Measured memory_bytes: 5608
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define INF 1e9
#define PI 3.14159265359
#define MOD 1000000007
#define ALL(v) v.begin(),v.end()
#define ALLR(v) v.rbegin(),v.rend()
typedef long long ll;
const int dx[4] = {1,0,-1,0};
const int dy[4] = {0,1,0,-1};
//isPrime
//modpow modinv
//getDigit
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;
}
int main() {
  cout << fixed << setprecision(10);
  int d;
  cin >> d;
  vector<int> c(26);
  rep(i,26)cin>>c[i];
  vector<vector<int>> s(d,vector<int>(26));
  rep(i,d){
    rep(j,26)cin>>s[i][j];
  }
  rep(i,d){
    cout << 1 << endl;
  }
}


Measured memory_bytes: 3668
n = int(input())
lst = list(map(int,input().split()))
lst2 = [0 for i in range(n)]
for i in range(n - 1):
  x = lst[i]
  lst2[x - 1] = lst2[x - 1] + 1
for i in range(n):
  print(lst2[i])


Measured memory_bytes: 32220
#include <iostream>
#include <vector>
#include <algorithm>
#include <string.h>
#include <math.h>
#include <map>
#include <iomanip>
#include <stdio.h>
#include <bitset>

typedef long long LL;

constexpr long long INFLL = 1e18;

using namespace std;

int main()
{
    int n, k;
    cin >> n >> k;
    vector<int> a(n);
    for (int i = 0; i < n; i++)
    {
        cin >> a.at(i);
    }
    sort(a.begin(), a.end());
    int sum = 0;

    for (int i = 0; i < k; i++)
    {
        sum += a.at(i);
    }

    cout << sum << endl;

    return 0;
}

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

const int MAX = 100000;

void swap(int &x, int &y) {
	int tmp = x;
	x = y;
	y = tmp;
}

int partition(int A[], int p, int r) {
	int x = A[r];
	int i = p; // First index greater than A[r]
	for (int j = p; j <= r-1; j++) {
		if (A[j] > x) continue;
		swap(A[i], A[j]); // Insert A[j] (less than A[r])
		i++;
	}
	swap(A[i], A[r]);
	return i;
}

int main() {
	int n, A[MAX];
	cin >> n;
	for (int i = 0; i < n; i++) cin >> A[i];

	int idx = partition(A, 0, n-1);
	for (int i = 0; i < n; i++) {
		if (i == idx) cout << '[' << A[i] << ']';
		else cout << A[i];
		if (i < n-1) cout << ' ';
		else cout << endl;
	}
}



Measured memory_bytes: 3472
#include <bits/stdc++.h>
typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ldb;
 
#define endl '\n'
#define loop(i, m, n) for (lli i = m; i < n; i++)
#define loope(i, m, n) for (lli i = m; i <= n; i++)
#define epool(i, m, n) for (lli i = m; i >= n; i--)
#define maxe *max_element
#define mine *min_element
#define mod 1000000007
#define mod2 998244353
#define vt vector<lli>
#define fi first
#define se second
#define pb push_back
#define umap unordered_map
#define mmap multimap
#define MP make_pair
#define empf emplace_front
#define empb emplace_back
#define ret(x) return cout << x << endl, 0;
#define all(v) v.begin(),v.end()

#define fast_io                       \
    ios_base::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
using namespace std;
 
lli gcd(lli a, lli b){
    if (b == 0)
        return a;
    return gcd(b, a % b);
}
 
lli lcm(lli a, lli b){
    return (a * b) / gcd(a, b);
}
 
lli modi( lli n, lli m=mod ){ 
    n%=m;
    n+=m;
    n%=m;
    return n;
}

lli mpow(lli base, lli exp){
    base %= mod;
    lli result = 1;
    while (exp > 0){
        if (exp & 1)
            result = ((lli)result * base) % mod;
        base = ((lli)base * base) % mod;
        exp >>= 1;
    }
    return result;
}

const lli MIN=-1*1e18;
const lli INF=1e18+999999999999999999;
const lli N=2e5+5;
const ldb pi=4*atan(1);

int32_t main(){
    fast_io
    lli i = 0,j = 0;
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    //cout << fixed << setprecision(22);
   
    lli n;
    cin >> n;
    bool fl=0;
    loope(i,-1000,1000){
        loope(j,-1000,1000){
            if(pow(i,5)-pow(j,5)==n){
                cout << i << " " << j << endl;
                fl=1;
                break;
            }
            if(fl) break;
        }
    }


}



Measured memory_bytes: 4080
#include <bits/stdc++.h>
#include <unordered_map>
using namespace std;
#define PB push_back
#define MP make_pair
#define LL long long
#define int LL
#define FOR(i,a,b) for(int i = (a); i <= (b); i++)
#define FORD(i,a,b) for(int i = (a); i >= (b); i--)
#define RE(i,n) FOR(i,1,n)
#define REP(i,n) FOR(i,0,(int)(n)-1)
#define R(i,n) REP(i,n)
#define VI vector<int>
#define PII pair<int,int>
#define LD long double
#define FI first
#define SE second
#define st FI
#define nd SE
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((int)(x).size())
#define M_PI 3.14159265358979323846
template<class C> void mini(C& _a4, C _b4) { _a4 = min(_a4, _b4); }
template<class C> void maxi(C& _a4, C _b4) { _a4 = max(_a4, _b4); }

template<class TH> void _dbg(const char *sdbg, TH h) { cerr << sdbg << '=' << h << endl; }
template<class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) {
	while (*sdbg != ',')cerr << *sdbg++; cerr << '=' << h << ','; _dbg(sdbg + 1, a...);
}

template<class T> ostream& operator<<(ostream& os, vector<T> V) {
	os << "["; for (auto& vv : V) os << vv << ","; os << "]";
	return os;
}

template<class T> ostream& operator<<(ostream& os, set<T> V) {
	os << "["; for (auto& vv : V) os << vv << ","; os << "]";
	return os;
}

template<class L, class R> ostream &operator<<(ostream &os, pair<L, R> P) {
	return os << "(" << P.st << "," << P.nd << ")";
}


#ifdef LOCAL
#define debug(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
#else
#define debug(...) (__VA_ARGS__)
#endif

int32_t main(int32_t argc, char ** argv) {
	ios_base::sync_with_stdio(0);
	int n, k;
	cin >> k >> n;
	if (k % 2 == 0) {
		cout << k / 2<<" ";
		REP(i, n - 1) {
			cout << k <<" ";
		}
	}
	else {
		vector<int> seq(n, (k + 1) / 2);
		REP(i, n / 2) {
			if (seq.back() == 1) {
				seq.pop_back();
			}
			else {
				seq.back()--;
				while (SZ(seq) != n) {
					seq.push_back(k);
				}
			}
		}
		REP(i, SZ(seq)) {
			cout << seq[i] << " ";
		}
	}
	return 0;
}

Measured memory_bytes: 4608
#include<bits/stdc++.h>
using namespace std;
signed main()
{
  string s;
  int a=0;
  cin>>s;
  if(s[0]==s[1]){
    if(s[2]==s[3]){
      a++;
    }
  }if(s[0]==s[2]){
    if(s[1]==s[3]){
      a++;
    }
  }if(s[0]==s[3]){
    if(s[1]==s[2]){
      a++;
    }
  }if(s[0]==s[1] && s[0]==s[2]){
    a=0;
  }
  if(a>0){
    cout<<"Yes\n";
  }else{
    cout<<"No\n";
  }
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int k = in.nextInt();

        double ans = 0;
        for (int i = 1; i <= n; i++) {
            int m = 1;
            int nn = i;
            while(nn < k) {
                nn *= 2;
                m *= 2;
            }
            ans += 1.0 / m;
        }

        ans /= n;
        System.out.println(ans);
    }
}

Measured memory_bytes: 21588
#include<iostream>

using namespace std;

int main(){
  int n, i;
  while(cin >> n && n != 0) {
    int dp[n+1] = {};
    dp[1] = 1;
    dp[2] = 2;
    dp[3] = 4;

    for(i = 4; i <= n; i++) {
      dp[i] = dp[i-3] + dp[i-2] + dp[i-1];
    }

    i = 0;
    
    while(dp[n] > 0) {
      dp[n]-=3650;
      i++;
    }
    
    cout <<  i  << endl;
  }
  
  return 0;
}

Measured memory_bytes: 3016
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <memory>
#include <complex>
#include <numeric>
#include <cstdio>
#include <iomanip>

#define REP(i,m,n) for(int i=int(m);i<int(n);i++)
#define EACH(i,c) for (auto &(i): c)
#define all(c) begin(c),end(c)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort(begin(c),end(c))
#define pb emplace_back
#define MP make_pair
#define SZ(a) int((a).size())

#ifdef LOCAL
#define DEBUG(s) cout << (s) << endl
#define dump(x)  cerr << #x << " = " << (x) << endl
#define BR cout << endl;
#else
#define DEBUG(s) do{}while(0)
#define dump(x) do{}while(0)
#define BR 
#endif
using namespace std;

using UI = unsigned int;
using UL = unsigned long;
using LL = long long int;
using ULL = unsigned long long;
using VI = vector<int>;
using VVI = vector<VI>;
using VLL = vector<LL>;
using VS = vector<string>;
using PII = pair<int,int>;
using VP = vector<PII>;

constexpr double EPS = 1e-10;
constexpr double PI  = acos(-1.0);

template<class T> inline T sqr(T x) {return x*x;}

array<int, 100001> box, p;

int main() {
	int n,m;
	cin >> n >> m;
	REP(i,1,n+1) box[i] = 1;
	p[1] = 1;
	int x,y;
	REP(i,0,m) {
		cin >> x >> y;
		box[x]--; box[y]++;
		if (p[x]) p[y] = 1;
		if (box[x] == 0) p[x] = 0;
	}
	int cnt = 0;
	REP(i,1,n+1) cnt += p[i];
	cout << cnt << endl;
	
	return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <fstream>
#include <sstream>
#include <string.h>
#include <algorithm>
#include <cmath>
#include <assert.h>
#include <stack>
#include <queue>
#include <list>
#include <vector>
#include <map>
#include <set>

//#define DEBUG 1

#define for0(i,n) for (int i=0; i<n; i++)
#define forr(i,n) for (int i=n-1; i>=0; i--)
#define fori(i,a,b) for (int i=a; i<=b; i++)
#define iter(c) for(auto it=c.begin(); it!=c.end(); it++)
#define vec(x) vector< x >
#define pb push_back
#define ms(a,z) memset(a,z,sizeof(a));
#define mp make_pair
#define X first
#define Y second
#define sqr(x) 1LL*(x)*(x)
#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
#define all(a) a.begin(),a.end()
#define sz(x) (int)(x).size()
#define read(x) int x; scanf("%d",&x);
#ifdef DEBUG
#define nl cout<<"\n";
#define pr(x) cout<<(x)<<" ";
#define prl(x) cout<<#x " = "<<x<<endl;
#define prp(x) cout<<"("<<(x).first<<" "<<(x).second<<") ";
#define printv(v) {for(int _=0; _<sz(v); _++) cout<<v[_]<<" "; cout<<"\n";}
#define printa(a,s) {for (int _=0; _<s; _++) cout<<a[_]<<" "; cout<<"\n";}
#define print2D(a,m,n) {for (int _=0; _<m; _++) {for (int __=0; __<n; __++) cout<<a[_][__]<<" "; cout<<"\n";} cout<<"\n";}
#define debug cout<<"ok at line "<<__LINE__<<endl;
#else
#define nl
#define pr(x)
#define prl(x)
#define prp(x)
#define printv(v)
#define printa(a,s)
#define print2D(a,m,n)
#define debug
#endif

using namespace std;

typedef long long ll;

const int INF = 2147483647;
const long long INFL = 9223372036854775807LL;
const double EPSILON = 0.00000001;
const long long MOD = 1000000007;

bool check(string s)
{
    for (int i=1; i<s.length(); i++) {
        if (s[i] != s[0])
            return false;
    }
    return true;
}

int main()
{
    #ifdef DEBUG
    freopen("A.txt","r",stdin);
    //freopen("","w",stdout);
    #endif

    string s;
    cin >> s;

    int ans = INF;
    for (char c='a'; c<='z'; c++) {
        int moves = 0;
        string s_copy = s;
        //prl(c)

        while (!check(s_copy)) {
            string s_next = s_copy.substr(0,s_copy.length()-1);
            for (int i=0; i<s_copy.length()-1; i++) {
                if (s_copy[i] == c || s_copy[i+1] == c)
                    s_next[i] = c;
                else
                    s_next[i] = s_copy[i];
            }
            moves++;
            s_copy = s_next;
            //pr(s_copy) nl
        }
        ans = min(ans,moves);
    }
    cout<<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
using namespace std;

int l;
int n, m;
vector<int> et[20];
vector<int> ec[20];

signed main() {
	int i, j;
	
	cin >> l;
	n = 20;
	
	int mul = 1;
	for (i = n - 2; i >= 1; i--) {
		et[i].push_back(i + 1);
		ec[i].push_back(0);
		et[i].push_back(i + 1);
		ec[i].push_back(mul);
		mul *= 2;
	}
	
	int remL = l;
	for (i = 1; i < n; i++) {
		int id = n - 1 - i;
		while (remL >= (1 << id)) {
			et[0].push_back(i);
			ec[0].push_back(remL - (1 << id));
			remL -= (1 << id);
		}
	}
	
	for (i = 0; i < n; i++) m += et[i].size();
	
	cout << n << " " << m << endl;
	for (i = 0; i < n; i++) {
		for (j = 0; j < et[i].size(); j++) {
			cout << i + 1 << " " << et[i][j] + 1 << " " << ec[i][j] << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <bitset>
#include <utility>
#include <numeric>

using namespace std;

using ll = long long;
using ull = unsigned long long;

const ll inf = (ll)1e9;
const ll mod = (ll)1e9 + 7;

#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()

#define print(s) cout << s;
#define println(s) cout << s << endl;
#define printd(s, f) cout << fixed << setprecision(f) << s << endl;


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

	vector<ll> dp(n + 1);

	dp[1] = 1;
	dp[2] = 2;

	ll old = -1;
	for (int i = 0; i < m; i++)
	{
		int x;
		cin >> x;
		
		dp[x] = -1;

		if (x == 1)
		{
			dp[2] = 1;
		}
	}

	for (int i = 3; i <= n; i++)
	{
		if (dp[i] >= 0)
		{
			if (dp[i - 1] >= 0)
			{
				dp[i] = (dp[i] + dp[i - 1]) % mod;
			}

			if (i - 2 >= 0 && dp[i - 2] >= 0)
			{
				dp[i] = (dp[i] + dp[i - 2]) % mod;
			}
		}
	}

	println(dp[n]);
}


Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <cmath>

using namespace std;
using ll = long long;

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

    int si,ci;

    vector<int> v(3,-1);
    bool no = false;
    for(int i=0; i<m; i++){
        cin >> si >> ci;
        si = n-si;

        if(v[si] == -1){
            v[si] = ci;
        }else if(v[si]!=ci){
            no = true;
        }
    }
    
    if(v[n-1]==0 and n>1){
        no = true;
    }

    if(v[n-1]==-1 and n>1){
        v[n-1] = 1;
    }
    if(v[0]==-1 and n==1){
        v[0] = 0;
    }
    for(int i=0; i<n-1; i++){
        if(v[i]==-1){
            v[i] = 0;
        }
    }



    int ans = 0;
    for(int i=0; i<n; i++){
        if(i==0){
            ans += v[i];
        }else if(i==1){
            ans += v[i]*10;
        }else{
            ans += v[i]*100;
        }
    }

    if(no){
        cout << -1 << endl;
    }else{
        cout << ans << endl;
    }
}

Measured memory_bytes: 256
N,M=map(int,input().split())
t=[0]*N
ans=0
H=list(map(int,input().split()))
for j in range(M):
    A,B=map(int,input().split())
    t[A-1]=max(t[A-1],H[B-1])
    t[B-1]=max(t[B-1],H[A-1])
for w in range(N):
        if H[w] > t[w]:
            ans+=1
print(ans)

    


Measured memory_bytes: 85796
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#define MOD 1000000007
using namespace std;

typedef pair<int, int> P;
typedef pair<long long, long long> LLP;

long long int fib[100001];

void calcFib(int N) {
    fib[0] = 1;
    fib[1] = 1;
    for (int i = 2; i <= N; i++) {
        fib[i] = (fib[i - 1] + fib[i - 2]) % MOD;
    }
}

int main() {

    int N, M;
    cin >> N >> M;
    
    int a[M];
    for (int i = 0; i < M; i++) {
        scanf("%d", &a[i]);
    }

    calcFib(N);

    int count = 0;
    int now_i = 0;
    long long int ans = 1;

    for (int i = 1; i < N; i++) {
        if (i == a[now_i]) {
            if (now_i < M && i + 1 == a[now_i + 1]) ans = 0;
            else {
                ans = ans * fib[count] % MOD;
                now_i++;
                i++;
                count = 0;
            }
        } else {
            count++;
        }
    }
    count++;

    ans = ans * fib[count] % MOD;

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 1408
use std::io::stdin;
fn main() {
    let mut st = String::new();
    stdin().read_line(&mut st).unwrap();
    let y:Vec<char> = st.trim().chars().collect();
    let x:Vec<i32> = y.into_iter().map(|x| x as i32 - 48).collect();
    let z:i32 = x.iter().sum();
    println!("{:?}",z);
}

Measured memory_bytes: 2068
#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,a,ans,tmp;
priority_queue<int,vector<int>,greater<int>> pq;

main() {
    cin >> n;
    rep(i,n) cin >> a,pq.push(a);
    tmp = pq.top();
    pq.pop();
    ans++;
    while(!pq.empty()) {
        if (pq.top() > tmp*2) ans = 1;
        else ans++;
        tmp += pq.top();
        pq.pop();
    }
    cout << ans << endl;
}


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

static const int INF = 1000000;

int isprime[200001];

void eratos(int n) {
	for (int i = 0; i < 200001; i++)
		isprime[i] = 1;
	
	isprime[0] = isprime[1] = 0;
	for (int i = 2; i <= sqrt(n); i++) {
		if (isprime[i]) {
			int j = i * 2;
			while (j <= n) {
				isprime[j] = 0;
				j += i;
			}
		}
	}
}

void sort(int a[]) {
	for (int i = 0; i < 1275; i++)
		for (int j = i; j > 0; j--)
			if (a[j-1] > a[j]) {
				int t = a[j-1];
				a[j-1] = a[j];
				a[j] = t;
			}
}

int main() {
	eratos(200000);
	while (1) {
		int n, p;
		cin >> n >> p;
		if (p == -1) break;
		
		int index;
		for (int i = n + 1; ;i++)
			if (isprime[i]) {
				index = i;
				break;
			}
		int nprime[50];
		nprime[0] = index;
		int t = 1;
		for (int i = index + 1; ; i++) {
			if (isprime[i]) {
				nprime[t] = i;
				t++;
			}
			if (t == 50) break;
		}
		
		
		int sum[1275] = {INF};
		t = 0;
		for (int i = 0; i < 50; i++) {
			for (int j = i; j < 50; j++) {
				sum[t] = nprime[i] + nprime[j];
				t++;
			}
		}
		
		sort(sum);
		
		cout << sum[p-1] << endl;
		
	}
	return 0;
}

Measured memory_bytes: 3848
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
using static System.Math;
using System.Numerics;

namespace AtCoder
{
    class Program
    {
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }
        static long Mod = (long)1e9 + 7;
        static long N, M, Q;
        static long[] a, b, c, d;
        static void Main(string[] args)
        {
            SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
            Solve();
            Out.Flush();
            Read();
        }
        static void Solve()
        {
            var S = ReadLine();
            var N = S.Length;
            var K = Sarray()[0];

            var dp = new long[N, 4, 2];
            var F = 0;
            var T = 1;
            var Ss = S[0] - '0';
            dp[0, 1, F] = Ss - 1;
            dp[0, 1, T] = 1;
            for (var i = 1; i < N; ++i)
            {
                var Sn = S[i] - '0';
                var Sp = S[i - 1] - '0';

                for (var k = 1; k <= 3; ++k)
                {
                    //0に推移する場合
                    dp[i, k, F] += dp[i - 1, k, F];
                    if (0 != Sn)
                        dp[i, k, F] += dp[i - 1, k, T];

                    //0以外に遷移する場合
                    dp[i, k, F] += 9 * dp[i - 1, k - 1, F];
                    if (0 != Sn)
                        dp[i, k, F] += (Sn - 1) * dp[i - 1, k - 1, T];

                    //張り付き
                    if (0 == Sn)
                        dp[i, k, T] = dp[i - 1, k, T];
                    else
                        dp[i, k, T] = dp[i - 1, k - 1, T];
                }
                //前全部0から推移
                dp[i, 1, F] += 9;
            }
            var ans = dp[N - 1, K, F] + dp[N - 1, K, T];
            WriteLine(ans);
        }
    }
}

Measured memory_bytes: 13396
#include<iostream>
#include<cmath>
#include<algorithm>
#include<cstdio>
 
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define MAX 100010
 
using namespace std;
 
typedef long long ll;
 
int N,M,s[MAX],t[MAX],p[MAX],L[MAX],R[MAX];
ll sum[MAX];
 
int main(){
  cin >> N >> M;
  rep(i,N)cin >> s[i] >> t[i];
  rep(i,M)cin >> p[i];
  sort(p,p+M);
  rep(i,N){
    L[i] = lower_bound(p,p+M,max(s[i],t[i])) - p;
    R[i] = lower_bound(p,p+M,min(s[i],t[i])) - p;
    if(R[i] >= M)R[i]--;
    L[i]--;
  }

  sum[0] = p[1] - p[0];
  sum[1] = p[2] - p[1];
  rep(i,M-3)sum[i+2] = sum[i] + p[i+3] - p[i+2];

  ll ans = 0;
  rep(i,N){
    if(p[R[i]] > p[L[i]]){
      ans += abs(s[i]-t[i]);
      continue;
    }
    if(p[R[i]] == p[L[i]]){
       if( min(s[i],t[i]) <= p[R[i]] && p[L[i]] <= max(s[i],t[i]) ){
     if(s[i] < t[i])ans += p[R[i]] - s[i];
     else           ans += s[i] - p[R[i]];
     continue;
       } else {
    ans += abs(s[i]-t[i]);
    continue;
      }
    }
    int theNumber = L[i] - R[i] + 1;
    if(s[i] > t[i]) {
      if(theNumber & 1){
    ans += (L[i]-2>=0?sum[L[i]-2]:0) - (R[i]-2>=0?sum[R[i]-2]:0);
    ans += s[i] - p[L[i]];
      } else {
    ans += (L[i]-2>=0?sum[L[i]-2]:0) - (R[i]-1>=0?sum[R[i]-1]:0);
    ans += s[i] - p[L[i]] + p[R[i]] - t[i];
      }
    } else {
      if(theNumber & 1){
    ans += (L[i]-1>=0?sum[L[i]-1]:0) - (R[i]-1>=0?sum[R[i]-1]:0);
    ans += p[R[i]] - s[i];
      } else {
    ans += (L[i]-2>=0?sum[L[i]-2]:0) - (R[i]-1>=0?sum[R[i]-1]:0);
    ans += t[i] - p[L[i]] + p[R[i]] - s[i];
      }
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3904
#include <cstdio>

#include <algorithm>

using namespace std;

int a[4];

int main() {
  for (int i = 0; i < 4; ++i)
    scanf("%d", &a[i]);
  sort(a, a + 4);
  puts(a[0] == 1 && a[1] == 4 && a[2] == 7 && a[3] == 9 ? "YES" : "NO");
  return 0;
}


Measured memory_bytes: 128
use proconio::{input, fastout};

#[fastout]
fn main() {
    input!{
        s: String,
        t:String,
    }

    let mut min_diff = t.len();
    for i in 0..=(s.len() - t.len()) {
        let mut diff_num = 0;
        for k in 0..t.len() {
            if t.chars().nth(k) != s.chars().nth(i + k) {
                diff_num += 1;
            }
        }
        min_diff = min_diff.min(diff_num);
    }

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


Measured memory_bytes: 2176
#include <stdio.h>

int main(){
	int N;
	scanf("%d",&N);
	char str[N+1];
	int flag =1;
	scanf("%s",str);
	if(N%2 == 1){
		printf("No\n");
}
else{

	for(int i=0 ; i< N/2 ; i++){
		if(str[i] != str[i+((N/2))]){
			flag = 0;
		}
	}

	if(flag){
		printf("Yes");
	}
	else{
		printf("No");
	}
}
	return 0;
}

Measured memory_bytes: 1680
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<set>
#include<iomanip>
#define pi 3.14159265358979323846
#define ll long long
#define rep(i, a, n) for(int i = a; i < n; i++)
using namespace std;
int main(){
  ll n, d, sm = 0;
  cin >> n >> d;
  d = d * d;
  ll int x[n], y[n], z[n];
  rep(i, 0, n){
    cin >> x[i] >> y[i];
    x[i] = x[i] * x[i];
    y[i] = y[i] * y[i];
    z[i] = x[i] + y[i];
    if(z[i] <= d){
      sm++;
    }
  }
  cout << sm << "\n";
}

Measured memory_bytes: 8196
#include <bits/stdc++.h>
#define endl "\n"
using namespace std;
typedef long long ll;
typedef pair<ll, ll> l_l;
typedef pair<int, int> i_i;
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;
}

const long long INF = 1e18;
const ll mod = 1000000007;
struct SegmentTree {
private:
    int n;
    vector<int> node;
 
public:
    SegmentTree() {
        int sz = 200010;
        n = 1; while(n < sz) n *= 2;
        node.resize(2*n-1, 0);
        for(int i=0; i<sz; i++) node[i+n-1] = 0;
        for(int i=n-2; i>=0; i--) node[i] = min(node[2*i+1], node[2*i+2]);
    }
 
    void add(int x, int val) {
        x += (n - 1);
        node[x] += val;
        node[x] %= mod;
        while(x > 0) {
            x = (x - 1) / 2;
            node[x] = (node[2*x+1] + node[2*x+2]) % mod;
        }
    }
    // hannkaikukann 
    int getsum(int a, int b, int k=0, int l=0, int r=-1) {
        if(r < 0) r = n;
        if(r <= a || b <= l) return 0;
        if(a <= l && r <= b) return node[k];
 
        int vl = getsum(a, b, 2*k+1, l, (l+r)/2);
        int vr = getsum(a, b, 2*k+2, (l+r)/2, r);
        return (vl + vr) % mod;
    }
};


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, M;
    cin >> N >> M;
    vector<int> x(N);
    for(int i = 0; i < N; i++) {
        cin >> x[i];
    }
    vector<int> y(M);
    for(int i = 0; i < M; i++) {
        cin >> y[i];
    }
    vector<i_i> v;
    vector<int> xcmp, ycmp;
    for(int i = 0; i < N; i++) {
        auto itr = lower_bound(y.begin(), y.end(), x[i]);
        if(itr == y.begin() or itr == y.end()) continue;
        i_i tmp;
        tmp.second = *itr - x[i];
        itr--;
        tmp.first = x[i] - *itr;
        tmp.first *= -1;
        v.push_back(tmp);
        xcmp.push_back(tmp.first);
        ycmp.push_back(tmp.second);
    }
    sort(xcmp.begin(), xcmp.end());
    xcmp.erase(unique(xcmp.begin(), xcmp.end()), xcmp.end());
    sort(ycmp.begin(), ycmp.end());
    ycmp.erase(unique(ycmp.begin(), ycmp.end()), ycmp.end());
    for(int i = 0; i < v.size(); i++) {
        auto itr = lower_bound(xcmp.begin(), xcmp.end(), v[i].first);
        v[i].first = itr - xcmp.begin();
        itr = lower_bound(ycmp.begin(), ycmp.end(), v[i].second);
        v[i].second = itr - ycmp.begin();
    }
    sort(v.begin(), v.end(), greater<i_i>());
    v.erase(unique(v.begin(), v.end()), v.end());
    SegmentTree seg;
    seg.add(0, 1);
    for(auto tmp : v) {
        int val = seg.getsum(0, tmp.second + 1);
        seg.add(tmp.second + 1, val);
    }
    cout << seg.getsum(0, v.size() + 1) << endl;
    return 0;
}

Measured memory_bytes: 4984
#include <bits/stdc++.h>
#define f first
#define s second
#define MOD 1000000007
#define PMOD 998244353
#define pb(x) push_back(x)
using namespace std;

typedef long long int ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> plii;
typedef pair<int, pii> piii;
const int INF = 1e9+10;
const ll LINF = 1LL*INF*INF;
const int MAXN = 2e5+10;
const int MAXM = 5e3+10;

priority_queue<int> pq;
vector<vector<int> > graph;
queue<int> que;

bool dp[100][13010];
int A[110][110];
int B[110][110];
bool tmp[13010];

void solve(int x,int y)
{
    for(int i=0;i<=13000;i++)
        tmp[i] = (dp[y][i]||dp[y-1][i]);

    int cur = A[x][y]-B[x][y];
    int nxta,nxtb;

    for(int i=0;i<=13000;i++)
        dp[y][i] = false;

    for(int i=0;i<=13000;i++){
        if(tmp[i]){
            nxta = abs(i+cur);
            nxtb = abs(i-cur);
            if(nxta<=13000)dp[y][nxta] = true;
            if(nxtb<=13000)dp[y][nxtb] = true;
        }
    }
    return;
}


int main()
{
    int n,m,k,a,b,x,y,q;
    int sum = 0;
    int cnt = 0;
    int mx = 0;
    int mn = INF;
    int cur = 0, idx = -1;
    int tc;

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

    cin>>n>>m;

    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            cin>>A[i][j];
        }
    }
    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++){
            cin>>B[i][j];
        }
    }

    dp[0][0] = true;

    for(int i=1;i<=n;i++){
        for(int j=1;j<=m;j++)
            solve(i,j);
        dp[0][0] = false;
    }

    for(int i=0;i<=13000;i++){
        if(dp[m][i]){
            cout<<i<<"\n";
            break;
        }
    }

    return 0;
}


Measured memory_bytes: 1536
#include<iostream>

using namespace std;

struct clo{
	int l,h;
	int v;
};

int abs(int x){
	if(x<0)return x*-1;
	return x;
}

int tem[300];
clo data[300];
int dp[300][300]={0};

bool che(clo c,int t){
	if(c.l<=t && c.h>=t)return true;
	else return false;
}
int main(){
	int D,n;
	cin>>D>>n;
	for(int i=0;i<D;i++){
		cin>>tem[i];
	}
	for(int i=0;i<n;i++){
		cin>>data[i].l>>data[i].h>>data[i].v;
	}
	for(int i=0;i<n;i++){
		dp[0][i]=0;
	}
	for(int i=1;i<D;i++){
		for(int j=0;j<n;j++){
			for(int k=0;k<n;k++){
				if(che(data[k],tem[i]) && che(data[j],tem[i-1]))dp[i][k]=max(dp[i][k],dp[i-1][j]+abs(data[k].v-data[j].v));
			}
		}
	}
	int ans=0;
	for(int i=0;i<n;i++){
		ans=max(ans,dp[D-1][i]);
	}
	cout<<ans<<endl;
	
}

Measured memory_bytes: 1400
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
using ll = long long;

constexpr int P = 1000000007;

ll powmod(ll n, ll k) {
    ll r = 1, t = n % P;
    for (; k != 0; k /= 2) {
        if (k & 1) r = r * t % P;
        t = t * t % P;
    }
    return r;
}

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

    ll r = powmod(10, n) - powmod(9, n) * 2 + powmod(8, n);

    r %= P;
    if (r < 0) r += P;

    cout << r << endl;

    return 0;
}

Measured memory_bytes: 3668
/*
このコード、と～おれ!
Be accepted!
∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>

#pragma GCC optimize("Ofast")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printin(a) printf(a ? "possible\n" : "inposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0

using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const double PI = acos(-1);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);//最初の改行対策
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

/*-----------------------------------------ここからコード-----------------------------------------*/


int main() {
	
	int n;
	scanf("%d", &n);
	if(n == 1)printf("%s\n", "Hello World");
	else{
	  int a, b;
	  scanf("%d%d", &a, &b);
	  printf("%d\n", a + b);
	}
	
	Please AC;
}


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

int main() {
	int N;
	cin >> N;
	vector<int> A(N),B(N);

	rep(i,N)
		cin >> A.at(i) >> B.at(i);
	sort(A.begin(), A.end());
	sort(B.begin(), B.end());
	
	if(N%2)
		cout << B.at(N/2)-A.at(N/2)+1;
	else
		cout << B.at(N/2)+B.at(N/2-1)-A.at(N/2)-A.at(N/2-1)+1;
	cout << endl;
}

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

using namespace std;

set <string> st;
map <string,int> mp;

int main()
{
  int n;
  cin >> n;
  
  int mx=0;
  
  while(n--)
  {
    string str;
    cin >> str;
    mp[str]++;
    mx = max(mx,mp[str]);
    st.insert(str);
  }
  set <string> :: iterator it;
  for(it=st.begin();it!=st.end();it++)
  {
    string str = *it;
    if(mp[str]==mx)cout << str << '\n';
  }
}


Measured memory_bytes: 34560
#include<bits/stdc++.h>
using namespace std;
int main(){
  
  set<int> s;
  int a , b , c ;
  cin>>a>>b>>c;
  s.insert(a); s.insert(b); s.insert(c);
  if(s.size()==2) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
  
  return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
public class Main
{
public static void main(String[] args)
{
    Scanner in = new Scanner(System.in);
    int x = in.nextInt();
    int ans = atCoder(x);
    System.out.println(ans);
}
    public static int atCoder(int x)
    {
        if (x == 0)
        {
            return 1;
        }
        else if (x == 1) {
            return 0;
        }
        return x;
    }

}


Measured memory_bytes: 35660
a = int(input())
b = int(input())
c = int(input())
d = int(input())
e = int(input())
k = int(input())

x = min(a, b, c, d, e)
y = max(a, b, c, d, e)
if (y - x) <= k:
    print('Yay!')
else:
    print(':(')

Measured memory_bytes: 3064
package main

import (
	"bufio"
	"fmt"
	"os"
	"sort"
	"strconv"
)

// I/O
type Scanner struct {
	sc *bufio.Scanner
}

func NewScanner() *Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &Scanner{sc}
}

func (s *Scanner) nextStr() string {
	s.sc.Scan()
	return s.sc.Text()
}

func (s *Scanner) nextInt() int {
	i, e := strconv.Atoi(s.nextStr())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *Scanner) nextFloat() float64 {
	f, e := strconv.ParseFloat(s.nextStr(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func (s *Scanner) nextRuneSlice() []rune {
	return []rune(s.nextStr())
}

func (s *Scanner) nextIntSlice(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextInt()
	}
	return res
}

func (s *Scanner) nextFloatSlice(n int) []float64 {
	res := make([]float64, n)
	for i := 0; i < n; i++ {
		res[i] = s.nextFloat()
	}
	return res
}

// Arithmetic
func max(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m < i {
			m = i
		}
	}
	return m
}

func min(nums ...int) int {
	m := nums[0]
	for _, i := range nums {
		if m > i {
			m = i
		}
	}
	return m
}

func abs(x int) int {
	if x > 0 {
		return x
	}
	return -x
}

func pow(x, y int) int {
	res := 1
	for i := 0; i < y; i++ {
		res *= x
	}
	return res
}

// Sort
type Val struct {
	id, num int
}
type ByNum []Val

func (a ByNum) Len() int           { return len(a) }
func (a ByNum) Less(i, j int) bool { return a[i].num < a[j].num }
func (a ByNum) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }

func main() {
	sc := NewScanner()
	wtr := bufio.NewWriter(os.Stdout)
	arr := sc.nextIntSlice(3)
	sort.Ints(arr)
	ans := 0
	for {
		if arr[1] < arr[2] {
			arr[0]++
			arr[1]++
			ans++
		} else {
			break
		}
	}
	if !(arr[0] == arr[1]) {
		for arr[0] < arr[1] {
			arr[0] += 2
			ans++
		}
		if arr[0] > arr[1] {
			arr[1]++
			arr[2]++
			ans++
		}
	}

	fmt.Fprintln(wtr, ans)
	wtr.Flush()
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define UNIQUE(v) v.erase(unique(all(v)), v.end());
#define ZIP(v) sort(all(v)),UNIQUE(v)
#define repi(i,m,n) for(int i = m;i < n;i++)
#define drep(i,n,m) for(int i = n;i >= m;i--)
#define rep(i,n) repi(i,0,n)
#define rrep(i,n) repi(i,1,n+1)
#define chmin(x,y) x = min(x,y)
#define chmax(x,y) x = max(x,y)
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(), v.rend()
#define pb(x) push_back(x)
#define fi first
#define se second
typedef pair<int,int> P;
typedef pair<int, P> PP;
typedef vector<int> vi;
const int inf = 1e9+7;
const int INF = 1e18+7;
int mod = 1e9+7;

int _pow(int x, int y){
	int ret = 1;
	while(y > 0){
		if(y&1)ret = ret*x;
		x = x*x;
		y >>= 1;
	}
	return ret;
}

signed main(){
	int n, ans = 1;
	scanf("%lld", &n);
	rrep(i,1001)repi(j,2,1002){
		int x = (int)_pow(i, j);
		if(x > n)break;
		chmax(ans, x);
	}
	printf("%lld\n", ans);
	return 0;
}




Measured memory_bytes: 256
#include <bits/stdc++.h>
typedef long long ll;
#define rep(i,n) for(ll i = 0; i < (n); ++i )
#define rep_rev(n,i) for(ll i = n; i >= 0; --i )
using namespace std;
using P = pair<int, int>;
const long long INF = 1LL << 60;

int main(){
  int X; cin >> X;
  int ans = 0;
  ans += 1000 * (X / 500);
  X %= 500;
  ans += 5 * (X / 5);
  cout << ans << endl;
  return 0;
}


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

using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
typedef vector<VL> VVL;
typedef pair<int, int> PII;

#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(x) x.begin(), x.end()
#define IN(a, b, x) (a<=x&&x<b)
#define MP make_pair
#define PB push_back
const int INF = (1LL<<30);
const ll LLINF = (1LL<<60);
const double PI = 3.14159265359;
const double EPS = 1e-12;
const int MOD = 1000000007;
#define int ll

template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }

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

#define MAX_N 10000
struct edge{ int to, cap, rev; };

vector<edge> G[MAX_N];
int level[MAX_N]; // sからの距離
int iter[MAX_N];  // どこまで調べ終わったか

void add_edge(int from, int to, int cap) {
  G[from].PB({to, cap, (int)G[to].size()});
  G[to].PB({from, 0, (int)G[from].size()-1});
}

void bfs(int s) {
  memset(level, -1, sizeof(level));
  queue<int> que;
  level[s] = 0;
  que.push(s);
  while(que.size()) {
    int v = que.front(); que.pop();
    for(auto i: G[v]) {
      if(i.cap > 0 && level[i.to] < 0) {
        level[i.to] = level[v] + 1;
        que.push(i.to);
      }
    }
  }
}

int dfs(int v, int t, int f) {
  if(v == t) return f;
  for(int &i = iter[v]; i<(int)G[v].size(); ++i) {
    edge &e = G[v][i];
    if(e.cap > 0 && level[v] < level[e.to]) {
      int d = dfs(e.to, t, min(f, e.cap));
      if(d > 0) {
        e.cap -= d;
        G[e.to][e.rev].cap += d;
        return d;
      }
    }
  }
  return 0;
}

int max_flow(int s, int t) {
  int flow = 0;
  while(1) {
    bfs(s);
    if(level[t] < 0) return flow;
    memset(iter, 0, sizeof(iter));
    int f;
    while((f = dfs(s, t, INF)) > 0) flow += f;
  }
}

string s[105];
int a[105][105];
signed main(void)
{
  int h, w;
  cin >> h >> w;
  REP(i, h) cin >> s[i];

  REP(i, h) REP(j, w) {
    if(s[i][j] == 'o') {
      add_edge(i, h+j, 1);
      add_edge(h+j, i, 1);
    } else if(s[i][j] == 'S') {
      add_edge(h+w, i, INF);
      add_edge(h+w, h+j, INF);
      // add_edge(i, h+j, INF);
      // add_edge(h+j, i, INF);
    } else if(s[i][j] == 'T') {
      add_edge(i, h+w+1, INF);
      add_edge(h+j, h+w+1, INF);
      // add_edge(i, h+j, INF);
      // add_edge(h+j, i, INF);
    }
  }

  int res = max_flow(h+w, h+w+1);
  if(res >= INF) cout << -1 << endl;
  else cout << res << endl;

  return 0;
}


Measured memory_bytes: 1920
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>

int main() {
  int k;
  char buf[120];
  char *s, *tmp;
  scanf("%d", &k);
  int i = 0;
  s = (char*)malloc(sizeof(char*));
  while(fgets(buf,sizeof(buf),stdin)!='\0'){
    sscanf(buf,"%s",s);
  };
  //printf("%d",(int)strlen(s));
  if((int)(strlen(s))-k>0) {
    for(i=0; i<k; i++) {
      printf("%c", buf[i]);
    }
    printf("...\n");
  } else {
    printf("%s",buf);
  }
  return 0;
}


Measured memory_bytes: 1736
n=int(input())
ta=[list(map(int,input().split())) for i in range(n)]
T=ta[0][0]
A=ta[0][1]
for i in range(1,n):
    t,a=ta[i]
    if T%t==0:
        s=T//t
    else:
        s=T//t+1
    if A%a==0:
        b=A//a
    else:
        b=A//a+1
    T=t*max(s,b)
    A=a*max(s,b)
print(T+A)

Measured memory_bytes: 39280