Language: C++

#include <stdio.h>
#include <algorithm>
#include <assert.h>
#include <cmath>
#include <deque>
#include <iostream>
#include <limits.h>
#include<functional>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
#include <stack>
#include <deque>
#include <tuple>
#include <float.h>
#include<time.h>

#define MOD 1000000007;
#define LL long long
#define pLL pair<LL,LL>
#define mp make_pair
#define mt make_tuple
#define pq priority_queue<LL>
#define pqg priority_queue<LL,vector<LL>,greater<LL>>
#define vecLL vector<LL>
#define vecpLL vector<pLL>
#define vecbL vector<bool>
#define mat vector<vecLL>
#define endl "\n"
#define REP(e,v) for(auto e:v)
#define rep(i, a, n) for(LL i = a; i < n;i++)
#define Arep(i, a, n) for(i = a; i < n;i++)

#define INF LLONG_MAX/2
#define DINF DBL_MAX/2
using namespace std;


/*↓マイライブラリ↓*/

//clock_t start = clock();
//
//clock_t end = clock();
//
//const double time = static_cast<double>(end - start) / CLOCKS_PER_SEC * 1000.0;
//printf("time %lf[ms]\n", time);

LL linp(){
	LL x;
	scanf("%lld",&x);
	return x;
}
template<typename T>
T numperm(T x,T y){
	LL res = 1;
	for(LL i = x; i >= y; i--){
		res = res * i;
	}
	return res;
}

template<typename T>
T pow(T x,T y){

	if(y == 1){
		return x;
	}
	LL res = pow(x*x,y/2);
	if(y % 2 == 0){
		return res;
	}
	else{
		return x*res;
	}
}

 template <LL mod>
 struct ModLL {
     LL x;
     LL y = 100;
     ModLL() : x(0) {}
     ModLL(LL x_) {
         if ((x = x_ % mod + mod) >= mod) x -= mod;
     }
     ModLL& operator+=(ModLL rhs) {
         if ((x += rhs.x) >= mod) x -= mod;
         return *this;
     }

     ModLL& operator-=(ModLL rhs) {
         if ((x -= rhs.x) < 0) x += mod;
         return *this;
     }
     ModLL& operator*=(ModLL rhs) {
         x = (unsigned long long)x * rhs.x % mod;
         return *this;
     }
     ModLL& operator/=(ModLL rhs) {
         x = (unsigned long long)x * rhs.inv().x % mod;
         return *this;
     }

     ModLL operator-() const { return -x < 0 ? mod - x : -x; }
     ModLL operator+(ModLL rhs) const { return ModLL(*this) += rhs; }
     ModLL operator-(ModLL rhs) const { return ModLL(*this) -= rhs; }
     ModLL operator*(ModLL rhs) const { return ModLL(*this) *= rhs; }
     ModLL operator/(ModLL rhs) const { return ModLL(*this) /= rhs; }
     bool operator==(ModLL rhs) const { return x == rhs.x; }
     bool operator!=(ModLL rhs) const { return x != rhs.x; }
     ModLL inv() const { return pow(*this, mod - 2); }

     friend ostream& operator<<(ostream& s, ModLL<mod> a) {
         s << a.x;
         return s;
     }
     friend istream& operator>>(istream& s, ModLL<mod>& a) {
         s >> a.x;
         return s;
     }
 };

#define mLL ModLL<1000000007>
#define mvec vector<mLL>

 template<typename T>
 struct SquareMatrix{

     vector<vector<T>> dat;
     size_t N;
     SquareMatrix() = default;
     SquareMatrix(size_t N, T val = T()):N(N){
         dat = vector<vector<T>> (N, vector<T> (N));
         for(size_t i=0;i<N;i++)
             for(size_t j=0;j<N;j++)
                 dat[i][j]=val;
     }
     SquareMatrix& operator=(const SquareMatrix& a){
         dat=a.dat;
         return (*this);
     }
     bool operator==(const SquareMatrix& a) const{
         return dat==a.dat;
     }

     size_t size() const{return N;};
     vector<T>& operator[](size_t k){return dat[k];};
     const vector<T>& operator[](size_t k) const {return dat[k];};

     SquareMatrix operator*(const SquareMatrix &B) const{
         SquareMatrix res(N, 0);
         for(size_t i=0;i<N;i++)
             for(size_t j=0;j<N;j++)
                 for(size_t k=0;k<N;k++)
                     res[i][j]=res[i][j]+(dat[i][k]*B[k][j]);
         return res;
     }

     SquareMatrix operator+(const SquareMatrix &B) const{
         SquareMatrix res(N, 0);
         for(size_t i=0;i<N;i++)
             for(size_t j=0;j<N;j++)
                 res[i][j]=dat[i][j]+B[i][j];
         return res;
     }

     SquareMatrix operator-(const SquareMatrix &B) const{
              SquareMatrix res(N, 0);
              for(size_t i=0;i<N;i++)
                  for(size_t j=0;j<N;j++)
                      res[i][j]=dat[i][j]-B[i][j];
              return res;
          }

     SquareMatrix pow(long long n) const{
         SquareMatrix a=*this;
         SquareMatrix res(N, 0);
         for(size_t i = 0; i < N; i++) res[i][i] = 1;
         while(n){
             if(n&1) res=res*a;
             a=a*a;
             n>>=1;
         }
         return res;
     }
 };

