| Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 75330 | sh25_wangtaojie | 基因相关性 | C++ | 通过 | 0 MS | 248 KB | 564 | 2025-12-05 15:46:27 |
#include <iostream> #include <string> using namespace std; int main() { double threshold; string dna1, dna2; cin >> threshold >> dna1 >> dna2; int length = dna1.length(); int matches = 0; for (int i = 0; i < length; i++) { if (dna1[i] == dna2[i]) { matches++; } } double similarity = static_cast<double>(matches) / length; if (similarity >= threshold) { cout << "yes" << endl; } else { cout << "no" << endl; } return 0; }