結果

問題 No.1544 [Cherry 2nd Tune C] Synchroscope
ユーザー outlineoutline
提出日時 2021-06-11 21:30:01
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,787 bytes
コンパイル時間 1,367 ms
コンパイル使用メモリ 141,132 KB
実行使用メモリ 302,228 KB
最終ジャッジ日時 2023-08-21 11:36:12
合計ジャッジ時間 10,693 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 125 ms
151,824 KB
testcase_04 AC 123 ms
171,472 KB
testcase_05 AC 139 ms
171,956 KB
testcase_06 AC 152 ms
208,596 KB
testcase_07 AC 96 ms
130,224 KB
testcase_08 AC 115 ms
149,252 KB
testcase_09 AC 132 ms
158,988 KB
testcase_10 AC 152 ms
212,188 KB
testcase_11 AC 67 ms
85,312 KB
testcase_12 AC 58 ms
78,352 KB
testcase_13 AC 51 ms
65,168 KB
testcase_14 AC 167 ms
174,700 KB
testcase_15 AC 183 ms
252,144 KB
testcase_16 AC 64 ms
76,252 KB
testcase_17 AC 41 ms
58,044 KB
testcase_18 AC 17 ms
20,036 KB
testcase_19 AC 18 ms
20,780 KB
testcase_20 AC 147 ms
223,632 KB
testcase_21 AC 56 ms
63,048 KB
testcase_22 AC 30 ms
45,960 KB
testcase_23 AC 266 ms
261,728 KB
testcase_24 AC 241 ms
262,568 KB
testcase_25 AC 246 ms
263,112 KB
testcase_26 AC 242 ms
262,508 KB
testcase_27 AC 244 ms
263,484 KB
testcase_28 AC 243 ms
262,216 KB
testcase_29 AC 243 ms
263,928 KB
testcase_30 AC 243 ms
262,296 KB
testcase_31 AC 244 ms
262,568 KB
testcase_32 AC 249 ms
261,952 KB
testcase_33 AC 260 ms
262,380 KB
testcase_34 AC 1 ms
4,380 KB
testcase_35 AC 2 ms
4,376 KB
testcase_36 WA -
testcase_37 AC 132 ms
164,704 KB
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <deque>
#include <array>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
#include <limits>
#include <iterator>
#include <functional>
#include <sstream>
#include <fstream>
#include <complex>
#include <cstring>
#include <unordered_map>
#include <unordered_set>
using namespace std;

#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native")
#pragma GCC target("avx512f,avx512dq,avx512cd,avx512bw,avx512vl")

using ll = long long;
constexpr int INF = 1001001001;
// constexpr int mod = 1000000007;
constexpr int mod = 998244353;

template<class T>
inline bool chmax(T& x, T y){
    if(x < y){
        x = y;
        return true;
    }
    return false;
}
template<class T>
inline bool chmin(T& x, T y){
    if(x > y){
        x = y;
        return true;
    }
    return false;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int n, m;
    cin >> n >> m;
    vector<int> a(n), b(m);
    for(int i = 0; i < n; ++i)  cin >> a[i];
    for(int i = 0; i < m; ++i)  cin >> b[i];

    for(int j = 0; j < n; ++j){
        for(int i = 0; i < n; ++i){
            a.emplace_back(a[i]);
        }
    }
    n = a.size();
    for(int j = 0; j < m; ++j){
        for(int i = 0; i < m; ++i){
            b.emplace_back(b[i]);
        }
    }
    m = b.size();

    for(int i = 0; i < min(n, m); ++i){
        if(a[i] == b[i]){
            cout << i + 1 << endl;
            return 0;
        }
    }

    cout << -1 << endl;

    return 0;
}
0