제출 #873413

#제출 시각아이디문제언어결과실행 시간메모리
873413vjudge1Colors (RMI18_colors)C++17
0 / 100
66 ms12880 KiB
#include <bits/stdc++.h> #define f first #define S second #define pb push_back #define msk(x , y) ((x >> y) & 1) #define all(x) x.begin() , x.end() using namespace std; typedef long long int ll; const int N = 2e5 + 7; const ll mod = 1e18; const int dx[] = {-1,-1,1,1,2,-2,2,-2}; const int dy[] = {-2,2,2,-2,1,1,-1,-1}; int n , m , a[N] , b[N] , used[N]; vector <int > g[N]; void solve(){ cin >> n >> m ; for(int i = 1 ; i <= n; i++)cin >> a[i]; for(int i = 1 ; i <= n; i++)cin >> b[i]; int rt = 0 ; for(int i = 1 ; i <= m; i++){ int u , v; cin >> u >> v ; g[u].pb(v); g[v].pb(u); if(g[v].size() == n - 1) rt = v ; if(g[u].size() == n - 1) rt = u ; } for(int i = 1 ; i <= n; i++){ if(a[rt] < b[i]){ cout << "0\n"; return ; } if(a[i] < b[i]){ cout << "0\n"; return ; } used[a[i]] = 1; } for(int i = 1 ; i <= n; i++){ if(used[b[i]]) continue ; cout << "0\n"; return ; } cout << "1\n"; } int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int test=1; cin >> test ; for(int i=1;i<=test;i++){ // cout << "Case " << i << ": "; solve(); } }

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

colors.cpp: In function 'void solve()':
colors.cpp:27:18: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   27 |   if(g[v].size() == n - 1) rt = v ;
      |      ~~~~~~~~~~~~^~~~~~~~
colors.cpp:28:18: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   28 |   if(g[u].size() == n - 1) rt = u ;
      |      ~~~~~~~~~~~~^~~~~~~~
#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...