제출 #1368876

#제출 시각아이디문제언어결과실행 시간메모리
1368876ezzzayFind the Box (EGOI23_findthebox)C++20
20 / 100
1 ms412 KiB
#include<bits/stdc++.h>
using namespace std;
#define ff first
#define ss second
#define pb push_back
signed main(){
    int n,m;
    cin>>n>>m;
    vector<int>v;
	for(int i=0;i<n;i++)v.pb(i);
	mt19937 mt(3);
	random_shuffle(v.begin(),v.end(), [&](int p){
		return mt()%p;	
	});
    for(int i=0;i<n;i++){
        int Y=v[i];
        cout<<"? ";
        for(int j=0;j<=Y-1;j++){
            cout<<"v";
        }
        for(int j=0;j<m;j++){
            cout<<'>';
        }
        cout<<endl;
        int y,x;
        cin>>y>>x;
        if(y==Y and x==m-1)continue;
        if(y== Y-1){
            cout<<"! "<<y+1<<" "<<0<<endl;
            return 0;
        }
        else if(y==Y){
            cout<<"! "<<y<<" "<<x+1<<endl;
            return 0;
        }
    }
}

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

Main.cpp: In function 'int main()':
Main.cpp:12:23: warning: 'void std::random_shuffle(_RAIter, _RAIter, _Generator&&) [with _RAIter = __gnu_cxx::__normal_iterator<int*, vector<int> >; _Generator = main()::<lambda(int)>]' is deprecated: use 'std::shuffle' instead [-Wdeprecated-declarations]
   12 |         random_shuffle(v.begin(),v.end(), [&](int p){
      |         ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   13 |                 return mt()%p;
      |                 ~~~~~~~~~~~~~~
   14 |         });
      |         ~~             
In file included from /usr/include/c++/13/algorithm:61,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:51,
                 from Main.cpp:1:
/usr/include/c++/13/bits/stl_algo.h:4620:5: note: declared here
 4620 |     random_shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last,
      |     ^~~~~~~~~~~~~~
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…
#결과 실행 시간메모리채점기 출력
결과를 불러오는 중입니다…