# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
72291 | cat > /dev/null (#118) | 마법 다우징 (FXCUP3_magic) | C++17 | 2 ms | 256 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "dowsing.h"
#include<set>
#include<ctime>
#include<cstdio>
#include<cstdlib>
using namespace std;
void FindTreasure(int N) {
srand(time(NULL));
set<int> rest, rest2;
for (int i = 1; i <= N; i ++)
rest.insert(i), rest2.insert(i);
int row, col;
while (true) {
int ra = ((long long)rand() * rand()) % rest.size();
int val;
for (int item : rest) {
val = item;
if (!ra)
break;
ra--;
}
if (Detect(1, val)) {
col = val;
break;
}
rest.erase(val);
}
while (true) {
int ra = ((long long)rand() * rand()) % rest2.size();
int val;
for (int item : rest2) {
val = item;
if (!ra)
break;
ra--;
}
if (Detect(val,1)) {
row = val;
break;
}
rest2.erase(val);
}
Report(row, col);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |