Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- #include <sys/time.h>
- using namespace std;
- #define FI first
- #define SE second
- #define X first
- #define Y second
- #define ST first
- #define ND second
- #define MP make_pair
- #define PB push_back
- typedef long long LL;
- typedef vector<int> VI;
- typedef long double LD;
- typedef pair<int,int> PII;
- #define REP(i,n) for(int i=0;i<(n);++i)
- #define FOR(i,a,b) for(int i=(a);i<(b);++i)
- #define FORE(a,b) for(VAR(a,(b).begin());a!=(b).end();++a)
- #define VAR(a,b) __typeof(b) a=(b)
- #define ALL(x) (x).begin(),(x).end()
- #define CLR(x,a) memset(x,a,sizeof(x))
- double getTime() {
- timeval tv;
- gettimeofday(&tv, NULL);
- return tv.tv_sec + tv.tv_usec * 1e-6;
- }
- int d1000(int x) {
- if (x < 0) {
- return -((-x + 999) / 1000);
- } else {
- return x / 1000;
- }
- }
- bool should_color(int x, int y) {
- LL a = x;
- LL b = y;
- REP (i, 30) {
- LL a2 = d1000(a * a - b * b);
- LL b2 = d1000(2 * a * b);
- if (a2 > 4000) {
- return false;
- }
- a = a2 + x;
- b = b2 + y;
- }
- return true;
- }
- int main() {
- int x0, y0, x1, y1;
- cin >> x0 >> y0 >> x1 >> y1;
- FOR (x, x0, x1) {
- FOR (y, y0, y1) {
- if (should_color(x * 5, y * 5)) {
- cout << "X";
- } else {
- cout << ".";
- }
- }
- cout << endl;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement