結果
問題 |
No.2692 How Many Times Reached?
|
ユーザー |
|
提出日時 | 2025-03-21 10:15:42 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 576 bytes |
コンパイル時間 | 829 ms |
コンパイル使用メモリ | 72,040 KB |
実行使用メモリ | 7,324 KB |
最終ジャッジ日時 | 2025-03-21 10:15:45 |
合計ジャッジ時間 | 2,433 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 40 WA * 3 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:13:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 13 | scanf("%d",&n); | ~~~~~^~~~~~~~~
ソースコード
#include<iostream> #include<vector> #include<cassert> #define rep(i,n) for(i=0;i<(int)(n);i++) using namespace std; typedef long long ll; typedef unsigned long long ull; int n; int main(){ int i,j,na1=0,na2=0; scanf("%d",&n); vector<int> row(n),col(n); string str; rep(i,n){ cin>>str; rep(j,n)if(str[j]=='A'){ row[i]++; col[j]++; if(i==j)na1++; if(j==n-1-i)na2++; } } j=(na1==n-1)+(na2==n-1); rep(i,n)j+=(row[i]==n-1)+(col[i]==n-1); printf("%d\n",j); return 0; }