結果

問題 No.1377 Half xor Half
コンテスト
ユーザー SSRS
提出日時 2021-02-05 22:08:29
言語 C++14
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++14 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 478 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 915 ms
コンパイル使用メモリ 179,556 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2026-03-23 20:30:37
合計ジャッジ時間 7,590 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 1 RE * 1
other WA * 41 RE * 5
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
int main(){
  int N;
  cin >> N;
  string S;
  cin >> S;
  string T;
  cin >> T;
  bool ok = true;
  for (int i = 0; i < N; i++){
    bool s = false, t = false;
    if (S[i] == '0' && S[N + i] == '0'){
      s = true;
    }
    if (T[i] == '0' && T[N + i] == '0'){
      t = true;
    }
    if (s ^ t){
      ok = false;
      assert(false);
      cout << -1 << endl;
      break;
    }
  }
  if (!ok){
    cout << -1 << endl;
  }
}
0