Submission #486361

# Submission time Handle Problem Language Result Execution time Memory
486361 2021-11-11T11:51:21 Z leinad2 라멘 (JOI14_ramen) C++17
100 / 100
1 ms 204 KB
#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

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 time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct