| Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 317436 | gyszzmz25 | 守序数 T4 | C++ | 运行超时 | 1000 MS | 704 KB | 588 | 2026-04-18 18:36:27 |
#include<bits/stdc++.h> using namespace std; bool sxs(long long x){ int last = x % 10; x /= 10; while(x > 0){ int last1 = x % 10; if(abs(last - last1) > 1){ return 0; } last = last1; x /= 10; } return 1; } int main(){ int n; cin >> n; long long cnn = 0, i = 0; while(cnn < n){ if(i < 12){ cnn++; i++; continue; } if(i % 100 == 0){ i++; if(sxs(i)){ cnn++; } continue; } i += 8; for(int j = 1; j <= 3; j++){ i++; if(sxs(i)) cnn++; if(cnn == n) break; } } cout << i; return 0; }