提出 #577804


ソースコード 拡げる

#include<bits/stdc++.h>

#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)

using namespace std;

const int MAXY = 1001;
int N;
char D[10010];
int L[10010];

int main(){
  cin >> N;
  rep(i,N) cin >> D[i] >> L[i];
  int y = MAXY , n = 0;
  int cnt = 0;
  rep(i,N){
    if( D[i] == 'y' ) {
      y = min(y,L[i]);
      if( y <= n ) {
	++cnt;
	y = L[i], n = 0;
      }
    } else {
      if( y != MAXY ) {
	n = max(n,L[i]);
      }
      if( y <= n ) {
	++cnt;
	y = MAXY, n = 0;
      }
    }
  }
  if( y != MAXY ) {
    ++cnt;
  }
  cout << cnt << endl;
  return 0;
}

提出情報

提出日時
問題 C - Delete Files
ユーザ konoha
言語 C++ (GCC 4.4.7)
得点 0
コード長 625 Byte
結果 WA
実行時間 27 ms
メモリ 932 KiB

ジャッジ結果

セット名 All
得点 / 配点 0 / 100
結果
AC × 29
WA × 25
セット名 テストケース
All 00_sample_00, 00_sample_01, 00_sample_02, 01_random-small_00, 01_random-small_01, 01_random-small_02, 01_random-small_03, 01_random-small_04, 01_random-small_05, 01_random-small_06, 01_random-small_07, 01_random-small_08, 01_random-small_09, 02_random-large_00, 02_random-large_01, 02_random-large_02, 02_random-large_03, 02_random-large_04, 02_random-large_05, 02_random-large_06, 02_random-large_07, 02_random-large_08, 02_random-large_09, 03_mutual_00, 03_mutual_01, 03_mutual_02, 03_mutual_03, 03_mutual_04, 03_mutual_05, 03_mutual_06, 03_mutual_07, 03_mutual_08, 03_mutual_09, 04_all_00, 04_all_01, 04_all_02, 04_all_03, 04_all_04, 04_all_05, 04_all_06, 04_all_07, 04_all_08, 04_all_09, 05_maximal_00, 05_maximal_01, 05_maximal_02, 05_maximal_03, 05_maximal_04, 05_maximal_05, 05_maximal_06, 05_maximal_07, 05_maximal_08, 05_maximal_09, 99_handmade_00
ケース名 結果 実行時間 メモリ
00_sample_00 AC 24 ms 800 KiB
00_sample_01 AC 23 ms 672 KiB
00_sample_02 AC 24 ms 800 KiB
01_random-small_00 WA 24 ms 928 KiB
01_random-small_01 WA 24 ms 924 KiB
01_random-small_02 AC 24 ms 924 KiB
01_random-small_03 WA 26 ms 920 KiB
01_random-small_04 WA 24 ms 924 KiB
01_random-small_05 WA 24 ms 808 KiB
01_random-small_06 AC 24 ms 928 KiB
01_random-small_07 AC 27 ms 924 KiB
01_random-small_08 AC 23 ms 796 KiB
01_random-small_09 WA 24 ms 924 KiB
02_random-large_00 WA 25 ms 924 KiB
02_random-large_01 WA 24 ms 928 KiB
02_random-large_02 WA 24 ms 676 KiB
02_random-large_03 WA 24 ms 804 KiB
02_random-large_04 WA 23 ms 924 KiB
02_random-large_05 WA 24 ms 924 KiB
02_random-large_06 WA 24 ms 800 KiB
02_random-large_07 WA 25 ms 924 KiB
02_random-large_08 WA 24 ms 800 KiB
02_random-large_09 WA 24 ms 796 KiB
03_mutual_00 WA 24 ms 920 KiB
03_mutual_01 WA 24 ms 804 KiB
03_mutual_02 WA 27 ms 672 KiB
03_mutual_03 WA 23 ms 800 KiB
03_mutual_04 WA 24 ms 796 KiB
03_mutual_05 WA 24 ms 924 KiB
03_mutual_06 WA 24 ms 796 KiB
03_mutual_07 AC 24 ms 920 KiB
03_mutual_08 WA 24 ms 844 KiB
03_mutual_09 WA 24 ms 924 KiB
04_all_00 AC 22 ms 672 KiB
04_all_01 AC 24 ms 800 KiB
04_all_02 AC 23 ms 796 KiB
04_all_03 AC 23 ms 924 KiB
04_all_04 AC 23 ms 804 KiB
04_all_05 AC 23 ms 932 KiB
04_all_06 AC 24 ms 928 KiB
04_all_07 AC 24 ms 796 KiB
04_all_08 AC 24 ms 800 KiB
04_all_09 AC 24 ms 800 KiB
05_maximal_00 AC 24 ms 804 KiB
05_maximal_01 AC 26 ms 812 KiB
05_maximal_02 AC 26 ms 928 KiB
05_maximal_03 AC 25 ms 928 KiB
05_maximal_04 AC 25 ms 720 KiB
05_maximal_05 AC 24 ms 928 KiB
05_maximal_06 AC 25 ms 924 KiB
05_maximal_07 AC 24 ms 928 KiB
05_maximal_08 AC 24 ms 928 KiB
05_maximal_09 AC 25 ms 796 KiB
99_handmade_00 AC 25 ms 920 KiB