Language: Java

#include<stdio.h>
#include<iostream>
#include<vector>
#include<math.h>
#include<queue>
#include<map>
#include<algorithm>
#include<string.h>
#include<functional>
#include<limits.h>
#include<stdlib.h>
#include<cmath>
#include<cstring>
#include<set>
#include<climits>
#include<deque>
#include <iomanip>
#include<utility>
using namespace std;

#define intmax INT_MAX
#define lmax LONG_MAX
#define uintmax UINT_MAX
#define ulmax ULONG_MAX
#define llmax LLONG_MAX
#define ll long long
#define rep(i,a,N) for((i)=(a);(i)<(N);(i)++)
#define rrp(i,N,a) for((i)=(N)-1;(i)>=(a);(i)--)
#define llfor ll i,j
#define sc(a) cin>>a
#define pr(a) cout<<a<<endl
#define pY puts("YES")
#define pN puts("NO")
#define py puts("Yes")
#define pn puts("No")
#define pnn printf("\n")
#define all(a) a.begin(),a.end()
#define push(a,b) (a).push_back(b)
#define llvec vector<vector<ll>>
#define charvec vector<vector<char>>
#define size(a,b) (a,vector<ll>(b))
#define llpvec vector<pair<ll,ll>>
#define S 21 
llfor;ll mod=1e9+7;
/*pi*/double pi=acos(-1);
/*繰り上げ除算*/ll cei(ll x,ll y){ll ans=x/y;if(x%y!=0)ans++;return ans;}
/*最大公約数*/ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
/*最小公倍数*/ll lcm(ll x,ll y){return x/gcd(x,y)*y;}
/*n乗 1*/ll llpow(ll x,ll n){ll ans=1;rep(i,0,n){ans*=x;ans%=mod;}return ans;}
/*n乗 2*/ll modpow(ll x,ll n,ll m){ll ans=x,tmp=x,t1=1;i=1; while(i<n){if(i*2<n){ans*=ans;ans%=m;i*=2;}else{t1=1;tmp=x;while(t1*x<n-i){tmp*=tmp;tmp%=m;t1*=2;}ans*=tmp;ans%=m;i+=t1;}}return ans;}
/*階乗*/ll fact(ll x){ll ans=1;rep(i,0,x){ans*=(x-i);ans%=mod;}return ans;}
/*nCr*/ll ncr(ll n,ll r){ll ans=1,l=2;rep(i,0,min(n-r,r)){ans*=(n-i);ans%=mod;while(ans%l==0&&l<=min(r,n-r)){ans/=l;l++;}}return ans;}
/*nPr*/ll npr(ll n,ll r){return fact(n)/fact(n-r);}
/*primejudge*/bool prime(ll a){if(a<=1)return false;for(i=2;i*i<=a;i++){if(a%i==0)return false;}return true;}//素数の時true
/*Fibonacci数列*/ll fib(ll x){ll fibo[x+10];fibo[0]=1;fibo[1]=1;fibo[2]=1;rep(i,3,x+1)fibo[i]=fibo[i-1]+fibo[i-2];return fibo[x];}
/*桁数*/ll dig(ll n){ll d=1,tmp=n;while(tmp/10>0){tmp/=10;d++;}return d;}
/*行列のコピー*/void matcpy(ll a[S][S],ll b[S][S]){ll t=i;rep(i,0,S)rep(j,0,S)b[i][j]=a[i][j];/*(aをbに)*/i=t;}
/*行列のリセット*/void matrst(ll a[S][S]){ll t=i;rep(i,0,S)rep(j,0,S)a[i][j]=0;i=t;}
/*行列の2乗*/void matpow(ll a[S][S]){ll ans[S][S];matrst(ans);ll t=i,k;rep(i,0,S)rep(j,0,S)rep(k,0,S)ans[i][j]+=a[i][k]*a[k][j];matcpy(ans,a);i=t;}
/*行列の乗算*/void matmul(ll a[S][S],ll b[S][S], ll as[S][S]){ll t=i,k;matrst(as);rep(i,0,S)rep(j,0,S)rep(k,0,S)as[i][j]+=a[i][k]*b[k][j];i=t;}
//ll ans=0;
////////////////////////////////////////////////////////////
int main(){
 ll a,b,n;
 cin>>n>>a>>b;
 ll ans=modpow(2,n,mod);
 ll c1=1,c2=1,d1=1,d2=1;
 rep(i,0,a){
  c1*=(n-i);
  c1%=mod;

  d1*=i+1;
  d1%=mod;
 }
 rep(i,0,b){
  c2*=(n-i);
  c2%=mod;

  d2*=i+1;
  d2%=mod;
 }

 ll tmp1=d1,tmp2=d2,t1=1;i=1; 
 ll memo1=d1,memo2=d2;
 while(i<mod-2){
  if(i*2<mod-2){
   d1*=d1;d2*=d2;
   d1%=mod;d2%=mod;
   i*=2;
  }
  else{
   t1=1;
   tmp1=memo1;tmp2=memo2;
   while(t1*2<mod-2-i){
    tmp1*=tmp1;tmp2*=tmp2;
    tmp1%=mod;tmp2%=mod;
    t1*=2;
   }
   d1*=tmp1;d2*=tmp2;
   d1%=mod;d2%=mod;
   i+=t1;
  }
 // cout<<i<<" ";
 }
 c1*=d1;c2*=d2;
 c2%=mod;c1%=mod;
 //pnn;cout<<c1<<" "<<d1<<" "<<c2<<" "<<d2<<endl;
 ans-=c1+c2+1;
 if(ans<0)ans+=mod;
 pr(ans);
return 0;}

