제출 #140577

#제출 시각아이디문제언어결과실행 시간메모리
140577luciocf이상한 기계 (APIO19_strange_device)C++14
5 / 100
2 ms396 KiB
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

int main(void)
{
	int n;
	ll A, B;

	scanf("%d %lld %lld", &n, &A, &B);

	ll l, r;
	scanf("%lld %lld", &l, &r);

	ll x = (r-l+1)/B;
	ll g = A/__gcd(B+1, A);

	if (x >= g)
	{
		printf("%lld\n", B*g);
	}
	else
	{
		printf("%lld\n", r-l+1);
	}
}

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

strange_device.cpp: In function 'int main()':
strange_device.cpp:12:7: 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:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%lld %lld", &l, &r);
  ~~~~~^~~~~~~~~~~~~~~~~~~~~
#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...