結果
問題 |
No.486 3 Straight Win(3連勝)
|
ユーザー |
|
提出日時 | 2017-04-06 00:17:48 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 967 bytes |
コンパイル時間 | 160 ms |
コンパイル使用メモリ | 24,576 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-08 11:08:44 |
合計ジャッジ時間 | 923 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 25 WA * 3 |
ソースコード
#include <stdio.h> #include <stdlib.h> #include <string.h> #define READ_BUFSIZE ( 128 ) #define READ_DELIMITER ( " " ) //標準入力取得(1行) int GetStdin( char* pszStr, int lMaxLen ) { int lLen = 0; memset( pszStr, 0, lMaxLen ); if( fgets( pszStr, lMaxLen, stdin ) ) { lLen = strlen( pszStr ); if( lLen >= 1 ) { if( pszStr[ lLen - 1 ] == 0x0A ) { pszStr[ lLen - 1 ] = 0; lLen--; } } } return( lLen ); } int main(int argc, char *argv[]) { char szRead[READ_BUFSIZE] = ""; //char* psOutbuf[10000] = { 0 }; //int lInput[10] = {0}; int lLen = GetStdin( szRead, READ_BUFSIZE ); char* pEast = strstr( szRead, "OOO" ); char* pWast = strstr( szRead, "XXX" ); if( pEast == 0 ) { if( pWast == 0 ) printf( "NA" ); else printf( "West" ); } else { if( pWast == 0 ) printf( "East" ); if( pEast > pWast ) printf( "West" ); else printf( "East" ); } return 0; }