Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*
- ∧_∧
- ( ・ω・。)つ━☆・*。
- ⊂ ノ ・゜
- しーJ Accepted
- */
- // #pragma GCC optimize("O3")
- // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
- #include<bits/stdc++.h>
- #include <ext/pb_ds/assoc_container.hpp>
- #include <ext/pb_ds/tree_policy.hpp>
- #define ll long long
- #define all(x) begin(x), end(x)
- #define x first
- #define y second
- #define int long long
- using namespace std;
- using namespace __gnu_pbds;
- typedef pair<int, int> pii;
- typedef long double ld;
- template<typename T>
- using kawaii_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
- const ld PI = atan2(0, -1);
- void seriy() {
- ios::sync_with_stdio(0);
- cin.tie(0);
- cout.tie(0);
- cout << fixed << setprecision(14);
- #ifdef _offline
- freopen("input.txt", "r", stdin);
- freopen("output.txt", "w", stdout);
- #endif
- }
- const int MAXN = 1e5 + 10;
- const int MAXM = 600;
- const int INF = INT_MAX;
- const int MOD = 1e9 + 7;
- const int MAXLOG = 61;
- vector<vector<char>> res;
- int dx[4] = {-1, 1, 0, 0};
- int dy[4] = {0, 0, -1, 1};
- int d;
- bool cor(int x, int y) {
- return x > -1 && x < res.size() && y > -1 && y < res[0].size();
- }
- signed main() {
- seriy();
- int k;
- cin >> k >> d;
- d--;
- int w, h;
- cin >> w >> h;
- int n;
- cin >> n;
- vector<vector<char>> kek(((h - 1) * (k - 1) + h), vector<char>((w - 1) * (k - 1) + w, '.'));
- vector<vector<int>> lol(((h - 1) * (k - 1) + h), vector<int>((w - 1) * (k - 1) + w, -1));
- for(int i = 0; i < n; i++) {
- int x1, y1, x2, y2;
- cin >> y1 >> x1 >> y2 >> x2;
- x1 *= k;
- x2 *= k;
- y1 *= k;
- y2 *= k;
- if(x1 == x2) {
- if(y1 > y2) {
- swap(y1, y2);
- }
- for(int j = y1; j <= y2; j++) {
- lol[x1][j] = 0;
- kek[x1][j] = '*';
- }
- }
- else if(y1 == y2) {
- if(x1 > x2) {
- swap(x1, x2);
- }
- for(int j = x1; j <= x2; j++) {
- lol[j][y1] = 1;
- kek[j][y1] = '*';
- }
- }
- else {
- if(y1 > y2) {
- swap(x1, x2);
- swap(y1, y2);
- }
- if(x1 > x2) {
- for(int j = 0; j <= y2 - y1; j++) {
- lol[x1 - j][y1 + j] = 2;
- kek[x1 - j][y1 + j] = '*';
- }
- }
- else {
- for(int j = 0; j <= y2 - y1; j++) {
- lol[x1 + j][y1 + j] = 2;
- kek[x1 + j][y1 + j] = '*';
- }
- }
- }
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement