Submission #634940

# Submission time Handle Problem Language Result Execution time Memory
634940 2022-08-25T09:18:29 Z minhcool 라멘 (JOI14_ramen) C++17
Compilation error
0 ms 0 KB
ramen
#include "ramen.h"
#include<bits/stdc++.h>
using namespace std;
 
//#define int long long
#define fi first
#define se second
#define pb push_back
//#define mp make_pair
#define foru(i, l, r) for(int i = l; i <= r; i++)
#define ford(i, r, l) for(int i = r; i >= l; i--)
 
typedef pair<int, int> ii;
typedef pair<ii, int> iii;
typedef pair<ii, ii> iiii;
 
const int N = 1e5 + 5;
 
const int oo = 1e18 + 7, mod = 1e9 + 7;
 
int n;
 
void Ramen(int N){
    n = N;
    vector<int> vc1, vc2;
    for(int i = 0; i < n; i += 2){
        if(i == (n - 1)){
            vc1.pb(i);
            vc2.pb(i);
        }
        else{
            if(Compare(i, i + 1) == 1){
                vc2.pb(i);
                vc1.pb(i + 1);
            }
            else{
                vc1.pb(i);
                vc2.pb(i + 1);
            }
        }
    }
    int cur_mn = vc1[0], cur_mx = vc2[0];
    for(int i = 1; i < vc1.size(); i++){
        if(Compare(vc1[i], cur_mx) == -1) cur_mx = i;
    }
    for(int i = 1; i < vc2.size(); i++){
        if(Compare(vc2[i], cur_mn) == 1) cur_mn = i;
    }
    /*
    for(int i = 1; i < n; i++){
        if(Compare(i, cur_mx) == 1) cur_mx = i;
        if(Compare(i, cur_mn) == -1) cur_mn = i;
    }*/
    Answer(cur_mx, cur_mn);
}
 
/*
 
signed main(){
	ios_base::sync_with_stdio(0);
	process();
}
*/

Compilation message

ramen.cpp:1:1: error: 'ramen' does not name a type
    1 | ramen
      | ^~~~~
ramen.cpp:20:21: warning: overflow in conversion from 'double' to 'int' changes value from '1.0e+18' to '2147483647' [-Woverflow]
   20 | const int oo = 1e18 + 7, mod = 1e9 + 7;
      |                ~~~~~^~~
ramen.cpp: In function 'void Ramen(int)':
ramen.cpp:33:16: error: 'Compare' was not declared in this scope
   33 |             if(Compare(i, i + 1) == 1){
      |                ^~~~~~~
ramen.cpp:44:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   44 |     for(int i = 1; i < vc1.size(); i++){
      |                    ~~^~~~~~~~~~~~
ramen.cpp:45:12: error: 'Compare' was not declared in this scope
   45 |         if(Compare(vc1[i], cur_mx) == -1) cur_mx = i;
      |            ^~~~~~~
ramen.cpp:47:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   47 |     for(int i = 1; i < vc2.size(); i++){
      |                    ~~^~~~~~~~~~~~
ramen.cpp:48:12: error: 'Compare' was not declared in this scope
   48 |         if(Compare(vc2[i], cur_mn) == 1) cur_mn = i;
      |            ^~~~~~~