結果
| 問題 | No.2921 Seated in Classroom |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2024-10-14 13:33:24 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.90.0) |
| 結果 |
AC
|
| 実行時間 | 146 ms / 2,000 ms |
| コード長 | 447 bytes |
| 記録 | |
| コンパイル時間 | 988 ms |
| コンパイル使用メモリ | 213,508 KB |
| 実行使用メモリ | 9,220 KB |
| 最終ジャッジ日時 | 2026-07-05 23:24:58 |
| 合計ジャッジ時間 | 2,657 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 5 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#include<atcoder/modint>
using namespace atcoder;
using mint=modint998244353;
void solve(){
ll N,M;
cin>>N>>M;
ll B=(N+3)/4;
ll Z=B*8-N;
if(M<=Z){
cout<<B<<endl;
}
else{
cout<<B+(M-Z+7)/8<<endl;
}
}
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
ll T;
cin>>T;
while(T--)
solve();
}