| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 789530 | fatemetmhr | 라멘 (JOI14_ramen) | C++17 | 3 ms | 340 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
// ~ Be Name Khoda ~ //
#include "ramen.h"
#include <bits/stdc++.h>
//#pragma GCC optimize ("O3")
//#pragma GCC target("avx2")
//#pragma GCC optimize("unroll-loops,Ofast")
using namespace std;
typedef long long ll;
#define pb push_back
#define mp make_pair
#define all(x) x.begin(), x.end()
#define fi first
#define se second
const int maxn = 1e6 + 10;
const int maxn5 = 5e5 + 10;
const int maxnt = 1.2e6 + 10;
const int maxn3 = 1e3 + 10;
const int mod = 1e9 + 7;
const ll inf = 1e18;
int mn[maxn5], mx[maxn5];
vector <int> av1, av2;
void Ramen(int n) {
for(int i = 1; i < n; i += 2){
mx[i - 1] = i - 1;
mn[i - 1] = i;
if(Compare(i, i - 1) == 1)
swap(mx[i - 1], mn[i - 1]);
}
if(n & 1)
mn[n - 1] = mx[n - 1] = n - 1;
for(int i = 0; i < n; i += 2){
av1.pb(mx[i]);
av2.pb(mn[i]);
}
int ans1 = av1[0], ans2 = av2[0];
for(int i = 1; i < av1.size(); i++){
if(Compare(av1[i], ans1) == 1)
ans1 = av1[i];
if(Compare(ans2, av2[i]) == 1)
ans2 = av2[i];
}
Answer(ans2, ans1);
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
