题解 P6159 【[Cnoi2020]光图】
chenpengda · · 题解
初中物理知识。
对称取模即可。
#include<bits/stdc++.h>
using namespace std;
int main()
{
unsigned long long n,p,k;
cin>>n>>p>>k;
cout<<(p*k)%n;
return 0;
}
为什么这样是对的呢?
因为第一次,光从
所以总共走了
chenpengda · · 题解
对称取模即可。
#include<bits/stdc++.h>
using namespace std;
int main()
{
unsigned long long n,p,k;
cin>>n>>p>>k;
cout<<(p*k)%n;
return 0;
}
为什么这样是对的呢?
因为第一次,光从
所以总共走了