답안 #544168

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
544168 2022-04-01T09:24:21 Z sksusha8853 Tracks in the Snow (BOI13_tracks) C++17
2.1875 / 100
73 ms 35928 KB
#include<bits/stdc++.h>
using namespace std;
#define ll   long long int
#define pb   push_back
#define all(v) v.begin(),v.end()
#define umap unordered_map
void fileIO(string filename) {
	freopen((filename + ".in").c_str(), "r", stdin);
	freopen((filename + ".out").c_str(), "w", stdout);
}
ll mod=1e9+7;

void solve(){
	int h,w;
	cin>>h>>w;
	vector<string>vs(h);
	for(int i=0;i<h;i++){
		cin>>vs[i];
	}
	vector<vector<bool>>vis(h,vector<bool>(w,false));
	int ans=0;
	int cnt1=0,cnt2=0;
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			if(vs[i][j]=='R'){
				cnt1=1;
			}
			if(vs[i][j]=='F'){
				cnt2=1;
			}

			// if(vis[i][j])continue;
			// if(vs[i][j]=='.'){
			// 	vis[i][j]=true;
			// 	continue;
			// }
			// queue<pair<int,int>>Q;

		}
	}
	cout<<cnt1+cnt2;





	
}

int main()
{ios_base::sync_with_stdio(false);cin.tie(0);cin.tie(0);
	 //fileIO("");
	 int t=1;
	 //cin>>t;
	 while(t--)solve();
	 
return 0;}

Compilation message

tracks.cpp: In function 'void solve()':
tracks.cpp:21:6: warning: unused variable 'ans' [-Wunused-variable]
   21 |  int ans=0;
      |      ^~~
tracks.cpp: In function 'void fileIO(std::string)':
tracks.cpp:8:9: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
    8 |  freopen((filename + ".in").c_str(), "r", stdin);
      |  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
tracks.cpp:9:9: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
    9 |  freopen((filename + ".out").c_str(), "w", stdout);
      |  ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 852 KB Output isn't correct
2 Incorrect 1 ms 340 KB Output isn't correct
3 Incorrect 1 ms 212 KB Output isn't correct
4 Incorrect 1 ms 596 KB Output isn't correct
5 Incorrect 1 ms 468 KB Output isn't correct
6 Incorrect 1 ms 212 KB Output isn't correct
7 Incorrect 1 ms 212 KB Output isn't correct
8 Incorrect 0 ms 320 KB Output isn't correct
9 Incorrect 0 ms 340 KB Output isn't correct
10 Incorrect 1 ms 468 KB Output isn't correct
11 Incorrect 1 ms 336 KB Output isn't correct
12 Incorrect 1 ms 468 KB Output isn't correct
13 Incorrect 1 ms 468 KB Output isn't correct
14 Incorrect 1 ms 460 KB Output isn't correct
15 Incorrect 2 ms 852 KB Output isn't correct
16 Incorrect 2 ms 852 KB Output isn't correct
17 Incorrect 2 ms 852 KB Output isn't correct
18 Incorrect 2 ms 584 KB Output isn't correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 724 KB Output isn't correct
2 Incorrect 8 ms 3784 KB Output isn't correct
3 Incorrect 59 ms 35764 KB Output isn't correct
4 Incorrect 14 ms 8516 KB Output isn't correct
5 Incorrect 26 ms 20148 KB Output isn't correct
6 Incorrect 68 ms 35892 KB Output isn't correct
7 Incorrect 1 ms 724 KB Output isn't correct
8 Incorrect 1 ms 724 KB Output isn't correct
9 Incorrect 1 ms 336 KB Output isn't correct
10 Incorrect 1 ms 340 KB Output isn't correct
11 Incorrect 1 ms 724 KB Output isn't correct
12 Incorrect 1 ms 340 KB Output isn't correct
13 Incorrect 8 ms 3712 KB Output isn't correct
14 Incorrect 5 ms 2240 KB Output isn't correct
15 Incorrect 5 ms 2500 KB Output isn't correct
16 Incorrect 4 ms 1736 KB Output isn't correct
17 Incorrect 18 ms 9128 KB Output isn't correct
18 Incorrect 16 ms 9108 KB Output isn't correct
19 Incorrect 13 ms 8540 KB Output isn't correct
20 Incorrect 14 ms 7840 KB Output isn't correct
21 Incorrect 35 ms 20724 KB Output isn't correct
22 Incorrect 25 ms 20088 KB Output isn't correct
23 Incorrect 34 ms 17268 KB Output isn't correct
24 Incorrect 37 ms 20284 KB Output isn't correct
25 Incorrect 60 ms 35816 KB Output isn't correct
26 Correct 33 ms 27340 KB Output is correct
27 Incorrect 45 ms 35900 KB Output isn't correct
28 Incorrect 73 ms 35916 KB Output isn't correct
29 Incorrect 66 ms 35816 KB Output isn't correct
30 Incorrect 56 ms 35084 KB Output isn't correct
31 Incorrect 70 ms 22860 KB Output isn't correct
32 Incorrect 43 ms 35928 KB Output isn't correct