Submission #654285

# Submission time Handle Problem Language Result Execution time Memory
654285 2022-10-30T21:04:57 Z four_specks Pairs (IOI07_pairs) C++17
30 / 100
38 ms 7572 KB
#include <bits/stdc++.h>

using namespace std;

inline namespace
{
} // namespace

void solve()
{
    int b;
    int n;
    long m, d;
    cin >> b >> n >> d >> m;

    vector board(n, vector<long>(b));
    for (int i = 0; i < n; i++)
    {
        for (long &x : board[i])
            cin >> x, --x;
    }

    long cnt = 0;
    if (b == 1)
    {
        vector<long> a(n);
        for (int i = 0; i < n; i++)
            a[i] = board[i][0];
        sort(a.begin(), a.end());

        for (int i = 0; i < n; i++)
            cnt += i - (lower_bound(a.begin(), a.end(), a[i] - d) - a.begin());
    }
    else if (b == 2)
    {
    }
    else if (b == 3)
    {
    }

    cout << cnt << '\n';
}

int main()
{
    ios_base::sync_with_stdio(false), cin.tie(NULL);

    solve();

    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 21 ms 6864 KB Output is correct
2 Correct 23 ms 6972 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 30 ms 7504 KB Output is correct
2 Correct 30 ms 7572 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 28 ms 7372 KB Output is correct
2 Correct 26 ms 7464 KB Output is correct
3 Correct 25 ms 7456 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Incorrect 1 ms 340 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 22 ms 6308 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 25 ms 6484 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 24 ms 7060 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 28 ms 6348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 38 ms 6616 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 34 ms 6600 KB Output isn't correct
2 Halted 0 ms 0 KB -