結果

問題 No.709 優勝可能性
ユーザー memmemmimemmemmi
提出日時 2018-09-25 22:24:25
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,132 bytes
コンパイル時間 1,106 ms
コンパイル使用メモリ 115,808 KB
実行使用メモリ 10,112 KB
最終ジャッジ日時 2024-04-15 22:52:12
合計ジャッジ時間 7,221 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cfloat>
#include <map>
#include <utility>
#include <set>
#include <iostream>
#include <memory>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include <sstream>
#include <complex>
#include <stack>
#include <queue>
#include <iomanip>
#include <array>
#include <numeric>
#include <regex>
#include <bitset>
#include <deque>

using namespace std;
typedef long long ll;
typedef pair<int, int> p_ii;

const int INF = 1e9;
const double PI = acos(-1.0);
const ll MOD = 1e9 + 7;

int N,M,R[100010][10];

int main() {
    stack<int>t[10];
    int pp[100010], res=0;
    cin>>N>>M;
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < M; j++) {
            cin>>R[i][j];
            while(!t[j].empty()&&R[t[j].top()][j]<R[i][j]){
                if(--pp[t[j].top()]==0)res--;
                t[j].pop();
            }
            if(t[j].empty()||R[t[j].top()][j]==R[i][j]){
                if(++pp[i]==1)res++;
                t[j].push(i);
            }
        }
        cout<<res<<endl;
    }
    

    return 0;
}
0