結果
| 問題 |
No.311 z in FizzBuzzString
|
| コンテスト | |
| ユーザー |
Maeda
|
| 提出日時 | 2025-03-27 15:37:14 |
| 言語 | C (gcc 13.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 380 bytes |
| コンパイル時間 | 519 ms |
| コンパイル使用メモリ | 25,216 KB |
| 実行使用メモリ | 14,768 KB |
| 最終ジャッジ日時 | 2025-03-27 15:37:18 |
| 合計ジャッジ時間 | 3,926 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 7 TLE * 1 -- * 3 |
コンパイルメッセージ
main.c: In function ‘main’:
main.c:5:5: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
5 | scanf("%lld",&n);
| ^~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
void main(void){
long long int n = 0 ;
scanf("%lld",&n);
long long int zCount = 0;
for(int i = 1 ; i <= n ; i++){
if(i%3 != 0 && i%5 != 0){
continue;
}
if(i%15 == 0){
zCount += 4;
}else if(i%3 == 0 || i%5 == 0){
zCount += 2;
}
}
printf("%lld",zCount);
}
Maeda