답안 #796633

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
796633 2023-07-28T15:01:52 Z Tunglam07 Ljeto (COCI21_ljeto) C++17
10 / 50
1 ms 212 KB
#include <bits/stdc++.h>
using namespace std;

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int t, cnt[9],time,p1,p2,sc1=0,sc2=0, tbonus[9];
	memset(tbonus,INT_MAX,9);
	memset(cnt,0,9);
	cin >> t;
	for(int i=1;i<=t;i++)
	{
		cin >> time >> p1 >> p2;
		cnt[p1]++;
		if(p1>=1&&p1<=4)
		{
			sc1+=100;
			if(cnt[p1]>1&&i!=1)
			{
				if((time-tbonus[p1])<=10)
				{
					sc1+=50;
				}
			}
		}
		else
		{
			sc2+=100;
			if(cnt[p1]>1&&i!=1)
			{
				if(abs(time-tbonus[p1])<=10)
				{
					sc2+=50;
				}
			}
		}
		tbonus[p1]=time;
	}
	cout << sc1 << " " << sc2;
}

Compilation message

Main.cpp: In function 'int main()':
Main.cpp:10:25: warning: 'memset' used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]
   10 |  memset(tbonus,INT_MAX,9);
      |                         ^
Main.cpp:11:16: warning: 'memset' used with length equal to number of elements without multiplication by element size [-Wmemset-elt-size]
   11 |  memset(cnt,0,9);
      |                ^
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Incorrect 1 ms 212 KB Output isn't correct
4 Halted 0 ms 0 KB -