1 / 19

Problem A サイゾウ

Problem A サイゾウ. 問題作成:松本 解法作成:松本,北村. おわび. コンテスト開始直後にジャッジのミスがあり大変ご迷惑をおかけいたしました. 解法. やるだけ. 結果. Submitted:39 人 /52 回 Accepted:39 人 1st Accepted: 高橋周平( 2 分 56 秒). Problem B 完全数. 問題作成:松本 解法作成:北村. 注意. 問題文に「プログラムの実行時間が制限時間を越えないように注意すること 」と警告あり. 駄目な例. int sum = 0;

caitir
Télécharger la présentation

Problem A サイゾウ

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Problem A サイゾウ 問題作成:松本 解法作成:松本,北村

  2. おわび • コンテスト開始直後にジャッジのミスがあり大変ご迷惑をおかけいたしました

  3. 解法 • やるだけ

  4. 結果 • Submitted:39人/52回 • Accepted:39人 • 1st Accepted: 高橋周平(2分56秒)

  5. Problem B 完全数 問題作成:松本 解法作成:北村

  6. 注意 • 問題文に「プログラムの実行時間が制限時間を越えないように注意すること 」と警告あり

  7. 駄目な例 int sum = 0; for(int i = 1; i < n; i++){ if(n % i == 0){ sum += i; } } ループが1億回回る! Time Limit Exceeded!

  8. 駄目な例2 int sum = 0; for(int i = 1; i <= n / 2; i++){ if(n % i == 0){ sum += i; } } ループが5000万回回る! Time Limit Exceeded!

  9. 正解 int sum = 0; for(int i = 1; i * i <= n; i++){ if(n % i == 0){ if(i * i == n) sum += i; else sum += i + n / i; } } sum -= n; ループが1万回回る! Accepted! 計算量はO(sqrt(n))

  10. 結果 • Submitted:34人/58回 • Accepted:34人 • 1st Accepted:黄檗雅也 (4分17秒)

  11. Problem D バトルタウン 問題作成:松本 解法作成:松本,八森

  12. 元ネタ • バトルシティ(ナムコ)

  13. 解法 • やるだけ • そこそこ面倒 • 問題文に「データセットの間には1行の空行を出力せよ. 最後のデータセットの後に余計な空行を出力しないよう注意すること. 」と警告あり

  14. 結果 • Submitted:34人/66回 • Accepted:34人 • 1st Accepted:岩田陽一 (42分54秒)

  15. Problem E カントリーロード 問題作成:松本 解法作成:松本,坪坂

  16. 解法 • 電源が一個のとき 電源 全区間(二つの隣り合う家がはさむ区間) に電線を引く必要あり 電源は電線上のどこに置いてもよい

  17. 解法 • 電源が二個のとき 電線を引かなくていい区間が一つ ⇒一番大きい区間を除いて電線を引けばよい

  18. 解法 • 電源が k 個あるとき電線を引かなくていい区間が k – 1 個 • 区間の大きさをソートして大きい方から k – 1 個を取り除くだけ • 計算量はO(N log N) • N = 100000 でも大丈夫

  19. 結果 • Submitted:28人35回 • Accepted:24人 • 1st Accepted:秋葉拓哉 (32分7秒)

More Related