제출 #1091501

#제출 시각아이디문제언어결과실행 시간메모리
1091501quangminh412Stove (JOI18_stove)C++14
0 / 100
0 ms344 KiB
#include <bits/stdc++.h> using namespace std; /* John Watson Mua Code nhu mua Florentino !! */ #define faster() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); #define ll long long const int maxn = 5e5 + 9; int n, m; int t[maxn], a[maxn]; bool solve(int k) { int pre = k; unordered_map<int, int> mp; int i = 1; while (i <= m) { if (mp[a[i]] == t[i]) pre--; mp[a[i]] = 1; i++; if (pre == 0) break; } if (i == m + 1) return true; set<int> se; for (auto it : mp) if (it.second != 0) se.insert(it.first); for (int j = i; j <= m; j++) { auto it1 = lower_bound(se.begin(), se.end(), a[j]); auto it2 = it1; it2--; } } signed main() { if (fopen("test.inp", "r")) { freopen("test.inp", "r", stdin); freopen("test.out", "w", stdout); } faster(); cin >> n >> m; vector<pair<int, int>> v(m); for (int i = 0; i < m; i++) cin >> v[i].first; for (int i = 0; i < m; i++) cin >> v[i].second; sort(v.begin(), v.end()); for (int i = 1; i <= m; i++) { t[i] = v[i - 1].first; a[i] = v[i - 1].second; } return 0; }

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

stove.cpp: In function 'bool solve(int)':
stove.cpp:21:26: warning: control reaches end of non-void function [-Wreturn-type]
   21 |  unordered_map<int, int> mp;
      |                          ^~
stove.cpp: In function 'int main()':
stove.cpp:45:10: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   45 |   freopen("test.inp", "r", stdin);
      |   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
stove.cpp:46:10: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   46 |   freopen("test.out", "w", stdout);
      |   ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...