Submission #845743

# Submission time Handle Problem Language Result Execution time Memory
845743 2023-09-06T15:13:12 Z vjudge1 Konstrukcija (COCI20_konstrukcija) C++17
15 / 110
1 ms 548 KB
/* Author : Mychecksdead  */
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define MOD (1000000000+7)
#define MOD1 (998244353)
#define pb push_back
#define all(x) x.begin(), x.end()
#define en cout << '\n'
const int N = 1e6+100, M = 1e5+10, K = 18;



int k;
void solve(){
  cin >> k;
  if(k==0){
    cout << "2 0";
    return;
  }
  if(k > 0){
    cout << k + 3 << ' ' << 2*k+2 << '\n';
    for(int i = 2; i < k+3; ++i) cout << 1 << ' ' << i << '\n';
    for(int i = 2; i < k+3; ++i) cout << i << ' ' << k+3 << '\n';
  }else{
    k = -k;
    cout << 2*k+2 << ' ' << 3*k << '\n';
    for(int i = 2; i < 2*k+2; i += 2){
      cout << 1 << ' ' << i << '\n';
      cout << i << ' ' << i + 1 << '\n';
      cout << i + 1 << ' ' << 2*k+2<< '\n';
    } 
  }
}



int main(){
  cin.tie(0); ios::sync_with_stdio(0);
  int tt = 1, aa;
  // freopen("in.txt", "r", stdin);
  // freopen("out.txt", "w", stdout);
  // cin >> tt;
  while(tt--){
    solve();
    // en;
  }
  cerr<<"time taken : "<<(float)clock()/CLOCKS_PER_SEC<<" seconds\n";
  return 0;
}

Compilation message

konstrukcija.cpp: In function 'int main()':
konstrukcija.cpp:40:15: warning: unused variable 'aa' [-Wunused-variable]
   40 |   int tt = 1, aa;
      |               ^~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Correct.
2 Correct 0 ms 344 KB Correct.
3 Correct 1 ms 548 KB Correct.
4 Correct 1 ms 344 KB Correct.
5 Correct 1 ms 344 KB Correct.
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 344 KB Wrong answer.
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Correct.
2 Correct 0 ms 344 KB Correct.
3 Correct 1 ms 548 KB Correct.
4 Correct 1 ms 344 KB Correct.
5 Correct 1 ms 344 KB Correct.
6 Incorrect 0 ms 344 KB Wrong answer.
7 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Correct.
2 Correct 0 ms 344 KB Correct.
3 Correct 1 ms 548 KB Correct.
4 Correct 1 ms 344 KB Correct.
5 Correct 1 ms 344 KB Correct.
6 Incorrect 0 ms 344 KB Wrong answer.
7 Halted 0 ms 0 KB -