Submission #72175891
Source Code Expand
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <chrono>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <list>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <tuple>
#include <typeinfo>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using ll = long long;
using ld = long double;
using namespace std;
#define endl "\n";
#define ff first
#define ss second
#define forn(i,n) for(int i=0;i<n;i++)
#define dbgv(v) cout<<#v<<" "<<v<<endl
#define dbga(a,n) forn(i,n-1) {cout<<a[i]<<' ';} cout<<a[n-1]<<'\n';
#define all(v) (v).begin(), (v).end()
const ll N = 1e6 + 5, mod = 1e9 + 7;
ll fact[N], modinv[N];
ll fastpow(ll n, ll m) {
int ret = 1;
while (m) {
if (m & 1)
(ret *= n) %= mod;
(n *= n) %= mod;
m /= 2;
}
return ret;
}
void pre() {
fact[0] = 1;
for (int i = 1; i < N; i++)
fact[i] = i * fact[i - 1] % mod;
modinv[N - 1] = fastpow(fact[N - 1], mod - 2);
for (int i = N - 2; i >= 0; i--)
modinv[i] = (i + 1) * modinv[i + 1] % mod;
}
ll ncr(ll n, ll r) {
return fact[n] * modinv[n - r] % mod * modinv[r] % mod;
}
void dfs(int i,int p, vector<vector<int>>&adj){
for(auto c:adj[i]){
dfs(c,i,adj);
}
}
void solve(){
int n;
cin>>n;
cout<<fastpow(2,n)-2*n<<endl;
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
int T = 1;
// cin >> T;
while(T--){
solve();
}
return 0;
}
Submission Info
| Submission Time | |
|---|---|
| Task | A - 2^n - 2*n |
| User | SummitDevil |
| Language | C++23 (GCC 15.2.0) |
| Score | 100 |
| Code Size | 1990 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 3716 KiB |
Compile Error
./Main.cpp: In function 'void dfs(int, int, std::vector<std::vector<int> >&)':
./Main.cpp:79:20: warning: unused parameter 'p' [-Wunused-parameter]
79 | void dfs(int i,int p, vector<vector<int>>&adj){
| ~~~~^
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 100 / 100 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 01.txt, 02.txt, 11.txt |
| All | 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 01.txt | AC | 1 ms | 3512 KiB |
| 02.txt | AC | 1 ms | 3432 KiB |
| 03.txt | AC | 1 ms | 3528 KiB |
| 04.txt | AC | 1 ms | 3564 KiB |
| 05.txt | AC | 1 ms | 3488 KiB |
| 06.txt | AC | 1 ms | 3528 KiB |
| 07.txt | AC | 1 ms | 3652 KiB |
| 08.txt | AC | 1 ms | 3716 KiB |
| 09.txt | AC | 1 ms | 3716 KiB |
| 10.txt | AC | 1 ms | 3596 KiB |
| 11.txt | AC | 1 ms | 3552 KiB |