結果
問題 |
No.3091 The Little Match Boy
|
ユーザー |
|
提出日時 | 2025-04-06 15:45:41 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,302 bytes |
コンパイル時間 | 2,120 ms |
コンパイル使用メモリ | 201,712 KB |
実行使用メモリ | 8,576 KB |
最終ジャッジ日時 | 2025-04-06 15:45:48 |
合計ジャッジ時間 | 5,887 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 4 WA * 49 RE * 9 |
コンパイルメッセージ
main.cpp:16:12: warning: use of ‘auto’ in parameter declaration only available with ‘-std=c++20’ or ‘-fconcepts’ 16 | bool chmin(auto &a, const auto &b) { | ^~~~ main.cpp:16:27: warning: use of ‘auto’ in parameter declaration only available with ‘-std=c++20’ or ‘-fconcepts’ 16 | bool chmin(auto &a, const auto &b) { | ^~~~ main.cpp:21:12: warning: use of ‘auto’ in parameter declaration only available with ‘-std=c++20’ or ‘-fconcepts’ 21 | bool chmax(auto &a, const auto &b) { | ^~~~ main.cpp:21:27: warning: use of ‘auto’ in parameter declaration only available with ‘-std=c++20’ or ‘-fconcepts’ 21 | bool chmax(auto &a, const auto &b) { | ^~~~
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; using ld = long double; template <class T> using vc = vector<T>; template <class T> using vvc = vc<vc<T>>; #define overload4(a, b, c, d, name, ...) name #define rep1(n) for (ll i = 0; i < n; ++i) #define rep2(i, n) for (ll i = 0; i < n; ++i) #define rep3(i, a, b) for (ll i = a; i < b; ++i) #define rep4(i, a, b, c) for (ll i = a; i < b; i += c) #define rep(...) overload4(__VA_ARGS__, rep4, rep3, rep2, rep1)(__VA_ARGS__) #define all(i) begin(i), end(i) bool chmin(auto &a, const auto &b) { if (a <= b) return 0; a = b; return 1; } bool chmax(auto &a, const auto &b) { if (a >= b) return 0; a = b; return 1; } void solve(); int main() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(20); ll t = 1; // cin >> t; for (int i = 1; i <= t; i++) solve(); return 0; } ll dy[] = {0, 1, 0, -1}, dx[] = {1, 0, -1, 0}; void solve() { ll n, m; cin >> n >> m; vector<ll> a(m); rep(i, n) cin >> a[i], a[i]--; vector<ll> cur(n); iota(all(cur), 0); set<pair<ll, ll>> st; for (auto x : a) { swap(cur[x], cur[x + 1]); st.insert({min(cur[x], cur[x + 1]), max(cur[x], cur[x + 1])}); } cout << st.size() << endl; }