답안 #345292

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
345292 2021-01-07T07:12:37 Z l3nl3 UFO (IZhO14_ufo) C++14
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>  
 
#define exit exit(false)
 
//#define here() cerr << "herewego\n";
#define show(x) cerr << #x << ": " << x << '\n';
 
#define int long long
//#define double long double
 
#define all(a) a.begin(), a.end()
#define whole(a, p, q) a+p, a+p+q
 
#define ioio() ios_base::sync_with_stdio (0); cin.tie (0); cout.tie (0);
 
using namespace std;
 
//using namespace __gnu_pbds;   
//typedef tree <int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;  

const int mxsz = 1e4 + 7;

int n, m, r, k , p, a[mxsz][mxsz];
char tp;
int x, y, sum;

signed main () { ioio();
	cin >> n >> m >> r >> k >> p;
	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= m; j++) {
			cin >> a[i][j];
			sum += a[i][j];
		}
	}
	while (k--) {
		cin >> tp >> x >> y;
		
	} cout << sum - (rand() % min (100, sum));
}

Compilation message

ufo.cpp: In function 'int main()':
ufo.cpp:40:41: error: no matching function for call to 'min(int, long long int&)'
   40 |  } cout << sum - (rand() % min (100, sum));
      |                                         ^
In file included from /usr/include/c++/9/bits/char_traits.h:39,
                 from /usr/include/c++/9/ios:40,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from ufo.cpp:1:
/usr/include/c++/9/bits/stl_algobase.h:198:5: note: candidate: 'template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)'
  198 |     min(const _Tp& __a, const _Tp& __b)
      |     ^~~
/usr/include/c++/9/bits/stl_algobase.h:198:5: note:   template argument deduction/substitution failed:
ufo.cpp:40:41: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   40 |  } cout << sum - (rand() % min (100, sum));
      |                                         ^
In file included from /usr/include/c++/9/bits/char_traits.h:39,
                 from /usr/include/c++/9/ios:40,
                 from /usr/include/c++/9/istream:38,
                 from /usr/include/c++/9/sstream:38,
                 from /usr/include/c++/9/complex:45,
                 from /usr/include/c++/9/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:54,
                 from ufo.cpp:1:
/usr/include/c++/9/bits/stl_algobase.h:246:5: note: candidate: 'template<class _Tp, class _Compare> constexpr const _Tp& std::min(const _Tp&, const _Tp&, _Compare)'
  246 |     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
      |     ^~~
/usr/include/c++/9/bits/stl_algobase.h:246:5: note:   template argument deduction/substitution failed:
ufo.cpp:40:41: note:   deduced conflicting types for parameter 'const _Tp' ('int' and 'long long int')
   40 |  } cout << sum - (rand() % min (100, sum));
      |                                         ^
In file included from /usr/include/c++/9/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:65,
                 from ufo.cpp:1:
/usr/include/c++/9/bits/stl_algo.h:3444:5: note: candidate: 'template<class _Tp> constexpr _Tp std::min(std::initializer_list<_Tp>)'
 3444 |     min(initializer_list<_Tp> __l)
      |     ^~~
/usr/include/c++/9/bits/stl_algo.h:3444:5: note:   template argument deduction/substitution failed:
ufo.cpp:40:41: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   40 |  } cout << sum - (rand() % min (100, sum));
      |                                         ^
In file included from /usr/include/c++/9/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:65,
                 from ufo.cpp:1:
/usr/include/c++/9/bits/stl_algo.h:3450:5: note: candidate: 'template<class _Tp, class _Compare> constexpr _Tp std::min(std::initializer_list<_Tp>, _Compare)'
 3450 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
/usr/include/c++/9/bits/stl_algo.h:3450:5: note:   template argument deduction/substitution failed:
ufo.cpp:40:41: note:   mismatched types 'std::initializer_list<_Tp>' and 'int'
   40 |  } cout << sum - (rand() % min (100, sum));
      |                                         ^