QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#610000#8048. Roman Masteryimg#Compile Error//C++20990b2024-10-04 14:40:262024-10-04 14:40:28

Judging History

你现在查看的是最新测评结果

  • [2024-10-04 14:40:28]
  • 评测
  • [2024-10-04 14:40:26]
  • 提交

answer

#include<Bits/stdc++.h>
using namespace std;
void work()
{
	string s;
	cin >> s;
	deque<int> ans;
	for(int i = s.length() - 1; i >= 0; --i){
		if(s[i] == 'V'){
			if(i && s[i - 1] == 'I'){
				ans.push_front(4);
				i--;
			}
			else{
				ans.push_front(5);
			}
		}
		else if(s[i] == 'I'){
			if(i >= 3 && s[i - 1] == 'I' && s[i - 2] == 'I' && s[i - 3] == 'V'){
				ans.push_front(8);
				i -= 3;
			}
			else if(i >= 2 && s[i - 1] == 'I' && s[i - 2] == 'I'){
				ans.push_front(3);
				i -= 2;
			}
			else if(i >= 2 && s[i - 1] == 'I' && s[i - 1] == 'V'){
				ans.push_front(7);
				i--;
			}
			else if(i && s[i - 1] == 'I'){
				ans.push_front(2);
				i--;
			}
			else if(i && s[i - 1] == 'V'){
				ans.push_front(6);
				i--;
			}
			else{
				ans.push_front(1);
			}
		}
	}
	for(auto i : ans){
		cout << i;
	}
	cout << "\n";
}
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	int t;
	cin >> t;
	while(t--)
		work();
}	


Details

answer.code:1:9: fatal error: Bits/stdc++.h: No such file or directory
    1 | #include<Bits/stdc++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.