結果

問題 No.547 未知の言語
ユーザー myanta
提出日時 2017-07-28 22:25:17
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 478 bytes
コンパイル時間 1,261 ms
コンパイル使用メモリ 39,936 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-26 02:10:54
合計ジャッジ時間 1,200 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:22:30: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   22 |                         scanf("%s", &s[i][0]);
      |                         ~~~~~^~~~~~~~~~~~~~~~
main.cpp:27:30: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   27 |                         scanf("%s", &t[i][0]);
      |                         ~~~~~^~~~~~~~~~~~~~~~

ソースコード

diff #

#include<cstdio>
#include<vector>


using namespace std;

using vc=vector<char>;
using vvc=vector<vc>;


int main(void)
{
	int n;

	while(scanf("%d", &n)==1)
	{
		vvc s(n), t(n);

		for(int i=0;i<n;i++)
		{
			s[i].resize(20+1);
			scanf("%s", &s[i][0]);
		}
		for(int i=0;i<n;i++)
		{
			t[i].resize(20+1);
			scanf("%s", &t[i][0]);
		}
		for(int i=0;i<n;i++)
		{
			if(s[i]!=t[i])
			{
				printf("%d\n%s\n%s\n", i+1, &s[i][0], &t[i][0]);
				break;
			}
		}
	}

	return 0;
}
0