이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
#include <iomanip>
#include <fstream>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <string>
#include <tuple>
#include <vector>
#include <map>
#include <unordered_map>
#include <list>
#include <set>
#include <stack>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <random>
#include <cassert>
using namespace std;
#define LL long long
#define MP(a, b) make_pair(a, b)
#define POWER9 1000000000
#define MOD POWER9+7
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -2147483647
#define INT_MAX 2147483647
#define LL_MIN (LL)-9223372036854775807
#define LL_MAX (LL)9223372036854775807
#define PI 3.14159265359
#include"ramen.h"
void Ramen(int N){
if(N == 1){
Answer(0,0);
return;
}
vector<int> minKoho,maxKoho;
for(int i=0; i+1<N; i+=2){
if(Compare(i,i+1) == 1){
maxKoho.push_back(i);
minKoho.push_back(i+1);
}
else{
maxKoho.push_back(i+1);
minKoho.push_back(i);
}
}
if(N%2 == 1){
maxKoho.push_back(N-1);
minKoho.push_back(N-1);
}
int minimum = minKoho[0];
for(int i=1; i<minKoho.size(); i++){
if(Compare(minimum,minKoho[i]) == 1) minimum = minKoho[i];
}
int maximum = maxKoho[0];
for(int i=1; i<maxKoho.size(); i++){
if(Compare(maxKoho[i],maximum) == 1) maximum = maxKoho[i];
}
Answer(minimum, maximum);
}
컴파일 시 표준 에러 (stderr) 메시지
ramen.cpp: In function 'void Ramen(int)':
ramen.cpp:56:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=1; i<minKoho.size(); i++){
~^~~~~~~~~~~~~~~
ramen.cpp:60:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i=1; i<maxKoho.size(); i++){
~^~~~~~~~~~~~~~~
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |