답안 #1062525

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1062525 2024-08-17T08:16:06 Z kunzaZa183 Amusement Park (CEOI19_amusementpark) C++17
0 / 100
0 ms 348 KB
#include <algorithm>
#include <bits/stdc++.h>
using namespace std;
int main() {
  cin.tie(0)->sync_with_stdio(0);
  cin.exceptions(cin.failbit);
  int n, m;
  cin >> n >> m;
  vector<int> ht(n);
  vector<pair<int, int>> vpii(m);
  for (auto &a : vpii) {
    cin >> a.first >> a.second;
    a.first--, a.second--;
  }
  iota(ht.begin(), ht.end(), 0);
  int sumc = 0;
  const int mod = 998244353;
  do {
    for (auto a : vpii)
      if ((ht[a.first] > ht[a.second])) {
        sumc++;
      }
  } while (next_permutation(ht.begin(), ht.end()));
  cout << sumc << "\n";
}

Compilation message

amusementpark.cpp: In function 'int main()':
amusementpark.cpp:17:13: warning: unused variable 'mod' [-Wunused-variable]
   17 |   const int mod = 998244353;
      |             ^~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Incorrect 0 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -