結果
| 問題 |
No.671 1000000007
|
| コンテスト | |
| ユーザー |
sasa
|
| 提出日時 | 2025-03-17 14:27:34 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 461 bytes |
| コンパイル時間 | 369 ms |
| コンパイル使用メモリ | 28,672 KB |
| 実行使用メモリ | 7,328 KB |
| 最終ジャッジ日時 | 2025-03-17 14:27:36 |
| 合計ジャッジ時間 | 1,349 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 3 |
| other | WA * 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 int 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);
printf("%d\n",digit);
if(digit > 10){
printf("%d",digit - 10);
}else{
printf("%d",10 - digit);
}
}
sasa