結果
問題 | No.491 10^9+1と回文 |
ユーザー |
|
提出日時 | 2025-05-18 21:27:49 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 517 bytes |
コンパイル時間 | 1,977 ms |
コンパイル使用メモリ | 191,312 KB |
実行使用メモリ | 7,844 KB |
最終ジャッジ日時 | 2025-05-18 21:27:54 |
合計ジャッジ時間 | 4,299 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 42 WA * 61 |
ソースコード
#include<bits/stdc++.h> using namespace std; #define int long long signed main(){ // freopen("palindrome.in","r",stdin); // freopen("palindrome.out","w",stdout); int n; cin>>n; int cnt=0; for(int i=1;i<=9;i++){ for(int j=1;j<=9;j++){ int t=9-i; int x=0; for(int k=1;k<=i;k++){ x=x*10+j; } for(int k=1;k<=t;k++){ x*=10; } for(int k=1;k<=i;k++){ x=x*10+j; } if(x<n){ cnt++; }else{ break; } } } cout<<cnt<<endl; return 0; }