結果
問題 | No.671 1000000007 |
ユーザー |
![]() |
提出日時 | 2025-03-17 14:28:55 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 444 bytes |
コンパイル時間 | 364 ms |
コンパイル使用メモリ | 28,672 KB |
実行使用メモリ | 7,324 KB |
最終ジャッジ日時 | 2025-03-17 14:28:56 |
合計ジャッジ時間 | 934 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 9 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:18:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 18 | scanf("%lld",&val); | ~~~~~^~~~~~~~~~~~~
ソースコード
#include <stdio.h> #include <stdlib.h> unsigned int get_num_digit(long long x) { unsigned long long abs_x = abs(x); unsigned int num_digit = 0; do { abs_x = abs_x / 10; num_digit++; } while (abs_x > 0); return num_digit; } int main(void){ long long val = 0; scanf("%lld",&val); int digit = get_num_digit(val); if(digit > 10){ printf("%d",digit - 10); }else{ printf("%d",10 - digit); } }