Submission #00030


ソースコード

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
#include <bits/stdc++.h>
#define F first
#define S second
#define MP make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
#define lcm( a, b ) (a)/__gcd((a),(b))*(b)
#define endl '\n'
using namespace std;
typedef long long LL;
typedef pair< int, int > P;
typedef pair< LL, LL > LP;
static const int INF = INT_MAX;
static const LL LINF = LLONG_MAX;
static const int MIN = INT_MIN;
static const LL LMIN = LLONG_MIN;
static const int MOD = 1000000007;
static const int SIZE = 200005;
const int dx[] = {0, -1, 1, 0};
const int dy[] = {-1, 0, 0, 1};
LL fac[SIZE], finv[SIZE], inv[SIZE];
void combInit() {
fac[0] = fac[1] = 1;
finv[0] = finv[1] = 1;
inv[1] = 1;
for( int i = 2; i < SIZE; ++i ) {
fac[i] = (fac[i - 1] * i) % MOD;
inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
finv[i] = (finv[i - 1] * inv[i]) % MOD;
}
}
LL comb(int n, int k) {
if( n < k ) return 0;
if( n < 0 || k < 0 ) return 0;
return (fac[n] * (finv[k] * finv[n - k] % MOD)) % MOD;
}
vector< int > Div( int n ) {
vector< int > ret;
for( int i = 1; i * i <= n; ++i ) {
if( n % i == 0 ) {
ret.pb( i );
if( i * i != n ) ret.pb( n / i );
}
}
sort( all( ret ) );
return ret;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n, m, d;
cin >> n >> m >> d;
int e = 0;
while( d-- && n > 0 ) {
if( n >= m ) {
e += m;
n -= m;
} else {
e += n;
n = 0;
}
}
cout << e << endl;
return 0;
}

ステータス

項目 データ
問題 0001 - Eating NAMEKUZI
ユーザー名 crom
投稿日時 2020-03-02 21:02:08
言語 C++14
状態 Accepted
得点 100
ソースコード長 1678 Byte
最大実行時間 30 ms
最大メモリ使用量 720 KB

セット

セット 得点 Cases
1 ALL 100 / 100 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
in01.txt AC 20 ms 476 KB
1
in02.txt AC 20 ms 432 KB
1
in03.txt AC 22 ms 392 KB
1
in04.txt AC 18 ms 472 KB
1
in05.txt AC 15 ms 432 KB
1
in06.txt AC 19 ms 516 KB
1
in07.txt AC 22 ms 468 KB
1
in08.txt AC 18 ms 548 KB
1
in09.txt AC 20 ms 508 KB
1
in10.txt AC 19 ms 592 KB
1
in11.txt AC 23 ms 680 KB
1
in12.txt AC 25 ms 632 KB
1
in13.txt AC 21 ms 720 KB
1
in14.txt AC 19 ms 676 KB
1
in15.txt AC 30 ms 624 KB
1
in16.txt AC 25 ms 576 KB
1
sample01.txt AC 23 ms 532 KB
1
sample02.txt AC 28 ms 492 KB
1