結果
問題 |
No.1903 Day1
|
ユーザー |
![]() |
提出日時 | 2022-02-02 00:58:01 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 523 bytes |
コンパイル時間 | 803 ms |
コンパイル使用メモリ | 83,676 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-11 13:25:20 |
合計ジャッジ時間 | 1,370 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 5 WA * 3 |
ソースコード
// 嘘二分探索 #include <iostream> #include <vector> using namespace std; int solve(int N) { for (int day = 1;; ++day) { if (day % 7 == 0) N += 6; --N; if (N <= 0) return day; } } int uso_binary_search(int N) { int ng = 0, ok = 13964; while (ok > ng + 1) { int c = (ok + ng) / 2; int num_problem = N + c / 7 * 6; (num_problem <= c ? ok : ng) = c; } return ok; } int main() { int N; cin >> N; cout << uso_binary_search(N) << '\n'; }