제출 #582688

#제출 시각아이디문제언어결과실행 시간메모리
582688MadokaMagicaFanPaint By Numbers (IOI16_paint)C++14
0 / 100
1 ms212 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; using pi = pair<int,int>; #define all(v) v.begin(),v.end() #define sort(v) sort(all(v)) #define endl '\n' #define forn(i,n) for(int i = 0; i < n; ++i) #define forbe(i,b,e) for(int i = b; i < e; ++i) #define forr(i,n) for(int i = n-1; i >= 0; --i) #define sz(v) ((int)v.size()) #define pb push_back #define f first #define s second string solve_puzzle(string s, vi c) { string ans = s; forn(i,sz(s)) ans[i] = '?'; int k = sz(c); int ps = 0; forn(i,k) { ps += c[i]; } ps += k; int d = 0; int n = sz(s); forn(i,k) { ps -= c[i]; ps -= 1; if (n - d - c[i] - ps == 0) { if (ps) ans[n-ps] = '_'; } forbe(j,n-ps-c[i],d + c[i] +1) ans[j] = 'X'; d += c[i]; ++d; } return ans; } #ifdef ONPC void solve() { int n, k, d; cin >> n; cout << n << endl; k = 0; forn(i,n) { cin >> d; cout << d << ' '; k += d; } cout << endl << k << endl; } int main() { // freopen("in", "r", stdin); // ios_base::sync_with_stdio(0);cin.tie(0); solve(); } #endif
#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...