QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#30114 | #235. Maximum Multiple | srf | WA | 125ms | 3640kb | C++14 | 485b | 2022-04-24 20:26:01 | 2022-04-28 12:28:03 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
inline void read(int &x){
static char c; x = 0,c = getchar();
while (!isdigit(c)) c = getchar();
while (isdigit(c)) x = x * 10 + c - '0',c = getchar();
}
#define LL long long
LL ans;
int main(){
int T,n;
read(T);
while (T--){
read(n),ans = -1;
if (n % 3 == 0) ans = (LL)(n/3) * (LL)(n/3) * (LL)(n/3);
if (n % 4 == 0) ans = max(ans,(LL)(n/4) * (LL)(n/2) * (LL)(n/2));
cout << ans << '\n';
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 125ms
memory: 3640kb
input:
1000000 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 ...
output:
-1 -1 1 4 -1 8 -1 32 27 -1 -1 108 -1 -1 125 256 -1 216 -1 500 343 -1 -1 864 -1 -1 729 1372 -1 1000 -1 2048 1331 -1 -1 2916 -1 -1 2197 4000 -1 2744 -1 5324 3375 -1 -1 6912 -1 -1 4913 8788 -1 5832 -1 10976 6859 -1 -1 13500 -1 -1 9261 16384 -1 10648 -1 19652 12167 -1 -1 23328 -1 -1 15625 27436 -1 17576...
result:
wrong answer 4th lines differ - expected: '2', found: '4'