Submission #00019


ソースコード

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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#include <set>
#include <map>
#include <list>
#include <queue>
#include <stack>
#include <cmath>
#include <ctime>
#include <cstdio>
#include <vector>
#include <string>
#include <bitset>
#include <cctype>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <numeric>
#include <complex>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <cassert>
#include <iostream>
#include <iterator>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef vector<int> vint;
typedef pair<int, int> pint;
typedef vector<long long> vlong;
#define vpush(a,x) a.push_back(x);
#define rep(i, n) REP(i, 0, n)
#define all(v) v.begin(), v.end()
#define REP(i, x, n) for(int i = x; i < n; i++)
#define INF 2e9
signed main(){
cin.tie(0);
ios::sync_with_stdio(false);
int n,m;
int flag=0;
vector <string> ha(n);
cin>>n>>m;
rep(i,n){
cin>>ha[i];
}
int count=0,count2=0,count3=0,min=99999,ans=0;
for(int i=0;i<n-2;i++){
for(int j=i;j<n-1;j++){
count=0;
rep(l,n){
rep(t,m){
if(l>j){
if(ha[l][t]=='W' || ha[l][t]=='B'){
count++;
}
}
else if(l>i){
if(ha[l][t]=='W' || ha[l][t]=='R'){
count++;
}
}
else{
if(ha[l][t]=='B' || ha[l][t]=='R'){
count++;
}
}
}
}
if(count<min){
min=count;
}
}
}
cout<<min<<'\n';
return(0);
}

ステータス

項目 データ
問題 0001 - ロシアの旗 (Russian Flag)
ユーザー名 ei1918
投稿日時 2019-10-30 16:47:14
言語 C++
状態 Accepted
得点 100
ソースコード長 1484 Byte
最大実行時間 32 ms
最大メモリ使用量 1664 KB

セット

セット 得点 Cases
1 INPUT1 20 / 20 *in1.txt
2 INPUT2 20 / 20 *in2.txt
3 INPUT3 20 / 20 *in3.txt
4 INPUT4 20 / 20 *in4.txt
5 INPUT5 20 / 20 *in5.txt

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
2016-yo-t3-in1.txt AC 22 ms 1624 KB
1
2016-yo-t3-in2.txt AC 31 ms 1580 KB
2
2016-yo-t3-in3.txt AC 29 ms 1664 KB
3
2016-yo-t3-in4.txt AC 32 ms 1612 KB
4
2016-yo-t3-in5.txt AC 30 ms 1556 KB
5
2016-yo-t3-in_s1.txt AC 16 ms 1636 KB
2016-yo-t3-in_s2.txt AC 19 ms 1464 KB