結果
問題 | No.5009 Draw A Convex Polygon |
ユーザー |
![]() |
提出日時 | 2022-12-02 13:40:52 |
言語 | Rust (1.83.0 + proconio) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,410 bytes |
コンパイル時間 | 505 ms |
実行使用メモリ | 37,236 KB |
スコア | 0 |
平均クエリ数 | 1000001.00 |
最終ジャッジ日時 | 2022-12-02 13:41:00 |
合計ジャッジ時間 | 6,209 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge11 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | WA * 1 |
ソースコード
fn main() {let n = 1_000_000;// (1e9, 0) -> ... -> (0, 1e9) -> ... -> (-1e9, 0) -> ... -> (0, -1e9)// (1000000 - 4) / 4 = 249999let mut points_1 = Vec::new();let (mut x, mut y) = (1_000_000_000_i64, 0);for _ in 0..(n - 4) / 4 {x -= 1;y += 2;points_1.push((x, y));}let mut points_2 = Vec::new();let (mut x, mut y) = (0, 1_000_000_000_i64);for _ in 0..(n - 4) / 4 {x -= 2;y -= 1;points_2.push((x, y));}let mut points_3 = Vec::new();let (mut x, mut y) = (-1_000_000_000_i64, 0);for _ in 0..(n - 4) / 4 {x += 1;y -= 2;points_3.push((x, y));}let mut points_4 = Vec::new();let (mut x, mut y) = (0, -1_000_000_000_i64);for _ in 0..(n - 4) / 4 {x += 2;y += 1;points_4.push((x, y));}let mut ans = Vec::new();ans.push((1_000_000_000_i64, 0));ans.extend(points_1);ans.push((0, 1_000_000_000_i64));ans.extend(points_2);ans.push((-1_000_000_000_i64, 0));ans.extend(points_3);ans.push((0, -1_000_000_000_i64));ans.extend(points_4);assert_eq!(ans.len(), n);println!("{}", n);for (x, y) in ans {assert!(-1_000_000_000 <= x && x <= 1_000_000_000);assert!(-1_000_000_000 <= y && y <= 1_000_000_000);println!("{} {}", x, y);}}