結果
| 問題 | No.632 穴埋め門松列 | 
| コンテスト | |
| ユーザー |  tkmst201 | 
| 提出日時 | 2021-01-08 15:30:11 | 
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 2 ms / 1,000 ms | 
| コード長 | 940 bytes | 
| コンパイル時間 | 1,833 ms | 
| コンパイル使用メモリ | 194,096 KB | 
| 最終ジャッジ日時 | 2025-01-17 10:44:08 | 
| ジャッジサーバーID (参考情報) | judge4 / judge2 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 6 | 
コンパイルメッセージ
In file included from /usr/include/c++/13/string:54,
                 from /usr/include/c++/13/bitset:52,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:52,
                 from main.cpp:1:
In member function ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::pointer std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::_M_data() const [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’,
    inlined from ‘std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::reference std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator[](size_type) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]’ at /usr/include/c++/13/bits/basic_string.h:1261:16,
    inlined from ‘main()::<lambda(int)>’ at main.cpp:22:9,
    inlined from ‘int main()’ at main.cpp:27:31:
/usr/include/c++/13/bits/basic_string.h:223:28: warning: ‘p’ may be used uninitialized [-Wmaybe-uninitialized]
  223 |       { return _M_dataplus._M_p; }
      |                            ^~~~
main.cpp: In function ‘int main()’:
main.cpp:19:13: note: ‘p’ was declared here
   19 |         int p;
      |             ^
            
            ソースコード
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
#define ALL(v) begin(v),end(v)
template<typename A, typename B> inline bool chmax(A & a, const B & b) { if (a < b) { a = b; return true; } return false; }
template<typename A, typename B> inline bool chmin(A & a, const B & b) { if (a > b) { a = b; return true; } return false; }
using ll = long long;
using pii = pair<int, int>;
constexpr ll INF = 1ll<<30;
constexpr ll longINF = 1ll<<60;
constexpr ll MOD = 1000000007;
constexpr bool debug = false;
//---------------------------------//
int main() {
	string c[3];
	REP(i, 3) cin >> c[i];
	int p;
	REP(i, 3) if (c[i] == "?") p = i;
	auto func = [&](int n) -> bool {
		c[p][0] = n + '0';
		if (c[0] > c[1] && c[1] < c[2]) return true;
		if (c[0] < c[1] && c[1] > c[2]) return true;
		return false;
	};
	for (int i : {1, 4}) if (func(i)) putchar(i + '0');
	putchar('\n');
}
            
            
            
        