QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#761016 | #8165. Numerous Elimination | badminton | WA | 1ms | 3712kb | C++14 | 1.5kb | 2024-11-18 20:36:12 | 2024-11-18 20:36:13 |
Judging History
answer
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef long double ld;
typedef vector <int> vi;
typedef pair <ll,ll> pll;
typedef pair <int,int> pii;
typedef pair <int,pii> piii;
#define forr(_a,_b,_c) for(int _a = (_b); _a <= int (_c); ++_a)
#define ford(_a,_b,_c) for(int _a = (_b) + 1; _a --> int (_c);)
#define forf(_a,_b,_c) for(int _a = (_b); _a < int (_c); ++_a)
#define st first
#define nd second
#define pb push_back
#define mp make_pair
#define all(x) begin(x),end(x)
#define mask(i) (1LL << (i))
#define bit(x, i) (((x) >> (i)) & 1)
#define bp __builtin_popcountll
#define file "test"
template<class X, class Y>
bool minz(X &x, const Y &y) {
if (x > y) {
x = y;
return true;
} return false;
}
template<class X, class Y>
bool maxz(X &x, const Y &y) {
if (x < y) {
x = y;
return true;
} return false;
}
const int N = 5e5 + 5;
const ll oo = (ll) 1e16;
const ll mod = 1e9 + 7; // 998244353;
ll modpow (ll u, ll v){
if (!v) return 1;
ll t = modpow(u, v >> 1);
t = t * t % mod;
if (v & 1)
t = t * u % mod;
return t;
}
int main(){
ios_base::sync_with_stdio(0); cin.tie(0);
#ifdef kaguya
freopen(file".inp", "r", stdin); freopen(file".out", "w", stdout);
#endif
ll n;
cin >> n;
cout << (modpow(2, n) + mod - n - 1) % mod << "\n";
return 0;
}
/*
*/
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3652kb
input:
3
output:
4
result:
ok "4"
Test #2:
score: 0
Accepted
time: 1ms
memory: 3712kb
input:
5
output:
26
result:
ok "26"
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3676kb
input:
100000
output:
607623519
result:
wrong answer 1st words differ - expected: '538161387', found: '607623519'