QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#340113#1807. Distribute the BarsHKOI0#WA 1ms3732kbC++20456b2024-02-28 15:17:422024-02-28 15:17:43

Judging History

你现在查看的是最新测评结果

  • [2024-02-28 15:17:43]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3732kb
  • [2024-02-28 15:17:42]
  • 提交

answer

#include <bits/stdc++.h>

using namespace std;
using ll = long long;

void solve() {
    int n;
    cin>>n;
    if(n>=4&&n%2==0) {
        cout<<n/2<<'\n';
        for(int i=1;i<=n/2;i++) cout<<2<<' '<<i*2-1<<' '<<n*2-i*2+1<<'\n';
    }
    else cout<<-1<<'\n';
}

int32_t main() {
#ifndef LOCAL
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
#endif
    int T = 1;
    // cin >> T;
    while (T--) solve();
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3688kb

input:

4

output:

2
2 1 7
2 3 5

result:

ok OK (2 groups)

Test #2:

score: 0
Accepted
time: 0ms
memory: 3732kb

input:

2

output:

-1

result:

ok OK (impossible)

Test #3:

score: 0
Accepted
time: 0ms
memory: 3660kb

input:

3

output:

-1

result:

ok OK (impossible)

Test #4:

score: -100
Wrong Answer
time: 0ms
memory: 3580kb

input:

1659

output:

-1

result:

wrong answer Jury found the solution, contestant isn't