結果
問題 |
No.402 最も海から遠い場所
|
ユーザー |
![]() |
提出日時 | 2016-07-22 00:28:32 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 672 bytes |
コンパイル時間 | 1,866 ms |
コンパイル使用メモリ | 56,072 KB |
実行使用メモリ | 14,720 KB |
最終ジャッジ日時 | 2024-11-06 12:19:32 |
合計ジャッジ時間 | 4,064 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 19 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:26:52: warning: format ‘%d’ expects argument of type ‘int’, but argument 4 has type ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wformat=] 26 | fprintf(stderr,"%dth size:%d!=W:%d.\n",i,S[i].size(),W); | ~^ ~~~~~~~~~~~ | | | | int std::__cxx11::basic_string<char>::size_type {aka long unsigned int} | %ld main.cpp:14:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 14 | scanf("%d %d",&H,&W); | ~~~~~^~~~~~~~~~~~~~~
ソースコード
#include <stdio.h> #include <iostream> #include <string> using namespace std; #define range(i,a,b) for(int i=(a); i < (b); i++) #define rep(i,n) range(i,0,n) string S[3000]; int HD[3002][3002],VD[3002][3002]; int main(){ int H,W,ans = 0; scanf("%d %d",&H,&W); if ((H < 1)||(H > 3000)){ fprintf(stderr,"H is bad!\n"); return -1; } if ((W < 1)||(W > 3000)){ fprintf(stderr,"W is bad!\n"); return -1; } rep(i,H){ cin >> S[i]; if (S[i].size() != W){ fprintf(stderr,"%dth size:%d!=W:%d.\n",i,S[i].size(),W); } rep(j,W){ if ((S[i][j] != '#') && (S[i][j] != '.')){ fprintf(stderr,"(%d,%d):%c is wrong.\n",i,j,S[i][j]); } } } return 0; }