| Run ID | Author | Problem | Lang | Verdict | Score | Time | Memory | Code Length | Submit Time |
|---|---|---|---|---|---|---|---|---|---|
| 74190 | 董承诺 | 位运算 | C++ | Wrong Answer | 40 | 0 MS | 260 KB | 496 | 2023-05-20 17:23:52 |
#include<bits/stdc++.h> using namespace std; string a; int b,c,d; int main(){ cin>>a; b=a.size(); for(int i=0;i<=b-1;i++){ c+=a[i]%'0'; if(a[i]==0) d++; } if(c==1){ cout<<"0"; return 0; } if(b>=2&&a[0]>'1'&&a[b-1]==0){ if(d==b-1){ a[0]=(a[0]%'0'-1)+'0'; a[1]=(a[0]%'0'+1)+'0'; } // if(d!=b-1){ // for(int i=0;i<=b-1;i++){ // if(a[i]!=0&&a[i+1]=='0'){ // // } // } // } } else{ a[b-1]--; cout<<a; } return 0; }