# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
239217 | osaaateiasavtnl | Teleporters (IOI08_teleporters) | C++14 | 903 ms | 7748 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ii pair <int, int>
#define app push_back
#define all(a) a.begin(), a.end()
#define bp __builtin_popcount
#define ll long long
#define mp make_pair
#define f first
#define s second
#define Time (double)clock()/CLOCKS_PER_SEC
#define str to_string
mt19937 rnd(228);
const int TEST = 10000;
string read(string name) {
string ans;
string line;
ifstream t(name);
while (getline(t, line)) ans += line + '\n';
return ans;
}
/*
const int C = 3;
string genstring(int n) {
string ans;
for (int i = 0; i < n; ++i) {
ans += (char)('a' + rnd() % C);
}
return ans;
}
*/
string tree(int n) {
string ans;
for (int i = 1; i < n; ++i) {
ans += to_string(rnd() % i + 1) + ' ' + to_string(i + 1) + '\n';
}
return ans;
}
string perm(int n) {
string ans;
vector <int> p(n);
for (int i = 0; i < n; ++i) p[i] = i;
shuffle(p.begin(), p.end(), rnd);
for (int e : p) ans += str(e + 1) + ' ';
return ans;
}
int lcm(int a, int b) {
return a * b / __gcd(a, b);
}
string gen() {
string test;
int t = 1;
while (t--) {
int n = rnd() % 3 + 1;
int m = rnd() % 2 + 1;
test += str(n) + ' ' + str(m) + '\n';
vector <int> c;
for (int i = 1; i <= 2 * n; ++i)
c.app(i);
shuffle(all(c), rnd);
for (int i = 0; i < n; ++i) {
int l = c[2 * i];
int r = c[2 * i + 1];
if (r < l)
swap(l, r);
test += str(l) + ' ' + str(r) + '\n';
}
}
return test;
}
signed main() {
ofstream ans("test.txt");
system("g++ -O2 -std=gnu++17 main.cpp -o main.exe");
system("g++ -O2 -std=gnu++17 brute.cpp -o brute.exe");
for (int i = 0; i < TEST; ++i) {
string test = gen();
ofstream newtest("newtest.txt");
newtest << test;
newtest.close();
system("main.exe < newtest.txt > out1.txt");
system("brute.exe < newtest.txt > out2.txt");
string ans1 = read("out1.txt");
string ans2 = read("out2.txt");
if (ans1 != ans2 && ans1 + '\n' != ans2 && ans2 + '\n' != ans1) {
ans << test;
ans.close();
exit(0);
}
cout << i << '\n';
}
cout << "NOT FOUND\n";
ans.close();
return 0;
}
컴파일 시 표준 에러 (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... |
# | 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... |
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |