QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#860252 | #9675. 电池检测 | Grain_Depot08 | Compile Error | / | / | C++14 | 284b | 2025-01-18 11:38:56 | 2025-01-18 11:39:05 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
int t,a,b,n;
int f(int x){return x*(x-1)/2;}
int main(){
scanf("%d",&t);
while(t--){
scanf("%d%d",&a,&b);n=a+b;
else printf("%d\n",f(n/(a-1))*(a-1-(n%(a-1)))+f(n/(a-1)+1)*(n%(a-1)));
}
return 0;
}
Details
answer.code: In function ‘int main()’: answer.code:9:9: error: ‘else’ without a previous ‘if’ 9 | else printf("%d\n",f(n/(a-1))*(a-1-(n%(a-1)))+f(n/(a-1)+1)*(n%(a-1))); | ^~~~ answer.code:6:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 6 | scanf("%d",&t); | ~~~~~^~~~~~~~~ answer.code:8:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 8 | scanf("%d%d",&a,&b);n=a+b; | ~~~~~^~~~~~~~~~~~~~