結果
| 問題 | No.601 Midpoint Erase | 
| コンテスト | |
| ユーザー |  merom686 | 
| 提出日時 | 2017-12-06 01:35:35 | 
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 81 ms / 2,000 ms | 
| コード長 | 474 bytes | 
| コンパイル時間 | 654 ms | 
| コンパイル使用メモリ | 74,308 KB | 
| 実行使用メモリ | 5,248 KB | 
| 最終ジャッジ日時 | 2024-12-23 03:29:21 | 
| 合計ジャッジ時間 | 2,159 ms | 
| ジャッジサーバーID (参考情報) | judge1 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 23 | 
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:24:20: warning: iteration 2 invokes undefined behavior [-Waggressive-loop-optimizations]
   24 |         s += p[0][i] / 2;
      |              ~~~~~~^
main.cpp:23:23: note: within this loop
   23 |     for (int i = 0; i < 4; i++) {
      |                     ~~^~~
            
            ソースコード
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cmath>
using namespace std;
int main() {
    int n;
    cin >> n;
    int p[2][2] = {};
    for (int i = 0; i < n; i++) {
        int x, y;
        cin >> x >> y;
        p[x % 2][y % 2]++;
    }
    int s = 0;
    for (int i = 0; i < 4; i++) {
        s += p[0][i] / 2;
    }
    cout << (s % 2 == 0 ? "Bob" : "Alice") << endl;
    return 0;
}
            
            
            
        