3 条题解

  • 1
    @ 2023-10-17 17:36:33

    #include<bits/stdc++.h>

    using namespace std;

    queue<string> q; int n,m,t; bool l; int u(int t) { int ture=1; for(int i=1;i<m;i++) { q.push(q.front()); q.pop(); } while(q.size()>1) { if(t%77) { l=ture; } int sl=t; while(sl!=0) { if(sl%107) { l=ture; } sl/=10; } if(l==1) { q.pop(); } else { q.push(q.front()); q.pop(); } t++; } } int main () { cin>>n>>m>>t; for(int i=-1;i<=n;i++) { string o; cin>>o; q.push(o); } u(t); cout<<q.front()<<endl; return 0; }

    • 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;
      }
      
      • -3
        @ 2025-1-15 14:26:13
        #include <iostream>
        #include <queue>
        using namespace std;
        int main() {
            int n, m;
        	cin >> n >> m;
            queue<int> q;
            for (int i = 1; i <= n; i ++) {
                q.push(i);
            }
            int cur = 1;
            while (q.size() > 1) {
                int x = q.front();
                q.pop();
                if (cur == m) {
                    cur = 1;
                } else {
                    q.push(x);
                    cur++;
                }
            }
            cout << q.front() << endl;
            return 0;
        }
        
        • 1

        信息

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