제출 #781464

#제출 시각아이디문제언어결과실행 시간메모리
781464makanhuliaStrange Device (APIO19_strange_device)C++17
10 / 100
5055 ms524288 KiB
#include <bits/stdc++.h> #define LL long long #define fi first #define se second using namespace std; int main() { LL n,a,b; scanf("%lld %lld %lld",&n,&a,&b); set<pair<int,int>>s; for(LL i=1;i<=n;i++) { LL x,y; scanf("%lld %lld",&x,&y); for(LL X=x;X<=y;X++) { LL amb=X/b; s.insert(make_pair(((X+amb)%a),X%b)); } } printf("%lld\n",s.size()); }

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

strange_device.cpp: In function 'int main()':
strange_device.cpp:22:14: warning: format '%lld' expects argument of type 'long long int', but argument 2 has type 'std::set<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wformat=]
   22 |   printf("%lld\n",s.size());
      |           ~~~^    ~~~~~~~~
      |              |          |
      |              |          std::set<std::pair<int, int> >::size_type {aka long unsigned int}
      |              long long int
      |           %ld
strange_device.cpp:9:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |   scanf("%lld %lld %lld",&n,&a,&b);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
strange_device.cpp:14:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   14 |     scanf("%lld %lld",&x,&y);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~
#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...