Submission #7575636


Source Code Expand

#include<bits/stdc++.h>
#define ll long long
#define MOD 1000000007
#define FOR(i, a, b) for(int i=a; i<b; i++)
#define REP(i, n) for(int i=0; i<n; i++)
using namespace std;

int main() {
    int a, b;
    int T, N, M;
    queue<int> A, B;
    cin >> T >> N;
    REP(i, N) {
        cin >> a;
        A.push(a);
    };
    cin >> M;
    REP(i, M) {
        cin >> b;
        B.push(b);
    }

    while (!B.empty()) {
        b = B.front();
        while (!A.empty()) {
            a = A.front();
            if (a <= b && b <= a + T) {
                A.pop();
                B.pop();
                break;
            } else {
                A.pop();
            }
        }
        if (A.empty()) break;
    }

    if (A.empty() && !B.empty()) cout << "no" << endl;
    else cout << "yes" << endl;
}

Submission Info

Submission Time
Task C - おいしいたこ焼きの売り方
User bokeh
Language C++14 (GCC 5.4.1)
Score 100
Code Size 846 Byte
Status AC
Exec Time 1 ms
Memory 256 KiB

Judge Result

Set Name All
Score / Max Score 100 / 100
Status
AC × 35
Set Name Test Cases
All rand0.txt, rand1.txt, rand10.txt, rand11.txt, rand12.txt, rand13.txt, rand14.txt, rand15.txt, rand16.txt, rand17.txt, rand18.txt, rand19.txt, rand2.txt, rand20.txt, rand21.txt, rand22.txt, rand23.txt, rand24.txt, rand25.txt, rand26.txt, rand27.txt, rand28.txt, rand29.txt, rand3.txt, rand4.txt, rand5.txt, rand6.txt, rand7.txt, rand8.txt, rand9.txt, s1.txt, s2.txt, s3.txt, s4.txt, s5.txt
Case Name Status Exec Time Memory
rand0.txt AC 1 ms 256 KiB
rand1.txt AC 1 ms 256 KiB
rand10.txt AC 1 ms 256 KiB
rand11.txt AC 1 ms 256 KiB
rand12.txt AC 1 ms 256 KiB
rand13.txt AC 1 ms 256 KiB
rand14.txt AC 1 ms 256 KiB
rand15.txt AC 1 ms 256 KiB
rand16.txt AC 1 ms 256 KiB
rand17.txt AC 1 ms 256 KiB
rand18.txt AC 1 ms 256 KiB
rand19.txt AC 1 ms 256 KiB
rand2.txt AC 1 ms 256 KiB
rand20.txt AC 1 ms 256 KiB
rand21.txt AC 1 ms 256 KiB
rand22.txt AC 1 ms 256 KiB
rand23.txt AC 1 ms 256 KiB
rand24.txt AC 1 ms 256 KiB
rand25.txt AC 1 ms 256 KiB
rand26.txt AC 1 ms 256 KiB
rand27.txt AC 1 ms 256 KiB
rand28.txt AC 1 ms 256 KiB
rand29.txt AC 1 ms 256 KiB
rand3.txt AC 1 ms 256 KiB
rand4.txt AC 1 ms 256 KiB
rand5.txt AC 1 ms 256 KiB
rand6.txt AC 1 ms 256 KiB
rand7.txt AC 1 ms 256 KiB
rand8.txt AC 1 ms 256 KiB
rand9.txt AC 1 ms 256 KiB
s1.txt AC 1 ms 256 KiB
s2.txt AC 1 ms 256 KiB
s3.txt AC 1 ms 256 KiB
s4.txt AC 1 ms 256 KiB
s5.txt AC 1 ms 256 KiB