답안 #124422

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
124422 2019-07-03T10:18:38 Z HassenAissa 이상한 기계 (APIO19_strange_device) C++14
0 / 100
2255 ms 524292 KB
#include <bits/stdc++.h>
using namespace std;


int main()
{
    int n,a,b,t,l;
    scanf("%d%d%d",&n,&a,&b);
    set<pair<int,int> > res;
    for(int i=0;i<n;i++)
    {
        scanf("%d%d",&t,&l);
        for(int j=t;j<=l;j++)
        {
            res.insert(make_pair((int)(j+floor(j/b))%a,j%b));
        }
    }
    printf("%d",res.size());
}

Compilation message

strange_device.cpp: In function 'int main()':
strange_device.cpp:18:27: warning: format '%d' expects argument of type 'int', but argument 2 has type 'std::set<std::pair<int, int> >::size_type {aka long unsigned int}' [-Wformat=]
     printf("%d",res.size());
                 ~~~~~~~~~~^
strange_device.cpp:8:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf("%d%d%d",&n,&a,&b);
     ~~~~~^~~~~~~~~~~~~~~~~~~
strange_device.cpp:12:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%d%d",&t,&l);
         ~~~~~^~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Incorrect 57 ms 9336 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Incorrect 2 ms 376 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 348 KB Output is correct
2 Incorrect 171 ms 27048 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Incorrect 419 ms 364 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Incorrect 419 ms 364 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Incorrect 419 ms 364 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 316 KB Output is correct
2 Runtime error 2255 ms 524292 KB Execution killed with signal 9 (could be triggered by violating memory limits)
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 256 KB Output is correct
2 Incorrect 57 ms 9336 KB Output isn't correct
3 Halted 0 ms 0 KB -