0
1
mirror of https://git.sb/baoshuo/OI-codes.git synced 2024-12-24 18:31:59 +00:00

P1738 洛谷的文件夹

R42014145
This commit is contained in:
Baoshuo Ren 2020-11-16 19:39:45 +08:00 committed by Baoshuo Ren
parent 15bec61c23
commit fa47505d1d
Signed by: baoshuo
GPG Key ID: 70F90A673FB1AB68

23
problem/P1738/P1738.cpp Normal file
View File

@ -0,0 +1,23 @@
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
set<string> disk;
string s, dir;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> s;
dir = "";
for (int j = 0; j < s.size(); j++) {
if (s[j] == '/') {
disk.insert(dir);
}
dir += s[j];
}
disk.insert(dir);
cout << disk.size() - 1 << endl;
}
return 0;
}