제출 #1312312

#제출 시각아이디문제언어결과실행 시간메모리
1312312lmaobruh순열 (APIO22_perm)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define eb emplace_back #define pb push_back #define fi first #define se second #define ii pair<int,int> #define ve vector #define all(x) x.begin(), x.end() #define fo(i,a,b) for (int i=(a); i<=(b); ++i) #define fd(i,a,b) for (int i=(a); i>=(b); --i) #define popcount(x) __builtin_popcountll(x) #define maxi(a, b) a = max(a, b) #define mini(a, b) a = min(a, b) #define siz(x) ((int)(x).size()) #define vi ve<int> #define _ << ' ' << const int N = 1e6+5, inf = 1e9+10, mod = 1e9+7; const ll lim = 1e18+5; mt19937_64 rng((ll)(new char)); int rand(int l, int r) { return rng() % (r - l + 1) + l; } vi construct_permutation(ll k) { assert(k > 0); if (k == 1) return {}; if (k == 2) return {0}; if (rand(0, 2)) { vi res = construct_permutation(k / 2); res.pb(siz(res)); if (k % 2 == 0) return res; res.insert(res.begin(), siz(res)); return res; } else { int sub = rand(1, 10); vi res = construct_permutation(k - sub); fo(i,1,sub) res.insert(res.begin(), siz(res)); return res; } } void sol() { } signed main(){ ios::sync_with_stdio(0); cin.tie(0); if(fopen("A.inp","r")) { freopen("A.inp","r",stdin); freopen("A.out","w",stdout); } int tc = 1; // cin >> tc; fo(i,1,tc) sol(); return 0; }

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

perm.cpp: In function 'int main()':
perm.cpp:54:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   54 |         freopen("A.inp","r",stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~
perm.cpp:55:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   55 |         freopen("A.out","w",stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~
/usr/bin/ld: /tmp/ccOy1IJH.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/cc7lbi30.o:perm.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status