Compiler output:
Main.java:1: error: illegal character: '#'
#include<stdio.h>
^
Main.java:1: error: class, interface, enum, or record expected
#include<stdio.h>
        ^
Main.java:2: error: illegal character: '#'
#include<iostream>
^
Main.java:3: error: illegal character: '#'
#include<vector>
^
Main.java:4: error: illegal character: '#'
#include<math.h>
^
Main.java:5: error: illegal character: '#'
#include<queue>
^
Main.java:6: error: illegal character: '#'
#include<map>
^
Main.java:7: error: illegal character: '#'
#include<algorithm>
^
Main.java:8: error: illegal character: '#'
#include<string.h>
^
Main.java:9: error: illegal character: '#'
#include<functional>
^
Main.java:10: error: illegal character: '#'
#include<limits.h>
^
Main.java:11: error: illegal character: '#'
#include<stdlib.h>
^
Main.java:12: error: illegal character: '#'
#include<cmath>
^
Main.java:13: error: illegal character: '#'
#include<cstring>
^
Main.java:14: error: illegal character: '#'
#include<set>
^
Main.java:15: error: illegal character: '#'
#include<climits>
^
Main.java:16: error: illegal character: '#'
#include<deque>
^
Main.java:17: error: illegal character: '#'
#include <iomanip>
^
Main.java:18: error: illegal character: '#'
#include<utility>
^
Main.java:21: error: illegal character: '#'
#define intmax INT_MAX
^
Main.java:22: error: illegal character: '#'
#define lmax LONG_MAX
^
Main.java:23: error: illegal character: '#'
#define uintmax UINT_MAX
^
Main.java:24: error: illegal character: '#'
#define ulmax ULONG_MAX
^
Main.java:25: error: illegal character: '#'
#define llmax LLONG_MAX
^
Main.java:26: error: illegal character: '#'
#define ll long long
^
Main.java:27: error: illegal character: '#'
#define rep(i,a,N) for((i)=(a);(i)<(N);(i)++)
^
Main.java:27: error: class, interface, enum, or record expected
#define rep(i,a,N) for((i)=(a);(i)<(N);(i)++)
                               ^
Main.java:27: error: class, interface, enum, or record expected
#define rep(i,a,N) for((i)=(a);(i)<(N);(i)++)
                                       ^
Main.java:28: error: illegal character: '#'
#define rrp(i,N,a) for((i)=(N)-1;(i)>=(a);(i)--)
^
Main.java:28: error: class, interface, enum, or record expected
#define rrp(i,N,a) for((i)=(N)-1;(i)>=(a);(i)--)
                                 ^
Main.java:28: error: class, interface, enum, or record expected
#define rrp(i,N,a) for((i)=(N)-1;(i)>=(a);(i)--)
                                          ^
