結果

問題 No.2372 既視感
ユーザー milanis48663220milanis48663220
提出日時 2023-07-07 21:28:54
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 2,248 bytes
コンパイル時間 1,176 ms
コンパイル使用メモリ 122,004 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-28 22:25:12
合計ジャッジ時間 2,433 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 WA -
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 2 ms
4,376 KB
testcase_08 WA -
testcase_09 AC 2 ms
4,376 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 2 ms
4,376 KB
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 2 ms
4,376 KB
testcase_23 AC 4 ms
4,380 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 AC 4 ms
4,384 KB
testcase_28 AC 10 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <tuple>
#include <cmath>
#include <numeric>
#include <functional>
#include <cassert>

#define debug_value(x) cerr << "line" << __LINE__ << ":<" << __func__ << ">:" << #x << "=" << x << endl;
#define debug(x) cerr << "line" << __LINE__ << ":<" << __func__ << ">:" << x << endl;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

using namespace std;
typedef long long ll;

template<typename T>
vector<vector<T>> vec2d(int n, int m, T v){
    return vector<vector<T>>(n, vector<T>(m, v));
}

template<typename T>
vector<vector<vector<T>>> vec3d(int n, int m, int k, T v){
    return vector<vector<vector<T>>>(n, vector<vector<T>>(m, vector<T>(k, v)));
}

template<typename T>
void print_vector(vector<T> v, char delimiter=' '){
    if(v.empty()) {
        cout << endl;
        return;
    }
    for(int i = 0; i+1 < v.size(); i++) cout << v[i] << delimiter;
    cout << v.back() << endl;
}

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << setprecision(10) << fixed;
    int n, k, q; cin >> n >> k >> q;
    vector<string> v;
    while(q--){
        int t; cin >> t;
        if(t == 1){
            string s; cin >> s;
            v.push_back(s);
        }else{
            vector<string> p(6);
            vector<int> d(6);
            for(int i = 0; i < 6; i++) cin >> p[i] >> d[i];
            int sum = 0;
            for(int i = 0; i < 6; i++){
                int l = max(0, (int)v.size()-n);
                bool ok = false;
                for(int j = l; j < v.size(); j++){
                    if(p[i] == v[j]) ok = true;
                }
                if(ok){
                    sum += min(k, d[i]);
                }else{
                    sum += d[i];
                }
                if(sum > 60){
                    cout << i << endl;
                    break;
                }
                if(i == 5) cout << 6 << endl;
            }
            for(int i = 0; i < 6; i++) v.push_back(p[i]);
        }
    }
}
0