Submission #38018566
Source Code Expand
#include <bits/stdc++.h>
const int MAXN = 1e5 + 10;
namespace trash_without_mode{
#define foe(i, now) for (int i = head[now]; ~i; i = edg[i].edg)
#define fo(i, g1, g2) for (int i = (g1), __Endi__ = (g2); i <= __Endi__; ++i)
#define fd(i, g1, g2) for (int i = (g1), __Endi__ = (g2); i >= __Endi__; --i)
#define go(v,now) for (auto &v:edg[now])
#define mem(g1, g2) memset((g1), g2, sizeof((g1)))
#define lowbit(now) ((now) & (-now))
#define lson ((now) << 1)
#define mid ((l + r) / 2)
#define rson (lson | 1)
#define ll long long
#define pb push_back
#define mp(g1, g2) make_pair((g1), (g2))
#define PII pair<int, int>
#define pow2(g2) (1ll << (g2))
#define II inline void
#define INF (0x3f3f3f3f)
#define ps push
#define lsond lson, l, mid
#define rsond rson, mid + 1, r
namespace Fread
{
const int SIZE = (1 << 26) + 1; // namespace Fread
char buf[SIZE], *S, *T;
}
namespace Fwrite
{
const int SIZE = (1 << 26) + 1; // namespace Fwrite
char buf[SIZE], *S = buf, *T = buf + SIZE;
inline void flush()
{
fwrite(buf, 1, S - buf, stdout), S = buf;
}
struct NTR
{
~NTR()
{
flush();
}
} ztr;
}
#ifdef ONLINE_JUDGE
#define getchar() (Fread::S == Fread::T && (Fread::T = (Fread::S = Fread::buf) + fread(Fread::buf, 1, 1 << 23, stdin), Fread::S == Fread::T) ? '\n' : *Fread::S++)
#define putchar(c) (*Fwrite::S++ = c, (Fwrite::S != Fwrite::T) ? 0 : (Fwrite::flush(), 0))
#endif
namespace Fastio
{
struct Reader
{
template <typename T>
inline Reader &operator>>(T &now)
{
static char c;
static short f;
c = getchar(), f = 1;
while (!isdigit(c))
{
c ^ '-' ? c = getchar() : (f = -1, c = getchar());
}
now = 0;
while (isdigit(c))
{
now = now * 10 + (c ^ '0'), c = getchar();
}
return now *= f, *this;
}
inline Reader &operator>>(char &c)
{
c = getchar();
while (c == '\n' || c == ' ')
c = getchar();
return *this;
}
inline Reader &operator>>(char *str)
{
static int len = 0;
len = 0;
static char c;
c = getchar();
while (c == '\n' || c == ' ')
c = getchar();
while (c ^ '\n' && c ^ ' ')
{
str[len++] = c, c = getchar();
}
return str[len] = '\0', *this;
}
Reader() {}
} cin;
const char endl = '\n';
struct Writer
{
template <typename T>
inline Writer &operator<<(T now)
{
static int cnt = 0;
now ? (now < 0 ? putchar('-'), now = -now, cnt = 0 : cnt = 0) : (putchar('0'), cnt = 0);
static int sta[45];
while (now)
{
sta[++cnt] = now % 10, now /= 10;
}
while (cnt)
{
putchar(sta[cnt] | 48), --cnt;
}
return *this;
}
inline Writer &operator<<(const char c)
{
return putchar(c), *this;
}
inline Writer &operator<<(const char *str)
{
static int cur = 0;
cur = 0;
while (str[cur])
putchar(str[cur++]);
return *this;
}
inline Writer &operator<<(char *str)
{
static int cur = 0;
cur = 0;
while (str[cur])
putchar(str[cur++]);
return *this;
}
Writer() {}
} cout;
}
#define cin Fastio ::cin
#define cout Fastio ::cout
#define endl Fastio ::endl
using namespace std;
}
using namespace trash_without_mode;
int n;
// s1 = s2
// s3,s4
// s5 = s6
// s8
// s7 = s9
int a[10];
signed main()
{
#ifndef ONLINE_JUDGE
freopen("txt.in", "r", stdin);
freopen("txt.out", "w", stdout);
#endif
cin >> n;
n--;
a[1] = 1;
while(n >= 100000) n -= 100000,a[1]++;
a[2] = a[1];
while(n >= 10000) n -= 10000,a[3]++;
while(n >= 1000) n -= 1000,a[4]++;
while(n >= 100) n -= 100,a[5]++;
a[6] = a[5];
while(n >= 10) n -= 10,a[7]++;
a[9] = a[7];
while(n >= 1) n -= 1,a[8]++;
fo (i,1,9) cout << a[i];
return 0;
}
Submission Info
| Submission Time |
|
| Task |
A - AABCDDEFE |
| User |
lby_my_superman |
| Language |
C++ (GCC 9.2.1) |
| Score |
300 |
| Code Size |
4588 Byte |
| Status |
AC |
| Exec Time |
7 ms |
| Memory |
3608 KiB |
Judge Result
| Set Name |
Sample |
All |
| Score / Max Score |
0 / 0 |
300 / 300 |
| Status |
|
|
| Set Name |
Test Cases |
| Sample |
01_sample_01.txt, 01_sample_02.txt, 01_sample_03.txt |
| All |
01_sample_01.txt, 01_sample_02.txt, 01_sample_03.txt, 02_min_01.txt, 02_min_02.txt, 02_min_03.txt, 02_min_04.txt, 02_min_05.txt, 02_min_06.txt, 02_min_07.txt, 02_min_08.txt, 02_min_09.txt, 02_min_10.txt, 03_max_01.txt, 03_max_02.txt, 03_max_03.txt, 03_max_04.txt, 03_max_05.txt, 03_max_06.txt, 03_max_07.txt, 03_max_08.txt, 03_max_09.txt, 03_max_10.txt, 04_rand_01.txt, 04_rand_02.txt, 04_rand_03.txt, 04_rand_04.txt, 04_rand_05.txt, 04_rand_06.txt, 04_rand_07.txt, 04_rand_08.txt, 04_rand_09.txt, 04_rand_10.txt |
| Case Name |
Status |
Exec Time |
Memory |
| 01_sample_01.txt |
AC |
7 ms |
3472 KiB |
| 01_sample_02.txt |
AC |
2 ms |
3476 KiB |
| 01_sample_03.txt |
AC |
2 ms |
3428 KiB |
| 02_min_01.txt |
AC |
2 ms |
3380 KiB |
| 02_min_02.txt |
AC |
2 ms |
3496 KiB |
| 02_min_03.txt |
AC |
2 ms |
3404 KiB |
| 02_min_04.txt |
AC |
2 ms |
3532 KiB |
| 02_min_05.txt |
AC |
2 ms |
3432 KiB |
| 02_min_06.txt |
AC |
2 ms |
3604 KiB |
| 02_min_07.txt |
AC |
2 ms |
3492 KiB |
| 02_min_08.txt |
AC |
3 ms |
3432 KiB |
| 02_min_09.txt |
AC |
2 ms |
3404 KiB |
| 02_min_10.txt |
AC |
2 ms |
3568 KiB |
| 03_max_01.txt |
AC |
2 ms |
3476 KiB |
| 03_max_02.txt |
AC |
2 ms |
3532 KiB |
| 03_max_03.txt |
AC |
2 ms |
3536 KiB |
| 03_max_04.txt |
AC |
1 ms |
3352 KiB |
| 03_max_05.txt |
AC |
2 ms |
3608 KiB |
| 03_max_06.txt |
AC |
2 ms |
3432 KiB |
| 03_max_07.txt |
AC |
1 ms |
3536 KiB |
| 03_max_08.txt |
AC |
2 ms |
3492 KiB |
| 03_max_09.txt |
AC |
2 ms |
3532 KiB |
| 03_max_10.txt |
AC |
2 ms |
3600 KiB |
| 04_rand_01.txt |
AC |
3 ms |
3568 KiB |
| 04_rand_02.txt |
AC |
3 ms |
3352 KiB |
| 04_rand_03.txt |
AC |
3 ms |
3496 KiB |
| 04_rand_04.txt |
AC |
2 ms |
3412 KiB |
| 04_rand_05.txt |
AC |
3 ms |
3536 KiB |
| 04_rand_06.txt |
AC |
2 ms |
3492 KiB |
| 04_rand_07.txt |
AC |
2 ms |
3476 KiB |
| 04_rand_08.txt |
AC |
2 ms |
3536 KiB |
| 04_rand_09.txt |
AC |
2 ms |
3376 KiB |
| 04_rand_10.txt |
AC |
2 ms |
3532 KiB |