QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#763433 | #6993. Take Your Seat | hejinming983282# | AC ✓ | 0ms | 3988kb | C++23 | 966b | 2024-11-19 20:15:52 | 2024-11-19 20:15:53 |
Judging History
answer
// Author : hejinming2012
#include <bits/stdc++.h>
#define int long long
#define endl '\n'
#define dbg(x) cout << #x " = " << (x) << endl
#define quickio ios::sync_with_stdio(false);
#define quickin cin.tie(0);
#define quickout cout.tie(0);
using namespace std;
inline int read() {
int now = 0, nev = 1; char c = getchar();
while(c < '0' || c > '9') { if(c == '-') nev = -1; c = getchar(); }
while(c >= '0' && c <= '9') { now = (now << 1) + (now << 3) + (c & 15); c = getchar(); }
return now * nev;
}
void write(int x) {
if(x < 0) putchar('-'), x = -x;
if(x > 9) write(x / 10);
putchar(x % 10 + '0');
}
signed main() {
quickio
quickin
quickout
int T = read();
for(int _ = 1; _ <= T; _++) {
int n = read(), m = read();
double y;
if(n == 1) y = 1.0;
else y = 0.5;
double z;
if(m == 0) z = 0.0;
else z = (double) (m + 1) / (2.0 * m);
printf("Case #%lld: %.6lf %.6lf\n", _, y, z);
}
return 0;
}
这程序好像有点Bug,我给组数据试试?
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3988kb
input:
1 2 3
output:
Case #1: 0.500000 0.666667
result:
ok 4 tokens
Test #2:
score: 0
Accepted
time: 0ms
memory: 3916kb
input:
50 1 1 2 2 3 3 4 4 5 5 6 6 7 8 8 8 9 10 10 10 11 12 12 12 13 14 14 14 15 15 16 16 17 17 18 18 19 19 20 20 21 22 22 22 23 23 24 24 25 25 26 26 27 28 28 28 29 29 30 30 31 31 32 32 33 34 34 34 35 35 36 36 37 38 38 38 39 40 40 40 41 41 42 42 43 43 44 44 45 45 46 47 47 47 48 48 49 49 50 50
output:
Case #1: 1.000000 1.000000 Case #2: 0.500000 0.750000 Case #3: 0.500000 0.666667 Case #4: 0.500000 0.625000 Case #5: 0.500000 0.600000 Case #6: 0.500000 0.583333 Case #7: 0.500000 0.562500 Case #8: 0.500000 0.562500 Case #9: 0.500000 0.550000 Case #10: 0.500000 0.550000 Case #11: 0.500000 0.541667 C...
result:
ok 200 tokens