Submission #371307


Source Code Expand

#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <cstdint>
#include <algorithm>
#include <cstdlib>
using namespace std;

int main() {
	double x, y;
	cin >> x >> y;
	x *= 1000, y *= 1000;

	int nx = round(x), ny = round(y);
	int dx = nx % 1000, dy = ny % 1000;
	int bx = (nx - dx) / 1000;
	int by = (ny - dy) / 1000;
	int ex = 1000 - dx, ey = 1000 - dy;
	dx *= 2, dy *= 2;
	ex *= 2, ey *= 2;

	if (dx == 0 && dy == 0) {
		cout << bx << " " << by << " " << bx + 1 << " " << by << endl;
		cout << bx << " " << by << " " << bx << " " << by + 1 << endl;
		return 0;
	}

	cout << bx << " " << by << " " << bx + dx << " " << by + dy << endl;
	cout << bx + 1 << " " << by + 1 << " " << bx + 1 - ex << " " << by + 1 - ey << endl;

	return 0;
}

Submission Info

Submission Time
Task B - 交点
User tanakh
Language C++11 (GCC 4.9.2)
Score 0
Code Size 851 Byte
Status WA
Exec Time 26 ms
Memory 932 KB

Judge Result

Set Name All
Score / Max Score 0 / 100
Status
AC × 26
WA × 1
Set Name Test Cases
All scrambled_00.txt, scrambled_01.txt, scrambled_02.txt, scrambled_03.txt, scrambled_04.txt, scrambled_05.txt, scrambled_06.txt, scrambled_07.txt, scrambled_08.txt, scrambled_09.txt, scrambled_10.txt, scrambled_11.txt, scrambled_12.txt, scrambled_13.txt, scrambled_14.txt, scrambled_15.txt, scrambled_16.txt, scrambled_17.txt, scrambled_18.txt, scrambled_19.txt, scrambled_20.txt, scrambled_21.txt, scrambled_22.txt, scrambled_23.txt, scrambled_24.txt, scrambled_25.txt, scrambled_26.txt
Case Name Status Exec Time Memory
scrambled_00.txt AC 24 ms 920 KB
scrambled_01.txt WA 23 ms 924 KB
scrambled_02.txt AC 23 ms 796 KB
scrambled_03.txt AC 26 ms 800 KB
scrambled_04.txt AC 26 ms 796 KB
scrambled_05.txt AC 26 ms 924 KB
scrambled_06.txt AC 25 ms 920 KB
scrambled_07.txt AC 26 ms 916 KB
scrambled_08.txt AC 26 ms 732 KB
scrambled_09.txt AC 26 ms 800 KB
scrambled_10.txt AC 25 ms 928 KB
scrambled_11.txt AC 25 ms 920 KB
scrambled_12.txt AC 23 ms 800 KB
scrambled_13.txt AC 26 ms 900 KB
scrambled_14.txt AC 26 ms 804 KB
scrambled_15.txt AC 25 ms 800 KB
scrambled_16.txt AC 24 ms 800 KB
scrambled_17.txt AC 24 ms 924 KB
scrambled_18.txt AC 25 ms 928 KB
scrambled_19.txt AC 26 ms 924 KB
scrambled_20.txt AC 25 ms 792 KB
scrambled_21.txt AC 24 ms 908 KB
scrambled_22.txt AC 25 ms 916 KB
scrambled_23.txt AC 26 ms 800 KB
scrambled_24.txt AC 23 ms 932 KB
scrambled_25.txt AC 25 ms 800 KB
scrambled_26.txt AC 26 ms 800 KB