結果
問題 | No.230 Splarraay スプラレェーイ |
ユーザー | るさ |
提出日時 | 2018-05-31 20:32:26 |
言語 | C++11 (gcc 11.4.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 956 bytes |
コンパイル時間 | 1,724 ms |
コンパイル使用メモリ | 26,072 KB |
実行使用メモリ | 8,768 KB |
最終ジャッジ日時 | 2023-09-12 21:05:36 |
合計ジャッジ時間 | 10,528 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,380 KB |
testcase_01 | AC | 2 ms
4,384 KB |
testcase_02 | AC | 2 ms
4,384 KB |
testcase_03 | AC | 1 ms
4,380 KB |
testcase_04 | AC | 1 ms
4,380 KB |
testcase_05 | AC | 1 ms
4,384 KB |
testcase_06 | AC | 8 ms
4,380 KB |
testcase_07 | AC | 2 ms
4,380 KB |
testcase_08 | AC | 2 ms
4,380 KB |
testcase_09 | AC | 630 ms
4,384 KB |
testcase_10 | AC | 28 ms
4,384 KB |
testcase_11 | AC | 215 ms
4,380 KB |
testcase_12 | AC | 628 ms
4,380 KB |
testcase_13 | AC | 19 ms
4,380 KB |
testcase_14 | TLE | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
ソースコード
#include <stdio.h> int main(void){ int n; int q; scanf("%d",&n); scanf("%d",&q); int field[n]; for(int i=0;i<n;i++){ field[i]=0; } int abo=0; int bbo=0; for(int i=0;i<q;i++){ int t; int s; int e; scanf("%d",&t); scanf("%d",&s); scanf("%d",&e); if(t==0){ int acnt=0; int bcnt=0; for(int j=s;j<=e;j++){ acnt+=field[j]==1; bcnt+=field[j]==2; } if(acnt>bcnt){ abo+=acnt; }else if(acnt<bcnt){ bbo+=bcnt; } }else{ for(int j=s;j<=e;j++){ field[j]=t; } } } int acnt=0; int bcnt=0; for(int j=0;j<n;j++){ acnt+=field[j]==1; bcnt+=field[j]==2; } printf("%d",abo+acnt); printf("%s"," "); printf("%d",bbo+bcnt); }