Compare commits

..

No commits in common. 'branch_local' and 'main' have entirely different histories.

@ -1,2 +1,2 @@
# test
##test

@ -1,40 +0,0 @@
#include <bits/stdc++.h>
using namespace std;
int ans=9;
int main(){
for (int i=1000;i<=9999;i++){
int t=i;
int hh=0,tt=0;
for (int j=1;j<=4;j++){
if (j<=2) tt+=t%10,t/=10;
else hh+=t%10,t/=10;
}
if (hh==tt) ans++;
}
for (int i=100000;i<=999999;i++){
int t=i;
int hh=0,tt=0;
for (int j=1;j<=6;j++){
if (j<=3) tt+=t%10,t/=10;
else hh+=t%10,t/=10;
}
if (hh==tt) ans++;
}
for (int i=10000000;i<=99999999;i++){
int t=i;
int hh=0,tt=0;
for (int j=1;j<=8;j++){
if (j<=4) tt+=t%10,t/=10;
else hh+=t%10,t/=10;
}
if (hh==tt) ans++;
}
cout<<ans;
return 0;
}
Loading…
Cancel
Save