답안 #31095

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
31095 2017-08-08T12:07:19 Z platinant 라멘 (JOI14_ramen) C++14
100 / 100
0 ms 1180 KB
#include "ramen.h"
#include <vector>
using namespace std;

vector<int> a,b;

void Ramen(int N) {
	for(int i=0;i<N;i+=2){
		if(i+1<N){
			if(Compare(i,i+1)>0){
				a.push_back(i+1);
				b.push_back(i);
			}else{
				a.push_back(i);
				b.push_back(i+1);
			}
		}else{
			a.push_back(i);
			b.push_back(i);
		}
	}

	int x=a[0],y=b[0];
	for(int i=1;i<a.size();i++){
		if(Compare(x,a[i])>0)x=a[i];
		if(Compare(y,b[i])<0)y=b[i];
	}
	Answer(x,y);
}

Compilation message

ramen.cpp: In function 'void Ramen(int)':
ramen.cpp:24:15: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  for(int i=1;i<a.size();i++){
               ^
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1180 KB Output is correct
2 Correct 0 ms 1180 KB Output is correct
3 Correct 0 ms 1180 KB Output is correct
4 Correct 0 ms 1180 KB Output is correct
5 Correct 0 ms 1180 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1180 KB Output is correct
2 Correct 0 ms 1180 KB Output is correct
3 Correct 0 ms 1180 KB Output is correct
4 Correct 0 ms 1180 KB Output is correct
5 Correct 0 ms 1180 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 1180 KB Output is correct
2 Correct 0 ms 1180 KB Output is correct
3 Correct 0 ms 1180 KB Output is correct
4 Correct 0 ms 1180 KB Output is correct
5 Correct 0 ms 1180 KB Output is correct