Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
80825 刘泽熙 18第一次出现与最后一次出现的位置 C++ Output Limit Exceeded 0 MS 280 KB 280 2024-07-11 16:31:15

Tests(0/10):


Code:

#include <bits/stdc++.h> using namespace std; int main() { int k, end, first; cin >> k; for (int i = 1; i <= k; i++) { if (first == 0) { first = i; end = i; } if (first == 0) { cout << -1; } else { cout << first << " " << end; } } }