#define mmat SquareMatrix<mLL>


vecLL bit(LL i,LL N){
	vecLL biti(N);

	rep(x,0,N){
		biti[N - 1 - x] = (i >> x) & 1;
	}

	return biti;
}
template<typename T>
void swap(T &a, T &b){
	T t = a;
	a = b;
	b = t;

	return ;
}

template<typename T>
T digit(T x,T n){
	LL count = 1;

	while(x >= n){
		x = x/n;
		count++;
	}
	return count;
}

template<typename T>
T gcd(T i,T j){
	if(j != 0)
		return gcd(j, i % j);
	else
		return i;
}

template<typename T>
bool isPrime(LL X){
	for(LL i = 2; i*i <= X;i++){
		if(X % i == 0){
			return false;
		}
	}
	return true;
}
template<typename T>
 vecLL Eratosthenes(LL n){//素数のベクトルを返す

	 bool isPrime[n];
	 fill(isPrime,isPrime+n,true);

	 isPrime[0] = isPrime[1] = false;
	 for(LL i = 2; i*i <= n;i++){
		 if(isPrime[i]){
			 for(LL j = 2*i ;j <= n ; j += i){
				 isPrime[j] = false;
			 }
		 }
	 }

	 vecLL P;

	 rep(i,2,n+1){
		 if(isPrime[i]){
			 P.push_back(i);
		 }
	 }

	 return P;
}

 map<LL,LL> factalization(LL N){
 	map<LL,LL> fac;
 	LL oriN = N;
 	LL div = 1;
 	for(LL i = 2;i*i <= N;++i){
 		while(N%i == 0){
 			fac[i]++;
 			div *= i;
 			N /= i;
 		}
 	}
 	if(oriN/div != 1){
 		fac[oriN/div]++;
 	}
 	return fac;
 }

 struct edge {//枝
	LL to,cost;
	double dcost;//コストが整数でない場合に使う
} ;


struct vertex{//頂点(枝付き)
	LL key;
	double dkey;//キーが整数でない場合に使う
	vector<edge> edges;//頂点から伸びる枝
};

class Graph{

public:

	LL V;//頂点数
	vertex* vertices;//グラフ


	Graph(LL v){//頂点数を指定してグラフの初期化
		V = v;//頂点数
		vertices = new vertex[V];//頂点集合

		rep(i,0,V){
			vertices[i].key = -1;//キー初期値は-1
			vertices[i].dkey = -1;//キー初期値は-1
		}

	}

	void setDE(LL i,LL j,LL cos){//i→jにコストcosの有向枝を加える

			edge e;
			e.to= j;
			e.cost = cos;

			vertices[i].edges.push_back(e);

			return;
	}

	void setDE(LL i,LL j,double dcos){//i→jにコストcosの有向枝を加える

				edge e;
				e.to= j;
				e.dcost = dcos;

				vertices[i].edges.push_back(e);

				return;
	}

	void setUDE(LL i,LL j,LL cos){//(i,j)にコストcosの無向枝を加える

		edge ei,ej;
		ei.to = j;
		ej.to = i;
		ei.cost = ej.cost = cos;

		vertices[i].edges.push_back(ei);
		vertices[j].edges.push_back(ej);

		return;
	}

	void setUDE(LL i,LL j,double dcos){//(i,j)にコストcosの無向枝を加える

		edge ei,ej;
		ei.to = j;
		ej.to = i;
		ei.dcost = ej.dcost = dcos;

		vertices[i].edges.push_back(ei);
		vertices[j].edges.push_back(ej);

		return;
	}

	void setKey(LL i,LL newKey){//キー変更
		vertices[i].key = newKey;
	}

