結果
| 問題 |
No.547 未知の言語
|
| コンテスト | |
| ユーザー |
kichirb3
|
| 提出日時 | 2018-02-26 19:59:22 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 1,051 bytes |
| コンパイル時間 | 777 ms |
| コンパイル使用メモリ | 77,440 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-26 03:01:52 |
| 合計ジャッジ時間 | 1,790 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 33 |
コンパイルメッセージ
main.cpp: In function 'std::tuple<int, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > solve(std::vector<std::__cxx11::basic_string<char> >&, std::vector<std::__cxx11::basic_string<char> >&)':
main.cpp:48:1: warning: control reaches end of non-void function [-Wreturn-type]
48 | }
| ^
ソースコード
// No.547 未知の言語
// https://yukicoder.me/problems/no/547
//
#include <iostream>
#include <vector>
#include <tuple>
using namespace std;
tuple<int, string, string> solve(vector<string>& wordsS, vector<string>& wordsT);
int main() {
int N;
cin >> N;
vector<string> wordsS;
vector<string> wordsT;
string tmp;
for (auto i = 0; i < N; i++) {
cin >> tmp;
wordsS.push_back(tmp);
}
for (auto i = 0; i < N; i++) {
cin >> tmp;
wordsT.push_back(tmp);
}
tuple<int, string, string> ans = solve(wordsS, wordsT);
#if 0
cout << get<0>(ans) << endl;
cout << get<1>(ans) << endl;
cout << get<2>(ans) << endl;
#else
int a;
string s, t;
tie(a, s, t) = ans;
cout << a << endl << s << endl << t << endl;
#endif
}
tuple<int, string, string> solve(vector<string>& wordsS, vector<string> &wordsT) {
for (auto i = 0; i < wordsS.size(); i++) {
if (wordsS[i] != wordsT[i]) {
return make_tuple(i+1, wordsS[i], wordsT[i]);
}
}
}
kichirb3