Submission #21075279
Source Code Expand
Copy
#include <bits/stdc++.h>using namespace std;#define oo 1e12#define fi first#define se second#define sp(iiii) setprecision(iiii)#define IO ios_base::sync_with_stdio(false); cin.tie(0)#define ms(aaaa,xxxx) memset(aaaa,xxxx,sizeof(aaaa))#define cntbit(xxxx) __builtin_popcount(xxxx)#define getbit(xxxx,aaaa) ((xxxx>>(aaaa-1))&1)typedef long double ld;typedef long long ll;typedef unsigned long long ull;typedef pair<int,int> pii;typedef pair<pair<int,int>,int> piii;typedef pair<long long,long long> pll;typedef pair<pair<long long,long long>,long long> plll;typedef pair<pair<long long,long long>,pair<long long,long long>> pllll;typedef pair<pair<long long,long long>,bool> pllb;
#include <bits/stdc++.h> using namespace std; #define oo 1e12 #define fi first #define se second #define sp(iiii) setprecision(iiii) #define IO ios_base::sync_with_stdio(false); cin.tie(0) #define ms(aaaa,xxxx) memset(aaaa,xxxx,sizeof(aaaa)) #define cntbit(xxxx) __builtin_popcount(xxxx) #define getbit(xxxx,aaaa) ((xxxx>>(aaaa-1))&1) typedef long double ld; typedef long long ll; typedef unsigned long long ull; typedef pair<int,int> pii; typedef pair<pair<int,int>,int> piii; typedef pair<long long,long long> pll; typedef pair<pair<long long,long long>,long long> plll; typedef pair<pair<long long,long long>,pair<long long,long long>> pllll; typedef pair<pair<long long,long long>,bool> pllb; const ll base=361; const ll mod=1e9+7; const ld eps=1e-5; const ll maxn=1e7-1; ll i,n,f[20000009],res; int main(){ IO; #ifndef ONLINE_JUDGE freopen("test.inp", "r", stdin); freopen("test.out", "w", stdout); #else #endif for (i=1;i<=9;i++) { f[i]=10; } for (i=10;i<=99;i++) { f[i]=100; } for (i=100;i<=999;i++) { f[i]=1000; } for (i=1000;i<=9999;i++) { f[i]=10000; } for (i=10000;i<=99999;i++) { f[i]=100000; } for (i=100000;i<=999999;i++) { f[i]=1000000; } for (i=1000000;i<=9999999;i++) { f[i]=10000000; } cin>>n; for (i=1;i<=maxn;i++) { if (i*f[i]+i<=n) { res++; } } cout<<res<<'\n'; }
Submission Info
Submission Time | |
---|---|
Task | C - Doubled |
User | Fidisk |
Language | C++ (GCC 9.2.1) |
Score | 300 |
Code Size | 1543 Byte |
Status | AC |
Exec Time | 74 ms |
Memory | 81784 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 300 / 300 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | 01_sample.txt, 02_sample.txt, 03_sample.txt |
All | 01_sample.txt, 02_sample.txt, 03_sample.txt, 04_hand.txt, 05_hand.txt, 06_hand.txt, 07_hand.txt, 08_hand.txt, 09_hand.txt, 10_random.txt, 11_random.txt, 12_random.txt, 13_random.txt, 14_random.txt, 15_random.txt, 16_random.txt, 17_random.txt, 18_random.txt, 19_random.txt, 20_random.txt, 21_random.txt, 22_random.txt, 23_random.txt, 24_random.txt, 25_random.txt, 26_random.txt, 27_random.txt, 28_random.txt, 29_random.txt, 30_double.txt, 31_double.txt, 32_double.txt, 33_double.txt, 34_double.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
01_sample.txt | AC | 74 ms | 81740 KB |
02_sample.txt | AC | 70 ms | 81768 KB |
03_sample.txt | AC | 65 ms | 81716 KB |
04_hand.txt | AC | 69 ms | 81696 KB |
05_hand.txt | AC | 70 ms | 81720 KB |
06_hand.txt | AC | 70 ms | 81772 KB |
07_hand.txt | AC | 67 ms | 81772 KB |
08_hand.txt | AC | 67 ms | 81736 KB |
09_hand.txt | AC | 69 ms | 81652 KB |
10_random.txt | AC | 68 ms | 81664 KB |
11_random.txt | AC | 69 ms | 81784 KB |
12_random.txt | AC | 69 ms | 81740 KB |
13_random.txt | AC | 67 ms | 81736 KB |
14_random.txt | AC | 72 ms | 81644 KB |
15_random.txt | AC | 70 ms | 81664 KB |
16_random.txt | AC | 69 ms | 81664 KB |
17_random.txt | AC | 69 ms | 81712 KB |
18_random.txt | AC | 71 ms | 81784 KB |
19_random.txt | AC | 67 ms | 81656 KB |
20_random.txt | AC | 69 ms | 81604 KB |
21_random.txt | AC | 70 ms | 81736 KB |
22_random.txt | AC | 68 ms | 81768 KB |
23_random.txt | AC | 67 ms | 81716 KB |
24_random.txt | AC | 68 ms | 81656 KB |
25_random.txt | AC | 69 ms | 81644 KB |
26_random.txt | AC | 68 ms | 81700 KB |
27_random.txt | AC | 69 ms | 81700 KB |
28_random.txt | AC | 67 ms | 81768 KB |
29_random.txt | AC | 69 ms | 81664 KB |
30_double.txt | AC | 70 ms | 81656 KB |
31_double.txt | AC | 68 ms | 81608 KB |
32_double.txt | AC | 69 ms | 81672 KB |
33_double.txt | AC | 68 ms | 81768 KB |
34_double.txt | AC | 68 ms | 81660 KB |