4 条题解

  • 0
    @ 2025-7-14 16:11:32

    #include <bits/stdc++.h> using namespace std; bool a[105] = {0}; int main() { int n, m, f = 0, t = 0, s = 0; cin >> n >> m; while (f != n) { t++; if (t > n) t = 1;

    	if (!a[t])
    	s++;
    	if (s == m) {
    		cout << t << " ";
    		s = 0;
    		a[t] = 1;
    		f++;
    	}
    }
    return 0;
    

    }

    • 0
      @ 2025-7-14 16:01:03

      #include <bits/stdc++.h> using namespace std;

      bool a[105] = {0};

      int main() { int n, m, f = 0, s = 0; cin >> n >> m; for (int t = 1; ; t++) { if (t > n) t = 1; if (!a[t]) s++; if (s == m) { cout << t << " "; s = 0; a[t] = 1; f++; if (f == n) break; } } return 0; }

      • 0
        @ 2025-7-14 15:32:35

        #include <bits/stdc++.h> using namespace std;

        bool a[105]={0};

        int main() { int n,m,f=0,t=0,s=0; cin>>n>>m; while(f!=n){ t++; if(t>n) t=1; if(!a[t]) s++; if(s==m){ cout<<t<<" "; s=0; a[t]=1; f++; } } return 0; }

        • 0
          @ 2025-7-14 15:29:18

          点个赞吧!

          #include <bits/stdc++.h> using namespace std;

          bool a[105] = {0};

          int main() { int n, m, f = 0, t = 0, s = 0; cin >> n >> m; while (f != n) { t++; if (t > n) t = 1; if (!a[t]) s++; if (s == m) { cout << t << " "; s = 0; a[t] = {1}; f++; } } return 0; } 你好

          • 1

          信息

          ID
          388
          时间
          1000ms
          内存
          128MiB
          难度
          3
          标签
          递交数
          73
          已通过
          42
          上传者