提出 #59353484
ソースコード 拡げる
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const int N=105;
int q[N], r[N], n;
int main(){
cin >> n;
for (int i=1;i<=n;i++)cin>>q[i]>>r[i];
int Q;cin>>Q;
while(Q--){
int t,d;cin>>t>>d;
int a=d%q[t];
if(a<=r[t])cout<<d+r[t]-a<<'\n';
else cout<<d+q[t]-(a-r[t])<<'\n';
}
return 0;
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | B - Garbage Collection |
| ユーザ | Nicrobott |
| 言語 | C++ 20 (gcc 12.2) |
| 得点 | 200 |
| コード長 | 384 Byte |
| 結果 | AC |
| 実行時間 | 1 ms |
| メモリ | 3556 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 200 / 200 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | 00_sample_01.txt |
| All | 00_sample_01.txt, 01_test_01.txt, 01_test_02.txt, 01_test_03.txt, 01_test_04.txt, 01_test_05.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 00_sample_01.txt | AC | 1 ms | 3556 KiB |
| 01_test_01.txt | AC | 1 ms | 3428 KiB |
| 01_test_02.txt | AC | 1 ms | 3456 KiB |
| 01_test_03.txt | AC | 1 ms | 3448 KiB |
| 01_test_04.txt | AC | 1 ms | 3428 KiB |
| 01_test_05.txt | AC | 1 ms | 3448 KiB |