제출 #999025

#제출 시각아이디문제언어결과실행 시간메모리
999025vjudge1Konstrukcija (COCI20_konstrukcija)C++17
15 / 110
1 ms348 KiB
#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;
    }
}

컴파일 시 표준 에러 (stderr) 메시지

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){
      |         ~~^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...