Forráskód Böngészése

路边骗局-----尼姆博弈(奇异状态:异或值为0)

爱玲姐姐 5 éve
szülő
commit
a7f36f7a92
1 módosított fájl, 17 hozzáadás és 0 törlés
  1. 17 0
      B.cpp

+ 17 - 0
B.cpp

@@ -0,0 +1,17 @@
+#include <bits/stdc++.h>
+using namespace std;
+int main(){
+    int n;
+    cin >> n;
+    int sum = 0;
+    int x;
+    for(int i = 1; i <= n; i++){
+        cin >> x;
+        sum ^= x;
+    }
+    if(sum){
+        cout << "Yes" << endl;
+    }else{
+        cout << "No" << endl;
+    }
+}