제출 #292704

#제출 시각아이디문제언어결과실행 시간메모리
292704BTheroPort Facility (JOI17_port_facility)C++17
10 / 100
543 ms512 KiB
// chrono::system_clock::now().time_since_epoch().count() #include<bits/stdc++.h> #define pb push_back #define eb emplace_back #define mp make_pair #define fi first #define se second #define all(x) (x).begin(), (x).end() #define debug(x) cerr << #x << " = " << x << endl; using namespace std; typedef long long ll; typedef pair<int, int> pii; const int MAXN = (int)2e3 + 5; const int MOD = (int)1e9 + 7; int addMod(int a, int b, int m = MOD) { a += b; if (m <= a) { a -= m; } return a; } int mulMod(int a, int b, int m = MOD) { return a * 1ll * b % m; } int dp[MAXN][MAXN]; pii arr[MAXN]; int n; bool ok(pii a, pii b) { return a.se < b.fi || a.se > b.se; } bool bit(int x, int p) { return x & (1 << p); } void solve() { scanf("%d", &n); for (int i = 1; i <= n; ++i) { scanf("%d %d", &arr[i].fi, &arr[i].se); } sort(arr + 1, arr + n + 1); int ans = 0; for (int mask = 0; mask < (1 << n); ++mask) { bool ok = 1; for (int i = 1; i <= n && ok; ++i) { for (int j = i + 1; j <= n && ok; ++j) { if (bit(mask, i) == bit(mask, j)) { if (arr[j].fi <= arr[i].se && arr[i].se <= arr[j].se) { ok = 0; } } } } if (ok) { ans++; } } printf("%d\n", ans); } int main() { int tt = 1; while (tt--) { solve(); } return 0; }

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

port_facility.cpp: In function 'void solve()':
port_facility.cpp:47:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   47 |   scanf("%d", &n);
      |   ~~~~~^~~~~~~~~~
port_facility.cpp:50:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   50 |     scanf("%d %d", &arr[i].fi, &arr[i].se);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...