답안 #999025

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
999025 2024-06-15T05:18:43 Z vjudge1 Konstrukcija (COCI20_konstrukcija) C++17
15 / 110
1 ms 348 KB
#include <bits/stdc++.h>
using namespace std;

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

    if (1 <= k < 500){
        int n = k + 3;
        vector<pair<int, int>> edges;
        for (int i = 2; i < n; i ++){
            edges.push_back({1, i});
            edges.push_back({i, n});
        }

        cout << n << " " << edges.size() << endl;
        for (auto [u, v] : edges)
            cout << u << " " << v << endl;
    }
}

Compilation message

konstrukcija.cpp: In function 'int main()':
konstrukcija.cpp:8:16: warning: comparison of constant '500' with boolean expression is always true [-Wbool-compare]
    8 |     if (1 <= k < 500){
      |         ~~~~~~~^~~~~
konstrukcija.cpp:8:11: warning: comparisons like 'X<=Y<=Z' do not have their mathematical meaning [-Wparentheses]
    8 |     if (1 <= k < 500){
      |         ~~^~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Correct.
2 Correct 0 ms 348 KB Correct.
3 Correct 1 ms 348 KB Correct.
4 Correct 0 ms 348 KB Correct.
5 Correct 1 ms 348 KB Correct.
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB Integer parameter [name=N] equals to -33, violates the range [1, 1000]
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Correct.
2 Correct 0 ms 348 KB Correct.
3 Correct 1 ms 348 KB Correct.
4 Correct 0 ms 348 KB Correct.
5 Correct 1 ms 348 KB Correct.
6 Incorrect 0 ms 348 KB Integer parameter [name=N] equals to -33, violates the range [1, 1000]
7 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Correct.
2 Correct 0 ms 348 KB Correct.
3 Correct 1 ms 348 KB Correct.
4 Correct 0 ms 348 KB Correct.
5 Correct 1 ms 348 KB Correct.
6 Incorrect 0 ms 348 KB Integer parameter [name=N] equals to -33, violates the range [1, 1000]
7 Halted 0 ms 0 KB -