QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#395424 | #6736. Alice and Bob | 1820357523 | WA | 1ms | 3800kb | C++20 | 793b | 2024-04-21 14:24:16 | 2024-04-21 14:24:16 |
Judging History
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'