/ SeriousOJ /

Record Detail

Compile Error

foo.cc:26:2: error: stray '#' in program
   26 | }#include <iostream>
      |  ^
foo.cc:26:3: error: 'include' does not name a type
   26 | }#include <iostream>
      |   ^~~~~~~
foo.cc:29:5: error: redefinition of 'int main()'
   29 | int main() {
      |     ^~~~
foo.cc:4:5: note: 'int main()' previously defined here
    4 | int main() {
      |     ^~~~

Code

#include <iostream>
using namespace std;

int main() {
    int T;
    cin >> T;

    while (T--) {
        int N;
        cin >> N;

        for (int i = 1; i <= N; ++i) {
            if (i % 2 == 1) {
                if (i < N)
                    cout << i + 1 << " ";
                else
                    cout << i << " ";
            } else {
                cout << i - 1 << " ";
            }
        }
        cout << "\n";
    }

    return 0;
}#include <iostream>
using namespace std;

int main() {
    int T;
    cin >> T;

    while (T--) {
        int N;
        cin >> N;

        for (int i = 1; i <= N; ++i) {
            if (i % 2 == 1) {
                if (i < N)
                    cout << i + 1 << " ";
                else
                    cout << i << " ";
            } else {
                cout << i - 1 << " ";
            }
        }
        cout << "\n";
    }

    return 0;
}

Information

Submit By
Type
Submission
Problem
P1210 A. Smallest Permutation
Contest
Educational Round 1
Language
C++17 (G++ 13.2.0)
Submit At
2025-07-14 15:59:09
Judged At
2025-07-14 15:59:09
Judged By
Score
0
Total Time
0ms
Peak Memory
0 Bytes