結果
| 問題 |
No.1318 ABCD quadruplets
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2020-12-16 20:56:38 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 326 bytes |
| コンパイル時間 | 294 ms |
| コンパイル使用メモリ | 31,744 KB |
| 実行使用メモリ | 12,320 KB |
| 最終ジャッジ日時 | 2024-09-20 05:19:56 |
| 合計ジャッジ時間 | 9,192 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 20 TLE * 1 -- * 9 |
コンパイルメッセージ
main.cpp:5:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
5 | main()
| ^~~~
ソースコード
#include<cstdio>
using namespace std;
int N,M;
int ans[160001];
main()
{
scanf("%d%d",&N,&M);
for(int a=0;a<=M;a++)for(int b=0,x;b<=M&&(x=a*a+(a+b)*b)<=N;b++)
{
for(int c=0,y;c<=M&&(y=x+(a+b+c)*c)<=N;c++)for(int d=0,z;d<=M&&(z=y+(a+b+c+d)*d)<=N;d++)
{
ans[z]++;
}
}
for(int i=0;i<=N;i++)printf("%d\n",ans[i]);
}