제출 #82062

#제출 시각아이디문제언어결과실행 시간메모리
82062heonTavan (COCI16_tavan)C++11
0 / 80
4 ms708 KiB
#include<bits/stdc++.h> using namespace std; int main(){ ios_base::sync_with_stdio(false); cin.tie(0); #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif int n,m,k,x; cin >> n >> m >> k >> x; string s; cin >> s; vector <string> v(m); for(int i = 0; i < m; i++){ cin >> v[i]; sort(v[i].begin(), v[i].end()); } long long curr = 0; int ind = 0; vector <char> rj; for(int i = 0; i < m; i++){ while(curr < x){ curr += max(1 ,(m - i - 1) * k); if(curr >= x){ rj.push_back(v[i][ind]); ind = 0; } else ind++; } curr -= (m - i - 1) * k; } for(auto x : s) (x == '#') ? cout << rj[ind++] : cout << x; }

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

tavan.cpp: In function 'int main()':
tavan.cpp:11:13: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
      freopen("input.txt", "r", stdin);
      ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
tavan.cpp:12:13: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
      freopen("output.txt", "w", stdout);
      ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...