ap数(不知是否完成)
This commit is contained in:
parent
6b4657fbe9
commit
e7be40d15e
|
@ -0,0 +1,32 @@
|
|||
#include<iostream>
|
||||
using namespace std;
|
||||
int main(){
|
||||
int n,m;
|
||||
cin>>n>>m;
|
||||
bool won[101][101]={0},lost[101][101]={0};//ÎÒÓ®ÁËË£¬ÎÒÊä¸øË
|
||||
for(int i=1;i<=m;i++){
|
||||
int yin,shu;
|
||||
cin>>yin>>shu;
|
||||
|
||||
won[yin][shu]=1;
|
||||
for(int j=1;j<=n;j++){
|
||||
if(lost[yin][j]==1){
|
||||
won[j][shu]=1;
|
||||
}
|
||||
}
|
||||
|
||||
lost[shu][yin]=1;
|
||||
for(int j=1;j<=n;j++){
|
||||
if(won[shu][j]==1){
|
||||
lost[j][yin]=1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int sheng[101]={0},bai[101]={0};
|
||||
for(int i=1;i<=n;i++){
|
||||
for(int j=1;j<=n;j++){
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,12 +1,32 @@
|
|||
#include <iostream>
|
||||
using namespace std;
|
||||
void doit(int n){
|
||||
|
||||
int su[10]={2,3,5,7,11,13,17,19,23,29};
|
||||
int ge[10]={0};
|
||||
long long allans,allge=0;
|
||||
void doit(int n,int now){
|
||||
if(n==1){
|
||||
long long ans=1;
|
||||
for(int i=0;i<=9;i++){
|
||||
ans=ans*(ge[i]+1);
|
||||
}
|
||||
if(allge<ans){
|
||||
allge=ans;
|
||||
|
||||
}
|
||||
return ;
|
||||
}
|
||||
for(int i=now;i<=9;i++){
|
||||
if(n%su[i]==0){
|
||||
ge[i]++;
|
||||
doit(n/su[i],i);
|
||||
ge[i]--;
|
||||
}
|
||||
}
|
||||
}
|
||||
int main()
|
||||
{
|
||||
int n;
|
||||
while(cin>>n){
|
||||
doit(n);
|
||||
doit(n,0);
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
|
@ -0,0 +1 @@
|
|||
10
|
|
@ -0,0 +1 @@
|
|||
20
|
|
@ -0,0 +1 @@
|
|||
50
|
|
@ -1,7 +1,18 @@
|
|||
## z:\Chao\src\Template\test\in.txt
|
||||
2020/03/14 ÖÜÁù 11:41:28.68
|
||||
Hello Easy C++ project!
|
||||
|
||||
## z:\Chao\src\2761_apnum_large\test\in.txt
|
||||
2020/05/07 ÖÜËÄ 18:26:44.29
|
||||
4
|
||||
-----------------------------------------------
|
||||
Process exited after 200 ms with return value 0
|
||||
Process exited after 150 ms with return value 0
|
||||
|
||||
## z:\Chao\src\2761_apnum_large\test\in2.txt
|
||||
2020/05/07 ÖÜËÄ 18:26:44.29
|
||||
6
|
||||
-----------------------------------------------
|
||||
Process exited after 90 ms with return value 0
|
||||
|
||||
## z:\Chao\src\2761_apnum_large\test\in3.txt
|
||||
2020/05/07 ÖÜËÄ 18:26:44.29
|
||||
6
|
||||
-----------------------------------------------
|
||||
Process exited after 100 ms with return value 0
|
||||
|
||||
|
|
Loading…
Reference in New Issue