結果
問題 |
No.3260 岩井スターグラフ
|
ユーザー |
|
提出日時 | 2025-09-07 12:21:16 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 528 bytes |
コンパイル時間 | 2,038 ms |
コンパイル使用メモリ | 192,956 KB |
実行使用メモリ | 7,720 KB |
最終ジャッジ日時 | 2025-09-07 12:21:25 |
合計ジャッジ時間 | 7,807 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 29 WA * 7 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:18:32: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘ll’ {aka ‘long long int’} [-Wformat=] 18 | if (!a || !b) printf("%d\n", (a - 1) % m + (b - 1) % m + 2); | ~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | int ll {aka long long int} | %lld main.cpp:19:55: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=] 19 | else if ((a - 1) / m == (b - 1) / m) printf("%d\n", abs(a - b)); | ~^ ~~~~~~~~~~ | | | | int long long int | %lld main.cpp:20:23: warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘ll’ {aka ‘long long int’} [-Wformat=] 20 | else printf("%d\n", (a - 1) % m + (b - 1) % m + 2); | ~^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | int ll {aka long long int} | %lld main.cpp:17:14: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 17 | scanf("%lld%lld", &a, &b); | ~~~~~^~~~~~~~~~~~~~~~~~~~
ソースコード
#include <bits/stdc++.h> using namespace std; typedef pair<int, int> pii; typedef long long ll; const int N = 2000086, MOD = 998244353, INF = 0x3f3f3f3f; ll res; int n, m, cnt, w[N]; int main() { int k; cin >> n >> m >> k; while (k--) { ll a, b; scanf("%lld%lld", &a, &b); if (!a || !b) printf("%d\n", (a - 1) % m + (b - 1) % m + 2); else if ((a - 1) / m == (b - 1) / m) printf("%d\n", abs(a - b)); else printf("%d\n", (a - 1) % m + (b - 1) % m + 2); } return 0; }