| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1308526 | trigon | Room Temperature (JOI24_ho_t1) | C++20 | 컴파일 에러 | 0 ms | 0 KiB |
#include<bits/stdc++.h>
int main(){
int n,t;
cin >> n >> t;
int a,b;
cin >> a >> b;
if(b>a) swap(a,b);
int ans = (a-b)%t;
cout<<ans<<endl;
}
컴파일 시 표준 에러 (stderr) 메시지
Main.cpp: In function 'int main()':
Main.cpp:4:3: error: 'cin' was not declared in this scope; did you mean 'std::cin'?
4 | cin >> n >> t;
| ^~~
| std::cin
In file included from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:146,
from Main.cpp:1:
/usr/include/c++/13/iostream:62:18: note: 'std::cin' declared here
62 | extern istream cin; ///< Linked to standard input
| ^~~
Main.cpp:7:11: error: 'swap' was not declared in this scope
7 | if(b>a) swap(a,b);
| ^~~~
Main.cpp:7:11: note: suggested alternatives:
In file included from /usr/include/c++/13/regex:68,
from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:181:
/usr/include/c++/13/bits/regex.h:2230:5: note: 'std::__cxx11::swap'
2230 | swap(match_results<_Bi_iter, _Alloc>& __lhs,
| ^~~~
In file included from /usr/include/c++/13/bits/stl_pair.h:61,
from /usr/include/c++/13/bits/stl_algobase.h:64,
from /usr/include/c++/13/algorithm:60,
from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:51:
/usr/include/c++/13/bits/move.h:189:5: note: 'std::swap'
189 | swap(_Tp& __a, _Tp& __b)
| ^~~~
/usr/include/c++/13/bits/move.h:189:5: note: 'std::swap'
In file included from /usr/include/c++/13/compare:37,
from /usr/include/c++/13/bits/stl_pair.h:65:
/usr/include/c++/13/concepts:243:43: note: 'std::ranges::__cust::swap'
243 | inline constexpr __cust_swap::_Swap swap{};
| ^~~~
In file included from /usr/include/c++/13/exception:164,
from /usr/include/c++/13/stdexcept:38,
from /usr/include/c++/13/system_error:43,
from /usr/include/c++/13/bits/ios_base.h:46,
from /usr/include/c++/13/streambuf:43,
from /usr/include/c++/13/bits/streambuf_iterator.h:35,
from /usr/include/c++/13/iterator:66,
from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:54:
/usr/include/c++/13/bits/exception_ptr.h:230:5: note: 'std::__exception_ptr::swap'
230 | swap(exception_ptr& __lhs, exception_ptr& __rhs)
| ^~~~
In file included from /usr/include/c++/13/filesystem:49,
from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:200:
/usr/include/c++/13/bits/fs_path.h:736:15: note: 'std::filesystem::__cxx11::swap'
736 | inline void swap(path& __lhs, path& __rhs) noexcept { __lhs.swap(__rhs); }
| ^~~~
/usr/include/c++/13/concepts:183:35: note: 'std::ranges::__cust_swap::swap'
183 | template<typename _Tp> void swap(_Tp&, _Tp&) = delete;
| ^~~~
Main.cpp:9:3: error: 'cout' was not declared in this scope; did you mean 'std::cout'?
9 | cout<<ans<<endl;
| ^~~~
| std::cout
/usr/include/c++/13/iostream:63:18: note: 'std::cout' declared here
63 | extern ostream cout; ///< Linked to standard output
| ^~~~
Main.cpp:9:14: error: 'endl' was not declared in this scope; did you mean 'std::endl'?
9 | cout<<ans<<endl;
| ^~~~
| std::endl
In file included from /usr/include/c++/13/bits/unique_ptr.h:42,
from /usr/include/c++/13/memory:78,
from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:56:
/usr/include/c++/13/ostream:735:5: note: 'std::endl' declared here
735 | endl(basic_ostream<_CharT, _Traits>& __os)
| ^~~~