Main.java:29: error: illegal character: '#'
#define llfor ll i,j
^
Main.java:30: error: illegal character: '#'
#define sc(a) cin>>a
^
Main.java:31: error: illegal character: '#'
#define pr(a) cout<<a<<endl
^
Main.java:32: error: illegal character: '#'
#define pY puts("YES")
^
Main.java:33: error: illegal character: '#'
#define pN puts("NO")
^
Main.java:34: error: illegal character: '#'
#define py puts("Yes")
^
Main.java:35: error: illegal character: '#'
#define pn puts("No")
^
Main.java:36: error: illegal character: '#'
#define pnn printf("\n")
^
Main.java:37: error: illegal character: '#'
#define all(a) a.begin(),a.end()
^
Main.java:38: error: illegal character: '#'
#define push(a,b) (a).push_back(b)
^
Main.java:39: error: illegal character: '#'
#define llvec vector<vector<ll>>
^
Main.java:40: error: illegal character: '#'
#define charvec vector<vector<char>>
^
Main.java:41: error: illegal character: '#'
#define size(a,b) (a,vector<ll>(b))
^
Main.java:42: error: illegal character: '#'
#define llpvec vector<pair<ll,ll>>
^
Main.java:43: error: illegal character: '#'
#define S 21 
^
Main.java:44: error: unnamed classes are a preview feature and are disabled by default.
llfor;ll mod=1e9+7;
      ^
  (use --enable-preview to enable unnamed classes)
Main.java:49: error: ';' expected
/*n? 1*/ll llpow(ll x,ll n){ll ans=1;rep(i,0,n){ans*=x;ans%=mod;}return ans;}
                                               ^
Main.java:51: error: ';' expected
/*??*/ll fact(ll x){ll ans=1;rep(i,0,x){ans*=(x-i);ans%=mod;}return ans;}
                                       ^
Main.java:52: error: ';' expected
/*nCr*/ll ncr(ll n,ll r){ll ans=1,l=2;rep(i,0,min(n-r,r)){ans*=(n-i);ans%=mod;while(ans%l==0&&l<=min(r,n-r)){ans/=l;l++;}}return ans;}
                                                         ^
Main.java:55: error: not a statement
/*Fibonacci??*/ll fib(ll x){ll fibo[x+10];fibo[0]=1;fibo[1]=1;fibo[2]=1;rep(i,3,x+1)fibo[i]=fibo[i-1]+fibo[i-2];return fibo[x];}
                                     ^
Main.java:55: error: ']' expected
/*Fibonacci??*/ll fib(ll x){ll fibo[x+10];fibo[0]=1;fibo[1]=1;fibo[2]=1;rep(i,3,x+1)fibo[i]=fibo[i-1]+fibo[i-2];return fibo[x];}
                                    ^
Main.java:55: error: ';' expected
/*Fibonacci??*/ll fib(ll x){ll fibo[x+10];fibo[0]=1;fibo[1]=1;fibo[2]=1;rep(i,3,x+1)fibo[i]=fibo[i-1]+fibo[i-2];return fibo[x];}
                                        ^
Main.java:55: error: ';' expected
/*Fibonacci??*/ll fib(ll x){ll fibo[x+10];fibo[0]=1;fibo[1]=1;fibo[2]=1;rep(i,3,x+1)fibo[i]=fibo[i-1]+fibo[i-2];return fibo[x];}
                                                                                    ^
Main.java:57: error: ']' expected
/*??????*/void matcpy(ll a[S][S],ll b[S][S]){ll t=i;rep(i,0,S)rep(j,0,S)b[i][j]=a[i][j];/*(a?b?)*/i=t;}
                           ^
Main.java:57: error: ';' expected
/*??????*/void matcpy(ll a[S][S],ll b[S][S]){ll t=i;rep(i,0,S)rep(j,0,S)b[i][j]=a[i][j];/*(a?b?)*/i=t;}
                                                              ^
Main.java:57: error: ';' expected
/*??????*/void matcpy(ll a[S][S],ll b[S][S]){ll t=i;rep(i,0,S)rep(j,0,S)b[i][j]=a[i][j];/*(a?b?)*/i=t;}
                                                                        ^
Main.java:58: error: ']' expected
/*???????*/void matrst(ll a[S][S]){ll t=i;rep(i,0,S)rep(j,0,S)a[i][j]=0;i=t;}
                            ^
Main.java:58: error: ';' expected
/*???????*/void matrst(ll a[S][S]){ll t=i;rep(i,0,S)rep(j,0,S)a[i][j]=0;i=t;}
                                                    ^
