| Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|
| 316911 | gyszzmz25 | 守序数 T4 | C++ | Time Limit Exceeded | 1000 MS | 696 KB | 528 | 2026-04-17 17:33:04 |
#include<bits/stdc++.h> using namespace std; bool sxs(int x){ if(x <= 12) return 1; int a[10] = {0}, cnt = 0; bool flag = 0; for(int i = x, j = 1; i > 0; i /= 10, j++){ a[j] = i % 10; cnt++; } for(int i = 1; i <= cnt; i++){ if(i == 1) continue; if(abs(a[i] - a[i-1]) <= 1) flag = 1; else{ flag = 0; break; } } if(flag) return 1; else return 0; } int main(){ int n; cin >> n; int cnn = 0, i = 0; while(cnn != n){ i++; if(sxs(i)) cnn++; } cout << i; return 0; }