Submission #243219

#TimeUsernameProblemLanguageResultExecution timeMemory
243219VEGAnnPick (COI18_pick)C++14
10 / 100
5 ms512 KiB
#include <bits/stdc++.h> #define sz(x) ((int)x.size()) #define all(x) x.begin(),x.end() #define PB push_back using namespace std; typedef long double ld; const int N = 400100; const ld E = 1e-10; int a, b, c, d, x, y; void prit(){ cout << x << " " << y << '\n'; } int main(){ ios_base::sync_with_stdio(0); cin.tie(0); #ifdef _LOCAL freopen("in.txt","r",stdin); #endif // _LOCAL cin >> a >> b >> c >> d; cout << "0 0\n"; if (a == 0 && b == 0){ for (int it = 0; it < c / 2; it++){ x++; y++; prit(); } x--; y++; prit(); for (int it = 1; it < c / 2; it++){ x--; y--; prit(); } for (int it = 1; it < d / 2; it++){ x--; y++; prit(); } x--; y--; prit(); for (int it = 0; it < d / 2; it++){ x++; y--; if (x != 0 || y != 0) prit(); } return 0; } if (a % 2 == 0 && b % 2 == 0 && a > 0 && b > 0){ for (int it = 0; it < a / 2; it++){ x++; prit(); } for (int it = 0; it < b / 2; it++){ y++; prit(); } for (int it = 0; it < c / 2; it++){ x++; y++; prit(); } for (int it = 0; it < d / 2; it++){ x--; y++; prit(); } x--; prit(); for (int it = 0; it < d / 2; it++){ x++; y--; prit(); } for (int it = 0; it < c / 2; it++){ x--; y--; prit(); } for (int it = 1; it < b / 2; it++){ y--; prit(); } for (int it = 1; it < a / 2; it++){ x--; prit(); } return 0; } if (c % 2 == 0 && c > 0 && a % 2 == 0 && a > 0){ for (int i = 0; i < a / 2; i++){ x++; prit(); } x++; y++; prit(); for (int i = 0; i < b / 2; i++){ y++; prit(); } for (int i = 1; i < c / 2; i++){ x++; y++; prit(); } for (int i = 0; i < d / 2; i++){ x--; y++; prit(); } x--; prit(); for (int i = 0; i < d / 2; i++){ x++; y--; prit(); } for (int i = 1; i < c / 2; i++){ x--; y--; prit(); } for (int i = 0; i < b / 2; i++){ y--; prit(); } for (int i = 1; i < a / 2; i++){ x--; prit(); } return 0; } if (d % 2 == 0 && d > 0 && a % 2 == 0 && a > 0){ for (int i = 0; i < a / 2; i++){ x++; prit(); } x--; y++; prit(); for (int i = 0; i < b / 2; i++){ y++; prit(); } for (int i = 0; i < c / 2; i++){ x++; y++; prit(); } for (int i = 1; i < d / 2; i++){ x--; y++; prit(); } x--; prit(); for (int i = 1; i < d / 2; i++){ x++; y--; prit(); } for (int i = 0; i < c / 2; i++){ x--; y--; prit(); } for (int i = 0; i < b / 2; i++){ y--; prit(); } for (int i = 1; i < a / 2; i++){ x--; prit(); } return 0; } if (a % 2 == 0 && a > 0 && c % 2 == 1 && d % 2 == 1){ for (int i = 1; i < a / 2; i++){ x++; prit(); } x++; y++; prit(); for (int it = 0; it < b / 2; it++){ y++; prit(); } for (int it = 0; it < c / 2; it++){ x++; y++; prit(); } for (int it = 0; it < d / 2; it++){ x--; y++; prit(); } x--; prit(); for (int it = 0; it < d / 2; it++){ x++; y--; prit(); } for (int it = 0; it < c / 2; it++){ x--; y--; prit(); } for (int it = 1; it < b / 2; it++){ y--; prit(); } for (int i = 0; i < a / 2; i++){ x--; prit(); } return 0; } if (b % 2 == 0 && b > 0 && c % 2 == 1 && d % 2 == 1){ for (int i = 1; i < b / 2; i++){ y++; prit(); } x--; y++; prit(); for (int it = 0; it < a / 2; it++){ x--; prit(); } for (int it = 0; it < c / 2; it++){ x--; y--; prit(); } for (int it = 0; it < d / 2; it++){ x--; y++; prit(); } y--; prit(); for (int it = 0; it < d / 2; it++){ x++; y--; prit(); } for (int it = 0; it < c / 2; it++){ x++; y++; prit(); } for (int it = 1; it < a / 2; it++){ x++; prit(); } for (int i = 0; i < b / 2; i++){ y--; prit(); } return 0; } if (b % 2 == 0 && b > 0 && c % 2 == 0 && c > 0){ for (int i = 0; i < b / 2; i++){ y++; prit(); } x--; y--; prit(); for (int it = 0; it < a / 2; it++){ x--; prit(); } for (int it = 1; it < c / 2; it++){ x--; y--; prit(); } for (int it = 0; it < d / 2; it++){ x--; y++; prit(); } y--; prit(); for (int it = 0; it < d / 2; it++){ x++; y--; prit(); } for (int it = 1; it < c / 2; it++){ x++; y++; prit(); } for (int it = 0; it < a / 2; it++){ x++; prit(); } for (int i = 1; i < b / 2; i++){ y--; prit(); } return 0; } if (b % 2 == 0 && b > 0 && d % 2 == 0 && d > 0){ for (int i = 0; i < b / 2; i++){ y++; prit(); } x--; y++; prit(); for (int it = 0; it < a / 2; it++){ x--; prit(); } for (int it = 0; it < c / 2; it++){ x--; y--; prit(); } for (int it = 1; it < d / 2; it++){ x--; y++; prit(); } y--; prit(); for (int it = 1; it < d / 2; it++){ x++; y--; prit(); } for (int it = 0; it < c / 2; it++){ x++; y++; prit(); } for (int it = 0; it < a / 2; it++){ x++; prit(); } for (int i = 1; i < b / 2; i++){ y--; prit(); } return 0; } if (a % 2 == 1 && b % 2 == 1 && c % 2 == 1){ for (int i = 0; i < a / 2; i++){ x++; prit(); } x++; y++; prit(); for (int i = 0; i < b / 2; i++){ y++; prit(); } for (int i = 0; i < c / 2; i++){ x++; y++; prit(); } for (int i = 0; i < d / 2; i++){ x--; y++; prit(); } x--; prit(); for (int i = 0; i < d / 2; i++){ x++; y--; prit(); } for (int i = 0; i < c / 2; i++){ x--; y--; prit(); } for (int i = 0; i < b / 2; i++){ y--; prit(); } for (int i = 0; i < a / 2; i++){ x--; prit(); } return 0; } return -1; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...