mirror of
https://git.sb/baoshuo/OI-codes.git
synced 2024-12-26 05:32:03 +00:00
31 lines
546 B (Stored with Git LFS)
C++
31 lines
546 B (Stored with Git LFS)
C++
#include <cmath>
|
|
#include "testlib.h"
|
|
using namespace std;
|
|
|
|
int main(int argc, char *argv[]){
|
|
|
|
registerTestlibCmd(argc, argv);
|
|
|
|
int p = ans.readInt(), q = ans.readInt();
|
|
|
|
double real_ans = 1.0 * p / q;
|
|
|
|
int x = ouf.readInt();
|
|
|
|
if (x == -1) {
|
|
double part_ans = ouf.readDouble();
|
|
if (abs(real_ans - part_ans) / max(max(real_ans, part_ans), 1.0) < 1e-5)
|
|
quitp(0.7, "ok");
|
|
else
|
|
quitf(_wa, "not ok");
|
|
}
|
|
|
|
int y = ouf.readInt();
|
|
if (x == p && y == q)
|
|
quitf(_ok, "ok");
|
|
|
|
quitf(_wa, "not ok");
|
|
|
|
return 0;
|
|
}
|