답안 #404906

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
404906 2021-05-15T09:31:17 Z A_D 이상한 기계 (APIO19_strange_device) C++14
10 / 100
5000 ms 524292 KB
#include <bits/stdc++.h>
#define int long long
#define ii pair<int,int>
#define F first
#define S second
#define du long double
using namespace std;
set<ii> st;
void solve()
{
    int n,a,b;
    cin>>n>>a>>b;
    while(n--){
        int l,r;
        scanf("%lld",&l);
        scanf("%lld",&r);
        for(int i=l;i<=r;i++){
            int x=(i+(i/b))%a;
            int y=i%b;
            st.insert({x,y});
        }
    }
    cout<<st.size()<<endl;
}

main()
{
    int t=1;
    //cin>>t;
    while(t--)solve();
}



Compilation message

strange_device.cpp:26:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   26 | main()
      | ^~~~
strange_device.cpp: In function 'void solve()':
strange_device.cpp:15:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   15 |         scanf("%lld",&l);
      |         ~~~~~^~~~~~~~~~~
strange_device.cpp:16:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   16 |         scanf("%lld",&r);
      |         ~~~~~^~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 65 ms 12260 KB Output is correct
3 Correct 71 ms 17812 KB Output is correct
4 Correct 2 ms 844 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 332 KB Output is correct
7 Correct 2 ms 460 KB Output is correct
8 Correct 1 ms 332 KB Output is correct
9 Correct 8 ms 1100 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 44 ms 6936 KB Output is correct
16 Correct 31 ms 6660 KB Output is correct
17 Correct 73 ms 6536 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Runtime error 3928 ms 524292 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 137 ms 32224 KB Output is correct
3 Correct 187 ms 31948 KB Output is correct
4 Correct 128 ms 30432 KB Output is correct
5 Execution timed out 5068 ms 62548 KB Time limit exceeded
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 639 ms 62768 KB Output is correct
3 Runtime error 2144 ms 524292 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 639 ms 62768 KB Output is correct
3 Runtime error 2144 ms 524292 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 639 ms 62768 KB Output is correct
3 Runtime error 2144 ms 524292 KB Execution killed with signal 9
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Runtime error 1599 ms 524292 KB Execution killed with signal 9
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 65 ms 12260 KB Output is correct
3 Correct 71 ms 17812 KB Output is correct
4 Correct 2 ms 844 KB Output is correct
5 Correct 1 ms 204 KB Output is correct
6 Correct 1 ms 332 KB Output is correct
7 Correct 2 ms 460 KB Output is correct
8 Correct 1 ms 332 KB Output is correct
9 Correct 8 ms 1100 KB Output is correct
10 Correct 1 ms 204 KB Output is correct
11 Correct 1 ms 204 KB Output is correct
12 Correct 1 ms 204 KB Output is correct
13 Correct 1 ms 204 KB Output is correct
14 Correct 1 ms 204 KB Output is correct
15 Correct 44 ms 6936 KB Output is correct
16 Correct 31 ms 6660 KB Output is correct
17 Correct 73 ms 6536 KB Output is correct
18 Correct 1 ms 204 KB Output is correct
19 Correct 1 ms 204 KB Output is correct
20 Runtime error 3928 ms 524292 KB Execution killed with signal 9
21 Halted 0 ms 0 KB -