QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#395424#6736. Alice and Bob1820357523WA 1ms3800kbC++20793b2024-04-21 14:24:162024-04-21 14:24:16

Judging History

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

  • [2024-04-21 14:24:16]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3800kb
  • [2024-04-21 14:24:16]
  • 提交

answer

#include <bits/stdc++.h>

#define ll long long
#define endl "\n"
#define __count __builtin_popcount
#define yes cout<<"Yes\n";
#define no cout<<"No\n";
using namespace std;

void solve() {
    ll n;cin>>n;
    if(n==1){
        cout<<1<<endl;
        return;
    }
    ll d=4;
    ll a[n+1];
    a[2]=1;
    ll now=2;
    ll gt=1;
    ll i;
    a[3]=3;
    for(i=4;i<=n;i++){
        a[i]=a[i-1]+pow(2,now)+2;
//        cout<<i<<" "<<a[i]<<endl;
        now+=3;
    }
    cout<<a[n]<<endl;
}

signed main() {
#ifdef ONLINE_JUDGE
#else
    freopen("114514.in", "r", stdin);
    freopen("114514.out", "w", stdout);
#endif

    std::ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    ll t = 1;
//    cin >> t;
    while (t--)
        solve();
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3644kb

input:

1

output:

1

result:

ok 1 number(s): "1"

Test #2:

score: 0
Accepted
time: 0ms
memory: 3776kb

input:

2

output:

1

result:

ok 1 number(s): "1"

Test #3:

score: -100
Wrong Answer
time: 0ms
memory: 3800kb

input:

10

output:

1198389

result:

wrong answer 1st numbers differ - expected: '997920', found: '1198389'