# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
287850 | 2020-09-01T04:41:40 Z | 반딧불(#5783) | Skyscraper (JOI16_skyscraper) | C++17 | 2000 ms | 384 KB |
#include <bits/stdc++.h> using namespace std; typedef long long ll; int n, l; int arr[102]; int ans = 0; int main(){ scanf("%d %d", &n, &l); for(int i=1; i<=n; i++){ scanf("%d", &arr[i]); } vector<int> v; for(int i=1; i<=n; i++) v.push_back(i); do { int tmp = 0; for(int i=1; i<n; i++) tmp += abs(arr[v[i]] - arr[v[i-1]]); if(tmp <= l) ans++; } while(next_permutation(v.begin(), v.end())); printf("%d", ans); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 256 KB | Output is correct |
2 | Correct | 0 ms | 256 KB | Output is correct |
3 | Correct | 1 ms | 256 KB | Output is correct |
4 | Correct | 1 ms | 256 KB | Output is correct |
5 | Correct | 2 ms | 384 KB | Output is correct |
6 | Correct | 1 ms | 256 KB | Output is correct |
7 | Correct | 1 ms | 256 KB | Output is correct |
8 | Correct | 1 ms | 256 KB | Output is correct |
9 | Correct | 1 ms | 384 KB | Output is correct |
10 | Correct | 1 ms | 256 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 2074 ms | 256 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 256 KB | Output is correct |
2 | Correct | 0 ms | 256 KB | Output is correct |
3 | Correct | 1 ms | 256 KB | Output is correct |
4 | Correct | 1 ms | 256 KB | Output is correct |
5 | Correct | 2 ms | 384 KB | Output is correct |
6 | Correct | 1 ms | 256 KB | Output is correct |
7 | Correct | 1 ms | 256 KB | Output is correct |
8 | Correct | 1 ms | 256 KB | Output is correct |
9 | Correct | 1 ms | 384 KB | Output is correct |
10 | Correct | 1 ms | 256 KB | Output is correct |
11 | Execution timed out | 2074 ms | 256 KB | Time limit exceeded |
12 | Halted | 0 ms | 0 KB | - |