QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#510035#7658. German Conference for Public CountingMinyou0713Compile Error//C++14811b2024-08-08 20:43:012024-08-08 20:43:02

Judging History

你现在查看的是最新测评结果

  • [2024-08-08 20:43:02]
  • 评测
  • [2024-08-08 20:43:01]
  • 提交

answer

#include <bits\stdc++.h>
using namespace std;
#define endl '\n'
#define int long long 
#define IOS ios::sync_with_stdio(false),cin.tie(0),cout.tie(0)
typedef unsigned long long ull ;
typedef long long ll ;
typedef pair<int, int>PII;

void solve(){
   int n;
   cin>>n;
   if(n<10) {
      cout<<n+1;
      return ;
   }
   if(n==10){
      cout<<10;
      return ;
   }
   
//计算位数算法需优化
   int x = n;
   int a = 1, b = 1;
   int t = 1;
   while(x/10){
      a=x/10;
      t++;
      if(x/100==0&&x/10!=0){
         b=x%10;
      }
      x/=10;
   }

   int ans;
   if(a<=b) ans = a*t+*(t-1);
   else ans = (a-1)*t+(11-a)*(t-1);
   cout<<ans;
}

signed main(){
   IOS;
   int tt;
   tt=1;
   //cin>>tt;
   while(tt--)
      solve();
   return 0;
}

Details

answer.code:1:10: fatal error: bits\stdc++.h: No such file or directory
    1 | #include <bits\stdc++.h>
      |          ^~~~~~~~~~~~~~~
compilation terminated.