結果
問題 | No.744 循環小数N桁目 Easy |
ユーザー | math957963 |
提出日時 | 2018-10-19 21:22:41 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 648 bytes |
コンパイル時間 | 347 ms |
コンパイル使用メモリ | 57,524 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-18 19:41:08 |
合計ジャッジ時間 | 794 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 7 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:24:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 24 | scanf("%d", &n); | ~~~~~^~~~~~~~~~
ソースコード
#include<cstdio> #include<cstdlib> #include<cstring> #include<cmath> #include<algorithm> #include<functional> #include<vector> #include<queue> #include<stack> #include<set> #include<map> using namespace std; #define MOD 1000000007 #define f(i,n) for(int i=0;i<int(n);i++) #define N 200000 int main(){ int n, k; int x, y, z; int s, ans; bool v = true; ans = 0; scanf("%d", &n); if (n % 6 == 0){ printf("4\n"); } else if (n % 6 == 1){ printf("2\n"); } else if(n % 6 == 2){ printf("8\n"); } else if(n % 6 == 3){ printf("5\n"); } else if(n % 6 == 4){ printf("7\n"); } else if(n % 6 == 5){ printf("1\n"); } return 0; }