結果
| 問題 | No.3327 うるせぇ、ポリオミノぶつけんぞ |
| コンテスト | |
| ユーザー |
のらら
|
| 提出日時 | 2024-12-27 22:36:26 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 940 bytes |
| 記録 | |
| コンパイル時間 | 6,880 ms |
| コンパイル使用メモリ | 176,276 KB |
| 実行使用メモリ | 14,592 KB |
| 最終ジャッジ日時 | 2024-12-28 12:44:54 |
| 合計ジャッジ時間 | 59,464 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 8 TLE * 16 |
ソースコード
#include <iostream>
#include <algorithm>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
//TLE想定
int main(){
int N, Q;
cin >> N >> Q;
vector<int> A(N, 0);
for(int i = 0; i < N; i++) cin >> A[i];
for(int q = 0; q < Q; q++){
int c, target;
cin >> c >> target;
if(c == 1){
int ans = -1;
for(int i = 0; i < N; i++){
if(A[i] > target){
ans = i + 1;
A[i] = 0;
break;
}
}
cout << ans << endl;
}
if(c == 2){
int ans = -1;
for(int i = N - 1; i >= 0; i--){
if(A[i] > target){
ans = i + 1;
A[i] = 0;
break;
}
}
cout << ans << endl;
}
}
return 0;
}
のらら