首页 > 其他分享 >Codeforces Round 677 (Div. 3) E. Two Round Dances(数论)

Codeforces Round 677 (Div. 3) E. Two Round Dances(数论)

时间:2023-04-10 19:58:30浏览次数:50  
标签:const LL 677 Two 轮舞 output input Round

https://codeforces.com/contest/1433/problem/E

题目大意:

n个人(n是偶数)跳了两轮舞,每轮舞正好有n/2个人。你的任务是找出n个人跳两轮舞的方法,如果每轮舞正好由n/2个人组成。每个人都应该属于这两种圆舞中的一种。

人相同位置不同也算是同一种方案。
input 
2
output 
1
input 
4
output 
3
input 
8
output 
1260
input 
20
output 
12164510040883200

1300的题目,vp是一脸懵逼:这题这么好做吗?
好吧,vp结束后发现是排列组合。(文科生不懂系列

#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<LL,LL> PII;
const LL MAXN=1e18,MINN=-MAXN,INF=0x3f3f3f3f;
const LL N=1e6+10,M=2023;
const LL mod=100000007;
const double PI=3.1415926535;
#define endl '\n'
LL a[N];
int main()
{
    cin.tie(0); cout.tie(0); ios::sync_with_stdio(false);
    LL T=1;
    //cin>>T;
    while(T--)
    {
        LL n;
        cin>>n;
        LL sum=1;
        for(LL i=1;i<=n;i++)
        {
            sum=sum*i;
        }
        sum*=2;
        sum/=(n*n);
        cout<<sum<<endl;
    }
    return 0;
}

标签:const,LL,677,Two,轮舞,output,input,Round
From: https://www.cnblogs.com/Vivian-0918/p/17304104.html

相关文章

  • Codeforces Round 864 (Div. 2)
    题解报告基本的一些理解和问题都在注释中A:LiHuaandMaze就是判断把其中一个点围起来所需要的最小的格子,考虑下边界的情况就行了#include<bits/stdc++.h>usingnamespacestd;intmain(void){ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);intT;c......
  • Codeforces Round 864 (Div. 2) E. Li Hua and Array
    CodeforcesRound864(Div.2E.LiHuaandArray)(暴力修改线段树+lca和数论的结合)Exampleinput5481637215234113234output1021Solution首先你得知道什么是欧拉函数我们\(O(n)\)求出\([1,5e6]\)范围内的每个数的欧拉函数后可以求一下最大的跳......
  • Codeforces Round 863 (Div. 3)
    题解报告基本的一些理解和问题都在注释中A:InsertDigit找到第一个小于输入数字的数的位置塞进去就好了,可以细推,但是粗略想想也能知道#include<bits/stdc++.h>usingnamespacestd;intmain(void){ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);int......
  • Codeforces Round 865 (Div. 2)
    CodeforcesRound865(Div.2)A.IanVisitsMaryvoidsolve(){intx=read(),y=read();if(__gcd(y,x)!=1){cout<<2<<endl;cout<<1<<""<<y-1<<endl;cout<<x<<"&q......
  • PeriodicTimer 和 BackgroundService
    实现.Net7下的数据库定时检查 在软件开发过程中,有时候我们需要定时地检查数据库中的数据,并在发现新增数据时触发一个动作。为了实现这个需求,我们在.Net7下进行一次简单的演示。PeriodicTimer.Net6中新增了PeriodicTimer这个类,它可以用来创建一个定时器,以固定间隔......
  • Codeforces Round 864 (Div. 2) C和D
    比赛地址C.LiHuaandChess题意:给出一个棋盘长宽n,m,有一颗棋子在棋盘上,向八个方向走一步的路程代价都为1,现在进行最多3次询问,问能否确认棋子的位置Solution第一次做交互题,想很好想,先询问(1,1),得到x,再询问(1+x,1+x),得到y,最后询问(1+x,1+x-y),如果得到的是0,则输出这个点,反之输......
  • Do you know the bitwise sum sample demonstrated in "Neural Networks and Deep Lea
    Doyouknowthebitwisesumsampledemonstratedin"NeuralNetworksandDeepLearning"byautor MichaelNielsen?Yes,Iamfamiliarwiththebitwisesumexampledemonstratedin"NeuralNetworksandDeepLearning"byMichaelNielsen......
  • Codeforces Round 860 (Div. 2)
    CodeforcesRound860(Div.2)Date:04/08/2023Link:CodeforcesRound860(Div.2)A|ShowstopperBrief:两组数\(\{a_i\}\)和\(\{b_i\}\),长度都为\(n\).\(\foralli\),可以交换\(a_i\)和\(b_i\),问是否可以使得\(a_n=\max(a_i)\),\(b_n=\max(b_i......
  • Codeforces Round 864 (Div. 2)
    评价:A~E感觉出的挺一般,特别是D怎么放这种暴力题,场上我还没调出来,F没看。但是Orzrui_er。A在一个点周围放障碍即可。B求出最少需要的操作次数\(p\),若\(p>k\)就无解,否则若\(n\)为偶数只能任选一个格子翻偶数次,即有解当且仅当\(2\mid(k-p)\);若\(n\)为奇数可......
  • Vulnhub之BoredHackerBlog: Social Network_Medium Socnet详细测试过程(拿到root shell
    BoredHackerBlog:SocialNetwork作者:jasonhuawen靶机信息名称:BoredHackerBlog:SocialNetwork地址:https://www.vulnhub.com/entry/boredhackerblog-social-network,454/识别目标主机IP地址Currentlyscanning:Finished!|ScreenView:UniqueHosts......