Submission #102952

#TimeUsernameProblemLanguageResultExecution timeMemory
102952AbduMMoney (IZhO17_money)C++14
0 / 100
4 ms640 KiB
#include <bits/stdc++.h> #define all(x) x.begin(), x.end() #define sz(s) (ll)(s.size()) #define pb push_back #define pf push_front #define ppb pop_back() #define ppf pop_front() #define F first #define S second #define MP make_pair #define ort1 exit(0); #define nl "\n" #define rep(i, l, r) for(int i = (l); i <= (r); ++i) #define per(i, l, r) for(int i = (l); i >= (r); --i) #define TL clock() / (double)CLOCKS_PER_SEC #define NFS ios_base :: sync_with_stdio(0), cin.tie(0), cout.tie(0); using namespace std; typedef long long ll; typedef unsigned long long ull; typedef double db; const double pi = acos(-1.0); const double eps = 1e-7; const long long inf = 1e12 + 1; const long long INF = 1e18 + 1; const int mod = 1e9 + 7; const int N = 5e5 + 7; int n; int a[N]; int main(){ NFS #ifdef ioi freopen("in.txt", "r", stdin); #else freopen("money.in", "r", stdin); freopen("money.out", "w", stdout); #endif cin >> n; rep(i, 1, n){ cin >> a[i]; } int ans = 1; rep(i, 1, n - 1){ if(a[i] > a[i + 1]) ans++; } cout << ans; #ifdef ioi cout << nl << TL << nl; #endif // ioi ort1 }

Compilation message (stderr)

money.cpp: In function 'int main()':
money.cpp:41:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
         freopen("money.in", "r", stdin);
         ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
money.cpp:42:16: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)', declared with attribute warn_unused_result [-Wunused-result]
         freopen("money.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...