結果
| 問題 |
No.249 N言っちゃダメゲーム (2)
|
| コンテスト | |
| ユーザー |
suppy193
|
| 提出日時 | 2015-07-27 09:22:41 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 416 bytes |
| コンパイル時間 | 99 ms |
| コンパイル使用メモリ | 20,480 KB |
| 実行使用メモリ | 15,288 KB |
| 最終ジャッジ日時 | 2024-07-16 03:51:11 |
| 合計ジャッジ時間 | 4,557 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | TLE * 1 -- * 2 |
コンパイルメッセージ
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", &P);
| ^~~~~~~~~~~~~~~~~
main.c:10:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
10 | scanf("%lld%lld", &N, &K);
| ^~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>
int main(void) {
long long int i, P, N, K, win, lose, turn;
scanf("%lld", &P);
turn = 1;
win = 0;
lose = 0;
for(i = 0;i < P;i++){
scanf("%lld%lld", &N, &K);
if(N % (K + 1) == 1){
if(turn == 1)turn = 0;
else turn = 1;
}
else{
if(turn == 1)win++;
}
}
printf("%lld\n", win);
return 0;
}
suppy193