Compare commits
No commits in common. "f457f3997778a76ba6fb6ef66d51b9946c6c50be" and "067d2d43ad3eaee6ed76065b970d3767209af50f" have entirely different histories.
f457f39977
...
067d2d43ad
3
.vscode/settings.json
vendored
3
.vscode/settings.json
vendored
@ -24,8 +24,7 @@
|
||||
"vector": "cpp",
|
||||
"unordered_map": "cpp",
|
||||
"unordered_set": "cpp",
|
||||
"string_view": "cpp",
|
||||
"cmath": "cpp"
|
||||
"string_view": "cpp"
|
||||
},
|
||||
"terminal.integrated.automationShell.windows": "cmd.exe",
|
||||
"files.encoding": "gb18030",
|
||||
|
@ -1,3 +0,0 @@
|
||||
# 标题
|
||||
|
||||
* 内容
|
@ -1 +0,0 @@
|
||||
#
|
Binary file not shown.
@ -1,26 +0,0 @@
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
int ans=0,a[10]={1,2,4,8,16,32,64,128,256,512};
|
||||
void dg(int n,int last){
|
||||
if(n==0){
|
||||
ans++;
|
||||
return ;
|
||||
}
|
||||
for(int i=last;i<=10;i++){
|
||||
if(n-a[i]>=0){
|
||||
dg(n-a[i],i);
|
||||
}else{
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
int main()
|
||||
{
|
||||
int n;
|
||||
cin>>n;
|
||||
for(int i=1;i<=20;i++){
|
||||
ans=0;
|
||||
dg(i,0);
|
||||
cout<<ans<<endl;
|
||||
}
|
||||
}
|
Binary file not shown.
@ -1 +0,0 @@
|
||||
5
|
@ -1,76 +0,0 @@
|
||||
1
|
||||
2
|
||||
2
|
||||
4
|
||||
4
|
||||
6
|
||||
6
|
||||
10
|
||||
10
|
||||
14
|
||||
14
|
||||
20
|
||||
20
|
||||
26
|
||||
26
|
||||
36
|
||||
36
|
||||
46
|
||||
46
|
||||
60
|
||||
|
||||
-----------------------------------------------
|
||||
Process exited after 170 ms with return value 0
|
||||
|
||||
## z:\Chao\src\1468_fenjienum\test\in2.txt
|
||||
2020/06/06 ÖÜÁù 10:13:02.87
|
||||
1
|
||||
2
|
||||
2
|
||||
4
|
||||
4
|
||||
6
|
||||
6
|
||||
10
|
||||
10
|
||||
14
|
||||
14
|
||||
20
|
||||
20
|
||||
26
|
||||
26
|
||||
36
|
||||
36
|
||||
46
|
||||
46
|
||||
60
|
||||
|
||||
-----------------------------------------------
|
||||
Process exited after 120 ms with return value 0
|
||||
|
||||
## z:\Chao\src\1468_fenjienum\test\in3.txt
|
||||
2020/06/06 ÖÜÁù 10:13:02.87
|
||||
1
|
||||
2
|
||||
2
|
||||
4
|
||||
4
|
||||
6
|
||||
6
|
||||
10
|
||||
10
|
||||
14
|
||||
14
|
||||
20
|
||||
20
|
||||
26
|
||||
26
|
||||
36
|
||||
36
|
||||
46
|
||||
46
|
||||
60
|
||||
|
||||
-----------------------------------------------
|
||||
Process exited after 90 ms with return value 0
|
||||
|
@ -1,3 +0,0 @@
|
||||
# 标题
|
||||
|
||||
* 内容
|
@ -1 +0,0 @@
|
||||
#
|
@ -1,43 +0,0 @@
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
int main()
|
||||
{
|
||||
int n,ans=0;
|
||||
int ce=0;
|
||||
for(int i=0;i<4;i++){
|
||||
char u;
|
||||
cin>>u;
|
||||
if(u=='1'){
|
||||
ans+=10;
|
||||
cin>>u;
|
||||
}
|
||||
if(u>='2'&&u<='9'){
|
||||
ans+=u-'0';
|
||||
}else{
|
||||
if(u=='J'){
|
||||
ans+=11;
|
||||
}
|
||||
if(u=='Q'){
|
||||
ans+=12;
|
||||
}
|
||||
if(u=='K'){
|
||||
ans+=13;
|
||||
}
|
||||
if(u=='A'){
|
||||
ans+=1;
|
||||
ce++;
|
||||
}
|
||||
}
|
||||
}
|
||||
cin>>n;
|
||||
if(ans>n){
|
||||
cout<<"0";
|
||||
}else{
|
||||
while(ce>0&&ans+10<=n){
|
||||
ans+=10;
|
||||
ce--;
|
||||
}
|
||||
cout<<ans;
|
||||
}
|
||||
return 0;
|
||||
}
|
Binary file not shown.
@ -1,2 +0,0 @@
|
||||
A 2 3 4
|
||||
9
|
@ -1,2 +0,0 @@
|
||||
10 10 10 10
|
||||
41
|
@ -1,2 +0,0 @@
|
||||
2 3 3 3
|
||||
99
|
@ -1,18 +0,0 @@
|
||||
## z:\Chao\src\1485_wanpai\test\in.txt
|
||||
2020/06/06 ÖÜÁù 9:41:11.31
|
||||
0
|
||||
-----------------------------------------------
|
||||
Process exited after 140 ms with return value 0
|
||||
|
||||
## z:\Chao\src\1485_wanpai\test\in2.txt
|
||||
2020/06/06 ÖÜÁù 9:41:11.31
|
||||
40
|
||||
-----------------------------------------------
|
||||
Process exited after 120 ms with return value 0
|
||||
|
||||
## z:\Chao\src\1485_wanpai\test\in3.txt
|
||||
2020/06/06 ÖÜÁù 9:41:11.31
|
||||
11
|
||||
-----------------------------------------------
|
||||
Process exited after 100 ms with return value 0
|
||||
|
@ -1,3 +0,0 @@
|
||||
# 标题
|
||||
|
||||
* 内容
|
@ -1 +0,0 @@
|
||||
#
|
@ -1,53 +0,0 @@
|
||||
#include <algorithm>
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
int main()
|
||||
{
|
||||
int m, n, a[1001] = { 0 }, all = 0,ans=0;
|
||||
cin >> m >> n;
|
||||
for (int i = 1; i <= n; i++) {
|
||||
cin >> a[i];
|
||||
all += a[i];
|
||||
}
|
||||
|
||||
if (m >= all) {
|
||||
cout << "0";
|
||||
return 0;
|
||||
}
|
||||
|
||||
sort(a + 1, a + 1 + n);
|
||||
all -= m;
|
||||
int que = all,ji=n;
|
||||
all /= n;
|
||||
bool ce=0;
|
||||
for (int i = 1; i <= n; i++) {
|
||||
if (a[i] <= all){
|
||||
que-=a[i];
|
||||
ans+=a[i]*a[i];
|
||||
}else{
|
||||
if(ce=0){
|
||||
ce=1;
|
||||
ji=i;
|
||||
}
|
||||
que-=all;
|
||||
ans+=all*all;
|
||||
}
|
||||
}
|
||||
|
||||
while(que>0){
|
||||
all++;
|
||||
for(int i=n;i>=ji;i--){
|
||||
if(a[i]>=all){
|
||||
ans=ans-(all-1)*(all-1)+all*all;
|
||||
if(que==0){
|
||||
break;
|
||||
}
|
||||
}else{
|
||||
ji=i-1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
cout<<ans;
|
||||
return 0;
|
||||
}
|
Binary file not shown.
@ -1,2 +0,0 @@
|
||||
10 5
|
||||
2 2 2 2 3
|
@ -1,6 +0,0 @@
|
||||
## z:\Chao\src\1487_fenjimu\test\in.txt
|
||||
2020/06/06 ÖÜÁù 11:27:42.85
|
||||
|
||||
-----------------------------------------------
|
||||
Process exited after 21259420 ms with return value 1073807364
|
||||
|
@ -1,3 +0,0 @@
|
||||
# 标题
|
||||
|
||||
* 内容
|
@ -1 +0,0 @@
|
||||
#
|
Binary file not shown.
@ -1,81 +0,0 @@
|
||||
#include <cmath>
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
int n, k,a[8] = { 0, 1, 2, 3, 4, 5, 6, 7 },allans=0;
|
||||
bool ce[8]={0};
|
||||
bool pan(int n)
|
||||
{
|
||||
int len = sqrt(n);
|
||||
for (int i = 2; i <= len; i++) {
|
||||
if (n % i == 0) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
return 1;
|
||||
}
|
||||
void dg(int xian){
|
||||
if(xian>n){
|
||||
// for(int i=1;i<=n;i++){
|
||||
// cout<<a[i]<<" ";
|
||||
// }
|
||||
// cout<<endl;
|
||||
|
||||
int now = 0, zong = 1, ans = 0;
|
||||
for (int i = n - k + 2; i <= n; i++) {
|
||||
now *= 10;
|
||||
now += a[i];
|
||||
zong *= 10;
|
||||
}
|
||||
for (int i = 1; i <= n; i++) {
|
||||
now %= zong;
|
||||
now *= 10;
|
||||
now += a[i];
|
||||
ans += pan(now);
|
||||
}
|
||||
if(ans>allans){
|
||||
allans=ans;
|
||||
}
|
||||
}
|
||||
for(int i=2;i<=n;i++){
|
||||
if(ce[i]==0){
|
||||
a[xian]=i;
|
||||
ce[i]=1;
|
||||
dg(xian+1);
|
||||
ce[i]=0;
|
||||
}
|
||||
}
|
||||
}
|
||||
int main()
|
||||
{
|
||||
int now = 0, zong = 1, ans = 0;
|
||||
cin >> n >> k;
|
||||
if (k == 1) {
|
||||
if (n == 1) {
|
||||
cout << "0" << endl
|
||||
<< "0";
|
||||
} else {
|
||||
int chu = 1;
|
||||
for (int i = 3; i <= n; i+=2) {
|
||||
chu++;
|
||||
}
|
||||
cout << chu << endl
|
||||
<< chu;
|
||||
}
|
||||
} else {
|
||||
for (int i = n - k + 2; i <= n; i++) {
|
||||
now *= 10;
|
||||
now += a[i];
|
||||
zong *= 10;
|
||||
}
|
||||
for (int i = 1; i <= n; i++) {
|
||||
now %= zong;
|
||||
now *= 10;
|
||||
now += a[i];
|
||||
ans += pan(now);
|
||||
}
|
||||
cout<<ans<<endl;
|
||||
dg(2);
|
||||
cout<<allans;
|
||||
}
|
||||
return 0;
|
||||
}
|
Binary file not shown.
@ -1 +0,0 @@
|
||||
7 1
|
@ -1 +0,0 @@
|
||||
7 3
|
@ -1 +0,0 @@
|
||||
6 4
|
@ -1,21 +0,0 @@
|
||||
## z:\Chao\src\1598_roundfind_sushu\test\in.txt
|
||||
2020/06/13 ÖÜÁù 9:56:47.43
|
||||
4
|
||||
4
|
||||
-----------------------------------------------
|
||||
Process exited after 180 ms with return value 0
|
||||
|
||||
## z:\Chao\src\1598_roundfind_sushu\test\in2.txt
|
||||
2020/06/13 ÖÜÁù 9:56:47.43
|
||||
0
|
||||
3
|
||||
-----------------------------------------------
|
||||
Process exited after 100 ms with return value 0
|
||||
|
||||
## z:\Chao\src\1598_roundfind_sushu\test\in3.txt
|
||||
2020/06/13 ÖÜÁù 9:56:47.43
|
||||
1
|
||||
2
|
||||
-----------------------------------------------
|
||||
Process exited after 90 ms with return value 0
|
||||
|
Loading…
x
Reference in New Issue
Block a user