제출 #443290

#제출 시각아이디문제언어결과실행 시간메모리
443290BeanZMoney (IZhO17_money)C++14
0 / 100
0 ms204 KiB
// I_Love_LPL 1y0m2d #include <bits/stdc++.h> using namespace std; #define ll long long #define endl '\n' const int N = 1e5 + 5; long long mod = 1000007; const int lim = 4e5 + 5; const int lg = 20; const int base = 311; const long double eps = 1e-6; ll dp[N][105], a[N]; int main(){ ios_base::sync_with_stdio(false); cin.tie(0); if (fopen("tests.inp", "r")){ freopen("test.inp", "r", stdin); freopen("test.out", "w", stdout); } ll n; cin >> n; set<ll> s; ll nx = -1, ans = 0; for (int i = 1; i <= n; i++){ cin >> a[i]; if (nx < 0 || a[i] < a[i - 1] || a[i] >= nx) { ans++; auto it = s.lower_bound(a[i]); if (it == s.end()) nx = 1e9; nx = *it; } s.insert(a[i]); } cout << ans; } /* 6 3 6 4 5 1 2 Ans: Out: */

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

money.cpp: In function 'int main()':
money.cpp:17:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   17 |         freopen("test.inp", "r", stdin);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
money.cpp:18:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
   18 |         freopen("test.out", "w", stdout);
      |         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...