結果
| 問題 | No.1176 少ない質問 |
| コンテスト | |
| ユーザー |
mot
|
| 提出日時 | 2020-09-02 13:38:19 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 869 bytes |
| 記録 | |
| コンパイル時間 | 599 ms |
| コンパイル使用メモリ | 103,608 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-05-15 17:56:50 |
| 合計ジャッジ時間 | 1,529 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 1 WA * 20 |
コンパイルメッセージ
In file included from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/ostream:42,
from /home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/iostream:43,
from main.cpp:1:
In member function 'std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>]',
inlined from 'int main()' at main.cpp:49:9:
/home/linuxbrew/.linuxbrew/Cellar/gcc/15.2.0_1/include/c++/15/bits/ostream.h:212:25: warning: 'ans' may be used uninitialized [-Wmaybe-uninitialized]
212 | { return _M_insert(__n); }
| ~~~~~~~~~^~~~~
main.cpp: In function 'int main()':
main.cpp:37:6: note: 'ans' was declared here
37 | ll ans;
| ^~~
ソースコード
#include<iostream>
#include<iomanip>
#include<cmath>
#include<string>
#include<cstring>
#include<vector>
#include<list>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<stack>
using namespace std;
typedef long long ll;
#define fi first
#define se second
#define mp make_pair
#define rep(i, n) for(int i=0;i<n;++i)
#define rrep(i, n) for(int i=n;i>=0;--i)
const int inf=1e9+7;
const ll mod=1e9+7;
const ll mod1=998244353;
const ll big=1e18;
const double PI=2*asin(1);
ll mypow(ll a, ll b) {
ll ans = 1;
for(int i=0;i<b;++i) ans *= a;
return ans;
}
int main() {
ll A;
cin>>A;
ll l=1, r=100, m;
bool can;
ll ans;
for(ll m=1;m<=100;++m) {
can = false;
for(ll i=1;i<=m;++i) {
if(m%i!=0) continue;
if(mypow(i, m/i)>=A) can = true;
}
if(can) {
ans = m;
break;
}
}
cout<<ans<<endl;
}
mot