	void setKey(LL i,double newKey){//キー変更
		vertices[i].key = newKey;
	}

	 edge getEdge(LL i,LL j){

		 rep(a,0,vertices[i].edges.size()){
			 if(vertices[i].edges[a].to == j){
				 return vertices[i].edges[a];
			 }
		 }

		 return (edge){j,INF,DINF};//なければ,コストINFの枝を返す
	}

	void bellman_ford(LL s,LL b[]){
		 fill(b,b+V,INF);

		 b[s] = 0;


		 while(true){

			 bool update = false;
			 rep(i,0,V){
				rep(j,0,vertices[i].edges.size()){
					edge e = vertices[i].edges[j];

					if(b[e.to] > b[i] + e.cost){
						b[e.to] = b[i] + e.cost;
						update = true;
					}

				}
			}
			if(!update)
				break;
		 }

		 return;
	}

	void dijkstra(LL s, LL d[]) {//ダイクストラ(始点を入力とし、各点への最小距離を返す)

	    priority_queue<pLL, vector<pLL>, greater<pLL> > que;

	    fill(d,d+V,INF);
	    d[s] = 0;
	    que.push(pLL(0, s));

	    while (!que.empty()) {
	        pLL p = que.top();
	        que.pop();
	        LL v = p.second;
	        if (d[v] < p.first) continue;

	        rep(i,0, vertices[v].edges.size()) {
	            edge e = vertices[v].edges[i];
	            if (d[e.to] > d[v] + e.cost) {
	                d[e.to] = d[v] + e.cost;
	                que.push(pLL(d[e.to], e.to));
	            }
	        }
	    }

	    return;

	}

	void warshall_floyd(LL **w){

		rep(i,0,V){
					rep(j,0,V){
						w[i][j] = INF;
					}
		}
		rep(i,0,V){
			rep(j,0,vertices[i].edges.size()){
				w[i][vertices[i].edges[j].to] = vertices[i].edges[j].cost;
			}
		}

		rep(i,0,V){
				w[i][i] = 0;
		}

		rep(i,0,V){
			rep(j,0,V){
				rep(k,0,V){
					w[i][j] = min(w[i][j],w[i][k]+w[k][j]);
				}
			}
		}

	}



};

class UF
{
public:
	LL N;
	LL* par;
	LL*  rank;

	UF(LL n){
		 N = n;

		 par = new LL[N];
		 rank = new LL[N];

		 rep(i,0,N){
			 par[i] = i;
			 rank[i] = i;
		 }

		 return;

	}

	LL root(LL x){
		if(x == par[x])
			return x;
		else
			return par[x] = root(par[x]);

	}

	bool same(LL x,LL y){
		return (root(x) == root(y));

	}

	void Union(LL x,LL y){
		LL rtx = root(x);
		LL rty = root(y);

		if(rank[rtx] < rank[rty]){
			par[rtx] = rty;
		}
		else{
			par[rty] = rtx;
			if(rank[rtx] == rank[rty]){
				rank[rtx]++;
			}
		}

	}

};

class ST{


};

/*↑マイライブラリ↑*/

LL solveA(){
	LL X,Y;

	cin >> X >> Y;

	cout << max(X,Y);
	return 0;
}

LL solveB(){

	return 0;
}

LL solveC(){

 	return 0;
}

LL solveD(){
	mLL n,a,b;

		cin >> n >> a >> b;

		mLL A,B,C;

		A = pow((mLL)2,n) - 1;
		B = numperm(n,n-a+1)/numperm(a,(mLL)1);
		C = numperm(n,n-b+1)/numperm(b,(mLL)1);

		cout <<  A - (B + C) << endl;

		return 0;
	return 0;
}

LL solveE(){

	return 0;
}

signed main(){
	//solveA();
	//solveB();
	//solveC();
	solveD();
	//solveE();
	return 0;
}


Compiler output:
a.cc: In instantiation of 'T pow(T, T) [with T = ModLL<1000000007>]':
a.cc:555:10:   required from here
  555 |                 A = pow((mLL)2,n) - 1;
      |                     ~~~^~~~~~~~~~
a.cc:75:21: error: cannot convert 'ModLL<1000000007>' to 'long long int' in initialization
   75 |         LL res = pow(x*x,y/2);
      |                  ~~~^~~~~~~~~
      |                     |
      |                     ModLL<1000000007>
