提出 #39814975
ソースコード 拡げる
//This code is written by hmz,and hmz is cute!!!
#include<bits/stdc++.h>
using namespace std;
#define TY int
#define umap unordered_map
#define ull unsigned long long
#define pq priority_queue
#define mp make_pair
#define mod (TY)(1e9+7)
#define MAXN 105
#define MAXM 200005
#define MAXK 27
#define INF (TY)1e9
#define File(name) \
freopen(#name ".in", "r", stdin); \
freopen(#name ".out", "w", stdout);
#define For(i,a,b) for(TY i=(a);i<=(b);++i)
#define FOR(i,a,b) for(TY i=(a);i<(b);++i)
#define Rof(i,a,b) for(TY i=(a);i>=(b);--i)
#define ROF(i,a,b) for(TY i=(a);i>(b);--i)
inline TY qr(){
TY x=0,f=1;char op=getchar();
for(;op<'0'||op>'9';op=getchar())if(op=='-')f=-1;
for(;op>='0'&&op<='9';op=getchar())x=x*10+(op^48);
return x*f;
}inline char getc(){
char op=getchar();
while(op==' '||op=='\n'||op=='\r')op=getchar();
return op;
}inline string qs(){
string op="";char u=getchar();
while(u=='\n'||u=='\r'||u==' ')u=getchar();
while(u!='\n'&&u!='\r'&&u!=' ')op+=u,u=getchar();
return op;
}inline void qw(TY x){
if(!x){putchar('0');return;}
if(x<0)putchar('-'),x=-x;
if(x>=10)qw(x/10);putchar(x%10+'0');
}inline void qw(TY x,char op){qw(x),putchar(op);}
inline void qw(long long x){
if(!x){putchar('0');return;}
if(x<0)putchar('-'),x=-x;
if(x>=10)qw(x/10);putchar(x%10+'0');
}inline void qw(long long x,char op){qw(x),putchar(op);}
inline void ws(string s){FOR(i,0,s.size())putchar(s[i]);}
inline TY Ceil(TY a,TY b){return a/b+(a%b!=0);}
inline TY Mod(TY a){return (a>=mod?a-mod:a);}
inline TY Abs(TY a,TY b){return a>b?a-b:b-a;}
inline TY Pow(TY a,TY b){
TY ans=1,base=a;
while(b){
if(b&1)ans=ans*base%mod;
base=base*base%mod;b>>=1;
}return ans;
}TY n,cnt[2],ans[2][MAXN][MAXN][MAXN];char a[4][MAXN][MAXN];
inline void Output(){
qw(max(cnt[0],cnt[1]),'\n');
For(op,0,1){
For(i,1,n)For(j,1,n)For(k,1,n)qw(ans[op][i][j][k]==-1?0:ans[op][i][j][k],' ');
putchar('\n');
}
}inline void solve(){
n=qr();For(i,0,3)For(j,1,n)For(k,1,n){
bool op=(i>=2);
a[i][j][k]=getc();
if(a[i][j][k]=='0'){
For(w,1,n){
if(i==1||i==3)ans[op][w][k][j]=-1;
else ans[op][k][w][j]=-1;
}
}
}For(i,0,3)For(j,1,n)For(k,1,n){
bool op=(i>=2);
if(a[i][j][k]=='1'){
For(w,1,n){
if((i==1||i==3)&&ans[op][w][k][j]!=-1){
if(!ans[op][w][k][j])ans[op][w][k][j]=++cnt[op];
break;
}if(!(i==1||i==3)&&ans[op][k][w][j]!=-1){
if(!ans[op][k][w][j])ans[op][k][w][j]=++cnt[op];
break;
}
}
}
}Output();
}int main(){
TY T=1;while(T--)solve();
return 0;
}
提出情報
コンパイルエラー
./Main.cpp: In function ‘void qw(int)’:
./Main.cpp:38:2: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
38 | if(x>=10)qw(x/10);putchar(x%10+'0');
| ^~
./Main.cpp:38:20: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
38 | if(x>=10)qw(x/10);putchar(x%10+'0');
| ^~~~~~~
./Main.cpp: In function ‘void qw(long long int)’:
./Main.cpp:43:2: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
43 | if(x>=10)qw(x/10);putchar(x%10+'0');
| ^~
./Main.cpp:43:20: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the ‘if’
43 | if(x>=10)qw(x/10);putchar(x%10+'0');
| ^~~~~~~
./Main.cpp: In function ‘void ws(std::string)’:
./Main.cpp:18:34: warning: comparison of integer expressions of different signedness: ‘int’ and ‘std::__cxx11::basic_string<char>::size_type’ {aka ‘long unsigned int’} [-Wsign-compare]
18 | #define FOR(i,a,b) for(TY i=(a);i<(b);++i)
| ^
./Main.cpp:45:26: note: in expansion of macro ‘FOR’
45 | inline void ws(string s){FOR(i,0,s.size())putchar(s[i]);}
| ^~~
ジャッジ結果
| セット名 |
test_ALL |
| 得点 / 配点 |
3977000000000 / 50000000000 |
| 結果 |
|
| セット名 |
テストケース |
| test_ALL |
test_0000.txt, test_0001.txt, test_0002.txt, test_0003.txt, test_0004.txt, test_0005.txt, test_0006.txt, test_0007.txt, test_0008.txt, test_0009.txt, test_0010.txt, test_0011.txt, test_0012.txt, test_0013.txt, test_0014.txt, test_0015.txt, test_0016.txt, test_0017.txt, test_0018.txt, test_0019.txt, test_0020.txt, test_0021.txt, test_0022.txt, test_0023.txt, test_0024.txt, test_0025.txt, test_0026.txt, test_0027.txt, test_0028.txt, test_0029.txt, test_0030.txt, test_0031.txt, test_0032.txt, test_0033.txt, test_0034.txt, test_0035.txt, test_0036.txt, test_0037.txt, test_0038.txt, test_0039.txt, test_0040.txt, test_0041.txt, test_0042.txt, test_0043.txt, test_0044.txt, test_0045.txt, test_0046.txt, test_0047.txt, test_0048.txt, test_0049.txt |
| ケース名 |
結果 |
実行時間 |
メモリ |
| test_0000.txt |
AC |
8 ms |
3536 KiB |
| test_0001.txt |
AC |
2 ms |
3488 KiB |
| test_0002.txt |
AC |
5 ms |
3508 KiB |
| test_0003.txt |
AC |
2 ms |
3652 KiB |
| test_0004.txt |
AC |
2 ms |
3696 KiB |
| test_0005.txt |
AC |
3 ms |
3720 KiB |
| test_0006.txt |
AC |
2 ms |
3724 KiB |
| test_0007.txt |
AC |
2 ms |
3772 KiB |
| test_0008.txt |
AC |
4 ms |
3636 KiB |
| test_0009.txt |
AC |
3 ms |
3816 KiB |
| test_0010.txt |
AC |
2 ms |
3668 KiB |
| test_0011.txt |
AC |
2 ms |
3652 KiB |
| test_0012.txt |
AC |
3 ms |
3500 KiB |
| test_0013.txt |
AC |
2 ms |
3624 KiB |
| test_0014.txt |
AC |
2 ms |
3548 KiB |
| test_0015.txt |
AC |
2 ms |
3720 KiB |
| test_0016.txt |
AC |
3 ms |
3588 KiB |
| test_0017.txt |
AC |
3 ms |
3756 KiB |
| test_0018.txt |
AC |
3 ms |
3688 KiB |
| test_0019.txt |
AC |
3 ms |
3912 KiB |
| test_0020.txt |
AC |
2 ms |
3664 KiB |
| test_0021.txt |
AC |
5 ms |
3472 KiB |
| test_0022.txt |
AC |
3 ms |
3504 KiB |
| test_0023.txt |
AC |
2 ms |
3748 KiB |
| test_0024.txt |
AC |
2 ms |
3648 KiB |
| test_0025.txt |
AC |
5 ms |
3704 KiB |
| test_0026.txt |
AC |
3 ms |
3660 KiB |
| test_0027.txt |
AC |
2 ms |
3684 KiB |
| test_0028.txt |
AC |
3 ms |
3844 KiB |
| test_0029.txt |
AC |
3 ms |
3672 KiB |
| test_0030.txt |
AC |
3 ms |
3608 KiB |
| test_0031.txt |
AC |
2 ms |
3432 KiB |
| test_0032.txt |
AC |
3 ms |
3572 KiB |
| test_0033.txt |
AC |
2 ms |
3516 KiB |
| test_0034.txt |
AC |
3 ms |
3696 KiB |
| test_0035.txt |
AC |
3 ms |
3792 KiB |
| test_0036.txt |
AC |
3 ms |
3784 KiB |
| test_0037.txt |
AC |
3 ms |
3724 KiB |
| test_0038.txt |
AC |
3 ms |
3880 KiB |
| test_0039.txt |
AC |
4 ms |
3836 KiB |
| test_0040.txt |
AC |
2 ms |
3576 KiB |
| test_0041.txt |
AC |
3 ms |
3552 KiB |
| test_0042.txt |
AC |
4 ms |
3612 KiB |
| test_0043.txt |
AC |
2 ms |
3752 KiB |
| test_0044.txt |
AC |
3 ms |
3588 KiB |
| test_0045.txt |
AC |
2 ms |
3760 KiB |
| test_0046.txt |
AC |
2 ms |
3576 KiB |
| test_0047.txt |
AC |
2 ms |
3780 KiB |
| test_0048.txt |
AC |
2 ms |
3796 KiB |
| test_0049.txt |
AC |
3 ms |
3836 KiB |