QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#679202#6819. Largest Unique Winswzl19371WA 0ms3960kbC++141.9kb2024-10-26 17:07:042024-10-26 17:07:05

Judging History

你现在查看的是最新测评结果

  • [2024-10-26 17:07:05]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3960kb
  • [2024-10-26 17:07:04]
  • 提交

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
**********************************************************************/


详细

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