QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#673150#8025. FibonacciqkyAC ✓0ms3700kbC++17770b2024-10-24 20:47:162024-10-24 20:47:19

Judging History

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

  • [2024-10-24 20:47:19]
  • 评测
  • 测评结果:AC
  • 用时:0ms
  • 内存:3700kb
  • [2024-10-24 20:47:16]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define endl "\n";
const int N=1e6+6;
ll mod=998244353;
ll n,m;


struct edge{
	int u,v,d;
}es[1000010];

bool cmp(edge a, edge b){

	return a.d<b.d;
}

void read(ll &t){
	t=0;ll flag=1;char c=getchar();
	while(c<'0'||c>'9'){if(c=='-'){flag=-1;}c=getchar();}
	while(c>='0'&&c<='9'){t=(t<<3)+(t<<1)+c-'0';c=getchar();}
	t=t*flag;
} 
void write(ll t){
	if(t<0){putchar('-');t=-t;}
	char buffer[20];int len=0;
	do{buffer[len++]=t%10+'0';t/=10;}while(t);
	for(int i=len-1;i>=0;i--){putchar(buffer[i]);}
	putchar('\n');
}
long long ans = 0;
int main(){
	read(n);
	int res = n %3;
	n/=3;
	ans = 5 * (n+1) * n /2;
	ans -= (2- res) * n;
	cout<<ans - n<<endl;
	return 0;
}

这程序好像有点Bug,我给组数据试试?

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3700kb

input:

1

output:

0

result:

ok answer is '0'

Test #2:

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

input:

2

output:

0

result:

ok answer is '0'

Test #3:

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

input:

3

output:

2

result:

ok answer is '2'

Test #4:

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

input:

4

output:

3

result:

ok answer is '3'

Test #5:

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

input:

5

output:

4

result:

ok answer is '4'

Test #6:

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

input:

6

output:

9

result:

ok answer is '9'

Test #7:

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

input:

7

output:

11

result:

ok answer is '11'

Test #8:

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

input:

8

output:

13

result:

ok answer is '13'

Test #9:

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

input:

9

output:

21

result:

ok answer is '21'

Test #10:

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

input:

1000000000

output:

277777777388888889

result:

ok answer is '277777777388888889'

Test #11:

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

input:

999999999

output:

277777777055555556

result:

ok answer is '277777777055555556'

Test #12:

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

input:

999999998

output:

277777776055555558

result:

ok answer is '277777776055555558'

Test #13:

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

input:

999999997

output:

277777775722222226

result:

ok answer is '277777775722222226'

Test #14:

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

input:

999999996

output:

277777775388888894

result:

ok answer is '277777775388888894'

Test #15:

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

input:

167959139

output:

7836186667808671

result:

ok answer is '7836186667808671'

Test #16:

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

input:

641009859

output:

114137121930720546

result:

ok answer is '114137121930720546'

Test #17:

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

input:

524125987

output:

76307791531929941

result:

ok answer is '76307791531929941'

Test #18:

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

input:

702209411

output:

136971682042251727

result:

ok answer is '136971682042251727'

Test #19:

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

input:

585325539

output:

95168329515123666

result:

ok answer is '95168329515123666'

Test #20:

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

input:

58376259

output:

946607661058146

result:

ok answer is '946607661058146'

Test #21:

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

input:

941492387

output:

246224420196576255

result:

ok answer is '246224420196576255'

Test #22:

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

input:

824608515

output:

188883111809927810

result:

ok answer is '188883111809927810'

Test #23:

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

input:

2691939

output:

2012926101266

result:

ok answer is '2012926101266'

Test #24:

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

input:

802030518

output:

178681375367258337

result:

ok answer is '178681375367258337'

Test #25:

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

input:

685146646

output:

130396090434956670

result:

ok answer is '130396090434956670'

Test #26:

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

input:

863230070

output:

206990597736971874

result:

ok answer is '206990597736971874'

Test #27:

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

input:

41313494

output:

474112415443986

result:

ok answer is '474112415443986'

Test #28:

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

input:

219396918

output:

13370835415627937

result:

ok answer is '13370835415627937'

Test #29:

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

input:

102513046

output:

2919145682411070

result:

ok answer is '2919145682411070'

Test #30:

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

input:

985629174

output:

269851352235706881

result:

ok answer is '269851352235706881'

Test #31:

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

input:

458679894

output:

58440901356845361

result:

ok answer is '58440901356845361'

Test #32:

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

input:

341796022

output:

32451255604586126

result:

ok answer is '32451255604586126'

Test #33:

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

input:

519879446

output:

75076288119314482

result:

ok answer is '75076288119314482'

Test #34:

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

input:

452405440

output:

56852967085618329

result:

ok answer is '56852967085618329'

Test #35:

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

input:

10

output:

24

result:

ok answer is '24'

Test #36:

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

input:

100

output:

2739

result:

ok answer is '2739'

Extra Test:

score: 0
Extra Test Passed