Submission #48546733
Source Code Expand
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
const ll MOD=998244353;
// head
const int N=15;
int a[N];
vector<int> V;
void dfs(int step,int now,int dir)
{
if(step==3){
V.pb(now);
return ;
}
for(int j=dir;j<=12;j++){
dfs(step+1,now+a[j],j);
}
}
signed main()
{
cin.tie(nullptr);
ios::sync_with_stdio(false);
for(int i=1;i<=12;i++) a[i]=a[i-1]*10+1;
dfs(0,0,1);
sort(V.begin(),V.end());
int n;cin>>n;
cout<<V[n-1]<<endl;
}
Submission Info
| Submission Time | |
|---|---|
| Task | C - Repunit Trio |
| User | gangbengr |
| Language | C++ 20 (gcc 12.2) |
| Score | 300 |
| Code Size | 724 Byte |
| Status | AC |
| Exec Time | 1 ms |
| Memory | 3572 KiB |
Judge Result
| Set Name | Sample | All | ||||
|---|---|---|---|---|---|---|
| Score / Max Score | 0 / 0 | 300 / 300 | ||||
| Status |
|
|
| Set Name | Test Cases |
|---|---|
| Sample | 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt |
| All | 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 01_test_01.txt, 01_test_02.txt, 01_test_03.txt, 01_test_04.txt, 01_test_05.txt, 01_test_06.txt, 01_test_07.txt, 01_test_08.txt, 01_test_09.txt, 01_test_10.txt, 01_test_11.txt, 01_test_12.txt, 01_test_13.txt, 01_test_14.txt, 01_test_15.txt, 01_test_16.txt, 01_test_17.txt |
| Case Name | Status | Exec Time | Memory |
|---|---|---|---|
| 00_sample_01.txt | AC | 1 ms | 3332 KiB |
| 00_sample_02.txt | AC | 1 ms | 3468 KiB |
| 00_sample_03.txt | AC | 1 ms | 3468 KiB |
| 01_test_01.txt | AC | 1 ms | 3328 KiB |
| 01_test_02.txt | AC | 1 ms | 3460 KiB |
| 01_test_03.txt | AC | 1 ms | 3396 KiB |
| 01_test_04.txt | AC | 1 ms | 3388 KiB |
| 01_test_05.txt | AC | 1 ms | 3480 KiB |
| 01_test_06.txt | AC | 1 ms | 3396 KiB |
| 01_test_07.txt | AC | 1 ms | 3472 KiB |
| 01_test_08.txt | AC | 1 ms | 3416 KiB |
| 01_test_09.txt | AC | 1 ms | 3396 KiB |
| 01_test_10.txt | AC | 1 ms | 3572 KiB |
| 01_test_11.txt | AC | 1 ms | 3528 KiB |
| 01_test_12.txt | AC | 1 ms | 3472 KiB |
| 01_test_13.txt | AC | 1 ms | 3472 KiB |
| 01_test_14.txt | AC | 1 ms | 3416 KiB |
| 01_test_15.txt | AC | 1 ms | 3420 KiB |
| 01_test_16.txt | AC | 1 ms | 3396 KiB |
| 01_test_17.txt | AC | 1 ms | 3476 KiB |