목록알고리즘 (2)
뜌릅
https://www.acmicpc.net/problem/2548 2548번: 대표 자연수 첫째 줄에는 자연수의 개수 N이 입력된다. N은 1 이상 20,000 이하이다. 둘째 줄에는 N개의 자연수가 빈칸을 사이에 두고 입력되며, 이 수들은 모두 1 이상 10,000 이하이다. www.acmicpc.net 매우 간단한 문제이다. 코드포스 a번으로 나올 거 같다. #include using namespace std; #define endl '\n' #define fast_io ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); void solve() { int n; cin>>n; vector v(n); for(auto &x: v)cin>>x; sort(v.begi..
https://www.acmicpc.net/problem/18323 18323번: Photoshoot Farmer John is lining up his $N$ cows ($2\le N\le 10^3$), numbered $1\ldots N$, for a photoshoot. FJ initially planned for the $i$-th cow from the left to be the cow numbered $a_i,$ and wrote down the permutation $a_1,a_2,\ldots,a_N$ on a sheet of paper. U www.acmicpc.net #include using namespace std; #define fast_io ios_base::sync_with_st..