답안 #646017

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
646017 2022-09-28T13:49:20 Z Tenis0206 이상한 기계 (APIO19_strange_device) C++11
0 / 100
1778 ms 524288 KB
#include <bits/stdc++.h>
#define int long long

using namespace std;

int n,a,b;

signed main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin>>n>>a>>b;
    vector<int> v;
    for(int i=1;i<=n;i++)
    {
        int l,r;
        cin>>l>>r;
        for(int j=l;j<=r;j++)
        {
            v.push_back(j % (a * b));
        }
    }
    sort(v.begin(),v.end());
    int rez = 1;
    for(int i=1;i<v.size();i++)
    {
        rez += (v[i]!=v[i-1]);
    }
    cout<<rez<<'\n';
    return 0;
}

Compilation message

strange_device.cpp: In function 'int main()':
strange_device.cpp:25:18: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<long long int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   25 |     for(int i=1;i<v.size();i++)
      |                 ~^~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 12 ms 2896 KB Output is correct
3 Correct 30 ms 4940 KB Output is correct
4 Incorrect 1 ms 468 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Runtime error 520 ms 524288 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 45 ms 8648 KB Output is correct
3 Correct 39 ms 8648 KB Output is correct
4 Correct 37 ms 8628 KB Output is correct
5 Runtime error 497 ms 524288 KB Execution killed with signal 9
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 408 ms 45352 KB Output is correct
3 Runtime error 598 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 408 ms 45352 KB Output is correct
3 Runtime error 598 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 408 ms 45352 KB Output is correct
3 Runtime error 598 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1778 ms 263852 KB Output is correct
3 Runtime error 579 ms 524288 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 12 ms 2896 KB Output is correct
3 Correct 30 ms 4940 KB Output is correct
4 Incorrect 1 ms 468 KB Output isn't correct
5 Halted 0 ms 0 KB -