QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#679193 | #6819. Largest Unique Wins | wzl19371 | WA | 0ms | 3968kb | C++14 | 1.7kb | 2024-10-26 17:05:54 | 2024-10-26 17:05:55 |
Judging History
answer
#include <bits/stdc++.h>
#define rep(i, o, p) for(int i =o; i <= p; i ++)
#define endl '\n'
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n, m;
cin >> n >> m;
double x = 1, y = 0, z = 1.0 / m;
if(n == 2) {
rep(i, 1, n){
rep(j, 1, m) {
printf("%.10lf ", (m == j) ? x : y);
}
printf("\n");
}
return 0;
}
if(m == 2) {
rep(i, 1, n) {
if(i <= 2) printf("%.10lf %.10lf\n", x, y);
else printf("%.10lf %.10lf\n", y, x);
}
return 0;
}
if(n >= m){
if(n - m == 1) {
rep(i, 1, n){
rep(j, 1, m)
if(i >= n - 1) printf("%.10lf ", j == m ? x : y);
else printf("%.10lf ", j == (m - 1) ? x : y);
printf("\n");
}
}
else {
rep(i, 1, n){
// if(i > m){
// if(i == n) rep(j, 1, m) printf("%.10lf ", j == 1 ? x : y);
// else rep(j, 1, m) printf("%.10lf ", j == m ? x : y);
// }
// else{
for(int j = m ; j >= 1; j --)
{
int d = (i % m == 0) ? m : (i % m);
printf("%.10lf ", (d == j) ? x : y);
}
printf("\n");
}
}
}
else {
rep(i, 1, n){
int t = m - n;
rep(j, 1, t) printf("%.10lf ", y);
rep(j, 1, n) printf("%.10lf ", (i == j) ? x : y);
printf("\n");
}
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3968kb
input:
2 2
output:
0.0000000000 1.0000000000 0.0000000000 1.0000000000
result:
ok ok 0.0000 0.0000
Test #2:
score: 0
Accepted
time: 0ms
memory: 3816kb
input:
3 3
output:
0.0000000000 0.0000000000 1.0000000000 0.0000000000 1.0000000000 0.0000000000 1.0000000000 0.0000000000 0.0000000000
result:
ok ok 1.0000 -1.0000 -1.0000
Test #3:
score: 0
Accepted
time: 0ms
memory: 3868kb
input:
3 2
output:
1.0000000000 0.0000000000 1.0000000000 0.0000000000 0.0000000000 1.0000000000
result:
ok ok -1.0000 -1.0000 1.0000
Test #4:
score: 0
Accepted
time: 0ms
memory: 3832kb
input:
12 12
output:
0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 1.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 1.0000000000 ...
result:
ok ok 1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000 -1.0000
Test #5:
score: -100
Wrong Answer
time: 0ms
memory: 3888kb
input:
12 11
output:
0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 1.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 0.0000000000 1.0000000000 0.0000000000 0.0000000000...
result:
wrong answer 1's strategy is not optimal, current = 0.0000000000, better (1) = 1.0000000000