結果

問題 No.3125 Make It Symmetry
ユーザー tokitsukaze
提出日時 2025-04-28 18:31:10
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 398 bytes
コンパイル時間 2,138 ms
コンパイル使用メモリ 190,908 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2025-04-28 18:31:15
合計ジャッジ時間 3,759 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 36
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:11:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   11 |         scanf("%d",&n);
      |         ~~~~~^~~~~~~~~
main.cpp:15:22: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   15 |                 scanf("%s",s);
      |                 ~~~~~^~~~~~~~

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF=0x3f3f3f3f;
const ll LLINF=0x3f3f3f3f3f3f3f3fLL;
const int MAX=505+10;
char s[MAX];
int main()
{
	int n,i,j,cnt;
	scanf("%d",&n);
	cnt=0;
	for(i=0;i<n;i++)
	{
		scanf("%s",s);
		for(j=0;j<n;j++) cnt+=(s[j]=='#');
	}
	cnt&=1;
	if(cnt==0) puts("Yes");
	else
	{
		if(n&1) puts("Yes");
		else puts("No");
	}
	return 0;
}
0