Submission #371289
Source Code Expand
#include <cstdio> #include <cstring> #include <cstdlib> #include <cmath> #include <ctime> #include <cassert> #include <string> #include <algorithm> #include <vector> #include <queue> #include <stack> #include <functional> #include <iostream> #include <map> #include <set> using namespace std; typedef pair<int,int> P; typedef pair<int,P> P1; typedef pair<P,P> P2; typedef long long ll; #define pu push #define pb push_back #define mp make_pair #define eps 1e-7 #define INF 1000000000 #define fi first #define sc second #define rep(i,x) for(int i=0;i<x;i++) int main() { double x,y; scanf("%lf %lf",&x,&y); int a = floor(x); int b = floor(y); double c = x-(double)a; double d = y-(double)b; if(c==0.0 && d==0.0) cout << a << " " << b << " " << a+1111 << " " << b+1112 << endl; else cout << a << " " << b << " " << a+(int)(c*1000.0+0.01) << " " << b+(int)(d*1000.0+0.01) << endl; double cc = x-(double)(a+1); if(d == 0.0) { double dd = y-(double)(b+1); cout << a+1 << " " << b+1 << " " << a+1+(int)(cc*1000.0-0.01) << " " << b+1+(int)(dd*1000.0-0.01) << endl; } else { cout << a+1 << " " << b << " " << a+1+(int)(cc*1000.0-0.01) << " " << b+(int)(d*1000.0+0.01) << endl; } }
Submission Info
Submission Time | |
---|---|
Task | B - 交点 |
User | is_yh |
Language | C++11 (GCC 4.9.2) |
Score | 100 |
Code Size | 1241 Byte |
Status | AC |
Exec Time | 27 ms |
Memory | 928 KB |
Compile Error
./Main.cpp: In function ‘int main()’: ./Main.cpp:32:24: warning: ignoring return value of ‘int scanf(const char*, ...)’, declared with attribute warn_unused_result [-Wunused-result] scanf("%lf %lf",&x,&y); ^
Judge Result
Set Name | All | ||
---|---|---|---|
Score / Max Score | 100 / 100 | ||
Status |
|
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 | 25 ms | 928 KB |
scrambled_01.txt | AC | 23 ms | 928 KB |
scrambled_02.txt | AC | 27 ms | 800 KB |
scrambled_03.txt | AC | 24 ms | 928 KB |
scrambled_04.txt | AC | 24 ms | 924 KB |
scrambled_05.txt | AC | 25 ms | 796 KB |
scrambled_06.txt | AC | 25 ms | 804 KB |
scrambled_07.txt | AC | 23 ms | 924 KB |
scrambled_08.txt | AC | 24 ms | 800 KB |
scrambled_09.txt | AC | 25 ms | 924 KB |
scrambled_10.txt | AC | 25 ms | 732 KB |
scrambled_11.txt | AC | 24 ms | 924 KB |
scrambled_12.txt | AC | 24 ms | 924 KB |
scrambled_13.txt | AC | 22 ms | 800 KB |
scrambled_14.txt | AC | 25 ms | 736 KB |
scrambled_15.txt | AC | 26 ms | 928 KB |
scrambled_16.txt | AC | 24 ms | 920 KB |
scrambled_17.txt | AC | 22 ms | 924 KB |
scrambled_18.txt | AC | 27 ms | 768 KB |
scrambled_19.txt | AC | 24 ms | 924 KB |
scrambled_20.txt | AC | 22 ms | 800 KB |
scrambled_21.txt | AC | 22 ms | 924 KB |
scrambled_22.txt | AC | 24 ms | 800 KB |
scrambled_23.txt | AC | 24 ms | 800 KB |
scrambled_24.txt | AC | 24 ms | 796 KB |
scrambled_25.txt | AC | 26 ms | 776 KB |
scrambled_26.txt | AC | 24 ms | 920 KB |