제출 #523442

#제출 시각아이디문제언어결과실행 시간메모리
523442fatemetmhrInside information (BOI21_servers)C++17
5 / 100
114 ms41240 KiB
// Be name khoda! // #include <bits/stdc++.h> using namespace std; typedef long long ll; const int maxn5 = 5e3 + 10; const int lg = 20; #define pb push_back bool have[maxn5][maxn5]; int ans[maxn5]; int main(){ ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n, q; cin >> n >> q; for(int i = 0; i < n; i++) have[i][i] = ans[i] = true; for(int i = 0; i < n + q - 1; i++){ char ty; cin >> ty; if(ty == 'S'){ int a, b; cin >> a >> b; a--; b--; for(int i = 0; i < n; i++){ ans[i] += (!have[a][i]) + (!have[b][i]); have[a][i] |= have[b][i]; have[b][i] |= have[a][i]; ans[i] -= (!have[a][i]) + (!have[b][i]); } } if(ty == 'Q'){ int a, b; cin >> a >> b; a--; b--; if(have[a][b]) cout << "yes\n"; else cout << "no\n"; } if(ty == 'C'){ int d; cin >> d; cout << ans[--d] << '\n'; } } }

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

servers.cpp: In function 'int main()':
servers.cpp:22:23: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   22 |   have[i][i] = ans[i] = true;
      |                ~~~~~~~^~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...