제출 #800453

#제출 시각아이디문제언어결과실행 시간메모리
800453Tunglam07Naboj (COCI22_naboj)C++17
0 / 110
1077 ms9872 KiB
#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; int sum[n+1]; string s[n+1]; 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"; } }

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

naboj.cpp: In function 'int main()':
naboj.cpp:33:43: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   33 |             if(misum>sum[j]||misum==sum[j]&&s[i]<s[j])
      |                              ~~~~~~~~~~~~~^~~~~~~~~~~
naboj.cpp:37:43: warning: suggest parentheses around '&&' within '||' [-Wparentheses]
   37 |             if(masum>sum[j]||masum==sum[j]&&s[i]<s[j])
      |                              ~~~~~~~~~~~~~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...