QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#86448 | #1893. Friendly Rooks | Ahmed_Abdelmegeed# | AC ✓ | 2ms | 3556kb | C++20 | 1.5kb | 2023-03-09 21:50:57 | 2023-03-09 21:51:00 |
Judging History
answer
#include <bits/stdc++.h>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define ll long long
#define ld long double
#define el "\n"
#define matrix vector<vector<int>>
#define pt complex<ld>
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define ordered_multiset tree<ll, null_type,less_equal<ll>, rb_tree_tag, tree_order_statistics_node_update>
using namespace __gnu_pbds;
using namespace std;
const ll N = 1e5 + 5, LOG = 20, INF = 1e18;
const ld pi = acos(-1);
const ll mod = 1e9 + 7;
const ld eps = 1e-12;
int dx[] = {0, 1, 0, -1, -1, 1, -1, 1};
int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
ll n, m, x, y, k;
char ans[102][102];
void dowork() {
cin >> n >> m >> k;
if (k > min(n, m)) {
cout << "Impossible" << el;
return;
}
cout << "Possible" << el;
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m; j++) {
ans[i][j] = '.';
}
}
for (int i = 1; i <= k; i++) {
ans[i][i] = '*';
}
for (int i = 1; i <= n; i++) {
for (int j = 1; j <= m; j++) {
cout << ans[i][j];
}
cout << el;
}
}
signed main() {
fast
//freopen("lis.in", "r", stdin);
//freopen("bitwise.out", "w", stdout);
int t = 1;
//cin >> t;
for (int i = 1; i <= t; i++) {
dowork();
}
return 0;
}
这程序好像有点Bug,我给组数据试试?
詳細信息
Test #1:
score: 100
Accepted
time: 2ms
memory: 3304kb
input:
1 2 1
output:
Possible *.
result:
ok n = 1, m = 2, k = 1
Test #2:
score: 0
Accepted
time: 2ms
memory: 3524kb
input:
3 3 100
output:
Impossible
result:
ok n = 3, m = 3, k = 100
Test #3:
score: 0
Accepted
time: 2ms
memory: 3412kb
input:
3 5 2
output:
Possible *.... .*... .....
result:
ok n = 3, m = 5, k = 2
Test #4:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
1 1 1
output:
Possible *
result:
ok n = 1, m = 1, k = 1
Test #5:
score: 0
Accepted
time: 2ms
memory: 3384kb
input:
1 1 2
output:
Impossible
result:
ok n = 1, m = 1, k = 2
Test #6:
score: 0
Accepted
time: 2ms
memory: 3552kb
input:
11 6 1
output:
Possible *..... ...... ...... ...... ...... ...... ...... ...... ...... ...... ......
result:
ok n = 11, m = 6, k = 1
Test #7:
score: 0
Accepted
time: 2ms
memory: 3384kb
input:
11 19 25
output:
Impossible
result:
ok n = 11, m = 19, k = 25
Test #8:
score: 0
Accepted
time: 2ms
memory: 3400kb
input:
30 17 11
output:
Possible *................ .*............... ..*.............. ...*............. ....*............ .....*........... ......*.......... .......*......... ........*........ .........*....... ..........*...... ................. ................. ................. ................. ................. ......
result:
ok n = 30, m = 17, k = 11
Test #9:
score: 0
Accepted
time: 2ms
memory: 3484kb
input:
34 31 50
output:
Impossible
result:
ok n = 34, m = 31, k = 50
Test #10:
score: 0
Accepted
time: 2ms
memory: 3556kb
input:
52 43 18
output:
Possible *.......................................... .*......................................... ..*........................................ ...*....................................... ....*...................................... .....*..................................... ......*.......................
result:
ok n = 52, m = 43, k = 18
Test #11:
score: 0
Accepted
time: 2ms
memory: 3544kb
input:
8 32 17
output:
Impossible
result:
ok n = 8, m = 32, k = 17
Test #12:
score: 0
Accepted
time: 0ms
memory: 3552kb
input:
26 26 4
output:
Possible *......................... .*........................ ..*....................... ...*...................... .......................... .......................... .......................... .......................... .......................... .......................... ........................
result:
ok n = 26, m = 26, k = 4
Test #13:
score: 0
Accepted
time: 0ms
memory: 3364kb
input:
50 24 87
output:
Impossible
result:
ok n = 50, m = 24, k = 87
Test #14:
score: 0
Accepted
time: 2ms
memory: 3332kb
input:
100 1 1
output:
Possible * . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
result:
ok n = 100, m = 1, k = 1
Test #15:
score: 0
Accepted
time: 2ms
memory: 3372kb
input:
1 100 1
output:
Possible *...................................................................................................
result:
ok n = 1, m = 100, k = 1
Test #16:
score: 0
Accepted
time: 1ms
memory: 3372kb
input:
100 1 2
output:
Impossible
result:
ok n = 100, m = 1, k = 2
Test #17:
score: 0
Accepted
time: 2ms
memory: 3384kb
input:
1 100 33
output:
Impossible
result:
ok n = 1, m = 100, k = 33
Test #18:
score: 0
Accepted
time: 2ms
memory: 3532kb
input:
100 100 1
output:
Possible *................................................................................................... .................................................................................................... ............................................................................................
result:
ok n = 100, m = 100, k = 1
Test #19:
score: 0
Accepted
time: 2ms
memory: 3400kb
input:
100 100 100
output:
Possible *................................................................................................... .*.................................................................................................. ..*.........................................................................................
result:
ok n = 100, m = 100, k = 100
Test #20:
score: 0
Accepted
time: 2ms
memory: 3420kb
input:
100 100 99
output:
Possible *................................................................................................... .*.................................................................................................. ..*.........................................................................................
result:
ok n = 100, m = 100, k = 99
Test #21:
score: 0
Accepted
time: 0ms
memory: 3520kb
input:
100 99 100
output:
Impossible
result:
ok n = 100, m = 99, k = 100