-
E - Group work
- Gym - 101879E
- 题意:
- In the first example we have two students, therefore we can only have one group. In the second example we have three students, say AA, BB and CC. We can form the groups ABAB, ACAC, BCBC and ABCABC.
-
#include<bits/stdc++.h> using namespace std; long long qm(long long a,long long b,long long c) { long long ans = 1; while(b) { if (b % 2 == 1) ans = (ans * a) % c; b /= 2; a = (a * a) % c; } return ans; } long long n; int main() { cin>>n; cout<<qm(2,n,5000000000000)-1-n<<endl; return 0; }
E - Group work-组合数公式
最新推荐文章于 2024-02-02 03:00:00 发布