답안 #361499

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
361499 2021-01-30T10:05:37 Z daringtrifles Temperature (POI11_tem) C++17
0 / 100
1000 ms 1772 KB
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long
#define pll pair<ll, ll>
#define FOR(i, a, b) for (signed ll i = (signed ll)(a); i < (signed ll)(b); i++)
#define NEGFOR(i, a, b) for (ll i = (a); i > (b); i--)
#define vll vector<ll>
#define sll set<ll>
#define ld long double
#define inf 1000000000000000000
#define mll multiset<ll>
#define vpll vector<pll>
#define nn << "\n"
#define ss << " "
//10^8 operations per second
//greatest int is 2,147,483,647
//greates long long is 9.22337204e18

//ALL FUNCTIONS SHOULD BE LL!!!!
ll power(ll x, ll n, ll m)
{
    assert(n >= 0);
    x %= m; //note: m*m must be less than 2^63 to avoid ll overflow
    ll res = 1;
    while (n > 0)
    {
        if (n % 2 == 1) //if n is odd
            res = res * x % m;
        x = x * x % m;
        n /= 2; //divide by two
    }
    return res;
}

ll log(ll base, ll number)
{

    int x = base;
    int count = 1;
    while (base < number)
    {
        base *= x;
        count++;
    }
    return count;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    set<pll> s;
    ll n;
    cin >> n;
    ll mx = -inf;
    FOR(i, 0, n)
    {
        ll a, b;
        cin >> a >> b;
        s.insert({a, i});
        set<pll> news;
        for (auto x : s)
        {
            if (x.first <= b)
            {
                news.insert({max(x.first, a), a});
                mx=max(mx,i-x.second);
            }
        }
    }
    cout << mx;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 364 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1079 ms 1156 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1080 ms 1224 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1097 ms 1260 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1048 ms 1772 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1088 ms 1736 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1091 ms 1472 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1053 ms 1260 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1053 ms 1260 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1060 ms 1644 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1089 ms 1628 KB Time limit exceeded
2 Halted 0 ms 0 KB -