| Task: | Monikulmio |
| Sender: | Interaalimato |
| Submission time: | 2025-10-27 08:18:31 +0200 |
| Language: | C++ (C++11) |
| Status: | READY |
| Result: | 0 |
| group | verdict | score |
|---|---|---|
| #1 | WRONG ANSWER | 0 |
| test | verdict | time | score | |
|---|---|---|---|---|
| #1 | WRONG ANSWER | 0.00 s | 0 | details |
| #2 | WRONG ANSWER | 0.00 s | 0 | details |
| #3 | WRONG ANSWER | 0.00 s | 0 | details |
| #4 | WRONG ANSWER | 0.00 s | 0 | details |
| #5 | WRONG ANSWER | 0.00 s | 0 | details |
| #6 | WRONG ANSWER | 0.00 s | 0 | details |
| #7 | WRONG ANSWER | 0.00 s | 0 | details |
| #8 | WRONG ANSWER | 0.00 s | 0 | details |
| #9 | WRONG ANSWER | 0.00 s | 0 | details |
| #10 | WRONG ANSWER | 0.01 s | 0 | details |
Code
#include <bits/stdc++.h>
using namespace std;
// read from file instead of console:
// freopen("input.txt", "r", stdin);
// freopen("output.txt", "w", stdout);
const int M = 1000000007;
typedef long long ll;
typedef vector<int> vi;
typedef vector<bool> vb;
typedef vector<vector<int>> vvi;
typedef vector<vector<vector<int>>> vvvi;
typedef pair<int, int> pi;
typedef queue<int> qi;
typedef stack<int> si;
typedef priority_queue<int> pqi;
typedef deque<int> dqi;
typedef unordered_set<int> seti;
typedef unordered_map<int,int> mapi;
typedef vector<long long> vll;
typedef vector<vector<long long>> vvll;
typedef vector<vector<vector<long long>>> vvvll;
typedef pair<long long, long long> pll;
typedef queue<long long> qll;
typedef stack<long long> sll;
typedef priority_queue<long long> pqll;
typedef deque<long long> dqll;
typedef unordered_set<long long> setll;
#define loop(i, a, b) for (int i = a; i < b; i++)
#define rloop(i, a, b) for (int i = a; i > b; i--)
#define each(a, c) for (auto a : c)
#define all(x) x.begin(), x.end()
#define PI M_PI
#define PB push_back
#define P push
#define POB pop_back
#define F first
#define S second
#define sz size()
#define R1(a) int a; cin >> a
#define R2(a, b) int a,b; cin >> a >> b
#define R3(a, b, c) int a,b,c; cin >> a >> b >> c
#define R4(a, b, c, d) int a,b,c,d; cin >> a >> b >> c >> d
#define WS(a) cout << a << " "
#define WN(a) cout << a << "\n"
#define WNL cout << "\n"
vector<string> res;
int n,m,k;
int ops[4][2] = {{-1,0},{1,0},{0,1},{0,-1}};
void dfs(int x, int y){
if(x == -1 || x == m || y == -1 || y == n) return;
if(res[y][x] != '#') return;
res[y][x] = '.';
loop(i,0,4){
dfs(x + ops[i][0], y+ops[i][1]);
}
}
int main()
{
ios_base::sync_with_stdio(0);
cin.tie(0);
cin >> n >> m >> k;
res = vector<string>(n, string(m,'#'));
pi pr;
pi fs;
loop(i,0,k+1){
pi cu;
if(i < k){
R2(a,b);
cu = {a,b};
if(i == 0) fs = cu;
}
else cu = fs;
if(i > 0){
cout << "i = " << i << "\n";
int y1 = pr.F - 1;
int x1 = pr.S - 1;
int dx = cu.S - pr.S;
int dy = cu.F - pr.F;
char ch = '\\';
if(dx == 0) ch = '|';
else if(dy == 0) ch = '=';
else if((dx > 0) ^ (dy > 0)) ch = '/';
int ct = max(abs(dy), abs(dx));
dx /= ct;
dy /= ct;
cout << y1 << "," <<dy << "&" << x1<< "," << dx << ": " << ct << "\n";
loop(j,1,ct){
res[y1 + dy*j][x1 + dx*j] = ch;
}
res[y1][x1] = '*';
}
pr = cu;
}
loop(i,0,n){
loop(sgn, 0, 2){
int y = i;
int x = (m-1)*sgn;
dfs(x,y);
}
}
loop(i,0,m){
loop(sgn, 0, 2){
int x = i;
int y = (n-1)*sgn;
dfs(x,y);
}
}
loop(i,0,n){
cout << res[i] << "\n";
}
return 0;
}
Test details
Test 1 (public)
Verdict: WRONG ANSWER
| input |
|---|
| 8 9 5 5 2 2 5 5 8 7 8 ... |
| correct output |
|---|
| ......... ....*.... .../#\... ../###\.. .*#####*. ... |
| user output |
|---|
| i = 1 4,-1&1,1: 3 i = 2 1,1&4,1: 3 i = 3 ... |
Feedback: Incorrect length on line 1: expected 9, got 1
Test 2 (public)
Verdict: WRONG ANSWER
| input |
|---|
| 20 40 4 5 10 5 30 15 30 15 10 |
| correct output |
|---|
| ................................. |
| user output |
|---|
| i = 1 4,0&9,1: 20 i = 2 4,1&29,0: 10 i = 3 ... |
Feedback: Incorrect length on line 1: expected 40, got 1
Test 3 (public)
Verdict: WRONG ANSWER
| input |
|---|
| 20 40 29 8 7 13 2 14 2 9 7 ... |
| correct output |
|---|
| ................................. |
| user output |
|---|
| i = 1 7,1&6,-1: 5 i = 2 12,1&1,0: 1 i = 3 ... |
Feedback: Incorrect length on line 1: expected 40, got 1
Test 4 (public)
Verdict: WRONG ANSWER
| input |
|---|
| 20 40 14 5 12 5 25 8 28 13 28 ... |
| correct output |
|---|
| ................................. |
| user output |
|---|
| i = 1 4,0&11,1: 13 i = 2 4,1&24,1: 3 i = 3 ... |
Feedback: Incorrect length on line 1: expected 40, got 1
Test 5 (public)
Verdict: WRONG ANSWER
| input |
|---|
| 20 40 12 3 20 7 16 7 9 11 13 ... |
| correct output |
|---|
| ................................. |
| user output |
|---|
| i = 1 2,1&19,-1: 4 i = 2 6,0&15,-1: 7 i = 3 ... |
Feedback: Incorrect length on line 1: expected 40, got 1
Test 6 (public)
Verdict: WRONG ANSWER
| input |
|---|
| 9 35 33 2 3 2 8 4 8 4 5 ... |
| correct output |
|---|
| ................................. |
| user output |
|---|
| i = 1 1,0&2,1: 5 i = 2 1,1&7,0: 2 i = 3 ... |
Feedback: Incorrect length on line 1: expected 35, got 1
Test 7 (public)
Verdict: WRONG ANSWER
| input |
|---|
| 30 100 69 6 10 6 14 7 14 7 18 ... |
| correct output |
|---|
| ................................. |
| user output |
|---|
| i = 1 5,0&9,1: 4 i = 2 5,1&13,0: 1 i = 3 ... |
Feedback: Incorrect length on line 1: expected 100, got 1
Test 8 (public)
Verdict: WRONG ANSWER
| input |
|---|
| 40 60 192 11 3 11 5 10 6 11 7 ... |
| correct output |
|---|
| ................................. |
| user output |
|---|
| i = 1 10,0&2,1: 2 i = 2 10,-1&4,1: 1 i = 3 ... |
Feedback: Incorrect length on line 1: expected 60, got 1
Test 9 (public)
Verdict: WRONG ANSWER
| input |
|---|
| 50 100 142 1 1 1 7 1 11 1 14 ... |
| correct output |
|---|
| *=====*===*==*................... |
| user output |
|---|
| i = 1 0,0&0,1: 6 i = 2 0,0&6,1: 4 i = 3 ... |
Feedback: Incorrect length on line 1: expected 100, got 1
Test 10 (public)
Verdict: WRONG ANSWER
| input |
|---|
| 100 100 1000 10 1 4 7 1 4 1 9 ... |
| correct output |
|---|
| ...*====*........................ |
| user output |
|---|
| i = 1 9,-1&0,1: 6 i = 2 3,-1&6,-1: 3 i = 3 ... |
Feedback: Incorrect length on line 1: expected 100, got 1
