1 条题解

  • 0
    @ 2025-2-27 21:46:39
    #include <iostream>
    using namespace std;
    
    const int MAX_N = 200 + 10;
    const int MAX_M = 200 + 10;
    int table[5][5] = {
      0, -1, 1, 1 ,-1,
    1 ,0 ,-1 ,1 ,-1,
    -1, 1, 0 ,-1 ,1,
    -1, -1, 1 ,0 ,1,
    1 ,1 ,-1, -1 ,0
    };
    
    int main() {
        int n, na, nb;
        cin >> n >> na >> nb;
    
        int a[MAX_N], b[MAX_N];
        for (int i = 0; i < na; i++) {
            cin >> a[i];
        }
        for (int i = 0; i < nb; i++) {
            cin >> b[i];
        }
    
    
        int scoreA = 0, scoreB = 0;
        for (int i = 0; i < n; i++) {
            int gestureA = a[i % na];
            int gestureB = b[i % nb];
            int result = table[gestureA][gestureB];
            if (result == 1) {
                scoreA++;
            } else if (result == -1) {
                scoreB++;
            }
        }
    
        cout << scoreA << " " << scoreB << endl;
        return 0;
    }
    
    • 1

    [NOIP 2014 提高组] 生活大爆炸版石头剪刀布

    信息

    ID
    5386
    时间
    1000ms
    内存
    125MiB
    难度
    2
    标签
    递交数
    82
    已通过
    63
    上传者