제출 #1089951

#제출 시각아이디문제언어결과실행 시간메모리
1089951solitaryManRoom Temperature (JOI24_ho_t1)C++17
5 / 100
2 ms444 KiB
#include <bits/stdc++.h>

using namespace std;
#define endl "\n"
#define ll long long
#define line cout << "---------------------------" << endl;
#define M -1
#define debug(x) cout << "x " << x << endl;
#define all(a) a.begin(), a.end()
#define INF (int) 1e9


bool sq(int n){
	return n * n;
}
void solve(){
	int n,t; cin >> n >> t;
	if(t == 1){
		cout << 0 << endl;
		return;
	}	
	vector<int> v(n);
	bool flg = 0;
	for(int i = 0; i < n; i++){
		cin >> v[i];
		v[i] %= 2;
		flg |= v[i];
	}
	cout << (*max_element(begin(v),end(v)) == 0 && flg ? 1 : 0 )<< endl;
// 2
// 1 2 3 4 5
// 1 2 1 2 1
// 1 0 1 0 1
}
int32_t main(){
	int t = 1;
	//cin >> t;
	while(t--){solve();}
	    cerr << "Execution time: " << 1000.f * clock() / CLOCKS_PER_SEC << " ms." << endl;

}

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

Main.cpp: In function 'bool sq(int)':
Main.cpp:14:11: warning: '*' in boolean context, suggest '&&' instead [-Wint-in-bool-context]
   14 |  return n * n;
      |         ~~^~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...