Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
89092 sh25_shengmy 七龙珠 C++ 通过 1 MS 256 KB 1137 2026-05-22 15:13:59

Tests(1/1):


#include <iostream> #include <string> #include <vector> #include <algorithm> using namespace std; bool containsDragonBall(const string &s, const string &target) { size_t pos = 0; bool found = false; while (true) { pos = s.find(target, pos); if (pos == string::npos) { break; } found = true; pos += target.length(); // Move past this occurrence to find next } return found; } int main() { int n; cin >> n; cin.ignore(); // Ignore the newline after reading n vector<string> targets = {"one", "two", "three", "four", "five", "six", "seven"}; for (int i = 0; i < n; ++i) { string s; getline(cin, s); bool allFound = true; for (const string &target : targets) { if (!containsDragonBall(s, target)) { allFound = false; break; } } if (allFound) { cout << "Yes" << endl; } else { cout << "No" << endl; } } return 0; }


测评信息: