AtCoder Beginner Contest 019

Submission #7058696

Source codeソースコード

#include<bits/stdc++.h>
using namespace std;

int main(){
    int n;
    cin >> n;
  	vector<pair<int, int>> q;
    for (int i = 0; i < n; i++){
      for (int j = i + 1; j < n; j++) q.push_back({i, j});
    }
    int dist;
    int ans = 0;
    for (int i = 0; i < min(1300, q.size()); i++){
      	int x = q[i].first + 1;
        int y = q[i].second + 1;
        cout << "? " << x << " " << y << endl;
        cin >> dist;
        ans = max(ans, dist);
    }
    cout << "! " << ans << endl;
}

Submission

Task問題 D - 高橋くんと木の直径
User nameユーザ名 lemon_
Created time投稿日時
Language言語 C++14 (GCC 5.4.1)
Status状態 CE
Score得点 -
Source lengthソースコード長 514 Byte
File nameファイル名
Exec time実行時間 -
Memory usageメモリ使用量 -

Compiler messageコンパイルメッセージ

./Main.cpp: In function ‘int main()’:
./Main.cpp:13:43: error: no matching function for call to ‘min(int, std::vector<std::pair<int, int> >::size_type)’
for (int i = 0; i < min(1300, q.size()); i++){
^
In file included from /usr/include/c++/5/bits/char_traits.h:39:0,
from /usr/include/c++/5/ios:40,
from /usr/include/c++/5/istream:38,
from /usr/include/c++/5/sstream:38,
from /usr/include/c++/5/complex:45,
from /usr/include/c++/5/ccomplex:38,
from /usr/include/x86_64-linux-gnu/c++/5/bits/stdc++.h:52,
from ./Main.cpp:1:
/usr/include/c++/5/bits/stl_algobase.h:195:5: note: candidate: template<class _Tp> constexpr const _Tp& std::min(const _Tp&, const _Tp&)
min(const _Tp& __a, const _Tp& __b)
^
/usr/include/c++/5/bits/stl_algobase.h:195:5: note: template argument deduction/substitution failed:
./Main.cpp:13:43: note: deduced conflicting...

Test case