QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#446236#8771. Dihedral GroupandoWA 1ms3612kbC++20713b2024-06-17 02:38:562024-06-17 02:38:56

Judging History

This is the latest submission verdict.

  • [2024-06-17 02:38:56]
  • Judged
  • Verdict: WA
  • Time: 1ms
  • Memory: 3612kb
  • [2024-06-17 02:38:56]
  • 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 < n; 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: 3596kb

input:

3 3
1 2 3
1 3 2

output:

1

result:

ok single line: '1'

Test #2:

score: -100
Wrong Answer
time: 1ms
memory: 3612kb

input:

3 1
1 2 3
1

output:

0

result:

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