結果
| 問題 | No.5019 Hakai Project | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2023-10-02 20:30:35 | 
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 33 ms / 3,000 ms | 
| コード長 | 1,531 bytes | 
| コンパイル時間 | 3,041 ms | 
| コンパイル使用メモリ | 260,152 KB | 
| 実行使用メモリ | 6,676 KB | 
| スコア | 9,148 | 
| 最終ジャッジ日時 | 2023-11-17 09:30:39 | 
| 合計ジャッジ時間 | 10,693 ms | 
| ジャッジサーバーID (参考情報) | judge11 / judge13 | 
| 純コード判定しない問題か言語 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 50 | 
コンパイルメッセージ
main.cpp: In function 'int main()':
main.cpp:14:22: warning: 'C' may be used uninitialized [-Wmaybe-uninitialized]
   14 |         bomb[i].first=C;
main.cpp:13:13: note: 'C' was declared here
   13 |         int C,L;
      |             ^
main.cpp:15:23: warning: 'L' may be used uninitialized [-Wmaybe-uninitialized]
   15 |         for(int j=0; j<L; j++){
      |                      ~^~
main.cpp:13:15: note: 'L' was declared here
   13 |         int C,L;
      |               ^
            
            ソースコード
#include <bits/stdc++.h>
using namespace std;
int main(){
    int N,M;
    cin>>N>>M;
    vector<string> A(N);
    for(int i=0; i<N; i++){
        cin>>A[i];
    }
    vector<pair<int,vector<pair<int,int>>>> bomb(M);
    for(int i=0; i<M; i++){
        int C,L;
        bomb[i].first=C;
        for(int j=0; j<L; j++){
            int a,b;
            cin>>a>>b;
            bomb[i].second.push_back(make_pair(a,b));
        }
    }
    int x=-1,y=-1;
    for(int i=0; i<N; i++){
        for(int j=0; j<N; j++){
            if(A[i][j]=='@'){
                x=i;
                y=j;
                break;
            }
        }
        if(x!=-1)break;
    }
    vector<pair<int,string>> ans;
    for(int i=0; i<x; i++){
        ans.push_back(make_pair(1,"D"));
    }
    for(int i=0; i<y; i++){
        ans.push_back(make_pair(1,"R"));
    }
    for(int i=0; i<N*N; i++){
        ans.push_back(make_pair(2,to_string(1)));
    }
    for(int i=0; i<x; i++){
        ans.push_back(make_pair(1,"U"));
    }
    for(int i=0; i<y; i++){
        ans.push_back(make_pair(1,"L"));
    }
    for(int i=0; i<N; i++){
        for(int j=0; j<N; j++){
            ans.push_back(make_pair(3,to_string(1)));
            if(i==N-1&&j==N-1)break;
            else if(j==N-1)ans.push_back(make_pair(1,"D"));
            else if(i%2==0)ans.push_back(make_pair(1,"R"));
            else ans.push_back(make_pair(1,"L"));
        }
    }
    cout<<ans.size()<<endl;
    for(pair<int,string> i:ans){
        cout<<i.first<<" "<<i.second<<endl;
    }
}
            
            
            
        