제출 #82248

#제출 시각아이디문제언어결과실행 시간메모리
82248tjdgus4384공룡 발자국 (KOI18_footprint)C++14
0 / 100
4 ms508 KiB
#include<cstdio> #include<vector> #include<algorithm> using namespace std; vector<pair<int, int> > v; int x[3000], y[3000]; bool cmp(pair<int, int> a, pair<int, int> b) { return a.first * b.second - a.second * b.first > 0; } int main() { int n, j, m = 1000000000; scanf("%d", &n); for(int i = 0;i < n;i++) { scanf("%d %d", &x[i], &y[i]); if(y[i] < m) {m = y[i];j = i;} } for(int i = 0;i < n;i++) { if(i == j) continue; v.push_back({x[i] - x[j], y[i] - y[j]}); } sort(v.begin(), v.end(), cmp); printf("%d\n", n); printf("%d %d\n", x[j], y[j]); for(int i = 0;i < v.size();i++) { printf("%d %d\n", v[i].first + x[j], v[i].second + y[j]); } return 0; }

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

footprint.cpp: In function 'int main()':
footprint.cpp:30:21: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i = 0;i < v.size();i++)
                   ~~^~~~~~~~~~
footprint.cpp:16:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d", &n);
     ~~~~~^~~~~~~~~~
footprint.cpp:19:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d %d", &x[i], &y[i]);
         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
footprint.cpp:29:11: warning: 'j' may be used uninitialized in this function [-Wmaybe-uninitialized]
     printf("%d %d\n", x[j], y[j]);
     ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...