제출 #1185059

#제출 시각아이디문제언어결과실행 시간메모리
1185059SmuggingSpunLjeto (COCI21_ljeto)C++20
50 / 50
0 ms328 KiB
#include<bits/stdc++.h>
#define taskname "A"
using namespace std;
const int LIM = 1e3 + 5;
int n, ans[2], a[LIM], b[LIM];
int main(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	if(fopen(taskname".inp", "r")){
		freopen(taskname".inp", "r", stdin);
	}
	cin >> n;
	memset(a, ans[0] = ans[1] = 0, sizeof(a));
	for(int _ = 0; _ < n; _++){
		int t;
		cin >> t >> a[t] >> b[t];
	}
	for(int i = 1; i < LIM; i++){
		if(a[i] != 0){
			for(int j = max(1, i - 10); j < i; j++){
				if(a[j] == a[i]){
					ans[(a[i] - 1) >> 2] += 50;
					break;
				}
			}
			ans[(a[i] - 1) >> 2] += 100;
		}
	}
	cout << ans[0] << " " << ans[1];
}

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

Main.cpp: In function 'int main()':
Main.cpp:9:24: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |                 freopen(taskname".inp", "r", stdin);
      |                 ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…