제출 #124433

#제출 시각아이디문제언어결과실행 시간메모리
124433AyaBenSaad이상한 기계 (APIO19_strange_device)C++14
10 / 100
5077 ms524288 KiB
#include <bits/stdc++.h>
#define ll long long 
// sub 4
using namespace std;

const int M = 2e6 + 6;
int n;
ll a, b;
ll l[M], r[M];
set <pair <ll, ll> >s;

int main () {
    scanf ("%d %lld %lld", &n, &a, &b);
    for (int i = 0; i < n; i++) {
        scanf("%lld %lld", &l[i], &r[i]);
        for (long long j = l[i]; j <= r[i]; j++) {
            long long x = (j + (j/b)) % a;
            long long y = j % b;
            s.insert ({x, y});
        }
    }
    printf("%d\n", (int)s.size());

}
 

컴파일 시 표준 에러 (stderr) 메시지

strange_device.cpp: In function 'int main()':
strange_device.cpp:13:11: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
     scanf ("%d %lld %lld", &n, &a, &b);
     ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
strange_device.cpp:15:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
         scanf("%lld %lld", &l[i], &r[i]);
         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...