Submission #3466887
Source Code Expand
#include <bits/stdc++.h> #define r(i,n) for(int i=0;i<n;i++) using namespace std; int dx[]={0,1,0,-1}; int dy[]={-1,0,1,0}; bool used[55][55]; int a[55][55]; typedef pair<int,int>P; vector<P>ANS; int main(){ int h,w; cin>>h>>w; int K; cin>>K; string s[h]; r(i,h)cin>>s[i]; r(i,h)r(j,w)a[i][j]=s[i][j]-'0'; r(Y,50){ r(X,50){ vector<P>v; if(used[Y][X])continue; if(a[Y][X]==0)continue; v.push_back(P(Y,X)); int y=Y; int x=X; int USED[h][w]={}; USED[Y][X]=1; r(k,K-1){ int MAX=0; P p; r(l,4){ int yy=y+dy[l]; int xx=x+dx[l]; if(yy<0||xx<0||yy>=h||xx>=w)continue; if(used[yy][xx])continue; if(USED[yy][xx])continue; if(a[yy][xx]>MAX){ p=P(yy,xx); MAX=a[yy][xx]; } } if(MAX==0)break; USED[p.first][p.second]=1; x=p.second; y=p.first; v.push_back(p); } if(v.size()!=8)continue; r(k,8)used[v[k].first][v[k].second]=1; r(k,8)ANS.push_back(v[k]); } } set<P>st; //r(i,ANS.size())st.insert(ANS[i]); //cout<<st.size()<<' '<<ANS.size()<<endl; cout<<ANS.size()/8<<endl; r(i,ANS.size())cout<<ANS[i].first<<' '<<ANS[i].second<<endl; }
Submission Info
Submission Time | |
---|---|
Task | A - Multiple Pieces |
User | c7c7 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 1635 Byte |
Status | WA |
Exec Time | 6 ms |
Memory | 256 KB |
Judge Result
Set Name | test_01 | test_02 | test_03 | test_04 | test_05 | test_06 | test_07 | test_08 | test_09 | test_10 | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Score / Max Score | 0 / 1343058 | 0 / 1343058 | 0 / 1343058 | 0 / 1343058 | 0 / 1343058 | 0 / 1343058 | 0 / 1343058 | 0 / 1343058 | 0 / 1343058 | 0 / 1343058 | ||||||||||||||||||||
Status |
|
|
|
|
|
|
|
|
|
|
Set Name | Test Cases |
---|---|
test_01 | subtask_01_01.txt |
test_02 | subtask_01_02.txt |
test_03 | subtask_01_03.txt |
test_04 | subtask_01_04.txt |
test_05 | subtask_01_05.txt |
test_06 | subtask_01_06.txt |
test_07 | subtask_01_07.txt |
test_08 | subtask_01_08.txt |
test_09 | subtask_01_09.txt |
test_10 | subtask_01_10.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
subtask_01_01.txt | WA | 6 ms | 256 KB |
subtask_01_02.txt | WA | 6 ms | 256 KB |
subtask_01_03.txt | WA | 6 ms | 256 KB |
subtask_01_04.txt | WA | 6 ms | 256 KB |
subtask_01_05.txt | WA | 6 ms | 256 KB |
subtask_01_06.txt | WA | 6 ms | 256 KB |
subtask_01_07.txt | WA | 6 ms | 256 KB |
subtask_01_08.txt | WA | 6 ms | 256 KB |
subtask_01_09.txt | WA | 6 ms | 256 KB |
subtask_01_10.txt | WA | 6 ms | 256 KB |