Submission #00007


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#include<iostream>
using namespace std;
int main(){
char a[4]="JOI",b[4]="IOI";
char word[10000];
int z,i=0,j=0;
cin>>word;
for(int s=0;word[s+2]!='\0';s++){
if(word[s]==a[0]){
for(z=0;z<3;z++){
if(word[s+z]!=a[z])break;
}
if(z==3)i++;
}
if(word[s]==b[0]){
for(z=0;z<3;z++){
if(word[s+z]!=b[z])break;
}
if(z==3)j++;
}
}
cout<<i<<endl;
cout<<j<<endl;
return 0;
}

ステータス

項目 データ
問題 0002 - JOI と IOI
ユーザー名 r1625
投稿日時 2016-11-09 16:47:21
言語 C++11
状態 Accepted
得点 100
ソースコード長 457 Byte
最大実行時間 24 ms
最大メモリ使用量 536 KB

セット

セット 得点 Cases
1 set1 20 / 20 *1.txt
2 set2 20 / 20 *2.txt
3 set3 20 / 20 *3.txt
4 set4 20 / 20 *4.txt
5 set5 20 / 20 *5.txt

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
2008-yo-t2-in1.txt AC 22 ms 480 KB
1
2008-yo-t2-in2.txt AC 24 ms 460 KB
2
2008-yo-t2-in3.txt AC 17 ms 440 KB
3
2008-yo-t2-in4.txt AC 16 ms 424 KB
4
2008-yo-t2-in5.txt AC 19 ms 536 KB
5