結果
問題 | No.755 Zero-Sum Rectangle |
ユーザー | kotatsugame |
提出日時 | 2018-12-03 05:56:24 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
AC
|
実行時間 | 143 ms / 2,000 ms |
コード長 | 524 bytes |
コンパイル時間 | 495 ms |
コンパイル使用メモリ | 66,108 KB |
実行使用メモリ | 7,804 KB |
最終ジャッジ日時 | 2023-09-13 21:06:05 |
合計ジャッジ時間 | 5,354 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge15 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
7,804 KB |
testcase_01 | AC | 99 ms
4,380 KB |
testcase_02 | AC | 80 ms
4,380 KB |
testcase_03 | AC | 108 ms
4,380 KB |
testcase_04 | AC | 120 ms
4,376 KB |
testcase_05 | AC | 133 ms
4,380 KB |
testcase_06 | AC | 88 ms
4,380 KB |
testcase_07 | AC | 83 ms
4,380 KB |
testcase_08 | AC | 110 ms
4,376 KB |
testcase_09 | AC | 124 ms
4,380 KB |
testcase_10 | AC | 143 ms
4,376 KB |
testcase_11 | AC | 2 ms
4,376 KB |
evil_1 | TLE | - |
コンパイルメッセージ
main.cpp:5:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type] 5 | main() | ^~~~
ソースコード
#include<iostream> using namespace std; int n,m; long a[130][130],s[131][131]; main() { cin>>n>>m; for(int i=0;i<m;i++)for(int j=0;j<m;j++)cin>>a[i][j]; for(int i=0;i<m;i++)for(int j=0;j<m;j++)s[i+1][j+1]=s[i+1][j]+a[i][j]; for(int j=0;j<=m;j++)for(int i=0;i<m;i++)s[i+1][j]+=s[i][j]; for(int c=0;c<n;c++) { int x,y;cin>>x>>y; int ans=0; for(int i=0;i<x;i++)for(int j=x;j<=m;j++) { for(int k=0;k<y;k++)for(int l=y;l<=m;l++) { ans+=s[j][l]+s[i][k]-s[j][k]-s[i][l]==0; } } cout<<ans<<endl; } }