結果

問題 No.2359 A in S ?
ユーザー 遭難者遭難者
提出日時 2023-05-23 13:20:02
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
TLE  
実行時間 -
コード長 848 bytes
コンパイル時間 5,443 ms
コンパイル使用メモリ 306,440 KB
実行使用メモリ 9,428 KB
最終ジャッジ日時 2023-08-29 05:26:33
合計ジャッジ時間 9,355 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#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, s_inf = 316;
int L[inf], R[inf], X[inf], Y[inf];
void solve()
{
    int n, m;
    cin >> n >> m;
    rep(i, n) cin >> L[i] >> R[i] >> X[i] >> Y[i];
    rep(j, m)
    {
        int x;
        cin >> x;
        int ans = 0;
        rep(i, n)
        {
            if (!(L[i] <= x && x <= R[i]))
                continue;
            if (x % X[i] == Y[i])
                ans++;
        }
        cout << ans << '\n';
    }
}
int main()
{
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(13);
    solve();
    return 0;
}
0