Run ID 作者 问题 语言 测评结果 时间 内存 代码长度 提交时间
84046 sh25_shenpy 七龙珠 C++ 通过 1 MS 248 KB 1139 2026-02-06 19:51:02

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; }


测评信息: