Submission #416870

#TimeUsernameProblemLanguageResultExecution timeMemory
416870cfalasPaint By Numbers (IOI16_paint)C++14
32 / 100
1 ms332 KiB
#include "paint.h" #include<bits/stdc++.h> using namespace std; #define mp make_pair #define INF 10000000 #define MOD 1000000007 #define MID ((l+r)/2) #define HASHMOD 2305843009213693951 #define ll long long #define ull unsigned long long #define F first #define S second typedef pair<ll, ll> ii; typedef pair<ii, int> iii; typedef vector<int> vi; typedef vector<ii> vii; typedef map<int, int> mii; #define EPS 1e-6 #define FOR(i,n) for(int i=0;i<((int)(n));i++) #define FORi(i,a,b) for(int i=((int)(a));i<((int)(b));i++) #define FOA(v, a) for(auto v : a) #define len(x) ((int)x.size()) string solve_puzzle(string s, vector<int> c) { int n = len(s); int t=0; FOR(i, len(c)){ if(i!=len(c)-1) t++; t+=c[i]; } string ans; FOR(i,n){ ans+="?"; } int p=0; FOA(v, c){ //cout<<p<<endl; FOR(i, v-(n-t)){ ans[i + p + (n-t)] = 'X'; } p+= v + 1; } if(n==t){ FOR(i,n) if(ans[i]=='?') ans[i] = '_'; } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...