This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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);
}
Compilation message (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... |