제출 #1064538

#제출 시각아이디문제언어결과실행 시간메모리
1064538chandu33Ljeto (COCI21_ljeto)C++17
50 / 50
1 ms436 KiB

#include <bits/stdc++.h>
using namespace std;

int main() {
	int n;
	scanf("%d", &n);
	int team1 = 0, team2 = 0;
	vector<int> last(9, -1);
	for(int i = 0; i < n; i++) {
		int t, a, b;
		scanf("%d %d %d", &t, &a, &b);
		if(a >= 1 && a <= 4) {
			team1 += 100;
		} else {
			team2 += 100;
		}
		if(last[a] == -1) {
			last[a] = t;
		} else {
			int diff = t - last[a];
			if(diff <= 10) {
				if(a >= 1 && a <= 4) {
					team1 += 50;
				} else {
					team2 += 50;
				}
			}
			last[a] = t;
		} 
	}
	printf("%d %d", team1, team2);
}

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

Main.cpp: In function 'int main()':
Main.cpp:7:7: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    7 |  scanf("%d", &n);
      |  ~~~~~^~~~~~~~~~
Main.cpp:12:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |   scanf("%d %d %d", &t, &a, &b);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...