結果
| 問題 | 
                            No.3109 Swap members
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2025-04-21 21:30:16 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 453 bytes | 
| コンパイル時間 | 2,074 ms | 
| コンパイル使用メモリ | 193,264 KB | 
| 実行使用メモリ | 10,624 KB | 
| 最終ジャッジ日時 | 2025-04-21 21:30:21 | 
| 合計ジャッジ時間 | 5,489 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 38 WA * 14 | 
コンパイルメッセージ
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%d",&n,&k);
      |         ~~~~~^~~~~~~~~~~~~~
main.cpp:12:32: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   12 |         for(i=1;i<=n;i++) scanf("%s",s[i]);
      |                           ~~~~~^~~~~~~~~~~
main.cpp:13:32: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   13 |         for(i=1;i<=n;i++) scanf("%s",t[i]);
      |                           ~~~~~^~~~~~~~~~~
            
            ソースコード
#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]);
	for(i=1;i<=n;i++) scanf("%s",t[i]);
	ok=1;
	for(i=1;i<=n;i++)
	{
		if(i-k<1&&i+k>n)
		{
			if(strcmp(s[i],t[i])!=0) ok=0;
		}
	}
	if(ok) puts("Yes");
	else puts("No");
	return 0;
}