QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#781460#8025. FibonacciUnstalian#WA 1ms3700kbC++14405b2024-11-25 16:11:302024-11-25 16:11:43

Judging History

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

  • [2024-11-25 16:11:43]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3700kb
  • [2024-11-25 16:11:30]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl '\n'
#define maxn

int n, m;

void solve(){
	cin >> n;
	int t = n / 3;
	int ans = 0;
	if(t >= 2)
		ans += t * (n - 1) - (t - 1) * t / 2;
	else
		ans = n - 1;
	cout << ans<<endl;
}
signed main(){
	ios::sync_with_stdio(0);
	cin.tie(0), cout.tie(0);
	int 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: 3700kb

input:

1

output:

0

result:

ok answer is '0'

Test #2:

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

input:

2

output:

1

result:

wrong answer expected '0', found '1'