QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#446237#8771. Dihedral GroupandoWA 2ms3832kbC++20713b2024-06-17 02:39:412024-06-17 02:39:41

Judging History

This is the latest submission verdict.

  • [2024-06-17 02:39:41]
  • Judged
  • Verdict: WA
  • Time: 2ms
  • Memory: 3832kb
  • [2024-06-17 02:39:41]
  • Submitted

answer

#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
#include "algo/debug.h"
#else
#define debug(...) 42
#endif
typedef long long ll;
typedef unsigned long long ull;
const int N = 1e5 + 10, INF = 1e9;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int n, m; cin >> n >> m;
    string s, t;
    for (int i = 0; i < n; i++) {
        char c; cin >> c; s += c;
    }
    for (int i = 0; i < m; i++) {
        char c; cin >> c; t += c;
    }
    string p = s + s;
    reverse(s.begin(), s.end());
    string q = s + s;
    if (p.find(t) != string::npos || q.find(t) != string::npos) cout << 1;
    else cout << 0;
    return 0;
}


详细

Test #1:

score: 100
Accepted
time: 0ms
memory: 3832kb

input:

3 3
1 2 3
1 3 2

output:

1

result:

ok single line: '1'

Test #2:

score: 0
Accepted
time: 1ms
memory: 3544kb

input:

3 1
1 2 3
1

output:

1

result:

ok single line: '1'

Test #3:

score: 0
Accepted
time: 0ms
memory: 3604kb

input:

4 2
1 2 3 4
1 3

output:

0

result:

ok single line: '0'

Test #4:

score: 0
Accepted
time: 0ms
memory: 3832kb

input:

4 4
1 2 3 4
2 3 4 1

output:

1

result:

ok single line: '1'

Test #5:

score: 0
Accepted
time: 0ms
memory: 3812kb

input:

4 4
1 2 3 4
3 2 1 4

output:

1

result:

ok single line: '1'

Test #6:

score: 0
Accepted
time: 1ms
memory: 3592kb

input:

5 3
1 3 5 4 2
2 1 3

output:

1

result:

ok single line: '1'

Test #7:

score: 0
Accepted
time: 1ms
memory: 3592kb

input:

5 4
1 3 5 4 2
2 1 5 3

output:

0

result:

ok single line: '0'

Test #8:

score: 0
Accepted
time: 0ms
memory: 3528kb

input:

1 1
1
1

output:

1

result:

ok single line: '1'

Test #9:

score: -100
Wrong Answer
time: 2ms
memory: 3652kb

input:

50000 50000
22577 42400 21546 3302 14673 38530 22117 34658 9767 8284 18979 21312 30964 13861 9502 17302 9772 23092 18502 26861 33431 46434 42862 33662 16736 26383 42119 18487 6112 34272 40503 9340 36859 22828 35809 1442 37730 28378 12422 12305 26736 32865 691 29405 7395 24658 20995 40821 23979 15723...

output:

0

result:

wrong answer 1st lines differ - expected: '1', found: '0'