結果

問題 No.3109 Swap members
コンテスト
ユーザー tokitsukaze
提出日時 2025-04-21 21:23:53
言語 C++17
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 489 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,048 ms
コンパイル使用メモリ 209,392 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2026-07-10 03:42:38
合計ジャッジ時間 6,028 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24 WA * 28
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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