# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
154330 | dandrozavr | Chessboard (IZhO18_chessboard) | C++14 | 700 ms | 1072 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define fi first
#define se second
#define ld long double
#define pi 3.1415926535897932384626433832795
#define sz(a) (int)a.size()
#define pii pair < int , int >
#define IOS {ios :: sync_with_stdio(false); cin.tie(0); cout.tie(0);}
#define TIME 1.0*clock()/CLOCKS_PER_SEC
#define pb push_back
using namespace std;
mt19937 gen(chrono::high_resolution_clock::now().time_since_epoch().count());
const int tinf = (int)1e9 + 7;
const long long inf = (long long)1e18 + 7;
const int N = 2e5 + 5;
const int M = 1e9 + 7;
int a[505][505];
namespace fastio {
template <class T> ostream &operator<<(ostream &os, const vector<T> &container){for (auto &u : container)os << u << " ";return os;}
template<class T1, class T2> ostream& operator << (ostream& os, const pair<T1, T2>& p) { return os << p.first << " " << p.second; }
template <class T> ostream &operator<<(ostream &os, set<T> const& con) { for (auto &u : con) os << u << " "; return os; }
void pr() {}
template <typename T, typename... args> void pr(T x, args... tail) { cout << x << " "; pr(tail...);}
}
using namespace fastio;
signed main(){
freopen("input.txt", "w", stdout);
int n = gen() % 400 + 50;
cout << n << " ";
vector < pair < pii , pii > > all;
int k = 200;
for (int i = 0; i < k; ++i)
{
while(clock() <= 0.7 * CLOCKS_PER_SEC)
{
int x1 = gen() % n ;
int x2 = gen() % n ;
if (x1 > x2)
swap(x1, x2);
int y1 = gen() % n;
int y2 = gen() % n;
if (y1 > y2)
swap(y1, y2);
bool g = 1;
for (int i = x1; i <= x2; ++i)
for (int j = y1; j <= y2; ++j)
if (a[i][j])
{
g = 0;
break;
}
if (g)
{
all.pb({{x1, y1}, {x2, y2}});
break;
}
}
if (all.size())
{
auto la = all.back();
for (int i = la.fi.fi; i <= la.se.fi; ++i)
for (int j = la.fi.se; j <= la.se.se; ++j)
a[i][j] = 1;
}
}
cout << all.size()<<endl;
for (auto i : all)
cout<<i.fi.fi+1<<" "<<i.fi.se+1<<" "<<i.se.fi+1<<" "<<i.se.se+1<<endl;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |