結果

問題 No.2282 Boxed Nim
ユーザー 👑 p-adicp-adic
提出日時 2023-04-29 09:52:07
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 21 ms / 2,000 ms
コード長 975 bytes
コンパイル時間 911 ms
コンパイル使用メモリ 75,112 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-29 07:04:10
合計ジャッジ時間 1,879 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 2 ms
5,376 KB
testcase_03 AC 2 ms
5,376 KB
testcase_04 AC 2 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 2 ms
5,376 KB
testcase_07 AC 2 ms
5,376 KB
testcase_08 AC 2 ms
5,376 KB
testcase_09 AC 18 ms
5,376 KB
testcase_10 AC 18 ms
5,376 KB
testcase_11 AC 19 ms
5,376 KB
testcase_12 AC 19 ms
5,376 KB
testcase_13 AC 18 ms
5,376 KB
testcase_14 AC 6 ms
5,376 KB
testcase_15 AC 6 ms
5,376 KB
testcase_16 AC 6 ms
5,376 KB
testcase_17 AC 4 ms
5,376 KB
testcase_18 AC 6 ms
5,376 KB
testcase_19 AC 21 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma GCC optimize ( "O3" )
#pragma GCC optimize( "unroll-loops" )
#pragma GCC target ( "sse4.2,fma,avx2,popcnt,lzcnt,bmi2" )
#include <iostream>
#include <stdio.h>
#include <stdint.h>
#include <cassert>
using namespace std;

#define TYPE_OF( VAR ) remove_const<remove_reference<decltype( VAR )>::type >::type
#define UNTIE ios_base::sync_with_stdio( false ); cin.tie( nullptr )
#define GETLINE( A ) string A; getline( cin , A )
#define FOR( VAR , INITIAL , FINAL_PLUS_ONE ) for( TYPE_OF( FINAL_PLUS_ONE ) VAR = INITIAL ; VAR < FINAL_PLUS_ONE ; VAR ++ )
#define QUIT return 0
#define COUT( ANSWER ) cout << ( ANSWER ) << "\n"
#define RETURN( ANSWER ) COUT( ANSWER ); QUIT

int main()
{
  UNTIE;
  GETLINE( N_str );
  GETLINE( A_str );
  int size = A_str.size() - 1;
  string c = " 0";
  int count = A_str.substr( 0 , 1 ) == "0" ? 1 : 0;
  FOR( i , 1 , size ){
    A_str.substr( i , 2 ) == c ? ++count : count;
  }
  RETURN( ( ( count & 1 ) == 1 ) ? "First" : "Second" );
}
0