제출 #659379

#제출 시각아이디문제언어결과실행 시간메모리
659379vinnipuh01Exhibition (JOI19_ho_t2)C++17
0 / 100
95 ms340 KiB
#include <iostream> #include <bits/stdc++.h> #include <cmath> #include <algorithm> #include <vector> #include <deque> #include <set> #include <stack> #include <string> #include <map> #include <queue> #define int long long #define sqrt sqrtl using namespace std; const long long oo = 1000000000000000000; long long sum, ans = 0, mx = 0, mn = 1000000000, num, pos; /* ViHHiPuh (( `'-""``""-'` )) )-__-_.._-__-( / --- (o _ o) --- \ \ .-* ( .0. ) *-. / _'-. ,_ '=' _, .-'_ / `;#'#'# - #'#'#;` \ \_)) -----'#'----- ((_/ # --------- # '# ------- ------ #' /..-'# ------- #'-.\ _\...-\'# -- #'/-.../_ ((____)- '#' -(____)) cout << fixed << setprecision(6) << x; ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); freopen ( "sum.in", "r", stdin ) */ vector <pair<int, int> > v; vector <int> vv; int mp[ 100001 ]; int a[ 100001 ], x, y, dp[ 100001 ], p[ 100001 ], d[ 100001 ], pr[ 100001 ], n, m; void f( int o = 1, int sum = 0, int aa = 0, int b = 0 ) { if ( o == m + 1 ) { ans = max( ans, sum ); return; } for ( int i = 0; i < v.size(); i ++ ) { if ( v[ i ].first <= a[ o ] && a[ o ] >= aa && v[ i ].second >= b && !mp[ i ] ) { mp[ i ] = 1; f( o + 1, sum + 1, a[ o ], v[ i ].second ); mp[ i ] = 0; } } f( o + 1, sum, aa, b ); } main () { cin >> n; cin >> m; for ( int i = 1; i <= n; i ++ ) { cin >> x >> y; v.push_back( { x, y } ); } for ( int i = 1; i <= m; i ++ ) cin >> a[ i ]; sort( a + 1, a + n + 1 ); f(); cout << ans; } /* 8 8 14 4 13 20 12 3 23 10 22 6 18 19 15 1 5 16 11 24 2 21 8 9 17 7 */

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

joi2019_ho_t2.cpp: In function 'void f(long long int, long long int, long long int, long long int)':
joi2019_ho_t2.cpp:58:21: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<std::pair<long long int, long long int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   58 |  for ( int i = 0; i < v.size(); i ++ ) {
      |                   ~~^~~~~~~~~~
joi2019_ho_t2.cpp: At global scope:
joi2019_ho_t2.cpp:68:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
   68 | main () {
      | ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...