| Run ID | 作者 | 问题 | 语言 | 测评结果 | 时间 | 内存 | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 318120 | c689user52 | 守序数 T4 | C++ | 解答错误 | 8 MS | 2716 KB | 1078 | 2026-04-19 17:04:14 |
#include<bits/stdc++.h> using namespace std; #define ioss ios::sync_with_stdio(false),cin.tie(0),cout.tie(0); using ll = long long; using LL = __int128; using ull = unsigned long long; using pii = pair<int, int>; using pll = pair<ll, ll>; using pLL = pair<LL, LL>; using upll = pair<ull, ull>; #define fi first #define se second #define ls i<<1 #define rs i<<1|1 constexpr double eps = 1e-3; const int inf = 0x3f3f3f3f; const ll Inf = 0x3f3f3f3f3f3f3f3f; const int N = 1e6 + 10; const int M = 114514 + 10; const ll mod = 1000000007; const string shiroko; template<typename U, typename V>bool cmin(U &x,const V &y){return y<x?x=y,1:0;} template<typename U, typename V>bool cmax(U &x,const V &y){return y>x?x=y,1:0;} int n; int a[N], c; int main(){ cin>>n; queue<pii> q; for(int i=1;i<=9;i++){ q.push({i,i}); } while(c<=n){ pii t=q.front(); q.pop(); a[++c]=t.fi; pii u; for(int i=-1;i<=1;i++){ u.se=t.se+i; u.fi=t.fi*10+u.se; if(u.se>=0&&u.se<=9){ q.push(u); } } } sort(a+1, a+1+c); cout<<a[n]; }