# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
282851 | 2020-08-25T04:43:02 Z | 임성재(#5752) | Lock Puzzle (innopolis2018_final_A) | C++17 | 19 ms | 512 KB |
#include<bits/stdc++.h> using namespace std; #define fast ios::sync_with_stdio(false); cin.tie(0); #define fi first #define se second #define em emplace #define eb emplace_back #define mp make_pair #define all(v) (v).begin(), (v).end() #define pre(a) cout << fixed; cout.precision(a); typedef long long ll; typedef long double ld; typedef pair<int,int> pii; typedef pair<ll,ll> pll; const int inf = 1e9; const ll INF = 1e18; int n, m; string s, t; vector<int> ans; void shift(int x) { ans.eb(x); reverse(s.begin(), s.begin() + n - x); reverse(s.begin(), s.end()); } void f(int x, int y) { shift(n - x - 1); shift(n); shift(n - y - 1); shift(n); } int main() { fast; cin >> n >> m; cin >> s >> t; for(int i=n-1; i>=0; i--) { bool flag = false; for(int j=i; j>=0; j--) { if(s[j] == t[i]) { f(j, i); flag = true; break; } } if(!flag) { cout << -1; return 0; } } cout << ans.size() << "\n"; for(auto i : ans) { cout << i << " "; } }
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 384 KB | [n = 1, m = 10000], OK, 4 operations |
2 | Correct | 0 ms | 384 KB | [n = 2, m = 10000], OK, 8 operations |
3 | Correct | 1 ms | 384 KB | [n = 8, m = 10000], OK, 32 operations |
4 | Correct | 1 ms | 384 KB | [n = 8, m = 10000], OK, 32 operations |
5 | Correct | 1 ms | 384 KB | [n = 8, m = 10000], OK, 32 operations |
6 | Correct | 1 ms | 384 KB | [n = 8, m = 10000], OK: No solution |
7 | Correct | 0 ms | 384 KB | [n = 8, m = 10000], OK, 32 operations |
8 | Correct | 1 ms | 384 KB | [n = 8, m = 10000], OK, 32 operations |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 384 KB | [n = 1, m = 10000], OK, 4 operations |
2 | Correct | 0 ms | 384 KB | [n = 2, m = 10000], OK, 8 operations |
3 | Correct | 1 ms | 384 KB | [n = 8, m = 10000], OK, 32 operations |
4 | Correct | 1 ms | 384 KB | [n = 8, m = 10000], OK, 32 operations |
5 | Correct | 1 ms | 384 KB | [n = 8, m = 10000], OK, 32 operations |
6 | Correct | 1 ms | 384 KB | [n = 8, m = 10000], OK: No solution |
7 | Correct | 0 ms | 384 KB | [n = 8, m = 10000], OK, 32 operations |
8 | Correct | 1 ms | 384 KB | [n = 8, m = 10000], OK, 32 operations |
9 | Correct | 1 ms | 384 KB | [n = 49, m = 10000], OK, 196 operations |
10 | Correct | 1 ms | 384 KB | [n = 50, m = 10000], OK, 200 operations |
11 | Correct | 1 ms | 384 KB | [n = 100, m = 10000], OK, 400 operations |
12 | Correct | 1 ms | 384 KB | [n = 99, m = 10000], OK, 396 operations |
13 | Correct | 0 ms | 384 KB | [n = 50, m = 10000], OK, 200 operations |
14 | Correct | 1 ms | 384 KB | [n = 50, m = 10000], OK, 200 operations |
15 | Correct | 0 ms | 384 KB | [n = 50, m = 10000], OK: No solution |
16 | Correct | 1 ms | 384 KB | [n = 50, m = 10000], OK, 200 operations |
17 | Correct | 1 ms | 384 KB | [n = 50, m = 10000], OK, 200 operations |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 384 KB | [n = 1, m = 10000], OK, 4 operations |
2 | Correct | 0 ms | 384 KB | [n = 2, m = 10000], OK, 8 operations |
3 | Correct | 1 ms | 384 KB | [n = 8, m = 10000], OK, 32 operations |
4 | Correct | 1 ms | 384 KB | [n = 8, m = 10000], OK, 32 operations |
5 | Correct | 1 ms | 384 KB | [n = 8, m = 10000], OK, 32 operations |
6 | Correct | 1 ms | 384 KB | [n = 8, m = 10000], OK: No solution |
7 | Correct | 0 ms | 384 KB | [n = 8, m = 10000], OK, 32 operations |
8 | Correct | 1 ms | 384 KB | [n = 8, m = 10000], OK, 32 operations |
9 | Correct | 1 ms | 384 KB | [n = 49, m = 10000], OK, 196 operations |
10 | Correct | 1 ms | 384 KB | [n = 50, m = 10000], OK, 200 operations |
11 | Correct | 1 ms | 384 KB | [n = 100, m = 10000], OK, 400 operations |
12 | Correct | 1 ms | 384 KB | [n = 99, m = 10000], OK, 396 operations |
13 | Correct | 0 ms | 384 KB | [n = 50, m = 10000], OK, 200 operations |
14 | Correct | 1 ms | 384 KB | [n = 50, m = 10000], OK, 200 operations |
15 | Correct | 0 ms | 384 KB | [n = 50, m = 10000], OK: No solution |
16 | Correct | 1 ms | 384 KB | [n = 50, m = 10000], OK, 200 operations |
17 | Correct | 1 ms | 384 KB | [n = 50, m = 10000], OK, 200 operations |
18 | Correct | 5 ms | 384 KB | [n = 1000, m = 10000], OK, 4000 operations |
19 | Correct | 5 ms | 384 KB | [n = 999, m = 10000], OK, 3996 operations |
20 | Correct | 5 ms | 384 KB | [n = 998, m = 10000], OK, 3992 operations |
21 | Correct | 5 ms | 384 KB | [n = 997, m = 10000], OK, 3988 operations |
22 | Correct | 5 ms | 384 KB | [n = 1000, m = 10000], OK, 4000 operations |
23 | Correct | 5 ms | 384 KB | [n = 1000, m = 10000], OK, 4000 operations |
24 | Correct | 5 ms | 384 KB | [n = 1000, m = 10000], OK: No solution |
25 | Correct | 5 ms | 384 KB | [n = 1000, m = 10000], OK, 4000 operations |
26 | Correct | 5 ms | 384 KB | [n = 1000, m = 10000], OK, 4000 operations |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 384 KB | [n = 1, m = 10000], OK, 4 operations |
2 | Correct | 0 ms | 384 KB | [n = 2, m = 10000], OK, 8 operations |
3 | Correct | 1 ms | 384 KB | [n = 8, m = 10000], OK, 32 operations |
4 | Correct | 1 ms | 384 KB | [n = 8, m = 10000], OK, 32 operations |
5 | Correct | 1 ms | 384 KB | [n = 8, m = 10000], OK, 32 operations |
6 | Correct | 1 ms | 384 KB | [n = 8, m = 10000], OK: No solution |
7 | Correct | 0 ms | 384 KB | [n = 8, m = 10000], OK, 32 operations |
8 | Correct | 1 ms | 384 KB | [n = 8, m = 10000], OK, 32 operations |
9 | Correct | 1 ms | 384 KB | [n = 49, m = 10000], OK, 196 operations |
10 | Correct | 1 ms | 384 KB | [n = 50, m = 10000], OK, 200 operations |
11 | Correct | 1 ms | 384 KB | [n = 100, m = 10000], OK, 400 operations |
12 | Correct | 1 ms | 384 KB | [n = 99, m = 10000], OK, 396 operations |
13 | Correct | 0 ms | 384 KB | [n = 50, m = 10000], OK, 200 operations |
14 | Correct | 1 ms | 384 KB | [n = 50, m = 10000], OK, 200 operations |
15 | Correct | 0 ms | 384 KB | [n = 50, m = 10000], OK: No solution |
16 | Correct | 1 ms | 384 KB | [n = 50, m = 10000], OK, 200 operations |
17 | Correct | 1 ms | 384 KB | [n = 50, m = 10000], OK, 200 operations |
18 | Correct | 5 ms | 384 KB | [n = 1000, m = 10000], OK, 4000 operations |
19 | Correct | 5 ms | 384 KB | [n = 999, m = 10000], OK, 3996 operations |
20 | Correct | 5 ms | 384 KB | [n = 998, m = 10000], OK, 3992 operations |
21 | Correct | 5 ms | 384 KB | [n = 997, m = 10000], OK, 3988 operations |
22 | Correct | 5 ms | 384 KB | [n = 1000, m = 10000], OK, 4000 operations |
23 | Correct | 5 ms | 384 KB | [n = 1000, m = 10000], OK, 4000 operations |
24 | Correct | 5 ms | 384 KB | [n = 1000, m = 10000], OK: No solution |
25 | Correct | 5 ms | 384 KB | [n = 1000, m = 10000], OK, 4000 operations |
26 | Correct | 5 ms | 384 KB | [n = 1000, m = 10000], OK, 4000 operations |
27 | Correct | 17 ms | 512 KB | [n = 2000, m = 10000], OK, 8000 operations |
28 | Correct | 18 ms | 384 KB | [n = 1999, m = 10000], OK, 7996 operations |
29 | Correct | 19 ms | 512 KB | [n = 1998, m = 10000], OK, 7992 operations |
30 | Correct | 18 ms | 384 KB | [n = 1997, m = 10000], OK, 7988 operations |
31 | Correct | 18 ms | 384 KB | [n = 2000, m = 10000], OK, 8000 operations |
32 | Correct | 18 ms | 384 KB | [n = 2000, m = 10000], OK, 8000 operations |
33 | Correct | 16 ms | 384 KB | [n = 2000, m = 10000], OK: No solution |
34 | Correct | 17 ms | 384 KB | [n = 2000, m = 10000], OK, 8000 operations |
35 | Correct | 17 ms | 384 KB | [n = 2000, m = 10000], OK, 8000 operations |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 384 KB | [n = 1, m = 10000], OK, 4 operations |
2 | Correct | 0 ms | 384 KB | [n = 2, m = 10000], OK, 8 operations |
3 | Correct | 1 ms | 384 KB | [n = 8, m = 10000], OK, 32 operations |
4 | Correct | 1 ms | 384 KB | [n = 8, m = 10000], OK, 32 operations |
5 | Correct | 1 ms | 384 KB | [n = 8, m = 10000], OK, 32 operations |
6 | Correct | 1 ms | 384 KB | [n = 8, m = 10000], OK: No solution |
7 | Correct | 0 ms | 384 KB | [n = 8, m = 10000], OK, 32 operations |
8 | Correct | 1 ms | 384 KB | [n = 8, m = 10000], OK, 32 operations |
9 | Correct | 1 ms | 384 KB | [n = 49, m = 10000], OK, 196 operations |
10 | Correct | 1 ms | 384 KB | [n = 50, m = 10000], OK, 200 operations |
11 | Correct | 1 ms | 384 KB | [n = 100, m = 10000], OK, 400 operations |
12 | Correct | 1 ms | 384 KB | [n = 99, m = 10000], OK, 396 operations |
13 | Correct | 0 ms | 384 KB | [n = 50, m = 10000], OK, 200 operations |
14 | Correct | 1 ms | 384 KB | [n = 50, m = 10000], OK, 200 operations |
15 | Correct | 0 ms | 384 KB | [n = 50, m = 10000], OK: No solution |
16 | Correct | 1 ms | 384 KB | [n = 50, m = 10000], OK, 200 operations |
17 | Correct | 1 ms | 384 KB | [n = 50, m = 10000], OK, 200 operations |
18 | Correct | 5 ms | 384 KB | [n = 1000, m = 10000], OK, 4000 operations |
19 | Correct | 5 ms | 384 KB | [n = 999, m = 10000], OK, 3996 operations |
20 | Correct | 5 ms | 384 KB | [n = 998, m = 10000], OK, 3992 operations |
21 | Correct | 5 ms | 384 KB | [n = 997, m = 10000], OK, 3988 operations |
22 | Correct | 5 ms | 384 KB | [n = 1000, m = 10000], OK, 4000 operations |
23 | Correct | 5 ms | 384 KB | [n = 1000, m = 10000], OK, 4000 operations |
24 | Correct | 5 ms | 384 KB | [n = 1000, m = 10000], OK: No solution |
25 | Correct | 5 ms | 384 KB | [n = 1000, m = 10000], OK, 4000 operations |
26 | Correct | 5 ms | 384 KB | [n = 1000, m = 10000], OK, 4000 operations |
27 | Correct | 17 ms | 512 KB | [n = 2000, m = 10000], OK, 8000 operations |
28 | Correct | 18 ms | 384 KB | [n = 1999, m = 10000], OK, 7996 operations |
29 | Correct | 19 ms | 512 KB | [n = 1998, m = 10000], OK, 7992 operations |
30 | Correct | 18 ms | 384 KB | [n = 1997, m = 10000], OK, 7988 operations |
31 | Correct | 18 ms | 384 KB | [n = 2000, m = 10000], OK, 8000 operations |
32 | Correct | 18 ms | 384 KB | [n = 2000, m = 10000], OK, 8000 operations |
33 | Correct | 16 ms | 384 KB | [n = 2000, m = 10000], OK: No solution |
34 | Correct | 17 ms | 384 KB | [n = 2000, m = 10000], OK, 8000 operations |
35 | Correct | 17 ms | 384 KB | [n = 2000, m = 10000], OK, 8000 operations |
36 | Correct | 18 ms | 384 KB | [n = 2000, m = 8100], OK, 8000 operations |
37 | Correct | 17 ms | 384 KB | [n = 1999, m = 8100], OK, 7996 operations |
38 | Correct | 17 ms | 384 KB | [n = 1998, m = 8100], OK, 7992 operations |
39 | Correct | 17 ms | 512 KB | [n = 1997, m = 8100], OK, 7988 operations |
40 | Correct | 17 ms | 384 KB | [n = 1996, m = 8100], OK, 7984 operations |
41 | Correct | 18 ms | 384 KB | [n = 2000, m = 8100], OK, 8000 operations |
42 | Correct | 18 ms | 512 KB | [n = 2000, m = 8100], OK, 8000 operations |
43 | Correct | 17 ms | 384 KB | [n = 2000, m = 8100], OK: No solution |
44 | Correct | 17 ms | 504 KB | [n = 2000, m = 8100], OK, 8000 operations |
45 | Correct | 18 ms | 512 KB | [n = 2000, m = 8100], OK, 8000 operations |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 384 KB | [n = 1, m = 10000], OK, 4 operations |
2 | Correct | 0 ms | 384 KB | [n = 2, m = 10000], OK, 8 operations |
3 | Correct | 1 ms | 384 KB | [n = 8, m = 10000], OK, 32 operations |
4 | Correct | 1 ms | 384 KB | [n = 8, m = 10000], OK, 32 operations |
5 | Correct | 1 ms | 384 KB | [n = 8, m = 10000], OK, 32 operations |
6 | Correct | 1 ms | 384 KB | [n = 8, m = 10000], OK: No solution |
7 | Correct | 0 ms | 384 KB | [n = 8, m = 10000], OK, 32 operations |
8 | Correct | 1 ms | 384 KB | [n = 8, m = 10000], OK, 32 operations |
9 | Correct | 1 ms | 384 KB | [n = 49, m = 10000], OK, 196 operations |
10 | Correct | 1 ms | 384 KB | [n = 50, m = 10000], OK, 200 operations |
11 | Correct | 1 ms | 384 KB | [n = 100, m = 10000], OK, 400 operations |
12 | Correct | 1 ms | 384 KB | [n = 99, m = 10000], OK, 396 operations |
13 | Correct | 0 ms | 384 KB | [n = 50, m = 10000], OK, 200 operations |
14 | Correct | 1 ms | 384 KB | [n = 50, m = 10000], OK, 200 operations |
15 | Correct | 0 ms | 384 KB | [n = 50, m = 10000], OK: No solution |
16 | Correct | 1 ms | 384 KB | [n = 50, m = 10000], OK, 200 operations |
17 | Correct | 1 ms | 384 KB | [n = 50, m = 10000], OK, 200 operations |
18 | Correct | 5 ms | 384 KB | [n = 1000, m = 10000], OK, 4000 operations |
19 | Correct | 5 ms | 384 KB | [n = 999, m = 10000], OK, 3996 operations |
20 | Correct | 5 ms | 384 KB | [n = 998, m = 10000], OK, 3992 operations |
21 | Correct | 5 ms | 384 KB | [n = 997, m = 10000], OK, 3988 operations |
22 | Correct | 5 ms | 384 KB | [n = 1000, m = 10000], OK, 4000 operations |
23 | Correct | 5 ms | 384 KB | [n = 1000, m = 10000], OK, 4000 operations |
24 | Correct | 5 ms | 384 KB | [n = 1000, m = 10000], OK: No solution |
25 | Correct | 5 ms | 384 KB | [n = 1000, m = 10000], OK, 4000 operations |
26 | Correct | 5 ms | 384 KB | [n = 1000, m = 10000], OK, 4000 operations |
27 | Correct | 17 ms | 512 KB | [n = 2000, m = 10000], OK, 8000 operations |
28 | Correct | 18 ms | 384 KB | [n = 1999, m = 10000], OK, 7996 operations |
29 | Correct | 19 ms | 512 KB | [n = 1998, m = 10000], OK, 7992 operations |
30 | Correct | 18 ms | 384 KB | [n = 1997, m = 10000], OK, 7988 operations |
31 | Correct | 18 ms | 384 KB | [n = 2000, m = 10000], OK, 8000 operations |
32 | Correct | 18 ms | 384 KB | [n = 2000, m = 10000], OK, 8000 operations |
33 | Correct | 16 ms | 384 KB | [n = 2000, m = 10000], OK: No solution |
34 | Correct | 17 ms | 384 KB | [n = 2000, m = 10000], OK, 8000 operations |
35 | Correct | 17 ms | 384 KB | [n = 2000, m = 10000], OK, 8000 operations |
36 | Correct | 18 ms | 384 KB | [n = 2000, m = 8100], OK, 8000 operations |
37 | Correct | 17 ms | 384 KB | [n = 1999, m = 8100], OK, 7996 operations |
38 | Correct | 17 ms | 384 KB | [n = 1998, m = 8100], OK, 7992 operations |
39 | Correct | 17 ms | 512 KB | [n = 1997, m = 8100], OK, 7988 operations |
40 | Correct | 17 ms | 384 KB | [n = 1996, m = 8100], OK, 7984 operations |
41 | Correct | 18 ms | 384 KB | [n = 2000, m = 8100], OK, 8000 operations |
42 | Correct | 18 ms | 512 KB | [n = 2000, m = 8100], OK, 8000 operations |
43 | Correct | 17 ms | 384 KB | [n = 2000, m = 8100], OK: No solution |
44 | Correct | 17 ms | 504 KB | [n = 2000, m = 8100], OK, 8000 operations |
45 | Correct | 18 ms | 512 KB | [n = 2000, m = 8100], OK, 8000 operations |
46 | Incorrect | 17 ms | 512 KB | Integer 8000 violates the range [-1, 6100] |
47 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 384 KB | [n = 1, m = 10000], OK, 4 operations |
2 | Correct | 0 ms | 384 KB | [n = 2, m = 10000], OK, 8 operations |
3 | Correct | 1 ms | 384 KB | [n = 8, m = 10000], OK, 32 operations |
4 | Correct | 1 ms | 384 KB | [n = 8, m = 10000], OK, 32 operations |
5 | Correct | 1 ms | 384 KB | [n = 8, m = 10000], OK, 32 operations |
6 | Correct | 1 ms | 384 KB | [n = 8, m = 10000], OK: No solution |
7 | Correct | 0 ms | 384 KB | [n = 8, m = 10000], OK, 32 operations |
8 | Correct | 1 ms | 384 KB | [n = 8, m = 10000], OK, 32 operations |
9 | Correct | 1 ms | 384 KB | [n = 49, m = 10000], OK, 196 operations |
10 | Correct | 1 ms | 384 KB | [n = 50, m = 10000], OK, 200 operations |
11 | Correct | 1 ms | 384 KB | [n = 100, m = 10000], OK, 400 operations |
12 | Correct | 1 ms | 384 KB | [n = 99, m = 10000], OK, 396 operations |
13 | Correct | 0 ms | 384 KB | [n = 50, m = 10000], OK, 200 operations |
14 | Correct | 1 ms | 384 KB | [n = 50, m = 10000], OK, 200 operations |
15 | Correct | 0 ms | 384 KB | [n = 50, m = 10000], OK: No solution |
16 | Correct | 1 ms | 384 KB | [n = 50, m = 10000], OK, 200 operations |
17 | Correct | 1 ms | 384 KB | [n = 50, m = 10000], OK, 200 operations |
18 | Correct | 5 ms | 384 KB | [n = 1000, m = 10000], OK, 4000 operations |
19 | Correct | 5 ms | 384 KB | [n = 999, m = 10000], OK, 3996 operations |
20 | Correct | 5 ms | 384 KB | [n = 998, m = 10000], OK, 3992 operations |
21 | Correct | 5 ms | 384 KB | [n = 997, m = 10000], OK, 3988 operations |
22 | Correct | 5 ms | 384 KB | [n = 1000, m = 10000], OK, 4000 operations |
23 | Correct | 5 ms | 384 KB | [n = 1000, m = 10000], OK, 4000 operations |
24 | Correct | 5 ms | 384 KB | [n = 1000, m = 10000], OK: No solution |
25 | Correct | 5 ms | 384 KB | [n = 1000, m = 10000], OK, 4000 operations |
26 | Correct | 5 ms | 384 KB | [n = 1000, m = 10000], OK, 4000 operations |
27 | Correct | 17 ms | 512 KB | [n = 2000, m = 10000], OK, 8000 operations |
28 | Correct | 18 ms | 384 KB | [n = 1999, m = 10000], OK, 7996 operations |
29 | Correct | 19 ms | 512 KB | [n = 1998, m = 10000], OK, 7992 operations |
30 | Correct | 18 ms | 384 KB | [n = 1997, m = 10000], OK, 7988 operations |
31 | Correct | 18 ms | 384 KB | [n = 2000, m = 10000], OK, 8000 operations |
32 | Correct | 18 ms | 384 KB | [n = 2000, m = 10000], OK, 8000 operations |
33 | Correct | 16 ms | 384 KB | [n = 2000, m = 10000], OK: No solution |
34 | Correct | 17 ms | 384 KB | [n = 2000, m = 10000], OK, 8000 operations |
35 | Correct | 17 ms | 384 KB | [n = 2000, m = 10000], OK, 8000 operations |
36 | Correct | 18 ms | 384 KB | [n = 2000, m = 8100], OK, 8000 operations |
37 | Correct | 17 ms | 384 KB | [n = 1999, m = 8100], OK, 7996 operations |
38 | Correct | 17 ms | 384 KB | [n = 1998, m = 8100], OK, 7992 operations |
39 | Correct | 17 ms | 512 KB | [n = 1997, m = 8100], OK, 7988 operations |
40 | Correct | 17 ms | 384 KB | [n = 1996, m = 8100], OK, 7984 operations |
41 | Correct | 18 ms | 384 KB | [n = 2000, m = 8100], OK, 8000 operations |
42 | Correct | 18 ms | 512 KB | [n = 2000, m = 8100], OK, 8000 operations |
43 | Correct | 17 ms | 384 KB | [n = 2000, m = 8100], OK: No solution |
44 | Correct | 17 ms | 504 KB | [n = 2000, m = 8100], OK, 8000 operations |
45 | Correct | 18 ms | 512 KB | [n = 2000, m = 8100], OK, 8000 operations |
46 | Incorrect | 17 ms | 512 KB | Integer 8000 violates the range [-1, 6100] |
47 | Halted | 0 ms | 0 KB | - |