QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#761016#8165. Numerous EliminationbadmintonWA 1ms3712kbC++141.5kb2024-11-18 20:36:122024-11-18 20:36:13

Judging History

你现在查看的是最新测评结果

  • [2024-11-18 20:36:13]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3712kb
  • [2024-11-18 20:36:12]
  • 提交

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'