結果

問題 No.2282 Boxed Nim
ユーザー 👑 p-adic
提出日時 2023-04-29 09:54:13
言語 C++17(gcc12)
(gcc 12.3.0 + boost 1.87.0)
結果
AC  
実行時間 33 ms / 2,000 ms
コード長 958 bytes
コンパイル時間 2,618 ms
コンパイル使用メモリ 94,920 KB
最終ジャッジ日時 2025-02-12 15:54:59
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

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";
  bool first = A_str.substr( 0 , 1 ) == "0";
  FOR( i , 1 , size ){
    A_str.substr( i , 2 ) == c ? first = !first : first;
  }
  RETURN( first ? "First" : "Second" );
}
0