Submission #709988

# Submission time Handle Problem Language Result Execution time Memory
709988 2023-03-15T02:27:56 Z pcc Konstrukcija (COCI20_konstrukcija) C++14
15 / 110
1 ms 212 KB
#include <bits/stdc++.h>
using namespace std;

#define pii pair<int,int> 
#define fs first
#define sc second
int main(){
    int k;
    cin>>k;
    if(k>0){
        vector<pii> v;
        for(int i = 2;i<=k+2;i++){
            v.push_back({1,i});
            v.push_back({i,1000});
        }
        cout<<1000<<' '<<v.size()<<'\n';
        for(auto &i:v)cout<<i.fs<<' '<<i.sc<<'\n';
    }
    else{
        vector<pii> v;
        int id = 2;
        for(int i = 0;i<=abs(k);i++){
            v.push_back({1,id});
            v.push_back({id,id+1});
            v.push_back({id+1,1000});
        }
        cout<<1000<<' '<<v.size()<<'\n';
        for(auto &i:v)cout<<i.fs<<' '<<i.sc<<'\n';
    }
    return 0;
}
/*
-C(x,0)+C(x,1)-C(X,2)+C(X,3)-C(x,4)+...+-C(x,x) if x is odd:0
if x is even:
x = 0:-1
x = 2:-1+2-1=0
x = 4:-1+4-6+4-1 =0
*/
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Correct.
2 Correct 1 ms 212 KB Correct.
3 Correct 1 ms 212 KB Correct.
4 Correct 1 ms 212 KB Correct.
5 Correct 1 ms 212 KB Correct.
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Wrong output format.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Correct.
2 Correct 1 ms 212 KB Correct.
3 Correct 1 ms 212 KB Correct.
4 Correct 1 ms 212 KB Correct.
5 Correct 1 ms 212 KB Correct.
6 Incorrect 1 ms 212 KB Wrong output format.
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Correct.
2 Correct 1 ms 212 KB Correct.
3 Correct 1 ms 212 KB Correct.
4 Correct 1 ms 212 KB Correct.
5 Correct 1 ms 212 KB Correct.
6 Incorrect 1 ms 212 KB Wrong output format.
7 Halted 0 ms 0 KB -