# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
938470 | 2024-03-05T07:37:13 Z | vjudge1 | Matching (CEOI11_mat) | C++17 | 2000 ms | 27368 KB |
#include <iostream> #include <vector> #include <algorithm> #include <utility> using namespace std; int n, m, a[1<<20], b[1<<20]; int z[1<<20], zn; int main() { scanf("%d", &n); scanf("%d", &m); for (int i = 1; i <= n; ++i) scanf("%d", a+i); for (int i = 1; i <= m; ++i) scanf("%d", b+i); for (int i = 1; i + n - 1 <= m; ++i) { vector<pair<int, int> > v; for (int j = i; j < i + n; ++j) v.emplace_back(b[j], j); sort(v.begin(), v.end()); int ok = 1; for (int j = 1; j <= n; ++j) if (v[j-1].second == a[j]+i-1); else ok = 0; if(ok)z [zn++] = i; } printf("%d\n", zn); for (int i = 0; i < zn; ++i) printf("%d ", z[i]); }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 4696 KB | Output is correct |
2 | Correct | 2 ms | 4440 KB | Output is correct |
3 | Correct | 1 ms | 4444 KB | Output is correct |
4 | Correct | 1 ms | 4440 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 4440 KB | Output is correct |
2 | Correct | 3 ms | 4444 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2049 ms | 4700 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2056 ms | 4700 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2059 ms | 9256 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2028 ms | 11740 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2049 ms | 11668 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2025 ms | 22652 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2027 ms | 27368 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2020 ms | 17548 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2044 ms | 19216 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |