奇怪的问
查看原帖
奇怪的问
830990
roumeideclown楼主2023/6/7 12:46

这个代码在luogu能AC,在我们老师自己的OJ就TLE了

为什么!!!

#include<bits/stdc++.h>
#pragma GCC optimeze(1)
#pragma GCC optimeze(2)
#pragma GCC optimeze(3,"Ofast","inline")
using namespace std;
map<string,int> m;
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
	int n;
	cin>>n;
	string s;
	for(int i=1;i<=n;i++) {
		cin>>s;
		if(m[s]) {
			cout<<s<<m[s]<<endl;
		}
		else {
			cout<<"OK"<<endl;
		}
		m[s]++;
	}
	return 0;
}

2023/6/7 12:46
加载中...