제출 #1128094

#제출 시각아이디문제언어결과실행 시간메모리
1128094bahabilMoney (IZhO17_money)C++20
0 / 100
44 ms320 KiB
#include <iostream>

using namespace std;

#define int long long
#define size() sz 
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()

const int N=2e5+10;
int a[N];

signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
	int n;
	cin >> n;
	bool f=true;
	for(int i = 1;i <= n; i++) 
	{
		cin>>a[i];
	}
	int cnt=0;
	for(int i = 1;i < n; i++) {
		if(a[i]>a[i-1]) {
			cnt++;
		}
	}
	cout<<cnt;
}

컴파일 시 표준 에러 (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("input.txt", "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("output.txt", "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...