제출 #789782

#제출 시각아이디문제언어결과실행 시간메모리
789782Minindu206Roller Coaster Railroad (IOI16_railroad)C++14
컴파일 에러
0 ms0 KiB
#pragma GCC optimize("O3") #pragma GCC target("sse4") #include <bits/stdc++.h> using namespace std; typedef long long ll; typedef long double ld; typedef pair<int, int> pi; typedef pair<ll, ll> pl; typedef pair<ld, ld> pd; typedef vector<int> vi; typedef vector<ld> vd; typedef vector<ll> vl; typedef vector<pi> vpi; typedef vector<pl> vpl; #define FOR(i, a, b) for (int i = a; i < (b); i++) #define F0R(i, a) for (int i = 0; i < (a); i++) #define FORd(i, a, b) for (int i = (b)-1; i >= a; i--) #define F0Rd(i, a) for (int i = (a)-1; i >= 0; i--) #define trav(a, x) for (auto &a : x) #define uid(a, b) uniform_int_distribution<int>(a, b)(rng) #define len(x) (int)(x).size() #define mp make_pair #define pb push_back #define fst first #define nl endl #define sec second #define lb lower_bound #define ub upper_bound #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define ins insert const int MOD = 1000000007; const int MX = INT_MAX; const int MN = INT_MIN; void init() { #ifndef ONLINE_JUDGE freopen("input.in", "r", stdin); freopen("output.out", "w", stdout); #endif } void fastIO() { ios_base::sync_with_stdio(0); cin.tie(0); } void solve() { int n; cin >> n; vi arr(n, 0); F0R(i, n) cin >> arr[i]; sort(all(arr)); do { F0R(i, n) cout << arr[i] << " "; cout << '\n'; } while (next_permutation(all(arr))); } int main() { fastIO(); init(); int t = 1; // cin >> t; while (t--) solve(); return 0; }

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

railroad.cpp: In function 'void init()':
railroad.cpp:38:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   38 |     freopen("input.in", "r", stdin);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
railroad.cpp:39:12: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   39 |     freopen("output.out", "w", stdout);
      |     ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/ld: /tmp/ccOAu92n.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccJKtuvo.o:railroad.cpp:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccOAu92n.o: in function `main':
grader.cpp:(.text.startup+0xf4): undefined reference to `plan_roller_coaster(std::vector<int, std::allocator<int> >, std::vector<int, std::allocator<int> >)'
collect2: error: ld returned 1 exit status