QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#398854#1893. Friendly Rooksdarkroute#WA 1ms3704kbC++141.4kb2024-04-25 19:10:412024-04-25 19:10:41

Judging History

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

  • [2024-04-25 19:10:41]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3704kb
  • [2024-04-25 19:10:41]
  • 提交

answer

//Practice, Practice, Practice

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

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>

#define debug(x) cerr << #x << " is " << x << endl;
#define Practice ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define el '\n'
#define pb push_back
#define F first
#define S second
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define ll long long
#define ull unsigned long long
#define one(x) __builtin_popcountll(x)
#define double long double
#define sz(x) x.size()
#define INF 1e9
#define int long long
using namespace std;
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag, tree_order_statistics_node_update> indexed_set;
const int MAXN = 5e5 + 5, SQ = 350, mod = 1e9 + 7, LOG = 21, base = 37;

void doWork() {
    int n, m, k;
    cin >> n >> m >> k;
    if(n < k)return void (cout << "Impossible" << el);
    cout << "Possible" << el;
    for(int i = 0; i < n; ++i){
        for(int j = 0; j < m; ++j){
            if(i == j && k) k--, cout << "*";
            else cout << ".";
        }
        cout << el;
    }
}
int32_t main(){
    Practice
    int testcases = 1;
    //cin >> testcases;
    for(; testcases; testcases--){
        doWork();
    }
    return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 1ms
memory: 3660kb

input:

1 2 1

output:

Possible
*.

result:

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

Test #2:

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

input:

3 3 100

output:

Impossible

result:

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

Test #3:

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

input:

3 5 2

output:

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

result:

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

Test #4:

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

input:

1 1 1

output:

Possible
*

result:

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

Test #5:

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

input:

1 1 2

output:

Impossible

result:

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

Test #6:

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

input:

11 6 1

output:

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

result:

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

Test #7:

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

input:

11 19 25

output:

Impossible

result:

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

Test #8:

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

input:

30 17 11

output:

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

result:

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

Test #9:

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

input:

34 31 50

output:

Impossible

result:

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

Test #10:

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

input:

52 43 18

output:

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

result:

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

Test #11:

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

input:

8 32 17

output:

Impossible

result:

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

Test #12:

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

input:

26 26 4

output:

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

result:

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

Test #13:

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

input:

50 24 87

output:

Impossible

result:

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

Test #14:

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

input:

100 1 1

output:

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

result:

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

Test #15:

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

input:

1 100 1

output:

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

result:

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

Test #16:

score: -100
Wrong Answer
time: 0ms
memory: 3572kb

input:

100 1 2

output:

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

result:

wrong answer Wrong number of rooks: 2 expected, 1 found