結果
問題 | No.2921 Seated in Classroom |
ユーザー |
|
提出日時 | 2024-10-12 15:06:30 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 376 ms / 2,000 ms |
コード長 | 449 bytes |
コンパイル時間 | 3,419 ms |
コンパイル使用メモリ | 272,040 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-12 15:06:37 |
合計ジャッジ時間 | 6,040 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 5 |
ソースコード
#include <bits/stdc++.h> #define rep(i, n) for (int i = 0; i < (int)(n); i++) #define all(x) (x).begin(), (x).end() typedef long long ll; using namespace std; int main(void) { int T; cin >> T; rep(notuse, T) { ll N, M; cin >> N >> M; ll mc = N / 4; N %= 4; M = max(M - mc * 4, 0LL); if (M == 0 && N > 0) { mc++; } else { ll t = N + M; mc += t / 8; if (t % 8 != 0) mc++; } cout << mc << endl; } return 0; }