| Run ID | 作者 | 问题 | 语言 | 测评结果 | Time | Memory | 代码长度 | 提交时间 |
|---|---|---|---|---|---|---|---|---|
| 138528 | hjx4333333 | 美丽数 | C++ | Time Limit Exceeded | 1000 MS | 572 KB | 669 | 2025-11-26 18:23:46 |
#include <bits/stdc++.h> using namespace std; int main() { long int i,j,k,n,s,temp; while (cin>>n) { i=3; j=5; s=2; vector <int> a(n+1); a[1]=3; a[2]=5; if (n>2) { i=i+3; j=j+5; k=3; while (s!=n) { temp=0; while (i<=j) { if (i<=j and i!=a[k-1]) { s++; a[k++]=i; } if (s==n) { temp=1; break; } i=i+3; } if (temp==0) { s++; if (j%3!=0 or j%5!=0) a[k++]=j; else a[k++]=i; } j=j+5; } } cout<<a[n]<<endl; } }