제출 #786366

#제출 시각아이디문제언어결과실행 시간메모리
786366LIFAliens (IOI16_aliens)C++14
4 / 100
1 ms436 KiB
#include "aliens.h" #include<bits/stdc++.h> #include<vector> using namespace std; int rr[300005]; int cc[300005]; int color[305][305]; long long take_photos(int n, int m, int k, std::vector<int> r, std::vector<int> c) { for(int i=0;i<r.size();i++)rr[i+1] = r[i]+1; for(int i=0;i<c.size();i++)cc[i+1] = c[i]+1; for(int i=1;i<=n;i++) { if(rr[i] > cc[i])swap(rr[i],cc[i]); } if(k == n && m <= 100) { for(int i=1;i<=n;i++) { for(int j=min(rr[i],cc[i]);j<=max(rr[i],cc[i]);j++) { for(int k=min(rr[i],cc[i]);k<=max(rr[i],cc[i]);k++)color[j][k] = 1; } } int cnt = 0; for(int i=1;i<=m;i++) { for(int j=1;j<=m;j++)if(color[i][j] == 1)cnt++; } return cnt; } return 0; }

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

aliens.cpp: In function 'long long int take_photos(int, int, int, std::vector<int>, std::vector<int>)':
aliens.cpp:9:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |  for(int i=0;i<r.size();i++)rr[i+1] = r[i]+1;
      |              ~^~~~~~~~~
aliens.cpp:10:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   10 |  for(int i=0;i<c.size();i++)cc[i+1] = c[i]+1;
      |              ~^~~~~~~~~
#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...