Submission #486361

#TimeUsernameProblemLanguageResultExecution timeMemory
486361leinad2라멘 (JOI14_ramen)C++17
100 / 100
1 ms204 KiB
#include "ramen.h" #include<bits/stdc++.h> using namespace std; void Ramen(int N) { vector<int>A, B; for(int i=0;i<N;i+=2) { if(i==N-1) { A.push_back(i); B.push_back(i); } else { if(Compare(i, i+1)==1)B.push_back(i),A.push_back(i+1); else A.push_back(i),B.push_back(i+1); } } int mx=A[0]; for(int i=1;i<A.size();i++) { if(Compare(A[i], mx)==-1)mx=A[i]; } int mn=B[0]; for(int i=1;i<B.size();i++) { if(Compare(B[i], mn)==1)mn=B[i]; } Answer(mx, mn); }

Compilation message (stderr)

ramen.cpp: In function 'void Ramen(int)':
ramen.cpp:21:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   21 |     for(int i=1;i<A.size();i++)
      |                 ~^~~~~~~~~
ramen.cpp:26:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   26 |     for(int i=1;i<B.size();i++)
      |                 ~^~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...