a.cc:76:14: error: no match for 'operator%' (operand types are 'ModLL<1000000007>' and 'int')
   76 |         if(y % 2 == 0){
      |            ~~^~~
a.cc: In instantiation of 'T numperm(T, T) [with T = ModLL<1000000007>]':
a.cc:556:14:   required from here
  556 |                 B = numperm(n,n-a+1)/numperm(a,(mLL)1);
      |                     ~~~~~~~^~~~~~~~~
a.cc:63:20: error: cannot convert 'ModLL<1000000007>' to 'long long int' in initialization
   63 |         for(LL i = x; i >= y; i--){
      |                    ^
      |                    |
      |                    ModLL<1000000007>
a.cc:63:25: error: no match for 'operator>=' (operand types are 'long long int' and 'ModLL<1000000007>')
   63 |         for(LL i = x; i >= y; i--){
      |                       ~~^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:64,
                 from /usr/include/c++/14/algorithm:60,
                 from a.cc:2:
/usr/include/c++/14/bits/stl_pair.h:1070:5: note: candidate: 'template<class _T1, class _T2> constexpr bool std::operator>=(const pair<_T1, _T2>&, const pair<_T1, _T2>&)'
 1070 |     operator>=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_pair.h:1070:5: note:   template argument deduction/substitution failed:
a.cc:63:25: note:   mismatched types 'const std::pair<_T1, _T2>' and 'long long int'
   63 |         for(LL i = x; i >= y; i--){
      |                       ~~^~~~
In file included from /usr/include/c++/14/bits/stl_algobase.h:67:
/usr/include/c++/14/bits/stl_iterator.h:476:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>=(const reverse_iterator<_Iterator>&, const reverse_iterator<_Iterator>&)'
  476 |     operator>=(const reverse_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:476:5: note:   template argument deduction/substitution failed:
a.cc:63:25: note:   mismatched types 'const std::reverse_iterator<_Iterator>' and 'long long int'
   63 |         for(LL i = x; i >= y; i--){
      |                       ~~^~~~
/usr/include/c++/14/bits/stl_iterator.h:520:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>=(const reverse_iterator<_Iterator>&, const reverse_iterator<_IteratorR>&)'
  520 |     operator>=(const reverse_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:520:5: note:   template argument deduction/substitution failed:
a.cc:63:25: note:   mismatched types 'const std::reverse_iterator<_Iterator>' and 'long long int'
   63 |         for(LL i = x; i >= y; i--){
      |                       ~~^~~~
/usr/include/c++/14/bits/stl_iterator.h:1724:5: note: candidate: 'template<class _IteratorL, class _IteratorR> constexpr bool std::operator>=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorR>&)'
 1724 |     operator>=(const move_iterator<_IteratorL>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1724:5: note:   template argument deduction/substitution failed:
a.cc:63:25: note:   mismatched types 'const std::move_iterator<_IteratorL>' and 'long long int'
   63 |         for(LL i = x; i >= y; i--){
      |                       ~~^~~~
/usr/include/c++/14/bits/stl_iterator.h:1781:5: note: candidate: 'template<class _Iterator> constexpr bool std::operator>=(const move_iterator<_IteratorL>&, const move_iterator<_IteratorL>&)'
 1781 |     operator>=(const move_iterator<_Iterator>& __x,
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_iterator.h:1781:5: note:   template argument deduction/substitution failed:
a.cc:63:25: note:   mismatched types 'const std::move_iterator<_IteratorL>' and 'long long int'
   63 |         for(LL i = x; i >= y; i--){
      |                       ~~^~~~
In file included from /usr/include/c++/14/deque:66,
                 from a.cc:5:
/usr/include/c++/14/bits/stl_deque.h:2363:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator>=(const deque<_Tp, _Alloc>&, const deque<_Tp, _Alloc>&)'
 2363 |     operator>=(const deque<_Tp, _Alloc>& __x, const deque<_Tp, _Alloc>& __y)
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_deque.h:2363:5: note:   template argument deduction/substitution failed:
a.cc:63:25: note:   mismatched types 'const std::deque<_Tp, _Alloc>' and 'long long int'
   63 |         for(LL i = x; i >= y; i--){
      |                       ~~^~~~
In file included from /usr/include/c++/14/bits/memory_resource.h:47,
                 from /usr/include/c++/14/deque:81:
/usr/include/c++/14/tuple:2631:5: note: candidate: 'template<class ... _TElements, class ... _UElements> constexpr bool std::operator>=(const tuple<_UTypes ...>&, const tuple<_Elements ...>&)'
 2631 |     operator>=(const tuple<_TElements...>& __t,
      |     ^~~~~~~~
/usr/include/c++/14/tuple:2631:5: note:   template argument deduction/substitution failed:
a.cc:63:25: note:   mismatched types 'const std::tuple<_UTypes ...>' and 'long long int'
   63 |         for(LL i = x; i >= y; i--){
      |                       ~~^~~~
In file included from /usr/include/c++/14/bits/basic_string.h:47,
                 from /usr/include/c++/14/string:54,
                 from /usr/include/c++/14/bits/locale_classes.h:40,
                 from /usr/include/c++/14/bits/ios_base.h:41,
                 from /usr/include/c++/14/ios:44,
                 from /usr/include/c++/14/ostream:40,
                 from /usr/include/c++/14/iostream:41,
                 from a.cc:6:
/usr/include/c++/14/string_view:739:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>=(basic_string_view<_CharT, _Traits>, basic_string_view<_CharT, _Traits>)'
  739 |     operator>=(basic_string_view<_CharT, _Traits> __x,
      |     ^~~~~~~~
/usr/include/c++/14/string_view:739:5: note:   template argument deduction/substitution failed:
a.cc:63:25: note:   mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'long long int'
   63 |         for(LL i = x; i >= y; i--){
      |                       ~~^~~~
/usr/include/c++/14/string_view:746:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>=(basic_string_view<_CharT, _Traits>, __type_identity_t<basic_string_view<_CharT, _Traits> >)'
  746 |     operator>=(basic_string_view<_CharT, _Traits> __x,
      |     ^~~~~~~~
/usr/include/c++/14/string_view:746:5: note:   template argument deduction/substitution failed:
a.cc:63:25: note:   mismatched types 'std::basic_string_view<_CharT, _Traits>' and 'long long int'
   63 |         for(LL i = x; i >= y; i--){
      |                       ~~^~~~
/usr/include/c++/14/string_view:754:5: note: candidate: 'template<class _CharT, class _Traits> constexpr bool std::operator>=(__type_identity_t<basic_string_view<_CharT, _Traits> >, basic_string_view<_CharT, _Traits>)'
  754 |     operator>=(__type_identity_t<basic_string_view<_CharT, _Traits>> __x,
      |     ^~~~~~~~
/usr/include/c++/14/string_view:754:5: note:   template argument deduction/substitution failed:
a.cc:63:25: note:   'ModLL<1000000007>' is not derived from 'std::basic_string_view<_CharT, _Traits>'
   63 |         for(LL i = x; i >= y; i--){
      |                       ~~^~~~
/usr/include/c++/14/bits/basic_string.h:3997:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
 3997 |     operator>=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:3997:5: note:   template argument deduction/substitution failed:
a.cc:63:25: note:   mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'long long int'
   63 |         for(LL i = x; i >= y; i--){
      |                       ~~^~~~
/usr/include/c++/14/bits/basic_string.h:4011:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>=(const __cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)'
 4011 |     operator>=(const basic_string<_CharT, _Traits, _Alloc>& __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4011:5: note:   template argument deduction/substitution failed:
a.cc:63:25: note:   mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'long long int'
   63 |         for(LL i = x; i >= y; i--){
      |                       ~~^~~~
/usr/include/c++/14/bits/basic_string.h:4024:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> bool std::operator>=(const _CharT*, const __cxx11::basic_string<_CharT, _Traits, _Allocator>&)'
 4024 |     operator>=(const _CharT* __lhs,
      |     ^~~~~~~~
/usr/include/c++/14/bits/basic_string.h:4024:5: note:   template argument deduction/substitution failed:
a.cc:63:25: note:   mismatched types 'const _CharT*' and 'long long int'
   63 |         for(LL i = x; i >= y; i--){
      |                       ~~^~~~
In file included from /usr/include/c++/14/vector:66,
                 from /usr/include/c++/14/functional:64,
                 from a.cc:8:
/usr/include/c++/14/bits/stl_vector.h:2114:5: note: candidate: 'template<class _Tp, class _Alloc> bool std::operator>=(const vector<_Tp, _Alloc>&, const vector<_Tp, _Alloc>&)'
 2114 |     operator>=(const vector<_Tp, _Alloc>& __x, const vector<_Tp, _Alloc>& __y)
      |     ^~~~~~~~
/usr/include/c++/14/bits/stl_vector.h:2114:5: note:   template argument deduction/substitution failed:
a.cc:63:25: note:   mismatched types 'const std::vector<_Tp, _Alloc>' and 'long long int'
   63 |         for(LL i = x; i >= y; i--){
      |                       ~~^~~~
In file