如題 原本只在運算加longlong
但是一直溢位,scanf("%lld")之後就ac了
懷疑測資是不是超過題目敘述的1e9+9
如題 原本只在運算加longlong
但是一直溢位,scanf("%lld")之後就ac了
懷疑測資是不是超過題目敘述的1e9+9
測資一切正常,皆符合題目敘述
看了一下你的 code
這裡是有問題的地方
LL x,y,p,t=1; scanf("%d %d %d",&x,&y,&p);
你可以參考看看這個
https://stackoverflow.com/questions/50572586/c-variable-initialization/50572704#50572704
下方是你的 code 編譯時的 Warning ,看看這些能不能解決你的問題
main.c: In function ‘main’:
main.c:5:10: warning: format ‘%d’ expects argument of type ‘int *’, but argument 2 has type ‘long long int *’ [-Wformat=]
5 | scanf("%d %d %d",&x,&y,&p);
| ~^ ~~
| | |
| int * long long int *
| %lld
main.c:5:13: warning: format ‘%d’ expects argument of type ‘int *’, but argument 3 has type ‘long long int *’ [-Wformat=]
5 | scanf("%d %d %d",&x,&y,&p);
| ~^ ~~
| | |
| int * long long int *
| %lld
main.c:5:16: warning: format ‘%d’ expects argument of type ‘int *’, but argument 4 has type ‘long long int *’ [-Wformat=]
5 | scanf("%d %d %d",&x,&y,&p);
| ~^ ~~
| | |
| int * long long int *
| %lld