跳到正文

题解

题解:P15090 [UOI 2025 II Stage] Movies

Geyichuan约 1 分钟
原文
文章信息与版本

文章信息

收录
2026年1月29日
更新
2026年1月29日
篇幅
约 1 分钟
题目
P15090

版本

  1. v1当前

主要思路

非常简单的题,分类讨论。

  1. nmod  k=0n \mod k=0,那么最后一页的时间就是 k×c k\times c。
  2. nmod  kn\mod k 不为 00,那么剩余电影就有 nmod  k×cn\mod k\times c。

代码如下:

C++
#include<bits/stdc++.h>
using namespace std;
int n,k,c;
int main(){
	cin>>n>>k>>c;
	if(n%k!=0) cout<<1LL*n%k*c;
	else cout<<k*c;
	return 0;
}
原文