Main.java:58: error: ';' expected
/*???????*/void matrst(ll a[S][S]){ll t=i;rep(i,0,S)rep(j,0,S)a[i][j]=0;i=t;}
                                                              ^
Main.java:59: error: not a statement
/*???2?*/void matpow(ll a[S][S]){ll ans[S][S];matrst(ans);ll t=i,k;rep(i,0,S)rep(j,0,S)rep(k,0,S)ans[i][j]+=a[i][k]*a[k][j];matcpy(ans,a);i=t;}
                                        ^
Main.java:59: error: not a statement
/*???2?*/void matpow(ll a[S][S]){ll ans[S][S];matrst(ans);ll t=i,k;rep(i,0,S)rep(j,0,S)rep(k,0,S)ans[i][j]+=a[i][k]*a[k][j];matcpy(ans,a);i=t;}
                                           ^
Main.java:59: error: ']' expected
/*???2?*/void matpow(ll a[S][S]){ll ans[S][S];matrst(ans);ll t=i,k;rep(i,0,S)rep(j,0,S)rep(k,0,S)ans[i][j]+=a[i][k]*a[k][j];matcpy(ans,a);i=t;}
                          ^
Main.java:59: error: ';' expected
/*???2?*/void matpow(ll a[S][S]){ll ans[S][S];matrst(ans);ll t=i,k;rep(i,0,S)rep(j,0,S)rep(k,0,S)ans[i][j]+=a[i][k]*a[k][j];matcpy(ans,a);i=t;}
                                         ^
Main.java:59: error: ';' expected
/*???2?*/void matpow(ll a[S][S]){ll ans[S][S];matrst(ans);ll t=i,k;rep(i,0,S)rep(j,0,S)rep(k,0,S)ans[i][j]+=a[i][k]*a[k][j];matcpy(ans,a);i=t;}
                                            ^
Main.java:59: error: ';' expected
/*???2?*/void matpow(ll a[S][S]){ll ans[S][S];matrst(ans);ll t=i,k;rep(i,0,S)rep(j,0,S)rep(k,0,S)ans[i][j]+=a[i][k]*a[k][j];matcpy(ans,a);i=t;}
                                                                             ^
Main.java:59: error: ';' expected
/*???2?*/void matpow(ll a[S][S]){ll ans[S][S];matrst(ans);ll t=i,k;rep(i,0,S)rep(j,0,S)rep(k,0,S)ans[i][j]+=a[i][k]*a[k][j];matcpy(ans,a);i=t;}
                                                                                       ^
Main.java:59: error: ';' expected
/*???2?*/void matpow(ll a[S][S]){ll ans[S][S];matrst(ans);ll t=i,k;rep(i,0,S)rep(j,0,S)rep(k,0,S)ans[i][j]+=a[i][k]*a[k][j];matcpy(ans,a);i=t;}
                                                                                                 ^
Main.java:60: error: ']' expected
/*?????*/void matmul(ll a[S][S],ll b[S][S], ll as[S][S]){ll t=i,k;matrst(as);rep(i,0,S)rep(j,0,S)rep(k,0,S)as[i][j]+=a[i][k]*b[k][j];i=t;}
                          ^
Main.java:60: error: ';' expected
/*?????*/void matmul(ll a[S][S],ll b[S][S], ll as[S][S]){ll t=i,k;matrst(as);rep(i,0,S)rep(j,0,S)rep(k,0,S)as[i][j]+=a[i][k]*b[k][j];i=t;}
                                                                                       ^
Main.java:60: error: ';' expected
/*?????*/void matmul(ll a[S][S],ll b[S][S], ll as[S][S]){ll t=i,k;matrst(as);rep(i,0,S)rep(j,0,S)rep(k,0,S)as[i][j]+=a[i][k]*b[k][j];i=t;}
                                                                                                 ^
Main.java:60: error: ';' expected
/*?????*/void matmul(ll a[S][S],ll b[S][S], ll as[S][S]){ll t=i,k;matrst(as);rep(i,0,S)rep(j,0,S)rep(k,0,S)as[i][j]+=a[i][k]*b[k][j];i=t;}
                                                                                                           ^
Main.java:65: error: not a statement
 cin>>n>>a>>b;
          ^
Main.java:68: error: ';' expected
 rep(i,0,a){
           ^
Main.java:75: error: ';' expected
 rep(i,0,b){
           ^
75 errors