Submission #544657

#TimeUsernameProblemLanguageResultExecution timeMemory
544657pokmui9909입력숫자 (KOI13_mystery)C++17
100 / 100
1 ms328 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; ll N; ll A[35]; ll B[35]; int main() { cin.tie(0) -> sync_with_stdio(false); cin >> N; cin >> A[1]; ll P = 0, V = 0; V = A[1]; B[P] = A[1]; for(int i = 1; i < N; i++) { P += V; P %= N; while(B[P]) { P++; P %= N; } cin >> A[i]; B[P] = V = A[i]; } cout << N << '\n'; for(int i = 0; i < N; i++) cout << B[i] << ' '; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...