17526번 - Star Trek
planet을 많이 이용해야하는 케이스가 없는 것으로 보입니다. 단순 다익스트라도 통과하네요. (채점 번호 15624863)
다음 코드를 수행한 결과를 입력으로 추가하면 어떨까요
#include <iostream> #include <algorithm> using namespace std; int main() { ios_base::sync_with_stdio(false); int n = 100'000; cout << n << "\n"; for (int i = 0; i < n - 1; i++) { cout << 1 << " \n"[i + 1 == n - 1]; } for (int i = 0; i < n - 1; i++) { cout << 0 << " " << (n-i) << "\n"; } return 0; }
#include <iostream> #include <algorithm> #include <cstdlib> using namespace std; int main() { srand(1234); // 적당히 아무 시드나 넣어주세요 ios_base::sync_with_stdio(false); int n = 100'000; cout << n << "\n"; for (int i = 0; i < n - 1; i++) { cout << (rand() % 1000 + 1) << " \n"[i + 1 == n - 1]; } for (int i = 0; i < n - 1; i++) { cout << (rand() % 300) << " " << (n - i) << "\n"; } return 0; }
재채점했습니다.
댓글을 작성하려면 로그인해야 합니다.
kcm1700 7년 전
planet을 많이 이용해야하는 케이스가 없는 것으로 보입니다. 단순 다익스트라도 통과하네요. (채점 번호 15624863)
다음 코드를 수행한 결과를 입력으로 추가하면 어떨까요
#include <iostream> #include <algorithm> using namespace std; int main() { ios_base::sync_with_stdio(false); int n = 100'000; cout << n << "\n"; for (int i = 0; i < n - 1; i++) { cout << 1 << " \n"[i + 1 == n - 1]; } for (int i = 0; i < n - 1; i++) { cout << 0 << " " << (n-i) << "\n"; } return 0; }
#include <iostream> #include <algorithm> #include <cstdlib> using namespace std; int main() { srand(1234); // 적당히 아무 시드나 넣어주세요 ios_base::sync_with_stdio(false); int n = 100'000; cout << n << "\n"; for (int i = 0; i < n - 1; i++) { cout << (rand() % 1000 + 1) << " \n"[i + 1 == n - 1]; } for (int i = 0; i < n - 1; i++) { cout << (rand() % 300) << " " << (n - i) << "\n"; } return 0; }