답안 #1027622

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1027622 2024-07-19T08:03:04 Z FIFI_cpp Unija (COCI17_unija) C++17
60 / 100
618 ms 53796 KB
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <stack>
#include <deque>
#include <fstream>
#include <iterator>
#include <set>
#include <map>
#include <unordered_map>
#include <iomanip>
#include <cctype>
#include <string>
#include <cassert>
#include <set>
#include <bitset>
#include <unordered_set>
using ll = int64_t;
#define pb push_back
#define all(a) a.begin(),a.end()
#define ppi pair<pair<int,int>,int>
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int int64_t
// xcode cant include bits/stdc++.h
using namespace std;
//ifstream fin ("sleepy.in");
//ofstream fout ("sleepy.out");
/*   /\_/\
*   (= ._.)
*   / >  \>
*/
// encouraging cat
const int INF = 100000000000000;
const int mod = 1000000007;
const int MAXN = 100001;
int32_t main() {
    int n;
    cin >> n;
    unordered_map<int, int> h;
    for (int i = 0;i < n;i++)
    {
        int x,y;
        cin >> x >> y;
        h[x/2] = max(h[x/2],y/2);
    }
    int mx = 0;
    int a = 0;
    for (int i = MAXN - 1;i >= 1;i--)
    {
        mx = max(h[i],mx);
        a += mx;
    }
    a *= 4;
    cout << a << '\n';
    return 0;
}

Compilation message

unija.cpp:32:9: warning: "/*" within comment [-Wcomment]
   32 | /*   /\_/\
      |
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 4968 KB Output is correct
2 Correct 5 ms 4972 KB Output is correct
3 Correct 4 ms 4972 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 4972 KB Output is correct
2 Correct 4 ms 5088 KB Output is correct
3 Correct 5 ms 4984 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 4972 KB Output is correct
2 Correct 6 ms 4972 KB Output is correct
3 Correct 6 ms 4972 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 4972 KB Output is correct
2 Correct 7 ms 4972 KB Output is correct
3 Correct 6 ms 4972 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 618 ms 53696 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 4972 KB Output is correct
2 Correct 4 ms 4972 KB Output is correct
3 Correct 5 ms 4972 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 18 ms 4972 KB Output is correct
2 Correct 16 ms 5100 KB Output is correct
3 Correct 15 ms 4972 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 52 ms 6952 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 148 ms 15740 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 609 ms 53796 KB Output isn't correct
2 Halted 0 ms 0 KB -