結果

問題 No.2359 A in S ?
ユーザー 遭難者遭難者
提出日時 2023-06-08 13:59:39
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 922 bytes
コンパイル時間 7,416 ms
コンパイル使用メモリ 343,272 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-29 05:25:32
合計ジャッジ時間 32,876 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1,816 ms
4,376 KB
testcase_05 AC 50 ms
4,380 KB
testcase_06 AC 1,844 ms
4,376 KB
testcase_07 AC 50 ms
4,376 KB
testcase_08 AC 89 ms
4,376 KB
testcase_09 AC 1,080 ms
4,376 KB
testcase_10 AC 45 ms
4,376 KB
testcase_11 AC 49 ms
4,376 KB
testcase_12 AC 1,948 ms
4,380 KB
testcase_13 TLE -
testcase_14 TLE -
testcase_15 TLE -
testcase_16 AC 1,938 ms
4,376 KB
testcase_17 TLE -
testcase_18 TLE -
testcase_19 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast,unroll-loops")
#include <bits/stdc++.h>
#include <atcoder/all>
#define rep(i, n) for (int i = 0; i < n; i++)
#define ALL(a) a.begin(), a.end()
#define ll int
#define pii pair<int, int>
#define pil pair<int, ll>
#define pli pair<ll, int>
#define vc vector
using namespace std;
constexpr int inf = 1e5 + 1;
int a[inf];
void solve()
{
    int n, m;
    cin >> n >> m;
    rep(k, n)
    {
        int l, r, x, y;
        cin >> l >> r >> x >> y;
        l = (l - y + x - 1) / x * x + y;
        r = (r - y + x) / x * x + y;
        while (l < r)
        {
            a[l]++;
            l += x;
        }
    }
    for (int i = 0, x; i < m; i++)
    {
        cin >> x;
        cout << a[x] << '\n';
    }
}
int main()
{
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(13);
    solve();
    return 0;
}
0