結果
問題 | No.131 マンハッタン距離 |
ユーザー |
![]() |
提出日時 | 2018-11-21 21:10:52 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 1,580 ms / 5,000 ms |
コード長 | 372 bytes |
コンパイル時間 | 2,159 ms |
コンパイル使用メモリ | 74,164 KB |
実行使用メモリ | 41,396 KB |
最終ジャッジ日時 | 2024-12-24 16:05:58 |
合計ジャッジ時間 | 11,605 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
ソースコード
import java.util.Scanner;public class Main {@SuppressWarnings("resource")public static void main(String args[]) {Scanner scanner = new Scanner(System.in);int x=scanner.nextInt();int y=scanner.nextInt();int d=scanner.nextInt();long cnt=0;for(int i=0;i<=x;i++) {int j=d-i;if(0<=j&&j<=y) {cnt++;}}System.out.println(cnt);}}