ããçµæ§å¥½ãï¼
åé¡æ¦è¦
ãããã æã®ã³ã¤ã³ã®å ¥ã£ã æã®è¢ã¨ã æã®ç¿ (åæç¶æ ã§ã¯ãã¹ã¦ç©º) ãããããããã使ã£ã¦ã²ã¼ã ããããå æã¨å¾æã交äºã«ä»¥ä¸ã®ããã«æãæã¤ã
- (ã³ã¤ã³ãå ¥ã£ãè¢ã 1 ã¤ä»¥ä¸åå¨ããã¨ã)ï¼ã³ã¤ã³ãå ¥ã£ãè¢ã¨ç¿ã 1 æãã¤é¸ã³ãé¸ãã è¢ã®ä¸ã«å ¥ã£ãå ¨ã¦ã®ã³ã¤ã³ãé¸ãã ç¿ã«ç§»ã(é¸ã¶ç¿ã«ã¯ã³ã¤ã³ãä¹ã£ã¦ãã¦ãããªãã¦ãæ§ããªã)
- (ã³ã¤ã³ãå ¥ã£ãè¢ãåå¨ããªãã¨ã)ï¼ã³ã¤ã³ãä¹ã£ãç¿ã 1 æé¸ã³ãé¸ãã ç¿ãã 1 æ以ä¸ã®ã³ã¤ã³ãåãé¤ã
å ã«æãæã¦ãªããªã£ã人ã®è² ãã§ããã2 人ãæé©ã«è¡åããã¨ãã«åã¤ã®ã¯ã©ã¡ãããå¤å®ãã (ã¨ãããã¹ãã±ã¼ã¹ã åä¸ãããã)ã
å¶ç´
- åãã¹ãã±ã¼ã¹ã® ã®åè¨å¤ã¯ ãè¶ ããªã
èãããã¨
ãã¹ãã±ã¼ã¹ãè¤æ°åãããã¨èªä½ã¯ãåã« Yes / No å¤å®åé¡ã®ã¸ã£ãã¸ã®ç²¾åº¦ãä¸ããããã£ã½ããè¦ã¯ ã ã§å¤å®ã§ããã° OKã
ã²ã¨ã¾ãããã®ã²ã¼ã ã¯æ¬¡ã®ããã«è¨ããã
- ãå¥æ°ã®ã¨ãï¼ç¿ç§»ããã§ã¼ãºã®æçµæãæã¤ã®ã¯å æã§ããããã£ã¦ãå æã«ã¨ã£ã¦ã¯æå¾ã®æå¾ã«ç¿ã®ææ°ã® XOR åã 0 ã«ã§ããã°åã¡ãã§ããªããã°è² ããã²ã¼ã ã§ãã
- ãå¶æ°ã®ã¨ãï¼ç¿ç§»ããã§ã¼ãºã®æçµæãæã¤ã®ã¯å¾æã§ããããã£ã¦ãå æã«ã¨ã£ã¦ã¯å¾æã®æå¾ã®ä¸æã®æç¹ã§ãå¾æãã©ã®ããã«æãæã£ã¦ãç¿ã®ææ°ã® XOR åã 0 ã«ãªããªãããã«ã§ããã°åã¡ãããã§ããªããã°è² ããã²ã¼ã ã§ãã
以ä¸ãè¸ã¾ãã¦èå¯ãã¦ã¿ããããã«ãã¦ãæãã®ã¯ããXOR åãã¨ãæ®éã®åãã¨ã®ç¸æ§ã¯ããªãæªãã®ã§ããããªãã«åç´ãªæ¦ç¥ãããããã¨ãããã¨ã ã£ãã
N ãå¥æ°ã®ã¨ã
å®ã¯å æã¯ããªããè² ãã¦ãã¾ãã£ã½ããã¨ãããã£ããå¾æã¯æ¬¡ã®ããã«ããã°ãããªãã XOR åã 0 ã«ãªããªãããã«ã§ããï¼
- æ®ã£ã¦ããè¢ã®ãã¡ãã³ã¤ã³ææ°ãæ大ã®ãã®ãé¸ã³
- åç¿ã®ãã¡ããã®æç¹ã§ã®ã³ã¤ã³ææ°ãæ大ã®ã¨ããã«åç®ãã
ãã®ããã«ããã¨ããå¾æã¯ããªããéåæ°ã®ã³ã¤ã³ã®ä¹ã£ãç¿ãä½ããã¨ãã§ããã
- å æã®æåã«é¸ãã ã³ã¤ã³ã®ææ°ã
- ãã®å¾ãå¾æãé¸ãã ã³ã¤ã³ã®ææ°ã®åè¨å¤ã
- æåã® 1 æ以å¤ã§ãå æãé¸ãã ã³ã¤ã³ã®ææ°ã®åè¨å¤ã
ã¨ããã¨ãã¾ã対称æ§ãã ãæç«ãããããã¦å¾æã®ä½ãæ大ç¿ã®ã³ã¤ã³ã®ææ°ã¯ ã¨ãªãã
ãæç«ãããããã«ã ã¯ãã³ã¤ã³ã®åè¨ææ° ã®éåæ°ãéæã§ãããããã¾ã§æ¥ãã°ãå¾æ㯠XOR åã 0 ã«ãªãã®ãããªããåé¿ã§ãããã¨ãããããå æã¯ã æã®ã³ã¤ã³ã®ä¹ã£ã¦ããç¿ä»¥å¤ã®ã³ã¤ã³ã®ææ°ã® XOR åã ã«ä¸è´ãããå¿ è¦ããããããã
(æ®ãã®ç¿ã®ã³ã¤ã³ã®ææ°ã®å) (æ®ãã®ç¿ã®ã³ã¤ã³ã®ææ°ã® XOR å]
ã¨ãªããã¨ãããå¾æã«éåæ°æ¦ç¥ãæ¡ããã¦ãã¾ã£ã¦ã¯ãXOR åã 0 ã«ãããã¨ã¯ã§ããªãã以ä¸ããã ãå¥æ°ã®ã¨ãã¯å æå¿ æã
N ãå¶æ°ã®ã¨ã
ä»åº¦ã¯éã«å æããç¿ç§»ããã§ã¼ãºã®æçµæãæã¦ããããå æã主å°æ¨©ãæ¡ããï¼ï¼ï¼
ããã¦å ã»ã©ã¨åæ§ã«ã»ã¨ãã©ã®å ´åã¯å æããéåæ°ã®ç¿ããä½ãããã«æããããããä¾å¤ããããããã¯
ã®ãããªå ´åã ãåææ°ã®è¢ãå¶æ°åãã¤ãããããªå ´åã¯ãã¡ãªã®ã ããã®å ´åã¯å¾æã¯æ¬¡ã®æ¦ç¥ã«ãã£ã¦ãããªãã XOR åã 0 ã«ãããã¨ãã§ãã¦ãã¾ãã
ãä¾å¤çã«å¾æãåã¦ã対称æ¦ç¥ã
- å æãã³ã¤ã³ææ° ã®è¢ãé¸ãã§ãã³ã¤ã³ææ° ã®ç¿ã«ä¹ã㦠æã«ãªãããã«ããç´å¾ã¯
- å¾æãã³ã¤ã³ææ° ã®è¢ãé¸ãã§ãå¥ã®ã³ã¤ã³ææ° ã®ç¿ (ãã®åå¨ã¯ä¿è¨¼ããã) ã«ä¹ã㦠æã«ãªãããã«ãã
ãã®ã±ã¼ã¹ã¯ã¾ããã¦ãå æå¿ æã ãã§ããè¢ã®åä¸ã³ã¤ã³ææ°ãå¶æ°åãã¤ã§ã¯ãªããããªå ´åã§ããã°å æããéåæ°æ¦ç¥ãã§åã¦ãããªããªã ããã³ã¤ã³ææ°ãå¤ãé ã« ã¨ããã¨ã
- å æã¯æå°ã§ã æ以ä¸ã®ã³ã¤ã³ã®ä¹ã£ãç¿ãä½ãã
- å¾æã¯æ大ã§ã æ以ä¸ã®ã³ã¤ã³ã®ä¹ã£ãç¿ããä½ããªã
ã¨ãããã¨ãè¨ããããã ããã£ã¦ãè¢ã®åä¸ã³ã¤ã³ææ°ãå¶æ°åãã¤ã§ã¯ãªããããªå ´åã§ã¯ãå æå¿ åã§ããï¼
ã¾ã¨ã
ã¾ã¨ããã¨
- ãå¥æ°ã®ã¨ãï¼å¾æå¿ å
- ãå¶æ°ã®ã¨ã
- ãã½ã¼ãããã¨ãã« 2 ã¤ãã¤å¤ãçããã¨ãï¼å¾æå¿ å
- ããã§ãªãã¨ãï¼å æå¿ å
è¨ç®é㯠ã
ã³ã¼ã
#include <bits/stdc++.h> using namespace std; bool solve() { int N; cin >> N; vector<long long> a(N); for (int i = 0; i < N; ++i) cin >> a[i]; sort(a.begin(), a.end()); if (N % 2 == 1) return false; bool exist = true; for (int i = 0; i < N; i += 2) { if (a[i] != a[i+1]) exist = false; } if (exist) return false; else return true; } int main() { int T; cin >> T; while (T--) { if (solve()) cout << "First" << endl; else cout << "Second" << endl; } }