QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#679202 | #6819. Largest Unique Wins | wzl19371 | WA | 0ms | 3960kb | C++14 | 1.9kb | 2024-10-26 17:07:04 | 2024-10-26 17:07:05 |
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{
rep(j, 1, m)
{
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");
}
}
}
/**********************************************************************
Problem: 1004
User: E11
Language: C++
Result: WA
**********************************************************************/
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3820kb
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: 3836kb
input:
3 3
output:
1.0000000000 0.0000000000 0.0000000000 0.0000000000 1.0000000000 0.0000000000 0.0000000000 0.0000000000 1.0000000000
result:
ok ok -1.0000 -1.0000 1.0000
Test #3:
score: 0
Accepted
time: 0ms
memory: 3960kb
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: 3852kb
input:
12 12
output:
1.0000000000 0.0000000000 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 ...
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: 3808kb
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