Submission #56209


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
typedef vector<long long> vlong;
#define vpush(a,x) a.push_back(x);
#define rep(i, n) REP(i, 0, n)
#define all(v) v.begin(), v.end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define INF 2e9
int fact(int n){
int m;
if (n == 0)
return 1;
m = fact(n - 1);
return n * m;
}
signed main(){
cin.tie(0);
ios::sync_with_stdio(false);
long long n,k,count=0,b=1,c;
cin>>n>>k;
rep(i,n){
b*=10;
}
long long d=b;
long long a=k;
if(d==10){
count+=9/k;
}
else{
rep(i,2){
if(b==d){
count+=((d/k)-1);
}
else{
count-=((d/k)-1);
}
d/=10;
}
}
/* while(true){
if(a>=c){
break;
}
a+=k;
}
while(true){
if(b<a){
break;
}
count++;
a+=k;
}
*/
cout<<count<<'\n';
return(0);
}

ステータス

項目 データ
問題 1204 - Password
ユーザー名 ei1918
投稿日時 2019-11-07 16:42:45
言語 C++
状態 Accepted
得点 10
ソースコード長 1478 Byte
最大実行時間 28 ms
最大メモリ使用量 752 KB

セット

セット 得点 Cases
1 ALL 10 / 10 in*

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
in00-1.txt AC 27 ms 604 KB
1
in00-2.txt AC 22 ms 556 KB
1
in00-3.txt AC 17 ms 636 KB
1
in01.txt AC 24 ms 592 KB
1
in02.txt AC 24 ms 548 KB
1
in03.txt AC 21 ms 500 KB
1
in04.txt AC 25 ms 584 KB
1
in05.txt AC 20 ms 536 KB
1
in06.txt AC 28 ms 616 KB
1
in07.txt AC 22 ms 576 KB
1
in08.txt AC 14 ms 536 KB
1
in09.txt AC 17 ms 752 KB
1
in10.txt AC 15 ms 580 KB
1
in11.txt AC 22 ms 660 KB
1
in12.txt AC 15 ms 488 KB
1
in13.txt AC 27 ms 576 KB
1
in14.txt AC 17 ms 532 KB
1
in15.txt AC 23 ms 484 KB
1
in16.txt AC 21 ms 564 KB
1
in17.txt AC 24 ms 644 KB
1
in18.txt AC 15 ms 600 KB
1
in19.txt AC 25 ms 552 KB
1
in20.txt AC 27 ms 628 KB
1
sample01.txt AC 24 ms 576 KB
sample02.txt AC 20 ms 532 KB