暴力 , 但80

P1055 [NOIP2008 普及组] ISBN 号码

cheemssssss @ 2022-08-11 09:27:01

#include<bits/stdc++.h>
using namespace std;
int main(){
    string s;
    cin >> s;
    int cnt = 0 , a = s.size() , jojo = (s[0] - '0') * 1 + (s[2] - '0') * 2 + (s[3] - '0') * 3 + (s[4] - '0')* 4 + (s[6] - '0') * 5 + (s[7] - '0') * 6 + (s[8] - '0') * 7 + (s[9] - '0') * 8 + (s[10] - '0') * 9;
    if(jojo % 11 == s[12] - '0') {
        cout << "Right";
        return 0;
    }
    if(jojo % 11 != 10) cout << s[0] << s[1] << s[2] << s[3] << s[4] << s[5] << s[6] << s[7] << s[8] << s[9] << s[10] << s[11] << jojo % 11;
    else  if(jojo % 11 == 10) cout << s[0] << s[1] << s[2] << s[3] << s[4] << s[5] << s[6] << s[7] << s[8] << s[9] << s[10] << s[11] << 'X';
    return 0;
} 

只事想暴力


by Galaxy_Star @ 2022-08-11 10:04:57

暴力,但是80


by ce_375 @ 2022-08-11 10:11:09

s12可能是X


by sansssss @ 2022-08-11 10:24:34

@cheemssssss

同机房jbl


by Flower_Bloom @ 2022-08-31 09:21:46

TLE应该是算法问题吧


by Flower_Bloom @ 2022-08-31 09:23:06

可是为什么会TLE呢,一个循环都没有


by Flower_Bloom @ 2022-08-31 09:24:01

@cheemssssss


|