답안 #800487

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
800487 2023-08-01T15:25:29 Z Tunglam07 Med (COCI22_med) C++17
50 / 50
1 ms 356 KB
#include<bits/stdc++.h>
using namespace std;
 
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n; 
	cin>>n;
    vector<int> sum(n);
    vector<string> s(n);
    for(int i=0; i<n; i++)
    {
        cin>>s[i];
        for(int j=0; j<5; j++)
        {
            int day; 
			cin>>day;
            sum[i]+=day;
        }
    }
    for(int i=0; i<n; i++)
    {
        int minn=n, maxx=n;
        int misum=sum[i]+500, masum=sum[i]-500;
        for(int j=0; j<n; j++)
        {
            if(i==j)
			{
				continue;
			}
            if(misum>sum[j]||(misum==sum[j]&&s[i]<s[j])) 
			{
				minn--;
			}
            if(masum>sum[j]||(masum==sum[j]&&s[i]<s[j])) 
			{
				maxx--;
			}
 
        }
        cout<<minn<<" "<<maxx<<"\n";
    }
 
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 340 KB Output is correct
6 Correct 1 ms 324 KB Output is correct
7 Correct 1 ms 340 KB Output is correct
8 Correct 1 ms 356 KB Output is correct
9 Correct 1 ms 324 KB Output is correct