QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#60061#1893. Friendly RooksSa3tElSefr#AC ✓2ms3720kbC++231.6kb2022-11-02 19:35:592022-11-02 19:35:59

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-11-02 19:35:59]
  • 评测
  • 测评结果:AC
  • 用时:2ms
  • 内存:3720kb
  • [2022-11-02 19:35:59]
  • 提交

answer

#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
#include <array>
#include <climits>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <bitset>
#include <array>
#include <climits>

//#pragma GCC optimize("O3")
//#pragma GCC optimize ("unroll-loops")
//#pragma GCC target("avx,avx2,fma")

#define ll long long
#define ld  double
using namespace std;

const int N = 5e2 + 5, lg = 19, mod = 998244353;
const int M = 1e6 + 5;
const int b = 31;


int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n, m, k;
    cin >> n >> m >> k;
    if (min(n, m) < k) {
        cout << "Impossible\n";
        return 0;
    }
    cout << "Possible\n";
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < m; ++j) {
            if (k && i == j) {
                cout << '*';
                --k;
            } else {
                cout << '.';
            }
        }
        cout << '\n';
    }
    return 0;
}

这程序好像有点Bug,我给组数据试试?

詳細信息

Test #1:

score: 100
Accepted
time: 2ms
memory: 3516kb

input:

1 2 1

output:

Possible
*.

result:

ok n = 1, m = 2, k = 1

Test #2:

score: 0
Accepted
time: 2ms
memory: 3520kb

input:

3 3 100

output:

Impossible

result:

ok n = 3, m = 3, k = 100

Test #3:

score: 0
Accepted
time: 2ms
memory: 3604kb

input:

3 5 2

output:

Possible
*....
.*...
.....

result:

ok n = 3, m = 5, k = 2

Test #4:

score: 0
Accepted
time: 2ms
memory: 3624kb

input:

1 1 1

output:

Possible
*

result:

ok n = 1, m = 1, k = 1

Test #5:

score: 0
Accepted
time: 2ms
memory: 3720kb

input:

1 1 2

output:

Impossible

result:

ok n = 1, m = 1, k = 2

Test #6:

score: 0
Accepted
time: 0ms
memory: 3620kb

input:

11 6 1

output:

Possible
*.....
......
......
......
......
......
......
......
......
......
......

result:

ok n = 11, m = 6, k = 1

Test #7:

score: 0
Accepted
time: 0ms
memory: 3560kb

input:

11 19 25

output:

Impossible

result:

ok n = 11, m = 19, k = 25

Test #8:

score: 0
Accepted
time: 2ms
memory: 3556kb

input:

30 17 11

output:

Possible
*................
.*...............
..*..............
...*.............
....*............
.....*...........
......*..........
.......*.........
........*........
.........*.......
..........*......
.................
.................
.................
.................
.................
......

result:

ok n = 30, m = 17, k = 11

Test #9:

score: 0
Accepted
time: 2ms
memory: 3656kb

input:

34 31 50

output:

Impossible

result:

ok n = 34, m = 31, k = 50

Test #10:

score: 0
Accepted
time: 1ms
memory: 3592kb

input:

52 43 18

output:

Possible
*..........................................
.*.........................................
..*........................................
...*.......................................
....*......................................
.....*.....................................
......*.......................

result:

ok n = 52, m = 43, k = 18

Test #11:

score: 0
Accepted
time: 2ms
memory: 3716kb

input:

8 32 17

output:

Impossible

result:

ok n = 8, m = 32, k = 17

Test #12:

score: 0
Accepted
time: 2ms
memory: 3560kb

input:

26 26 4

output:

Possible
*.........................
.*........................
..*.......................
...*......................
..........................
..........................
..........................
..........................
..........................
..........................
........................

result:

ok n = 26, m = 26, k = 4

Test #13:

score: 0
Accepted
time: 2ms
memory: 3640kb

input:

50 24 87

output:

Impossible

result:

ok n = 50, m = 24, k = 87

Test #14:

score: 0
Accepted
time: 2ms
memory: 3560kb

input:

100 1 1

output:

Possible
*
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.

result:

ok n = 100, m = 1, k = 1

Test #15:

score: 0
Accepted
time: 2ms
memory: 3624kb

input:

1 100 1

output:

Possible
*...................................................................................................

result:

ok n = 1, m = 100, k = 1

Test #16:

score: 0
Accepted
time: 2ms
memory: 3604kb

input:

100 1 2

output:

Impossible

result:

ok n = 100, m = 1, k = 2

Test #17:

score: 0
Accepted
time: 2ms
memory: 3548kb

input:

1 100 33

output:

Impossible

result:

ok n = 1, m = 100, k = 33

Test #18:

score: 0
Accepted
time: 2ms
memory: 3552kb

input:

100 100 1

output:

Possible
*...................................................................................................
....................................................................................................
............................................................................................

result:

ok n = 100, m = 100, k = 1

Test #19:

score: 0
Accepted
time: 0ms
memory: 3660kb

input:

100 100 100

output:

Possible
*...................................................................................................
.*..................................................................................................
..*.........................................................................................

result:

ok n = 100, m = 100, k = 100

Test #20:

score: 0
Accepted
time: 2ms
memory: 3656kb

input:

100 100 99

output:

Possible
*...................................................................................................
.*..................................................................................................
..*.........................................................................................

result:

ok n = 100, m = 100, k = 99

Test #21:

score: 0
Accepted
time: 1ms
memory: 3624kb

input:

100 99 100

output:

Impossible

result:

ok n = 100, m = 99, k = 100