답안 #670433

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
670433 2022-12-09T05:54:20 Z PoPularPlusPlus Crossing (JOI21_crossing) C++17
0 / 100
30 ms 2348 KB
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long 
#define pb(e) push_back(e)
#define sv(a) sort(a.begin(),a.end())
#define sa(a,n) sort(a,a+n)
#define mp(a,b) make_pair(a,b)
#define vf first
#define vs second
#define ar array
#define all(x) x.begin(),x.end()
const int inf = 0x3f3f3f3f;
const int mod = 1000000007; 
const double PI=3.14159265358979323846264338327950288419716939937510582097494459230;
bool remender(ll a , ll b){return a%b;}

//freopen("problemname.in", "r", stdin);
//freopen("problemname.out", "w", stdout);

string merge(string s , string t){
	for(int i = 0; i < (int)s.size(); i++){
		if(s[i] != t[i]){
			if(s[i]!='J' && t[i] != 'J')s[i] = 'J';
			else if(s[i]!='O' && t[i] != 'O')s[i] = 'O';
			else s[i] = 'I';
		}
	}
	return s;
}

void solve(){
	int n;
	cin >> n;
	string a,b,c;
	cin >> a >> b >> c;
	map<string,int> m;
	m[a] = 1;
	m[b] = 1;
	m[c] = 1;
	vector<string> v;
	v.pb(a);
	v.pb(b);
	v.pb(c);
	for(int i = 0; i < (int)v.size(); i++){
		for(int j = 0; j < (int)v.size(); j++){
			string s = merge(v[i],v[j]);
			if(m[s] == 1)continue;
			v.pb(s);
			m[s] = 1;
		}
	}
	assert(v.size() < 50);
	int q;
	cin >> q;
	string s;
	cin >> s;
	cout << "No\n";
	while(q--){
		int l , r;
		cin >> l >> r;
		char tp;
		cin >> tp;
		cout << "No\n";
	}
}

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

# 결과 실행 시간 메모리 Grader output
1 Correct 27 ms 2264 KB Output is correct
2 Correct 30 ms 2348 KB Output is correct
3 Correct 30 ms 2252 KB Output is correct
4 Incorrect 28 ms 2252 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 27 ms 2264 KB Output is correct
2 Correct 30 ms 2348 KB Output is correct
3 Correct 30 ms 2252 KB Output is correct
4 Incorrect 28 ms 2252 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 27 ms 2264 KB Output is correct
2 Correct 30 ms 2348 KB Output is correct
3 Correct 30 ms 2252 KB Output is correct
4 Incorrect 28 ms 2252 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 27 ms 2264 KB Output is correct
2 Correct 30 ms 2348 KB Output is correct
3 Correct 30 ms 2252 KB Output is correct
4 Incorrect 28 ms 2252 KB Output isn't correct
5 Halted 0 ms 0 KB -