# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
71968 | 이시대의진정한갓겜스타투 (#118) | 마법 다우징 (FXCUP3_magic) | C++17 | 2 ms | 376 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "dowsing.h"
#include<bits/stdc++.h>
using namespace std;
#define Fi first
#define Se second
#define pb(x) push_back(x)
#define sz(x) (int)x.size()
#define rep(i, n) for(int i=0;i<n;i++)
#define repp(i, n) for(int i=1;i<=n;i++)
#define all(x) x.begin(), x.end()
#define geti1(X) cin >> X
#define geti2(X,Y) cin >> X >> Y
#define geti3(X,Y,Z) cin >> X >> Y >> Z
#define geti4(X,Y,Z,W) cin >> X >> Y >> Z >> W
#define GET_MACRO(_1,_2,_3,_4,NAME,...) NAME
#define geti(...) GET_MACRO(__VA_ARGS__, geti4, geti3, geti2, geti1) (__VA_ARGS__)
void FindTreasure(int N) {
vector<int> RS,CS;
repp(i,N) RS.push_back(i);
repp(i,N) CS.push_back(i);
srand(412421);
int CNT = 150;
while( sz(RS) + sz(CS) > CNT ){
int r1 = rand() % sz(RS);
int r2 = rand() % sz(CS);
int x = RS[r1], y = CS[r2];
int res = Detect(x,y);
CNT--;
if( res == 1 ) continue;
RS.erase(RS.begin()+r1);
CS.erase(CS.begin()+r2);
}
int R,C;
map<int,int> rm, cm;
for(int i=0;i<sz(RS);i++){
int res = Detect(RS[i], CS[0]);
rm[RS[i]] += res;
}
for(int i=0;i<sz(CS);i++){
int res = Detect(RS[0], CS[i]);
cm[CS[i]] += res;
}
int mx = -1;
for(auto e : rm){
if( mx < e.Se ){
mx = e.Se; R = e.Fi;
}
}
mx = -1;
for(auto e : cm){
if( mx < e.Se ){
mx = e.Se; C = e.Fi;
}
}
Report(R,C);
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |