結果
| 問題 |
No.375 立方体のN等分 (1)
|
| コンテスト | |
| ユーザー |
Bantako
|
| 提出日時 | 2017-08-11 20:28:11 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 546 bytes |
| コンパイル時間 | 1,562 ms |
| コンパイル使用メモリ | 166,928 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-12 20:44:26 |
| 合計ジャッジ時間 | 2,565 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 2 |
| other | WA * 32 |
コンパイルメッセージ
main.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
6 | main(){
| ^~~~
main.cpp: In function 'int main()':
main.cpp:25:22: warning: 'A[2]' may be used uninitialized [-Wmaybe-uninitialized]
25 | cout << A[0]+A[1]+A[2]-3 << " " << N-1 << endl;
| ~~~~~~~~~^~~~~
main.cpp:7:10: note: 'A[2]' was declared here
7 | ll N,A[3],cnt;
| ^
main.cpp:19:17: warning: 'A[1]' may be used uninitialized [-Wmaybe-uninitialized]
19 | if(A[1] % i == 0){
| ~~~~~^~~
main.cpp:7:10: note: 'A[1]' was declared here
7 | ll N,A[3],cnt;
| ^
main.cpp:25:17: warning: 'A[0]' may be used uninitialized [-Wmaybe-uninitialized]
25 | cout << A[0]+A[1]+A[2]-3 << " " << N-1 << endl;
| ~~~~^~~~~
main.cpp:7:10: note: 'A[0]' was declared here
7 | ll N,A[3],cnt;
| ^
ソースコード
#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
int INF = 1e9;
int MOD = 1e9+7;
main(){
ll N,A[3],cnt;
cin >> N;
for(cnt = 1;cnt*cnt*cnt <= N;cnt++){}
for(ll i = cnt;i >= 1;i--){
cout << i << endl;
if(N % i == 0){
A[0] = i;
A[1] = N / i;
break;
}
}
for(ll i = cnt;i >= 1;i--){
if(A[1] % i == 0){
A[2] = i;
A[1] = A[1] / i;
break;
}
}
cout << A[0]+A[1]+A[2]-3 << " " << N-1 << endl;
}
Bantako