3 条题解

  • 0
    @ 2026-8-7 11:31:19
    using namespace std;
    string A[1010];
    bool check(int x){
        if(x % 7 == 0){
            return 1;
        }
        while(x){
            if(x%10==7){
                return 1;
            }
            x /= 10;
        }
        return 0;
    }
    int main(){
        int n,m,e;
        cin >> n >> m >> e;
        queue<string> q;
        for (int i = 1; i <= n; i ++){
            string s;
            cin >> s;
            A[i] = s;
        }
        for (int i = 1; i <= n; i++){
            q.push(A[m]);
            m ++;
            if(m > n){
                m = 1;
            }
        }
        string x;
        while (q.size() > 1){
            x = q.front();
            q.pop();
            if (!check(e)){
                q.push(x);
            }
            e++;
        }
        cout << q.front();
        return 0;
    }
    

    信息

    ID
    137
    时间
    1000ms
    内存
    256MiB
    难度
    8
    标签
    (无)
    递交数
    234
    已通过
    40
    上传者