답안 #335235

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
335235 2020-12-11T16:26:45 Z ronnith Konstrukcija (COCI20_konstrukcija) C++14
0 / 110
1 ms 364 KB
#include <bits/stdc++.h>
typedef long long ll;
#define sz(a) int((a).size())
#define trav(a, b) for(auto a : b)
#define mk make_pair
#define f first
#define s second
#define pb push_back
using namespace std;

vector<pair<int, int>> edge;
int cnt = 2;

int main(){
	// ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	ll k;scanf("%lld", &k);
	// cerr << k << '\n';
	for(int i = 0;i < k;i ++){
		edge.pb(mk(1,++cnt));
		edge.pb(mk(cnt, 2));
	}
	// cerr << "yes";
	printf("%d %d\n", cnt, sz(edge));
	trav(e, edge){
		if(e.f == 2)e.f = cnt;
		else if(e.f == cnt)e.f = 2;

		if(e.s == 2)e.s = cnt;
		else if(e.s == cnt)e.s = 2;
		printf("%d %d\n", e.f, e.s);
	}
	return 0;
}

Compilation message

konstrukcija.cpp: In function 'int main()':
konstrukcija.cpp:16:12: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   16 |  ll k;scanf("%lld", &k);
      |       ~~~~~^~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 364 KB Wrong answer.
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 364 KB Wrong answer.
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 364 KB Wrong answer.
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 364 KB Wrong answer.
2 Halted 0 ms 0 KB -